authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-03-26 08:41:38+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-03-26 08:41:38+02:00
log3a7fe0d0105ed69354960896a5d9eadd9dee3563
tree9a7558f2ea6c26df4889d700f5368777258d4423
parent37f6f7990e882ac9869513cf920f8cd0c4850039
parent59a67e9a43fe28537e9d0cf7fd346aaba8a6ce77
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #15077 from ziglang/update-macos-headers

libc: update macos headers

236 files changed, 82764 insertions(+), 30487 deletions(-)

lib/libc/darwin/libSystem.11.tbd+11-11
......@@ -4,17 +4,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
44 arm64e-macos, arm64e-maccatalyst ]
55uuids:
66 - target: x86_64-macos
7 value: 89E331F9-9A00-3EA4-B49F-FA2B91AE9182
7 value: EADFB1D1-E113-35B4-BD2D-C1E4C38010D4
88 - target: x86_64-maccatalyst
9 value: 89E331F9-9A00-3EA4-B49F-FA2B91AE9182
9 value: EADFB1D1-E113-35B4-BD2D-C1E4C38010D4
1010 - target: arm64-macos
1111 value: 00000000-0000-0000-0000-000000000000
1212 - target: arm64-maccatalyst
1313 value: 00000000-0000-0000-0000-000000000000
1414 - target: arm64e-macos
15 value: A9F7E132-0FFC-31FC-83C6-3848CA460DF3
15 value: A03485B7-4C44-3F47-8BF9-5D6E1BE0CF27
1616 - target: arm64e-maccatalyst
17 value: A9F7E132-0FFC-31FC-83C6-3848CA460DF3
17 value: A03485B7-4C44-3F47-8BF9-5D6E1BE0CF27
1818install-name: '/usr/lib/libSystem.B.dylib'
1919current-version: 1292.100.5
2020reexported-libraries:
......@@ -2058,19 +2058,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
20582058 arm64e-macos, arm64e-maccatalyst ]
20592059uuids:
20602060 - target: x86_64-macos
2061 value: A78F60F4-ABD5-3646-93F9-1F1109C4552D
2061 value: 62A19DE4-50C5-3866-B5B2-43220E379C3B
20622062 - target: x86_64-maccatalyst
2063 value: A78F60F4-ABD5-3646-93F9-1F1109C4552D
2063 value: 62A19DE4-50C5-3866-B5B2-43220E379C3B
20642064 - target: arm64-macos
2065 value: B7A2A355-3D98-3BBF-82CC-A82E05B30F1B
2065 value: C11F3472-54B1-3A61-A02F-6A80EA06F414
20662066 - target: arm64-maccatalyst
2067 value: B7A2A355-3D98-3BBF-82CC-A82E05B30F1B
2067 value: C11F3472-54B1-3A61-A02F-6A80EA06F414
20682068 - target: arm64e-macos
2069 value: 1B63FA43-CA44-3EB6-BF55-54F2E306B3CE
2069 value: D4C172DA-4E97-32E4-8969-C738E4AC9559
20702070 - target: arm64e-maccatalyst
2071 value: 1B63FA43-CA44-3EB6-BF55-54F2E306B3CE
2071 value: D4C172DA-4E97-32E4-8969-C738E4AC9559
20722072install-name: '/usr/lib/system/libsystem_kernel.dylib'
2073current-version: 7195.101.1
2073current-version: 7195.101.2
20742074parent-umbrella:
20752075 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
20762076 arm64e-macos, arm64e-maccatalyst ]
lib/libc/darwin/libSystem.12.tbd+422-365
......@@ -4,19 +4,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
44 arm64e-macos, arm64e-maccatalyst ]
55uuids:
66 - target: x86_64-macos
7 value: 2F242680-1523-3527-B7BA-13F7398854BF
7 value: 5E73061C-E99B-3651-BD84-E34B6365E97D
88 - target: x86_64-maccatalyst
9 value: 2F242680-1523-3527-B7BA-13F7398854BF
9 value: 5E73061C-E99B-3651-BD84-E34B6365E97D
1010 - target: arm64-macos
1111 value: 00000000-0000-0000-0000-000000000000
1212 - target: arm64-maccatalyst
1313 value: 00000000-0000-0000-0000-000000000000
1414 - target: arm64e-macos
15 value: 679CDB15-D472-38E8-8840-B38874010D51
15 value: DEE4A1ED-F9DF-3515-BE62-166170214E4C
1616 - target: arm64e-maccatalyst
17 value: 679CDB15-D472-38E8-8840-B38874010D51
17 value: DEE4A1ED-F9DF-3515-BE62-166170214E4C
1818install-name: '/usr/lib/libSystem.B.dylib'
19current-version: 1311
19current-version: 1311.100.3
2020reexported-libraries:
2121 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
2222 arm64e-macos, arm64e-maccatalyst ]
......@@ -59,17 +59,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
5959 arm64e-macos, arm64e-maccatalyst ]
6060uuids:
6161 - target: x86_64-macos
62 value: B547F879-03EB-3693-80A2-D588EF6EB815
62 value: 347DF236-2F9C-3EC3-B164-55417B437B97
6363 - target: x86_64-maccatalyst
64 value: B547F879-03EB-3693-80A2-D588EF6EB815
64 value: 347DF236-2F9C-3EC3-B164-55417B437B97
6565 - target: arm64-macos
6666 value: 00000000-0000-0000-0000-000000000000
6767 - target: arm64-maccatalyst
6868 value: 00000000-0000-0000-0000-000000000000
6969 - target: arm64e-macos
70 value: BB47A721-69A7-3EEA-9D9B-82F88FFF2641
70 value: E5029B58-FF22-3EC8-9708-A97E2C90C310
7171 - target: arm64e-maccatalyst
72 value: BB47A721-69A7-3EEA-9D9B-82F88FFF2641
72 value: E5029B58-FF22-3EC8-9708-A97E2C90C310
7373install-name: '/usr/lib/system/libcache.dylib'
7474current-version: 85
7575parent-umbrella:
......@@ -77,7 +77,7 @@ parent-umbrella:
7777 arm64e-macos, arm64e-maccatalyst ]
7878 umbrella: System
7979exports:
80 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
80 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
8181 arm64-macos, arm64-maccatalyst ]
8282 symbols: [ _cache_create, _cache_destroy, _cache_get, _cache_get_and_retain,
8383 _cache_get_cost_hint, _cache_get_count_hint, _cache_get_info,
......@@ -96,25 +96,25 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
9696 arm64e-macos, arm64e-maccatalyst ]
9797uuids:
9898 - target: x86_64-macos
99 value: 2308E152-A258-36BC-A841-D3E8E9F59F43
99 value: C36DA5CF-B8E6-36C1-98EF-FF138B438EE0
100100 - target: x86_64-maccatalyst
101 value: 2308E152-A258-36BC-A841-D3E8E9F59F43
101 value: C36DA5CF-B8E6-36C1-98EF-FF138B438EE0
102102 - target: arm64-macos
103103 value: 00000000-0000-0000-0000-000000000000
104104 - target: arm64-maccatalyst
105105 value: 00000000-0000-0000-0000-000000000000
106106 - target: arm64e-macos
107 value: E6CCD148-5E91-3111-BE37-1C19402F4637
107 value: 5AAADB40-420D-326A-AC38-CFE1D81DA1E5
108108 - target: arm64e-maccatalyst
109 value: E6CCD148-5E91-3111-BE37-1C19402F4637
109 value: 5AAADB40-420D-326A-AC38-CFE1D81DA1E5
110110install-name: '/usr/lib/system/libcommonCrypto.dylib'
111current-version: 60190
111current-version: 60191.100.1
112112parent-umbrella:
113113 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
114114 arm64e-macos, arm64e-maccatalyst ]
115115 umbrella: System
116116exports:
117 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
117 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
118118 arm64-macos, arm64-maccatalyst ]
119119 symbols: [ _CCAESCmac, _CCAESCmacCreate, _CCAESCmacDestroy, _CCAESCmacFinal,
120120 _CCAESCmacOutputSizeFromContext, _CCAESCmacUpdate, _CCBigNumAdd,
......@@ -190,13 +190,13 @@ tbd-version: 4
190190targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
191191uuids:
192192 - target: x86_64-macos
193 value: 805EDC9F-9F04-3DF0-96B6-B2530FAE7722
193 value: AD346AFB-8737-3E88-B4C5-25D77181AE44
194194 - target: arm64-macos
195 value: 2CF1B1A8-6B2C-3DA7-9A6F-B08089C83421
195 value: 0B616B91-A847-3817-B571-4498A1D36CC0
196196 - target: arm64e-macos
197 value: 92001FF7-799E-3BA8-BF46-5FA01FFB952C
197 value: 7E374D5C-9785-3D65-88D2-98B92AD24C78
198198install-name: '/usr/lib/system/libcompiler_rt.dylib'
199current-version: 102.2
199current-version: 103.1
200200parent-umbrella:
201201 - targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
202202 umbrella: System
......@@ -237,7 +237,7 @@ exports:
237237 ___paritysi2, ___parityti2, ___popcountdi2, ___popcountsi2,
238238 ___popcountti2, ___powixf2, ___subvdi3, ___subvsi3, ___subvti3,
239239 ___ucmpdi2, ___ucmpti2, ___udivdi3, ___udivmoddi4, ___umoddi3 ]
240 - targets: [ arm64-macos, x86_64-macos, arm64e-macos ]
240 - targets: [ arm64-macos, arm64e-macos, x86_64-macos ]
241241 symbols: [ '$ld$hide$os10.10$___chkstk_darwin', '$ld$hide$os10.10$___extendhfsf2',
242242 '$ld$hide$os10.10$___truncdfhf2', '$ld$hide$os10.10$___truncsfhf2',
243243 '$ld$hide$os10.10$_atomic_flag_clear', '$ld$hide$os10.10$_atomic_flag_clear_explicit',
......@@ -407,16 +407,16 @@ exports:
407407 ___atomic_fetch_or_2, ___atomic_fetch_or_4, ___atomic_fetch_or_8,
408408 ___atomic_fetch_sub_1, ___atomic_fetch_sub_2, ___atomic_fetch_sub_4,
409409 ___atomic_fetch_sub_8, ___atomic_fetch_xor_1, ___atomic_fetch_xor_2,
410 ___atomic_fetch_xor_4, ___atomic_fetch_xor_8, ___atomic_load,
411 ___atomic_load_1, ___atomic_load_2, ___atomic_load_4, ___atomic_load_8,
412 ___atomic_store, ___atomic_store_1, ___atomic_store_2, ___atomic_store_4,
413 ___atomic_store_8, ___chkstk_darwin, ___clear_cache, ___clzti2,
414 ___divti3, ___enable_execute_stack, ___extendhfsf2, ___fixdfti,
415 ___fixsfti, ___fixunsdfti, ___fixunssfti, ___floattidf, ___floattisf,
416 ___floatuntidf, ___floatuntisf, ___gcc_personality_v0, ___gnu_f2h_ieee,
417 ___gnu_h2f_ieee, ___modti3, ___muldc3, ___mulsc3, ___powidf2,
418 ___powisf2, ___truncdfhf2, ___truncsfhf2, ___udivmodti4, ___udivti3,
419 ___umodti3, _atomic_flag_clear, _atomic_flag_clear_explicit,
410 ___atomic_fetch_xor_4, ___atomic_fetch_xor_8, ___atomic_is_lock_free,
411 ___atomic_load, ___atomic_load_1, ___atomic_load_2, ___atomic_load_4,
412 ___atomic_load_8, ___atomic_store, ___atomic_store_1, ___atomic_store_2,
413 ___atomic_store_4, ___atomic_store_8, ___chkstk_darwin, ___clear_cache,
414 ___clzti2, ___divti3, ___enable_execute_stack, ___extendhfsf2,
415 ___fixdfti, ___fixsfti, ___fixunsdfti, ___fixunssfti, ___floattidf,
416 ___floattisf, ___floatuntidf, ___floatuntisf, ___gcc_personality_v0,
417 ___gnu_f2h_ieee, ___gnu_h2f_ieee, ___modti3, ___muldc3, ___mulsc3,
418 ___powidf2, ___powisf2, ___truncdfhf2, ___truncsfhf2, ___udivmodti4,
419 ___udivti3, ___umodti3, _atomic_flag_clear, _atomic_flag_clear_explicit,
420420 _atomic_flag_test_and_set, _atomic_flag_test_and_set_explicit,
421421 _atomic_signal_fence, _atomic_thread_fence ]
422422--- !tapi-tbd
......@@ -425,24 +425,24 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
425425 arm64e-macos, arm64e-maccatalyst ]
426426uuids:
427427 - target: x86_64-macos
428 value: DA53E55D-FBC9-3EF8-A1B0-78CDC0457EC4
428 value: C5E0151C-F9E9-3851-841D-F6C2528ADB07
429429 - target: x86_64-maccatalyst
430 value: DA53E55D-FBC9-3EF8-A1B0-78CDC0457EC4
430 value: C5E0151C-F9E9-3851-841D-F6C2528ADB07
431431 - target: arm64-macos
432432 value: 00000000-0000-0000-0000-000000000000
433433 - target: arm64-maccatalyst
434434 value: 00000000-0000-0000-0000-000000000000
435435 - target: arm64e-macos
436 value: 6BE94DC2-F363-3D76-B056-F45D4B56E152
436 value: 97564E56-1B3C-3C9A-B653-AE99C54231AC
437437 - target: arm64e-maccatalyst
438 value: 6BE94DC2-F363-3D76-B056-F45D4B56E152
438 value: 97564E56-1B3C-3C9A-B653-AE99C54231AC
439439install-name: '/usr/lib/system/libcopyfile.dylib'
440440parent-umbrella:
441441 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
442442 arm64e-macos, arm64e-maccatalyst ]
443443 umbrella: System
444444exports:
445 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
445 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
446446 arm64-macos, arm64-maccatalyst ]
447447 symbols: [ _copyfile, _copyfile_state_alloc, _copyfile_state_free, _copyfile_state_get,
448448 _copyfile_state_set, _fcopyfile, _xattr_flags_from_name, _xattr_intent_with_flags,
......@@ -453,19 +453,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
453453 arm64e-macos, arm64e-maccatalyst ]
454454uuids:
455455 - target: x86_64-macos
456 value: 1841B3FA-9360-3F14-903F-265EB054EACB
456 value: E8AE6CBE-D5F8-32B8-A9D3-A2D8BF77F4D0
457457 - target: x86_64-maccatalyst
458 value: 1841B3FA-9360-3F14-903F-265EB054EACB
458 value: E8AE6CBE-D5F8-32B8-A9D3-A2D8BF77F4D0
459459 - target: arm64-macos
460460 value: 00000000-0000-0000-0000-000000000000
461461 - target: arm64-maccatalyst
462462 value: 00000000-0000-0000-0000-000000000000
463463 - target: arm64e-macos
464 value: 881973B2-0426-325F-8D1A-17D60AE0CBFA
464 value: 29B2F7FD-0F6D-3F41-B569-FB4AE94F4D6B
465465 - target: arm64e-maccatalyst
466 value: 881973B2-0426-325F-8D1A-17D60AE0CBFA
466 value: 29B2F7FD-0F6D-3F41-B569-FB4AE94F4D6B
467467install-name: '/usr/lib/system/libcorecrypto.dylib'
468current-version: 1217.30.4
468current-version: 1218.100.47
469469parent-umbrella:
470470 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
471471 arm64e-macos, arm64e-maccatalyst ]
......@@ -484,7 +484,7 @@ exports:
484484 _ccaes_intel_xts_encrypt_aesni_mode, _ccaes_intel_xts_encrypt_opt_mode,
485485 _ccsha1_vng_intel_SupplementalSSE3_di, _ccsha224_vng_intel_SupplementalSSE3_di,
486486 _ccsha256_vng_intel_SupplementalSSE3_di ]
487 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
487 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
488488 arm64-macos, arm64-maccatalyst ]
489489 symbols: [ _CCEC_FAULT_CANARY, _CCRSA_PKCS1_FAULT_CANARY, _CCRSA_PSS_FAULT_CANARY,
490490 _CCSS_PRIME_P192, _CCSS_PRIME_P224, _CCSS_PRIME_P256, _CCSS_PRIME_P384,
......@@ -578,11 +578,12 @@ exports:
578578 _ccdh_gp_rfc5114_MODP_1024_160, _ccdh_gp_rfc5114_MODP_2048_224,
579579 _ccdh_gp_rfc5114_MODP_2048_256, _ccdh_gp_size, _ccdh_import_full,
580580 _ccdh_import_priv, _ccdh_import_pub, _ccdh_init_gp_from_bytes,
581 _ccdigest, _ccdigest_init, _ccdigest_oid_lookup, _ccdigest_update,
582 _ccdrbg_factory_nistctr, _ccdrbg_factory_nisthmac, _ccec_blind,
583 _ccec_compact_export, _ccec_compact_export_pub, _ccec_compact_generate_key,
584 _ccec_compact_import_priv, _ccec_compact_import_priv_size,
585 _ccec_compact_import_pub, _ccec_compact_import_pub_size, _ccec_compact_transform_key,
581 _ccdh_init_safe_gp_from_bytes, _ccdigest, _ccdigest_init,
582 _ccdigest_oid_lookup, _ccdigest_update, _ccdrbg_factory_nistctr,
583 _ccdrbg_factory_nisthmac, _ccec_affinify, _ccec_blind, _ccec_compact_export,
584 _ccec_compact_export_pub, _ccec_compact_generate_key, _ccec_compact_import_priv,
585 _ccec_compact_import_priv_size, _ccec_compact_import_pub,
586 _ccec_compact_import_pub_size, _ccec_compact_transform_key,
586587 _ccec_compressed_x962_export_pub, _ccec_compressed_x962_export_pub_size,
587588 _ccec_compressed_x962_import_pub, _ccec_compute_key, _ccec_cp_192,
588589 _ccec_cp_224, _ccec_cp_256, _ccec_cp_384, _ccec_cp_521, _ccec_curve_for_length_lookup,
......@@ -590,14 +591,15 @@ exports:
590591 _ccec_der_export_priv, _ccec_der_export_priv_size, _ccec_der_import_diversified_pub,
591592 _ccec_der_import_priv, _ccec_der_import_priv_keytype, _ccec_diversify_min_entropy_len,
592593 _ccec_diversify_priv_twin, _ccec_diversify_pub, _ccec_diversify_pub_twin,
593 _ccec_export_pub, _ccec_extract_rs, _ccec_generate_blinding_keys,
594 _ccec_export_pub, _ccec_extract_rs, _ccec_full_add, _ccec_generate_blinding_keys,
594595 _ccec_generate_key, _ccec_generate_key_deterministic, _ccec_generate_key_fips,
595 _ccec_generate_key_legacy, _ccec_get_cp, _ccec_get_fullkey_components,
596 _ccec_get_pubkey_components, _ccec_import_pub, _ccec_keysize_is_supported,
597 _ccec_make_priv, _ccec_make_pub, _ccec_pairwise_consistency_check,
598 _ccec_print_full_key, _ccec_print_public_key, _ccec_raw_import_priv_only,
599 _ccec_raw_import_pub, _ccec_rfc6637_dh_curve_p256, _ccec_rfc6637_dh_curve_p521,
600 _ccec_rfc6637_unwrap_key, _ccec_rfc6637_unwrap_sha256_kek_aes128,
596 _ccec_generate_key_legacy, _ccec_generate_scalar_fips_retry,
597 _ccec_get_cp, _ccec_get_fullkey_components, _ccec_get_pubkey_components,
598 _ccec_import_pub, _ccec_keysize_is_supported, _ccec_make_priv,
599 _ccec_make_pub, _ccec_mult_blinded, _ccec_pairwise_consistency_check,
600 _ccec_print_full_key, _ccec_print_public_key, _ccec_projectify,
601 _ccec_raw_import_priv_only, _ccec_raw_import_pub, _ccec_rfc6637_dh_curve_p256,
602 _ccec_rfc6637_dh_curve_p521, _ccec_rfc6637_unwrap_key, _ccec_rfc6637_unwrap_sha256_kek_aes128,
601603 _ccec_rfc6637_unwrap_sha512_kek_aes256, _ccec_rfc6637_wrap_key,
602604 _ccec_rfc6637_wrap_key_diversified, _ccec_rfc6637_wrap_key_size,
603605 _ccec_rfc6637_wrap_sha256_kek_aes128, _ccec_rfc6637_wrap_sha512_kek_aes256,
......@@ -671,8 +673,7 @@ exports:
671673 _ccrsa_sign_pss, _ccrsa_sign_pss_msg, _ccrsa_verify_pkcs1v15,
672674 _ccrsa_verify_pkcs1v15_allowshortsigs, _ccrsa_verify_pkcs1v15_digest,
673675 _ccrsa_verify_pkcs1v15_msg, _ccrsa_verify_pss_digest, _ccrsa_verify_pss_msg,
674 _ccrsabssa_blind_message, _ccrsabssa_ciphersuite_rsa2048_sha256,
675 _ccrsabssa_ciphersuite_rsa2048_sha384, _ccrsabssa_ciphersuite_rsa3072_sha256,
676 _ccrsabssa_blind_message, _ccrsabssa_ciphersuite_rsa2048_sha384,
676677 _ccrsabssa_ciphersuite_rsa3072_sha384, _ccrsabssa_ciphersuite_rsa4096_sha384,
677678 _ccrsabssa_sign_blinded_message, _ccrsabssa_unblind_signature,
678679 _ccsae_gen_kck_and_pmk, _ccsae_gen_password_value, _ccsae_generate_commitment,
......@@ -728,8 +729,9 @@ exports:
728729 _ccz_set, _ccz_set_bit, _ccz_seti, _ccz_size, _ccz_sub, _ccz_subi,
729730 _ccz_trailing_zeros, _ccz_write_int, _ccz_write_int_size,
730731 _ccz_write_radix, _ccz_write_radix_size, _ccz_write_uint,
731 _ccz_write_uint_size, _ccz_zero, _csss_shamir_share_bag_can_recover_secret,
732 _fipspost_post, _fipspost_trace_vtable ]
732 _ccz_write_uint_size, _ccz_zero, _cczp_add, _cczp_inv, _cczp_mod,
733 _cczp_mul, _cczp_sub, _csss_shamir_share_bag_can_recover_secret,
734 _fipspost_post, _fipspost_trace_vtable, _map_to_curve_sswu ]
733735 - targets: [ arm64e-macos, arm64e-maccatalyst, arm64-macos, arm64-maccatalyst ]
734736 symbols: [ _ccaes_arm_cbc_decrypt_mode, _ccaes_arm_cbc_encrypt_mode,
735737 _ccaes_arm_cfb_decrypt_mode, _ccaes_arm_cfb_encrypt_mode,
......@@ -744,19 +746,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
744746 arm64e-macos, arm64e-maccatalyst ]
745747uuids:
746748 - target: x86_64-macos
747 value: D98AD4CA-5E4C-3842-AC57-2C65CDAFFAB9
749 value: 31D69D55-9895-326C-AD61-621C5CA87314
748750 - target: x86_64-maccatalyst
749 value: D98AD4CA-5E4C-3842-AC57-2C65CDAFFAB9
751 value: 31D69D55-9895-326C-AD61-621C5CA87314
750752 - target: arm64-macos
751753 value: 00000000-0000-0000-0000-000000000000
752754 - target: arm64-maccatalyst
753755 value: 00000000-0000-0000-0000-000000000000
754756 - target: arm64e-macos
755 value: 9C4116F5-B8EB-3A00-B4B5-54AF6A76F66B
757 value: DC048E3B-E023-3D17-AFE5-4FF3DC625608
756758 - target: arm64e-maccatalyst
757 value: 9C4116F5-B8EB-3A00-B4B5-54AF6A76F66B
759 value: DC048E3B-E023-3D17-AFE5-4FF3DC625608
758760install-name: '/usr/lib/system/libdispatch.dylib'
759current-version: 1324.30.6
761current-version: 1325.100.36
760762parent-umbrella:
761763 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
762764 arm64e-macos, arm64e-maccatalyst ]
......@@ -799,23 +801,22 @@ exports:
799801 __os_object_retain_with_resurrect, _dispatch_activate, _dispatch_after,
800802 _dispatch_after_f, _dispatch_allocator_layout, _dispatch_apply,
801803 _dispatch_apply_attr_destroy, _dispatch_apply_attr_init, _dispatch_apply_attr_query,
802 _dispatch_apply_attr_set_amx_parallelism, _dispatch_apply_f,
803 _dispatch_apply_with_attr, _dispatch_apply_with_attr_f, _dispatch_assert_queue,
804 '_dispatch_assert_queue$V2', _dispatch_assert_queue_barrier,
805 _dispatch_assert_queue_not, '_dispatch_assert_queue_not$V2',
806 _dispatch_async, _dispatch_async_and_wait, _dispatch_async_and_wait_f,
807 _dispatch_async_enforce_qos_class_f, _dispatch_async_f, _dispatch_async_swift_job,
808 _dispatch_atfork_child, _dispatch_atfork_parent, _dispatch_atfork_prepare,
809 _dispatch_barrier_async, _dispatch_barrier_async_and_wait,
810 _dispatch_barrier_async_and_wait_f, _dispatch_barrier_async_f,
811 _dispatch_barrier_sync, _dispatch_barrier_sync_f, _dispatch_benchmark,
812 _dispatch_benchmark_f, _dispatch_block_cancel, _dispatch_block_create,
813 _dispatch_block_create_with_qos_class, _dispatch_block_create_with_voucher,
814 _dispatch_block_create_with_voucher_and_qos_class, _dispatch_block_notify,
815 _dispatch_block_perform, _dispatch_block_testcancel, _dispatch_block_wait,
816 _dispatch_channel_async, _dispatch_channel_async_f, _dispatch_channel_cancel,
817 _dispatch_channel_create, _dispatch_channel_drain, _dispatch_channel_drain_f,
818 _dispatch_channel_enqueue, _dispatch_channel_foreach_work_item_peek,
804 _dispatch_apply_attr_set_parallelism, _dispatch_apply_f, _dispatch_apply_with_attr,
805 _dispatch_apply_with_attr_f, _dispatch_assert_queue, '_dispatch_assert_queue$V2',
806 _dispatch_assert_queue_barrier, _dispatch_assert_queue_not,
807 '_dispatch_assert_queue_not$V2', _dispatch_async, _dispatch_async_and_wait,
808 _dispatch_async_and_wait_f, _dispatch_async_enforce_qos_class_f,
809 _dispatch_async_f, _dispatch_async_swift_job, _dispatch_atfork_child,
810 _dispatch_atfork_parent, _dispatch_atfork_prepare, _dispatch_barrier_async,
811 _dispatch_barrier_async_and_wait, _dispatch_barrier_async_and_wait_f,
812 _dispatch_barrier_async_f, _dispatch_barrier_sync, _dispatch_barrier_sync_f,
813 _dispatch_benchmark, _dispatch_benchmark_f, _dispatch_block_cancel,
814 _dispatch_block_create, _dispatch_block_create_with_qos_class,
815 _dispatch_block_create_with_voucher, _dispatch_block_create_with_voucher_and_qos_class,
816 _dispatch_block_notify, _dispatch_block_perform, _dispatch_block_testcancel,
817 _dispatch_block_wait, _dispatch_channel_async, _dispatch_channel_async_f,
818 _dispatch_channel_cancel, _dispatch_channel_create, _dispatch_channel_drain,
819 _dispatch_channel_drain_f, _dispatch_channel_enqueue, _dispatch_channel_foreach_work_item_peek,
819820 _dispatch_channel_foreach_work_item_peek_f, _dispatch_channel_testcancel,
820821 _dispatch_channel_wakeup, _dispatch_data_apply, _dispatch_data_apply_f,
821822 _dispatch_data_copy_region, _dispatch_data_create, _dispatch_data_create_alloc,
......@@ -869,8 +870,9 @@ exports:
869870 _dispatch_source_set_registration_handler, _dispatch_source_set_registration_handler_f,
870871 _dispatch_source_set_timer, _dispatch_source_testcancel, _dispatch_suspend,
871872 _dispatch_swift_job_should_yield, _dispatch_sync, _dispatch_sync_f,
872 _dispatch_time, _dispatch_time_to_nsecs, _dispatch_tsd_indexes,
873 _dispatch_walltime, _dispatch_workloop_copy_current, _dispatch_workloop_create,
873 _dispatch_time, _dispatch_time_from_nsec, _dispatch_time_to_nsec,
874 _dispatch_time_to_nsecs, _dispatch_tsd_indexes, _dispatch_walltime,
875 _dispatch_workloop_copy_current, _dispatch_workloop_create,
874876 _dispatch_workloop_create_inactive, _dispatch_workloop_is_current,
875877 _dispatch_workloop_set_autorelease_frequency, _dispatch_workloop_set_cpupercent,
876878 _dispatch_workloop_set_os_workgroup, _dispatch_workloop_set_qos_class,
......@@ -903,7 +905,8 @@ exports:
903905 _voucher_get_activity_id, _voucher_get_activity_id_and_creator,
904906 _voucher_get_current_persona, _voucher_get_current_persona_originator_info,
905907 _voucher_get_current_persona_proximate_info, _voucher_kvoucher_debug,
906 _voucher_process_can_use_arbitrary_personas, _voucher_replace_default_voucher ]
908 _voucher_process_can_use_arbitrary_personas, _voucher_release,
909 _voucher_replace_default_voucher, _voucher_retain ]
907910 objc-classes: [ OS_dispatch_channel, OS_dispatch_data, OS_dispatch_disk, OS_dispatch_group,
908911 OS_dispatch_io, OS_dispatch_mach, OS_dispatch_mach_msg, OS_dispatch_object,
909912 OS_dispatch_operation, OS_dispatch_queue, OS_dispatch_queue_attr,
......@@ -917,26 +920,26 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
917920 arm64e-macos, arm64e-maccatalyst ]
918921uuids:
919922 - target: x86_64-macos
920 value: D2F8B1F4-12FF-3226-9FCB-75193C2EDE2E
923 value: 6627654A-F427-3E04-98AC-492A1CA26FCC
921924 - target: x86_64-maccatalyst
922 value: D2F8B1F4-12FF-3226-9FCB-75193C2EDE2E
925 value: 6627654A-F427-3E04-98AC-492A1CA26FCC
923926 - target: arm64-macos
924 value: 7F570139-CD4C-32F5-B68D-AFB040F45EC4
927 value: 23F54944-4C0C-3479-93BE-F3A9D0B05724
925928 - target: arm64-maccatalyst
926 value: 7F570139-CD4C-32F5-B68D-AFB040F45EC4
929 value: 23F54944-4C0C-3479-93BE-F3A9D0B05724
927930 - target: arm64e-macos
928 value: 96ECED73-F10C-3941-91A7-00254B907499
931 value: D9C3F911-6697-3B95-A4F6-4FB979F04A6E
929932 - target: arm64e-maccatalyst
930 value: 96ECED73-F10C-3941-91A7-00254B907499
933 value: D9C3F911-6697-3B95-A4F6-4FB979F04A6E
931934install-name: '/usr/lib/system/libdyld.dylib'
932935parent-umbrella:
933936 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
934937 arm64e-macos, arm64e-maccatalyst ]
935938 umbrella: System
936939exports:
937 - targets: [ arm64-macos, x86_64-macos, arm64e-macos ]
940 - targets: [ arm64-macos, arm64e-macos, x86_64-macos ]
938941 symbols: [ _dyld_shared_cache_for_each_subcache4Rosetta, _dyld_shared_subcache_get_info4Rosetta ]
939 - targets: [ arm64-macos, x86_64-macos, arm64e-macos, x86_64-maccatalyst,
942 - targets: [ arm64-macos, arm64e-macos, x86_64-macos, x86_64-maccatalyst,
940943 arm64-maccatalyst, arm64e-maccatalyst ]
941944 symbols: [ _NSAddImage, _NSAddLibrary, _NSAddLibraryWithSearching, _NSAddressOfSymbol,
942945 _NSCreateObjectFileImageFromFile, _NSCreateObjectFileImageFromMemory,
......@@ -952,6 +955,7 @@ exports:
952955 _NSVersionOfLinkTimeLibrary, _NSVersionOfRunTimeLibrary, _NXArgc,
953956 _NXArgv, __NSGetExecutablePath, ___progname, __dyld_all_twolevel_modules_prebound,
954957 __dyld_atfork_parent, __dyld_atfork_prepare, __dyld_bind_fully_image_containing_address,
958 __dyld_dlopen_atfork_child, __dyld_dlopen_atfork_parent, __dyld_dlopen_atfork_prepare,
955959 __dyld_find_foreign_type_protocol_conformance, __dyld_find_protocol_conformance,
956960 __dyld_find_unwind_sections, __dyld_for_each_objc_class, __dyld_for_each_objc_protocol,
957961 __dyld_fork_child, __dyld_get_image_header, __dyld_get_image_header_containing_address,
......@@ -1007,17 +1011,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
10071011 arm64e-macos, arm64e-maccatalyst ]
10081012uuids:
10091013 - target: x86_64-macos
1010 value: 8F475783-80D3-378E-9A99-82602250DA06
1014 value: CCF77FC2-C655-30F7-AE37-9470E1C91C88
10111015 - target: x86_64-maccatalyst
1012 value: 8F475783-80D3-378E-9A99-82602250DA06
1016 value: CCF77FC2-C655-30F7-AE37-9470E1C91C88
10131017 - target: arm64-macos
10141018 value: 00000000-0000-0000-0000-000000000000
10151019 - target: arm64-maccatalyst
10161020 value: 00000000-0000-0000-0000-000000000000
10171021 - target: arm64e-macos
1018 value: F7CDC52B-7961-3283-A30F-B06E2E6ED6AB
1022 value: 7B91E34D-FEF4-3CAB-ABA5-B2CBCD2BCDC0
10191023 - target: arm64e-maccatalyst
1020 value: F7CDC52B-7961-3283-A30F-B06E2E6ED6AB
1024 value: 7B91E34D-FEF4-3CAB-ABA5-B2CBCD2BCDC0
10211025install-name: '/usr/lib/system/libkeymgr.dylib'
10221026current-version: 31
10231027parent-umbrella:
......@@ -1025,7 +1029,7 @@ parent-umbrella:
10251029 arm64e-macos, arm64e-maccatalyst ]
10261030 umbrella: System
10271031exports:
1028 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
1032 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
10291033 arm64-macos, arm64-maccatalyst ]
10301034 symbols: [ ___keymgr_dwarf2_register_sections, ___keymgr_initializer,
10311035 __keymgr_get_and_lock_processwide_ptr, __keymgr_get_and_lock_processwide_ptr_2,
......@@ -1037,24 +1041,24 @@ tbd-version: 4
10371041targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64e-macos ]
10381042uuids:
10391043 - target: x86_64-macos
1040 value: 962FA64E-23DE-3C77-AD8B-B302B5E892FF
1044 value: 4D6563C4-0109-33EF-9641-5762CA377023
10411045 - target: x86_64-maccatalyst
1042 value: 962FA64E-23DE-3C77-AD8B-B302B5E892FF
1046 value: 4D6563C4-0109-33EF-9641-5762CA377023
10431047 - target: arm64-macos
1044 value: 45FA69BC-984E-3D28-9D18-B3EEBA237CBE
1048 value: 5098ED51-AC6F-3D86-94CA-DB77E3BF43EE
10451049 - target: arm64-maccatalyst
1046 value: 45FA69BC-984E-3D28-9D18-B3EEBA237CBE
1050 value: 5098ED51-AC6F-3D86-94CA-DB77E3BF43EE
10471051 - target: arm64e-macos
1048 value: 8D2BECEF-1038-3F2C-B8EF-B02C03092286
1052 value: A96A86CA-C4C0-3013-BB2E-5F7572B18A00
10491053 - target: arm64e-maccatalyst
1050 value: 8D2BECEF-1038-3F2C-B8EF-B02C03092286
1054 value: A96A86CA-C4C0-3013-BB2E-5F7572B18A00
10511055install-name: '/usr/lib/system/libmacho.dylib'
1052current-version: 987
1056current-version: 994
10531057parent-umbrella:
10541058 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64e-macos ]
10551059 umbrella: System
10561060exports:
1057 - targets: [ arm64-macos, x86_64-macos, arm64e-macos, x86_64-maccatalyst ]
1061 - targets: [ arm64-macos, arm64e-macos, x86_64-macos, x86_64-maccatalyst ]
10581062 symbols: [ _NXCombineCpuSubtypes, _NXFindBestFatArch, _NXFindBestFatArch_64,
10591063 _NXFreeArchInfo, _NXGetAllArchInfos, _NXGetArchInfoFromCpuType,
10601064 _NXGetArchInfoFromName, _NXGetLocalArchInfo, _get_edata, _get_end,
......@@ -1097,25 +1101,25 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
10971101 arm64e-macos, arm64e-maccatalyst ]
10981102uuids:
10991103 - target: x86_64-macos
1100 value: C6D1E49B-561D-3F84-8548-18FE40AB02DA
1104 value: BFB0329D-28B0-3FF8-AF71-FB8798721547
11011105 - target: x86_64-maccatalyst
1102 value: C6D1E49B-561D-3F84-8548-18FE40AB02DA
1106 value: BFB0329D-28B0-3FF8-AF71-FB8798721547
11031107 - target: arm64-macos
11041108 value: 00000000-0000-0000-0000-000000000000
11051109 - target: arm64-maccatalyst
11061110 value: 00000000-0000-0000-0000-000000000000
11071111 - target: arm64e-macos
1108 value: 3D861651-91A7-3D78-B43B-ECAA41D63D9E
1112 value: 49C11AB5-FD65-39BE-A1C7-AD885809511E
11091113 - target: arm64e-maccatalyst
1110 value: 3D861651-91A7-3D78-B43B-ECAA41D63D9E
1114 value: 49C11AB5-FD65-39BE-A1C7-AD885809511E
11111115install-name: '/usr/lib/system/libquarantine.dylib'
1112current-version: 129.30.3
1116current-version: 133.100.3
11131117parent-umbrella:
11141118 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
11151119 arm64e-macos, arm64e-maccatalyst ]
11161120 umbrella: System
11171121exports:
1118 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
1122 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
11191123 arm64-macos, arm64-maccatalyst ]
11201124 symbols: [ ___esp_check, ___esp_check_ns, ___esp_enabled, ___esp_notify,
11211125 ___esp_notify_ns, __qtn_error, __qtn_file_alloc, __qtn_file_apply_to_fd,
......@@ -1151,17 +1155,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
11511155 arm64e-macos, arm64e-maccatalyst ]
11521156uuids:
11531157 - target: x86_64-macos
1154 value: A88ED990-563F-3230-9C80-703A3134AEE4
1158 value: 06A5E617-FB01-3F34-9A4C-CA3894CE0438
11551159 - target: x86_64-maccatalyst
1156 value: A88ED990-563F-3230-9C80-703A3134AEE4
1160 value: 06A5E617-FB01-3F34-9A4C-CA3894CE0438
11571161 - target: arm64-macos
11581162 value: 00000000-0000-0000-0000-000000000000
11591163 - target: arm64-maccatalyst
11601164 value: 00000000-0000-0000-0000-000000000000
11611165 - target: arm64e-macos
1162 value: FA2D8F89-D9C4-316F-9FDC-BFF1A791BD4E
1166 value: 4880993D-A23B-3DCE-942A-4201CE7E5461
11631167 - target: arm64e-maccatalyst
1164 value: FA2D8F89-D9C4-316F-9FDC-BFF1A791BD4E
1168 value: 4880993D-A23B-3DCE-942A-4201CE7E5461
11651169install-name: '/usr/lib/system/libremovefile.dylib'
11661170current-version: 60
11671171parent-umbrella:
......@@ -1169,7 +1173,7 @@ parent-umbrella:
11691173 arm64e-macos, arm64e-maccatalyst ]
11701174 umbrella: System
11711175exports:
1172 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
1176 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
11731177 arm64-macos, arm64-maccatalyst ]
11741178 symbols: [ ___removefile_init_random, ___removefile_random_char, ___removefile_randomize_buffer,
11751179 ___removefile_rename_unlink, ___removefile_sunlink, ___removefile_tree_walker,
......@@ -1182,19 +1186,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
11821186 arm64e-macos, arm64e-maccatalyst ]
11831187uuids:
11841188 - target: x86_64-macos
1185 value: 7A040D61-D8FB-3F40-99B7-0C84BA2574DC
1189 value: DAA735E5-A64F-3443-8B24-8C5A77A25EFD
11861190 - target: x86_64-maccatalyst
1187 value: 7A040D61-D8FB-3F40-99B7-0C84BA2574DC
1191 value: DAA735E5-A64F-3443-8B24-8C5A77A25EFD
11881192 - target: arm64-macos
11891193 value: 00000000-0000-0000-0000-000000000000
11901194 - target: arm64-maccatalyst
11911195 value: 00000000-0000-0000-0000-000000000000
11921196 - target: arm64e-macos
1193 value: 61963381-E322-3D0F-855D-CE1EA31FA4E1
1197 value: 6B2F4A2F-2C36-3D5D-87F0-9B6BBAE5560C
11941198 - target: arm64e-maccatalyst
1195 value: 61963381-E322-3D0F-855D-CE1EA31FA4E1
1199 value: 6B2F4A2F-2C36-3D5D-87F0-9B6BBAE5560C
11961200install-name: '/usr/lib/system/libsystem_asl.dylib'
1197current-version: 390
1201current-version: 392.100.2
11981202parent-umbrella:
11991203 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
12001204 arm64e-macos, arm64e-maccatalyst ]
......@@ -1276,25 +1280,25 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
12761280 arm64e-macos, arm64e-maccatalyst ]
12771281uuids:
12781282 - target: x86_64-macos
1279 value: 247F70CA-E83C-346B-8556-B3DACE78ED36
1283 value: CCC417A8-9265-3B0C-AF95-98B57ABE5E43
12801284 - target: x86_64-maccatalyst
1281 value: 247F70CA-E83C-346B-8556-B3DACE78ED36
1285 value: CCC417A8-9265-3B0C-AF95-98B57ABE5E43
12821286 - target: arm64-macos
12831287 value: 00000000-0000-0000-0000-000000000000
12841288 - target: arm64-maccatalyst
12851289 value: 00000000-0000-0000-0000-000000000000
12861290 - target: arm64e-macos
1287 value: 770FEB1F-FE27-3670-810F-A063D281CC8D
1291 value: DF7F3CF2-FF71-3E86-AA3A-46465B8B8DEC
12881292 - target: arm64e-maccatalyst
1289 value: 770FEB1F-FE27-3670-810F-A063D281CC8D
1293 value: DF7F3CF2-FF71-3E86-AA3A-46465B8B8DEC
12901294install-name: '/usr/lib/system/libsystem_blocks.dylib'
1291current-version: 79
1295current-version: 79.1
12921296parent-umbrella:
12931297 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
12941298 arm64e-macos, arm64e-maccatalyst ]
12951299 umbrella: System
12961300exports:
1297 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
1301 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
12981302 arm64-macos, arm64-maccatalyst ]
12991303 symbols: [ _Block_size, __Block_copy, __Block_extended_layout, __Block_has_signature,
13001304 __Block_isDeallocating, __Block_layout, __Block_object_assign,
......@@ -1308,19 +1312,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
13081312 arm64e-macos, arm64e-maccatalyst ]
13091313uuids:
13101314 - target: x86_64-macos
1311 value: DE0BB5F4-D3EC-36EB-8B7F-58964E2AAC7C
1315 value: 8E54ECA2-9BD8-3482-9589-B9574434D1AA
13121316 - target: x86_64-maccatalyst
1313 value: DE0BB5F4-D3EC-36EB-8B7F-58964E2AAC7C
1317 value: 8E54ECA2-9BD8-3482-9589-B9574434D1AA
13141318 - target: arm64-macos
13151319 value: 00000000-0000-0000-0000-000000000000
13161320 - target: arm64-maccatalyst
13171321 value: 00000000-0000-0000-0000-000000000000
13181322 - target: arm64e-macos
1319 value: 660D7866-E2A2-3651-A0A5-806E9217736B
1323 value: FD566A15-42D8-314A-A99A-B59237DDF5BC
13201324 - target: arm64e-maccatalyst
1321 value: 660D7866-E2A2-3651-A0A5-806E9217736B
1325 value: FD566A15-42D8-314A-A99A-B59237DDF5BC
13221326install-name: '/usr/lib/system/libsystem_c.dylib'
1323current-version: 1506.30.3
1327current-version: 1507.100.9
13241328parent-umbrella:
13251329 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
13261330 arm64e-macos, arm64e-maccatalyst ]
......@@ -1440,13 +1444,13 @@ exports:
14401444 _dbopen, _devname, _devname_r, _difftime, _digittoint, _digittoint_l,
14411445 _dirfd, _dirname, _dirname_r, _div, _dprintf, _dprintf_l,
14421446 _drand48, _duplocale, _dxprintf, _dxprintf_exec, _ecvt, _encrypt,
1443 _endttyent, _endusershell, _endutxent, _endutxent_wtmp, _erand48,
1444 _err, _err_set_exit, _err_set_exit_b, _err_set_file, _errc,
1445 _errx, _execl, _execle, _execlp, _execv, _execvP, _execvp,
1446 _exit, _f_prealloc, _fchmodx_np, _fclose, _fcvt, _fdopen,
1447 '_fdopen$DARWIN_EXTSN', _fdopendir, _feof, _feof_unlocked,
1448 _ferror, _ferror_unlocked, _fflagstostr, _fflush, _fgetc,
1449 _fgetln, _fgetpos, _fgetrune, _fgets, _fgetwc, _fgetwc_l,
1447 _endttyent, _endusershell, _endutxent, _endutxent_wtmp, _environ_lock_np,
1448 _environ_unlock_np, _erand48, _err, _err_set_exit, _err_set_exit_b,
1449 _err_set_file, _errc, _errx, _execl, _execle, _execlp, _execv,
1450 _execvP, _execvp, _exit, _f_prealloc, _fchmodx_np, _fclose,
1451 _fcvt, _fdopen, '_fdopen$DARWIN_EXTSN', _fdopendir, _feof,
1452 _feof_unlocked, _ferror, _ferror_unlocked, _fflagstostr, _fflush,
1453 _fgetc, _fgetln, _fgetpos, _fgetrune, _fgets, _fgetwc, _fgetwc_l,
14501454 _fgetwln, _fgetwln_l, _fgetws, _fgetws_l, _fileno, _fileno_unlocked,
14511455 _filesec_dup, _filesec_free, _filesec_get_property, _filesec_init,
14521456 _filesec_query_property, _filesec_set_property, _filesec_unset_property,
......@@ -1615,25 +1619,25 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
16151619 arm64e-macos, arm64e-maccatalyst ]
16161620uuids:
16171621 - target: x86_64-macos
1618 value: 238A47F2-BED4-36B9-8080-E88095B11F5A
1622 value: BDBBFF38-0DB7-3B60-BB26-1E7E36715C85
16191623 - target: x86_64-maccatalyst
1620 value: 238A47F2-BED4-36B9-8080-E88095B11F5A
1624 value: BDBBFF38-0DB7-3B60-BB26-1E7E36715C85
16211625 - target: arm64-macos
16221626 value: 00000000-0000-0000-0000-000000000000
16231627 - target: arm64-maccatalyst
16241628 value: 00000000-0000-0000-0000-000000000000
16251629 - target: arm64e-macos
1626 value: 1F580793-A1C3-30C6-A9BC-7789C14677AE
1630 value: B7FB982C-29CC-383B-9C25-60D660BB1433
16271631 - target: arm64e-maccatalyst
1628 value: 1F580793-A1C3-30C6-A9BC-7789C14677AE
1632 value: B7FB982C-29CC-383B-9C25-60D660BB1433
16291633install-name: '/usr/lib/system/libsystem_collections.dylib'
1630current-version: 1506.30.3
1634current-version: 1507.100.9
16311635parent-umbrella:
16321636 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
16331637 arm64e-macos, arm64e-maccatalyst ]
16341638 umbrella: System
16351639exports:
1636 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
1640 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
16371641 arm64-macos, arm64-maccatalyst ]
16381642 symbols: [ _os_map_128_clear, _os_map_128_count, _os_map_128_delete,
16391643 _os_map_128_destroy, _os_map_128_find, _os_map_128_foreach,
......@@ -1658,19 +1662,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
16581662 arm64e-macos, arm64e-maccatalyst ]
16591663uuids:
16601664 - target: x86_64-macos
1661 value: C13509A3-AE4E-3232-A5CD-4C055C585565
1665 value: 254B479C-BCCB-3A80-A6D8-246FE621D182
16621666 - target: x86_64-maccatalyst
1663 value: C13509A3-AE4E-3232-A5CD-4C055C585565
1667 value: 254B479C-BCCB-3A80-A6D8-246FE621D182
16641668 - target: arm64-macos
16651669 value: 00000000-0000-0000-0000-000000000000
16661670 - target: arm64-maccatalyst
16671671 value: 00000000-0000-0000-0000-000000000000
16681672 - target: arm64e-macos
1669 value: 8370E8A5-EADF-3A2C-9D5B-CA148723A5CA
1673 value: F241F139-76C4-38FC-A44C-5D695A58592D
16701674 - target: arm64e-maccatalyst
1671 value: 8370E8A5-EADF-3A2C-9D5B-CA148723A5CA
1675 value: F241F139-76C4-38FC-A44C-5D695A58592D
16721676install-name: '/usr/lib/system/libsystem_configuration.dylib'
1673current-version: 1163.30.6
1677current-version: 1163.100.19
16741678parent-umbrella:
16751679 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
16761680 arm64e-macos, arm64e-maccatalyst ]
......@@ -1698,17 +1702,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
16981702 arm64e-macos, arm64e-maccatalyst ]
16991703uuids:
17001704 - target: x86_64-macos
1701 value: EBCDED71-A48E-3FC6-A05D-81EA84A901AD
1705 value: 03AC1106-F611-3CCA-98AE-8C5FA6ED5C94
17021706 - target: x86_64-maccatalyst
1703 value: EBCDED71-A48E-3FC6-A05D-81EA84A901AD
1707 value: 03AC1106-F611-3CCA-98AE-8C5FA6ED5C94
17041708 - target: arm64-macos
17051709 value: 00000000-0000-0000-0000-000000000000
17061710 - target: arm64-maccatalyst
17071711 value: 00000000-0000-0000-0000-000000000000
17081712 - target: arm64e-macos
1709 value: 30C492F6-C9E6-3C1D-BE52-CA4F4FC824D6
1713 value: ECF472AD-D73F-3C98-B186-2AD4EE20F4D5
17101714 - target: arm64e-maccatalyst
1711 value: 30C492F6-C9E6-3C1D-BE52-CA4F4FC824D6
1715 value: ECF472AD-D73F-3C98-B186-2AD4EE20F4D5
17121716install-name: '/usr/lib/system/libsystem_containermanager.dylib'
17131717parent-umbrella:
17141718 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
......@@ -1788,17 +1792,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
17881792 arm64e-macos, arm64e-maccatalyst ]
17891793uuids:
17901794 - target: x86_64-macos
1791 value: 4B990266-91BF-3E2F-97C0-3B214B3052DC
1795 value: 5E34B58A-2BEE-3AA4-AB65-C32D4619AC2B
17921796 - target: x86_64-maccatalyst
1793 value: 4B990266-91BF-3E2F-97C0-3B214B3052DC
1797 value: 5E34B58A-2BEE-3AA4-AB65-C32D4619AC2B
17941798 - target: arm64-macos
17951799 value: 00000000-0000-0000-0000-000000000000
17961800 - target: arm64-maccatalyst
17971801 value: 00000000-0000-0000-0000-000000000000
17981802 - target: arm64e-macos
1799 value: F2A34B01-C264-3B7E-B3C9-1671E9E3C185
1803 value: 92325446-C184-3BDF-B839-CFC2A7C558EC
18001804 - target: arm64e-maccatalyst
1801 value: F2A34B01-C264-3B7E-B3C9-1671E9E3C185
1805 value: 92325446-C184-3BDF-B839-CFC2A7C558EC
18021806install-name: '/usr/lib/system/libsystem_coreservices.dylib'
18031807current-version: 133
18041808parent-umbrella:
......@@ -1806,7 +1810,7 @@ parent-umbrella:
18061810 arm64e-macos, arm64e-maccatalyst ]
18071811 umbrella: System
18081812exports:
1809 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
1813 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
18101814 arm64-macos, arm64-maccatalyst ]
18111815 symbols: [ _NSGetNextSearchPathEnumeration, _NSStartSearchPathEnumeration,
18121816 _NSStartSearchPathEnumerationPrivate, ___user_local_dirname,
......@@ -1814,7 +1818,7 @@ exports:
18141818 __dirhelper, __dirhelper_relative, __get_user_dir_suffix,
18151819 __libcoreservices_fork_child, __set_user_dir_suffix, _sysdir_get_next_search_path_enumeration,
18161820 _sysdir_start_search_path_enumeration, _sysdir_start_search_path_enumeration_private ]
1817 - targets: [ x86_64-macos, arm64e-macos, arm64-macos ]
1821 - targets: [ arm64e-macos, x86_64-macos, arm64-macos ]
18181822 symbols: [ __idle_exit ]
18191823--- !tapi-tbd
18201824tbd-version: 4
......@@ -1822,24 +1826,24 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
18221826 arm64e-macos, arm64e-maccatalyst ]
18231827uuids:
18241828 - target: x86_64-macos
1825 value: 735E8A58-EA5A-3989-946E-D19037A7A9AD
1829 value: A1C57F3C-0B85-367D-AFD8-CE4B01B638C6
18261830 - target: x86_64-maccatalyst
1827 value: 735E8A58-EA5A-3989-946E-D19037A7A9AD
1831 value: A1C57F3C-0B85-367D-AFD8-CE4B01B638C6
18281832 - target: arm64-macos
18291833 value: 00000000-0000-0000-0000-000000000000
18301834 - target: arm64-maccatalyst
18311835 value: 00000000-0000-0000-0000-000000000000
18321836 - target: arm64e-macos
1833 value: 01C0D793-E5FB-3141-95D6-32A973F9FFF8
1837 value: D07777F4-2044-30E7-82FB-8F239F71A802
18341838 - target: arm64e-maccatalyst
1835 value: 01C0D793-E5FB-3141-95D6-32A973F9FFF8
1839 value: D07777F4-2044-30E7-82FB-8F239F71A802
18361840install-name: '/usr/lib/system/libsystem_darwin.dylib'
18371841parent-umbrella:
18381842 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
18391843 arm64e-macos, arm64e-maccatalyst ]
18401844 umbrella: System
18411845exports:
1842 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
1846 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
18431847 arm64-macos, arm64-maccatalyst ]
18441848 symbols: [ ___libdarwin_init, ___os_temporary_resource_shortage, _claimfd_np,
18451849 _close_drop_np, _close_drop_optional_np, _crfprintf_np, _dirstat_np,
......@@ -1873,25 +1877,25 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
18731877 arm64e-macos, arm64e-maccatalyst ]
18741878uuids:
18751879 - target: x86_64-macos
1876 value: C2A4351C-A3A5-3B23-AC6E-33E2EC933845
1880 value: 5E0FC1CB-9A90-3163-8BBF-19076AC6D14C
18771881 - target: x86_64-maccatalyst
1878 value: C2A4351C-A3A5-3B23-AC6E-33E2EC933845
1882 value: 5E0FC1CB-9A90-3163-8BBF-19076AC6D14C
18791883 - target: arm64-macos
18801884 value: 00000000-0000-0000-0000-000000000000
18811885 - target: arm64-maccatalyst
18821886 value: 00000000-0000-0000-0000-000000000000
18831887 - target: arm64e-macos
1884 value: AED9DAFC-7AB1-31CF-96A1-14C87B614DD3
1888 value: BCF907AB-64F2-3E2C-A203-9FCA6584C584
18851889 - target: arm64e-maccatalyst
1886 value: AED9DAFC-7AB1-31CF-96A1-14C87B614DD3
1890 value: BCF907AB-64F2-3E2C-A203-9FCA6584C584
18871891install-name: '/usr/lib/system/libsystem_dnssd.dylib'
1888current-version: 1556.30.12
1892current-version: 1557.101.2
18891893parent-umbrella:
18901894 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
18911895 arm64e-macos, arm64e-maccatalyst ]
18921896 umbrella: System
18931897exports:
1894 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
1898 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
18951899 arm64-macos, arm64-maccatalyst ]
18961900 symbols: [ _DNSServiceAddRecord, _DNSServiceBrowse, _DNSServiceConstructFullName,
18971901 _DNSServiceCreateConnection, _DNSServiceCreateDelegateConnection,
......@@ -1916,25 +1920,25 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
19161920 arm64e-macos, arm64e-maccatalyst ]
19171921uuids:
19181922 - target: x86_64-macos
1919 value: C922FEBB-3F3D-3009-885D-386706502278
1923 value: 1D848276-387D-39BE-BDCC-6491A766B421
19201924 - target: x86_64-maccatalyst
1921 value: C922FEBB-3F3D-3009-885D-386706502278
1925 value: 1D848276-387D-39BE-BDCC-6491A766B421
19221926 - target: arm64-macos
19231927 value: 00000000-0000-0000-0000-000000000000
19241928 - target: arm64-maccatalyst
19251929 value: 00000000-0000-0000-0000-000000000000
19261930 - target: arm64e-macos
1927 value: F0456F65-B4DF-3E14-91DC-C0C2A7954233
1931 value: 8BCCBE77-3AEB-3BDA-A6B6-4D1D0B7FFBCF
19281932 - target: arm64e-maccatalyst
1929 value: F0456F65-B4DF-3E14-91DC-C0C2A7954233
1933 value: 8BCCBE77-3AEB-3BDA-A6B6-4D1D0B7FFBCF
19301934install-name: '/usr/lib/system/libsystem_featureflags.dylib'
1931current-version: 54.30.2
1935current-version: 56
19321936parent-umbrella:
19331937 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
19341938 arm64e-macos, arm64e-maccatalyst ]
19351939 umbrella: System
19361940exports:
1937 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
1941 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
19381942 arm64-macos, arm64-maccatalyst ]
19391943 symbols: [ __os_feature_enabled_impl, __os_feature_enabled_simple_impl ]
19401944--- !tapi-tbd
......@@ -1943,24 +1947,24 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
19431947 arm64e-macos, arm64e-maccatalyst ]
19441948uuids:
19451949 - target: x86_64-macos
1946 value: EC332A01-B383-3BBE-BD01-C732C1A9BF68
1950 value: 46CC22E7-C847-3A30-8B81-2E6CEF535451
19471951 - target: x86_64-maccatalyst
1948 value: EC332A01-B383-3BBE-BD01-C732C1A9BF68
1952 value: 46CC22E7-C847-3A30-8B81-2E6CEF535451
19491953 - target: arm64-macos
19501954 value: 00000000-0000-0000-0000-000000000000
19511955 - target: arm64-maccatalyst
19521956 value: 00000000-0000-0000-0000-000000000000
19531957 - target: arm64e-macos
1954 value: 5E36F087-5EF7-33B7-ACDA-CAE1C4A97621
1958 value: 2CE857CF-271D-3196-9087-0875C4D153BD
19551959 - target: arm64e-maccatalyst
1956 value: 5E36F087-5EF7-33B7-ACDA-CAE1C4A97621
1960 value: 2CE857CF-271D-3196-9087-0875C4D153BD
19571961install-name: '/usr/lib/system/libsystem_info.dylib'
19581962parent-umbrella:
19591963 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
19601964 arm64e-macos, arm64e-maccatalyst ]
19611965 umbrella: System
19621966exports:
1963 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
1967 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
19641968 arm64-macos, arm64-maccatalyst ]
19651969 symbols: [ _LI_get_thread_item, _LI_get_thread_list, _LI_ils_create,
19661970 _LI_set_thread_item, _LI_set_thread_list, ___dn_skipname,
......@@ -2080,19 +2084,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
20802084 arm64e-macos, arm64e-maccatalyst ]
20812085uuids:
20822086 - target: x86_64-macos
2083 value: A047541D-D968-3125-A5B1-B5A183385249
2087 value: 26A59789-B846-3ED4-96DC-8DBEF3C0C8E7
20842088 - target: x86_64-maccatalyst
2085 value: A047541D-D968-3125-A5B1-B5A183385249
2089 value: 26A59789-B846-3ED4-96DC-8DBEF3C0C8E7
20862090 - target: arm64-macos
2087 value: 2C89227C-13E1-3A3F-8417-67B7C86B441B
2091 value: 8678B4ED-EC14-3851-8DA2-AE9902BBD5FC
20882092 - target: arm64-maccatalyst
2089 value: 2C89227C-13E1-3A3F-8417-67B7C86B441B
2093 value: 8678B4ED-EC14-3851-8DA2-AE9902BBD5FC
20902094 - target: arm64e-macos
2091 value: 17550B77-D255-389A-B779-906AF75314B6
2095 value: 1D7B3B8E-75A1-34EA-AA52-9F7C23155C55
20922096 - target: arm64e-maccatalyst
2093 value: 17550B77-D255-389A-B779-906AF75314B6
2097 value: 1D7B3B8E-75A1-34EA-AA52-9F7C23155C55
20942098install-name: '/usr/lib/system/libsystem_kernel.dylib'
2095current-version: 8019.30.61
2099current-version: 8020.101.4
20962100parent-umbrella:
20972101 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
20982102 arm64e-macos, arm64e-maccatalyst ]
......@@ -2236,14 +2240,14 @@ exports:
22362240 _fchdir, _fchflags, _fchmod, _fchmodat, _fchown, _fchownat,
22372241 _fclonefileat, _fcntl, '_fcntl$NOCANCEL', _fdatasync, _ffsctl,
22382242 _fgetattrlist, _fgetxattr, _fhopen, _fileport_makefd, _fileport_makeport,
2239 _flistxattr, _flock, _fmount, _fpathconf, _fremovexattr, _fs_snapshot_create,
2240 _fs_snapshot_delete, _fs_snapshot_list, _fs_snapshot_mount,
2241 _fs_snapshot_rename, _fs_snapshot_revert, _fs_snapshot_root,
2242 _fsctl, _fsetattrlist, _fsetxattr, _fsgetpath, _fsgetpath_ext,
2243 _fstat, _fstat64, _fstatat, _fstatat64, _fstatfs, _fstatfs64,
2244 _fsync, '_fsync$NOCANCEL', _ftruncate, _futimens, _futimes,
2245 _getattrlist, _getattrlistat, _getattrlistbulk, _getaudit,
2246 _getaudit_addr, _getauid, _getdirentries, _getdirentriesattr,
2243 _flistxattr, _flock, _fmount, _fpathconf, _freadlink, _fremovexattr,
2244 _fs_snapshot_create, _fs_snapshot_delete, _fs_snapshot_list,
2245 _fs_snapshot_mount, _fs_snapshot_rename, _fs_snapshot_revert,
2246 _fs_snapshot_root, _fsctl, _fsetattrlist, _fsetxattr, _fsgetpath,
2247 _fsgetpath_ext, _fstat, _fstat64, _fstatat, _fstatat64, _fstatfs,
2248 _fstatfs64, _fsync, '_fsync$NOCANCEL', _ftruncate, _futimens,
2249 _futimes, _getattrlist, _getattrlistat, _getattrlistbulk,
2250 _getaudit, _getaudit_addr, _getauid, _getdirentries, _getdirentriesattr,
22472251 _getdtablesize, _getegid, _getentropy, _geteuid, _getfh, _getfsstat,
22482252 _getfsstat64, _getgid, _getgroups, _gethostuuid, _getiopolicy_np,
22492253 _getitimer, _getpeername, _getpgid, _getpgrp, _getpid, _getppid,
......@@ -2435,42 +2439,42 @@ exports:
24352439 _posix_spawnattr_setpcontrol_np, _posix_spawnattr_setpgroup,
24362440 _posix_spawnattr_setprocesstype_np, _posix_spawnattr_setsigdefault,
24372441 _posix_spawnattr_setsigmask, _posix_spawnattr_setspecialport_np,
2438 _posix_spawnattr_setsuidcredport_np, _pread, '_pread$NOCANCEL',
2439 _preadv, '_preadv$NOCANCEL', _proc_clear_cpulimits, _proc_clear_delayidlesleep,
2440 _proc_clear_dirty, _proc_clear_vmpressure, _proc_current_thread_schedinfo,
2441 _proc_denap_assertion_begin_with_msg, _proc_denap_assertion_complete,
2442 _proc_disable_apptype, _proc_disable_cpumon, _proc_disable_wakemon,
2443 _proc_donate_importance_boost, _proc_enable_apptype, _proc_get_cpumon_params,
2444 _proc_get_dirty, _proc_get_wakemon_params, _proc_importance_assertion_begin_with_msg,
2445 _proc_importance_assertion_complete, _proc_kmsgbuf, _proc_libversion,
2446 _proc_list_dynkqueueids, _proc_list_uptrs, _proc_listallpids,
2447 _proc_listchildpids, _proc_listcoalitions, _proc_listpgrppids,
2448 _proc_listpids, _proc_listpidspath, _proc_name, _proc_pid_rusage,
2449 _proc_piddynkqueueinfo, _proc_pidfdinfo, _proc_pidfileportinfo,
2450 _proc_pidinfo, _proc_pidoriginatorinfo, _proc_pidpath, _proc_pidpath_audittoken,
2451 _proc_regionfilename, _proc_reset_footprint_interval, _proc_resume_cpumon,
2452 _proc_rlimit_control, _proc_set_cpumon_defaults, _proc_set_cpumon_params,
2453 _proc_set_cpumon_params_fatal, _proc_set_csm, _proc_set_delayidlesleep,
2454 _proc_set_dirty, _proc_set_no_smt, _proc_set_owner_vmpressure,
2455 _proc_set_wakemon_defaults, _proc_set_wakemon_params, _proc_setcpu_percentage,
2456 _proc_setpcontrol, _proc_setthread_cpupercent, _proc_setthread_csm,
2457 _proc_setthread_no_smt, _proc_suppress, _proc_terminate, _proc_trace_log,
2458 _proc_track_dirty, _proc_udata_info, _proc_uuid_policy, _processor_assign,
2459 _processor_control, _processor_exit, _processor_get_assignment,
2460 _processor_info, _processor_set_create, _processor_set_default,
2461 _processor_set_destroy, _processor_set_info, _processor_set_max_priority,
2462 _processor_set_policy_control, _processor_set_policy_disable,
2463 _processor_set_policy_enable, _processor_set_stack_usage,
2464 _processor_set_statistics, _processor_set_tasks, _processor_set_tasks_with_flavor,
2465 _processor_set_threads, _processor_start, _pselect, '_pselect$DARWIN_EXTSN',
2466 '_pselect$DARWIN_EXTSN$NOCANCEL', '_pselect$NOCANCEL', _pthread_getugid_np,
2467 _pthread_setugid_np, _ptrace, _pwrite, '_pwrite$NOCANCEL',
2468 _pwritev, '_pwritev$NOCANCEL', _quota, _quotactl, _read, '_read$NOCANCEL',
2469 _readlink, _readlinkat, _readv, '_readv$NOCANCEL', _reboot,
2470 _reboot_np, _recvfrom, '_recvfrom$NOCANCEL', _recvmsg, '_recvmsg$NOCANCEL',
2471 _recvmsg_x, _register_uexc_handler, _removexattr, _rename,
2472 _rename_ext, _renameat, _renameatx_np, _renamex_np, _revoke,
2473 _rmdir, _searchfs, _select, '_select$DARWIN_EXTSN', '_select$DARWIN_EXTSN$NOCANCEL',
2442 _pread, '_pread$NOCANCEL', _preadv, '_preadv$NOCANCEL', _proc_clear_cpulimits,
2443 _proc_clear_delayidlesleep, _proc_clear_dirty, _proc_clear_vmpressure,
2444 _proc_current_thread_schedinfo, _proc_denap_assertion_begin_with_msg,
2445 _proc_denap_assertion_complete, _proc_disable_apptype, _proc_disable_cpumon,
2446 _proc_disable_wakemon, _proc_donate_importance_boost, _proc_enable_apptype,
2447 _proc_get_cpumon_params, _proc_get_dirty, _proc_get_wakemon_params,
2448 _proc_importance_assertion_begin_with_msg, _proc_importance_assertion_complete,
2449 _proc_kmsgbuf, _proc_libversion, _proc_list_dynkqueueids,
2450 _proc_list_uptrs, _proc_listallpids, _proc_listchildpids,
2451 _proc_listcoalitions, _proc_listpgrppids, _proc_listpids,
2452 _proc_listpidspath, _proc_name, _proc_pid_rusage, _proc_piddynkqueueinfo,
2453 _proc_pidfdinfo, _proc_pidfileportinfo, _proc_pidinfo, _proc_pidoriginatorinfo,
2454 _proc_pidpath, _proc_pidpath_audittoken, _proc_regionfilename,
2455 _proc_reset_footprint_interval, _proc_resume_cpumon, _proc_rlimit_control,
2456 _proc_set_cpumon_defaults, _proc_set_cpumon_params, _proc_set_cpumon_params_fatal,
2457 _proc_set_csm, _proc_set_delayidlesleep, _proc_set_dirty,
2458 _proc_set_no_smt, _proc_set_owner_vmpressure, _proc_set_wakemon_defaults,
2459 _proc_set_wakemon_params, _proc_setcpu_percentage, _proc_setpcontrol,
2460 _proc_setthread_cpupercent, _proc_setthread_csm, _proc_setthread_no_smt,
2461 _proc_suppress, _proc_terminate, _proc_trace_log, _proc_track_dirty,
2462 _proc_udata_info, _proc_uuid_policy, _processor_assign, _processor_control,
2463 _processor_exit, _processor_get_assignment, _processor_info,
2464 _processor_set_create, _processor_set_default, _processor_set_destroy,
2465 _processor_set_info, _processor_set_max_priority, _processor_set_policy_control,
2466 _processor_set_policy_disable, _processor_set_policy_enable,
2467 _processor_set_stack_usage, _processor_set_statistics, _processor_set_tasks,
2468 _processor_set_tasks_with_flavor, _processor_set_threads,
2469 _processor_start, _pselect, '_pselect$DARWIN_EXTSN', '_pselect$DARWIN_EXTSN$NOCANCEL',
2470 '_pselect$NOCANCEL', _pthread_getugid_np, _pthread_setugid_np,
2471 _ptrace, _pwrite, '_pwrite$NOCANCEL', _pwritev, '_pwritev$NOCANCEL',
2472 _quota, _quotactl, _read, '_read$NOCANCEL', _readlink, _readlinkat,
2473 _readv, '_readv$NOCANCEL', _reboot, _reboot_np, _recvfrom,
2474 '_recvfrom$NOCANCEL', _recvmsg, '_recvmsg$NOCANCEL', _recvmsg_x,
2475 _register_uexc_handler, _removexattr, _rename, _rename_ext,
2476 _renameat, _renameatx_np, _renamex_np, _revoke, _rmdir, _searchfs,
2477 _select, '_select$DARWIN_EXTSN', '_select$DARWIN_EXTSN$NOCANCEL',
24742478 '_select$NOCANCEL', _sem_close, _sem_destroy, _sem_getvalue,
24752479 _sem_init, _sem_open, _sem_post, _sem_trywait, _sem_unlink,
24762480 _sem_wait, '_sem_wait$NOCANCEL', _semaphore_create, _semaphore_destroy,
......@@ -2499,11 +2503,10 @@ exports:
24992503 _sync, _syscall, _syscall_thread_switch, _system_get_sfi_window,
25002504 _system_override, _system_set_sfi_window, _system_version_compat_mode,
25012505 _task_assign, _task_assign_default, _task_create, _task_create_identity_token,
2502 _task_create_suid_cred, _task_dyld_process_info_notify_deregister,
2503 _task_dyld_process_info_notify_get, _task_dyld_process_info_notify_register,
2504 _task_for_pid, _task_generate_corpse, _task_get_assignment,
2505 _task_get_dyld_image_infos, _task_get_emulation_vector, _task_get_exc_guard_behavior,
2506 _task_get_exception_ports, _task_get_exception_ports_info,
2506 _task_dyld_process_info_notify_deregister, _task_dyld_process_info_notify_get,
2507 _task_dyld_process_info_notify_register, _task_for_pid, _task_generate_corpse,
2508 _task_get_assignment, _task_get_dyld_image_infos, _task_get_emulation_vector,
2509 _task_get_exc_guard_behavior, _task_get_exception_ports, _task_get_exception_ports_info,
25072510 _task_get_mach_voucher, _task_get_special_port, _task_get_state,
25082511 _task_identity_token_get_task_port, _task_info, _task_inspect,
25092512 _task_inspect_for_pid, _task_map_corpse_info, _task_map_corpse_info_64,
......@@ -2518,10 +2521,10 @@ exports:
25182521 _task_set_phys_footprint_limit, _task_set_policy, _task_set_port_space,
25192522 _task_set_ras_pc, _task_set_special_port, _task_set_state,
25202523 _task_suspend, _task_suspend2, _task_swap_exception_ports,
2521 _task_swap_mach_voucher, _task_terminate, _task_test_sync_upcall,
2522 _task_threads, _task_unregister_dyld_image_infos, _task_zone_info,
2523 _terminate_with_payload, _terminate_with_reason, _thread_abort,
2524 _thread_abort_safely, _thread_assign, _thread_assign_default,
2524 _task_swap_mach_voucher, _task_terminate, _task_test_async_upcall_propagation,
2525 _task_test_sync_upcall, _task_threads, _task_unregister_dyld_image_infos,
2526 _task_zone_info, _terminate_with_payload, _terminate_with_reason,
2527 _thread_abort, _thread_abort_safely, _thread_assign, _thread_assign_default,
25252528 _thread_convert_thread_state, _thread_create, _thread_create_running,
25262529 _thread_depress_abort, _thread_destruct_special_reply_port,
25272530 _thread_get_assignment, _thread_get_exception_ports, _thread_get_exception_ports_info,
......@@ -2565,23 +2568,23 @@ targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-macc
25652568 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
25662569uuids:
25672570 - target: x86_64-macos
2568 value: 661AE5A6-34E0-3786-BAAA-0EA7C1B5436E
2571 value: ED42C002-0A3D-3CFC-A5B4-007E9F8450FD
25692572 - target: x86_64-maccatalyst
2570 value: 661AE5A6-34E0-3786-BAAA-0EA7C1B5436E
2573 value: ED42C002-0A3D-3CFC-A5B4-007E9F8450FD
25712574 - target: x86_64h-macos
2572 value: 4CE470DB-BC4F-3CC6-863B-DF899045C30C
2575 value: 5063016F-C5E4-3455-A057-CB3C3EEED7E8
25732576 - target: x86_64h-maccatalyst
2574 value: 4CE470DB-BC4F-3CC6-863B-DF899045C30C
2577 value: 5063016F-C5E4-3455-A057-CB3C3EEED7E8
25752578 - target: arm64-macos
25762579 value: 00000000-0000-0000-0000-000000000000
25772580 - target: arm64-maccatalyst
25782581 value: 00000000-0000-0000-0000-000000000000
25792582 - target: arm64e-macos
2580 value: 6AB180A4-1D1E-3FA1-88B7-A7866EFACFC8
2583 value: E02AEB06-0AB6-3743-BF8C-02CEFA571365
25812584 - target: arm64e-maccatalyst
2582 value: 6AB180A4-1D1E-3FA1-88B7-A7866EFACFC8
2585 value: E02AEB06-0AB6-3743-BF8C-02CEFA571365
25832586install-name: '/usr/lib/system/libsystem_m.dylib'
2584current-version: 3204
2587current-version: 3204.80.2
25852588parent-umbrella:
25862589 - targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst,
25872590 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
......@@ -2710,7 +2713,7 @@ exports:
27102713 '_tanhl$fenv_access_off', '_tanl$fenv_access_off', '_tgamma$fenv_access_off',
27112714 '_tgammaf$fenv_access_off', '_tgammal$fenv_access_off', '_trunc$fenv_access_off',
27122715 '_truncf$fenv_access_off', '_truncl$fenv_access_off' ]
2713 - targets: [ x86_64-macos, arm64e-macos, x86_64h-macos, x86_64-maccatalyst,
2716 - targets: [ arm64e-macos, x86_64-macos, x86_64h-macos, x86_64-maccatalyst,
27142717 x86_64h-maccatalyst, arm64e-maccatalyst, arm64-macos, arm64-maccatalyst ]
27152718 symbols: [ __FE_DFL_ENV, ___Libm_version, ___cos_d2, ___cos_f4, ___cospi,
27162719 ___cospif, ___exp10, ___exp10f, ___fegetfltrounds, ___fpclassifyd,
......@@ -2795,25 +2798,25 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
27952798 arm64e-macos, arm64e-maccatalyst ]
27962799uuids:
27972800 - target: x86_64-macos
2798 value: BA9DF725-FC7D-3856-90F7-0100C841DBFE
2801 value: CD1AD5BA-470D-33FF-A864-5FC3A18AB7C3
27992802 - target: x86_64-maccatalyst
2800 value: BA9DF725-FC7D-3856-90F7-0100C841DBFE
2803 value: CD1AD5BA-470D-33FF-A864-5FC3A18AB7C3
28012804 - target: arm64-macos
28022805 value: 00000000-0000-0000-0000-000000000000
28032806 - target: arm64-maccatalyst
28042807 value: 00000000-0000-0000-0000-000000000000
28052808 - target: arm64e-macos
2806 value: 7C9F7726-62C1-3B03-8130-03E8A2A68DDF
2809 value: 3A021C33-DD59-37F7-9A86-5CEED68FF9BA
28072810 - target: arm64e-maccatalyst
2808 value: 7C9F7726-62C1-3B03-8130-03E8A2A68DDF
2811 value: 3A021C33-DD59-37F7-9A86-5CEED68FF9BA
28092812install-name: '/usr/lib/system/libsystem_malloc.dylib'
2810current-version: 372.30.4
2813current-version: 374.100.5
28112814parent-umbrella:
28122815 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
28132816 arm64e-macos, arm64e-maccatalyst ]
28142817 umbrella: System
28152818exports:
2816 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
2819 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
28172820 arm64-macos, arm64-maccatalyst ]
28182821 symbols: [ ___mach_stack_logging_copy_uniquing_table, ___mach_stack_logging_enumerate_records,
28192822 ___mach_stack_logging_frames_for_uniqued_stack, ___mach_stack_logging_get_frames,
......@@ -2858,24 +2861,24 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
28582861 arm64e-macos, arm64e-maccatalyst ]
28592862uuids:
28602863 - target: x86_64-macos
2861 value: ACE11FA2-1955-3276-9343-D49A2B2059C5
2864 value: 9394E64A-D1D5-362C-98DB-760C7C15B9BE
28622865 - target: x86_64-maccatalyst
2863 value: ACE11FA2-1955-3276-9343-D49A2B2059C5
2866 value: 9394E64A-D1D5-362C-98DB-760C7C15B9BE
28642867 - target: arm64-macos
28652868 value: 00000000-0000-0000-0000-000000000000
28662869 - target: arm64-maccatalyst
28672870 value: 00000000-0000-0000-0000-000000000000
28682871 - target: arm64e-macos
2869 value: 2F331637-80F6-3208-816F-618DA9081899
2872 value: 8D842641-0F27-34B1-AEFC-C95B178E5433
28702873 - target: arm64e-maccatalyst
2871 value: 2F331637-80F6-3208-816F-618DA9081899
2874 value: 8D842641-0F27-34B1-AEFC-C95B178E5433
28722875install-name: '/usr/lib/system/libsystem_networkextension.dylib'
28732876parent-umbrella:
28742877 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
28752878 arm64e-macos, arm64e-maccatalyst ]
28762879 umbrella: System
28772880exports:
2878 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
2881 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
28792882 arm64-macos, arm64-maccatalyst ]
28802883 symbols: [ _NEHelperCacheAddRedirectedAddress, _NEHelperCacheClearRedirectedAddresses,
28812884 _NEHelperCacheClearUUIDs, _NEHelperCacheCopyAppUUIDMapping,
......@@ -2883,18 +2886,19 @@ exports:
28832886 _NEHelperCacheCopySigningIdentifierMapping, _NEHelperCacheSetDomainDictionaries,
28842887 _NEHelperCacheSetRoutes, _NEHelperCopyAggregatePathRules,
28852888 _NEHelperCopyAppInfo, _NEHelperCopyCurrentNetworkAsync, _NEHelperCopyCurrentNetworkInfo,
2886 _NEHelperCopyPerAppDomains, _NEHelperCopyPreferredBundleID,
2887 _NEHelperCopyResponse, _NEHelperGetIKESocket, _NEHelperGetIKESocketWithResult,
2888 _NEHelperGetKernelControlSocket, _NEHelperGetKernelControlSocketExtended,
2889 _NEHelperGetNECPSessionFD, _NEHelperGetPFKeySocket, _NEHelperHandleConfigurationsChangedBySC,
2889 _NEHelperCopyPerAppDomains, _NEHelperCopyResponse, _NEHelperGetIKESocket,
2890 _NEHelperGetIKESocketWithResult, _NEHelperGetKernelControlSocket,
2891 _NEHelperGetKernelControlSocketExtended, _NEHelperGetNECPSessionFD,
2892 _NEHelperGetPFKeySocket, _NEHelperHandleConfigurationsChangedBySC,
28902893 _NEHelperInit, _NEHelperInterfaceRemoveAddress, _NEHelperInterfaceSetAddress,
2891 _NEHelperInterfaceSetMTU, _NEHelperInterfaceSetOption, _NEHelperSendRequest,
2892 _NEHelperSettingsSetArray, _NEHelperSettingsSetBool, _NEHelperSettingsSetNumber,
2893 _NEHelperVPNConfigurationExists, _NEHelperVPNSetEnabled, _g_ne_read_uuid_cache,
2894 _g_ne_uuid_cache_hit, _ne_copy_cached_bundle_identifier_for_uuid,
2895 _ne_copy_cached_preferred_bundle_for_bundle_identifier, _ne_copy_cached_uuids_for_bundle_identifier,
2896 _ne_copy_signature_info_for_pid, _ne_copy_signing_identifier_for_pid,
2897 _ne_copy_uuid_cache, _ne_force_reset_uuid_cache, _ne_get_configuration_generation,
2894 _NEHelperInterfaceSetAddressWithLifetime, _NEHelperInterfaceSetMTU,
2895 _NEHelperInterfaceSetOption, _NEHelperSendRequest, _NEHelperSettingsSetArray,
2896 _NEHelperSettingsSetBool, _NEHelperSettingsSetNumber, _NEHelperVPNConfigurationExists,
2897 _NEHelperVPNSetEnabled, _g_ne_read_uuid_cache, _g_ne_uuid_cache_hit,
2898 _ne_copy_cached_bundle_identifier_for_uuid, _ne_copy_cached_preferred_bundle_for_bundle_identifier,
2899 _ne_copy_cached_uuids_for_bundle_identifier, _ne_copy_signature_info_for_pid,
2900 _ne_copy_signing_identifier_for_pid, _ne_copy_uuid_cache,
2901 _ne_force_reset_uuid_cache, _ne_get_configuration_generation,
28982902 _ne_is_sockaddr_valid, _ne_log_large_obj, _ne_log_obj, _ne_print_backtrace,
28992903 _ne_privacy_dns_netagent_id, _ne_privacy_proxy_netagent_id,
29002904 _ne_session_add_necp_drop_dest_from_dest_list, _ne_session_add_necp_drop_dest_from_path,
......@@ -2931,10 +2935,11 @@ exports:
29312935 _ne_session_start_with_options, _ne_session_status_to_string,
29322936 _ne_session_stop, _ne_session_stop_all_with_plugin_type, _ne_session_stop_reason_to_string,
29332937 _ne_session_type_to_string, _ne_session_use_as_system_vpn,
2934 _ne_session_vpn_include_all_networks_configs_present, _ne_socket_set_attribution,
2935 _ne_socket_set_domains, _ne_socket_set_is_app_initiated, _ne_socket_set_website_attribution,
2936 _ne_tracker_build_cache, _ne_tracker_build_trie, _ne_tracker_check_info_changed,
2937 _ne_tracker_clear_cache, _ne_tracker_context_get_domain, _ne_tracker_context_get_domain_owner,
2938 _ne_session_vod_evaluate_connection_present, _ne_session_vpn_include_all_networks_configs_present,
2939 _ne_socket_set_attribution, _ne_socket_set_domains, _ne_socket_set_is_app_initiated,
2940 _ne_socket_set_website_attribution, _ne_tracker_build_cache,
2941 _ne_tracker_build_trie, _ne_tracker_check_info_changed, _ne_tracker_clear_cache,
2942 _ne_tracker_context_get_domain, _ne_tracker_context_get_domain_owner,
29382943 _ne_tracker_context_is_from_app_list, _ne_tracker_context_is_from_web_list,
29392944 _ne_tracker_get_ddg_dictionary, _ne_tracker_lookup_app_domains,
29402945 _ne_tracker_set_test_domains, _ne_tracker_validate_domain,
......@@ -2949,17 +2954,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
29492954 arm64e-macos, arm64e-maccatalyst ]
29502955uuids:
29512956 - target: x86_64-macos
2952 value: 6C34EA32-0C1D-35E9-BB3B-32D8185F3C4E
2957 value: 90E8AC4C-D13B-3E0C-82CA-4179D34F4EC6
29532958 - target: x86_64-maccatalyst
2954 value: 6C34EA32-0C1D-35E9-BB3B-32D8185F3C4E
2959 value: 90E8AC4C-D13B-3E0C-82CA-4179D34F4EC6
29552960 - target: arm64-macos
29562961 value: 00000000-0000-0000-0000-000000000000
29572962 - target: arm64-maccatalyst
29582963 value: 00000000-0000-0000-0000-000000000000
29592964 - target: arm64e-macos
2960 value: 3701D756-7023-30C0-9A36-852971092AA9
2965 value: 5FF2DA89-8A88-34BB-AA68-BA9C5D24E639
29612966 - target: arm64e-maccatalyst
2962 value: 3701D756-7023-30C0-9A36-852971092AA9
2967 value: 5FF2DA89-8A88-34BB-AA68-BA9C5D24E639
29632968install-name: '/usr/lib/system/libsystem_notify.dylib'
29642969current-version: 301
29652970parent-umbrella:
......@@ -2967,7 +2972,7 @@ parent-umbrella:
29672972 arm64e-macos, arm64e-maccatalyst ]
29682973 umbrella: System
29692974exports:
2970 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
2975 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
29712976 arm64-macos, arm64-maccatalyst ]
29722977 symbols: [ __notify_fork_child, _notify_cancel, _notify_check, _notify_dump_status,
29732978 _notify_get_event, _notify_get_state, _notify_is_valid_token,
......@@ -2982,19 +2987,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
29822987 arm64e-macos, arm64e-maccatalyst ]
29832988uuids:
29842989 - target: x86_64-macos
2985 value: 4665F1E0-723C-3A58-81D6-220988B34F30
2990 value: A9552F53-A0CD-3E43-9930-80E582ED51FF
29862991 - target: x86_64-maccatalyst
2987 value: 4665F1E0-723C-3A58-81D6-220988B34F30
2992 value: A9552F53-A0CD-3E43-9930-80E582ED51FF
29882993 - target: arm64-macos
2989 value: DB2D2703-9015-37B8-A9CA-59F9672D5BC6
2994 value: A8C155A3-9295-340C-94A2-80B29BBA7A10
29902995 - target: arm64-maccatalyst
2991 value: DB2D2703-9015-37B8-A9CA-59F9672D5BC6
2996 value: A8C155A3-9295-340C-94A2-80B29BBA7A10
29922997 - target: arm64e-macos
2993 value: 8B28F7A3-6681-3D34-92AE-3688A74F50E6
2998 value: 84FA5DD0-806C-310E-B047-479924CD688C
29942999 - target: arm64e-maccatalyst
2995 value: 8B28F7A3-6681-3D34-92AE-3688A74F50E6
3000 value: 84FA5DD0-806C-310E-B047-479924CD688C
29963001install-name: '/usr/lib/system/libsystem_platform.dylib'
2997current-version: 272
3002current-version: 273.100.5
29983003parent-umbrella:
29993004 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
30003005 arm64e-macos, arm64e-maccatalyst ]
......@@ -3074,17 +3079,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
30743079 arm64e-macos, arm64e-maccatalyst ]
30753080uuids:
30763081 - target: x86_64-macos
3077 value: D0578DF0-DD14-3D5D-AD59-248764AC666E
3082 value: CC59553D-E561-3196-9A5C-4DBA8C385275
30783083 - target: x86_64-maccatalyst
3079 value: D0578DF0-DD14-3D5D-AD59-248764AC666E
3084 value: CC59553D-E561-3196-9A5C-4DBA8C385275
30803085 - target: arm64-macos
30813086 value: 00000000-0000-0000-0000-000000000000
30823087 - target: arm64-maccatalyst
30833088 value: 00000000-0000-0000-0000-000000000000
30843089 - target: arm64e-macos
3085 value: 4234FAEC-7D18-30E7-AEAD-E9FB6922AFE9
3090 value: 21E3CB05-5B01-3BAA-8F17-84E8181778C0
30863091 - target: arm64e-maccatalyst
3087 value: 4234FAEC-7D18-30E7-AEAD-E9FB6922AFE9
3092 value: 21E3CB05-5B01-3BAA-8F17-84E8181778C0
30883093install-name: '/usr/lib/system/libsystem_product_info_filter.dylib'
30893094current-version: 10
30903095parent-umbrella:
......@@ -3097,19 +3102,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
30973102 arm64e-macos, arm64e-maccatalyst ]
30983103uuids:
30993104 - target: x86_64-macos
3100 value: 9D8930B0-D6B4-31B4-B7A5-DEBB4C606EF4
3105 value: 2F6C275D-7E14-3D31-A924-E1BB41D2415F
31013106 - target: x86_64-maccatalyst
3102 value: 9D8930B0-D6B4-31B4-B7A5-DEBB4C606EF4
3107 value: 2F6C275D-7E14-3D31-A924-E1BB41D2415F
31033108 - target: arm64-macos
3104 value: 0BFB3F12-FA30-3002-AF01-0B0D19DEC76B
3109 value: 9507407A-B251-3158-BC81-8CABBEBE34DE
31053110 - target: arm64-maccatalyst
3106 value: 0BFB3F12-FA30-3002-AF01-0B0D19DEC76B
3111 value: 9507407A-B251-3158-BC81-8CABBEBE34DE
31073112 - target: arm64e-macos
3108 value: AA39FF66-B3F0-3777-99BC-F4A4C5CBD566
3113 value: CEE8BC77-6923-34D9-89A3-6F8F7279605E
31093114 - target: arm64e-maccatalyst
3110 value: AA39FF66-B3F0-3777-99BC-F4A4C5CBD566
3115 value: CEE8BC77-6923-34D9-89A3-6F8F7279605E
31113116install-name: '/usr/lib/system/libsystem_pthread.dylib'
3112current-version: 485.30.3
3117current-version: 486.100.11
31133118parent-umbrella:
31143119 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
31153120 arm64e-macos, arm64e-maccatalyst ]
......@@ -3117,8 +3122,8 @@ parent-umbrella:
31173122exports:
31183123 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
31193124 arm64e-macos, arm64e-maccatalyst ]
3120 symbols: [ __pthread_is_threaded, _cthread_yield ]
3121 - targets: [ arm64e-macos, x86_64-macos, arm64-macos, x86_64-maccatalyst,
3125 symbols: [ __pthread_is_threaded, _cthread_yield, _pthread_prefer_alternate_amx_self ]
3126 - targets: [ arm64-macos, arm64e-macos, x86_64-macos, x86_64-maccatalyst,
31223127 arm64-maccatalyst, arm64e-maccatalyst ]
31233128 symbols: [ ____chkstk_darwin, ___is_threaded, ___pthread_init, ___pthread_late_init,
31243129 ___pthread_workqueue_setkill, ___unix_conforming, __pthread_atfork_child,
......@@ -3168,21 +3173,21 @@ exports:
31683173 _pthread_getspecific, _pthread_install_workgroup_functions_np,
31693174 _pthread_introspection_getspecific_np, _pthread_introspection_hook_install,
31703175 _pthread_introspection_setspecific_np, _pthread_is_threaded_np,
3171 _pthread_jit_write_protect_np, _pthread_jit_write_protect_supported_np,
3172 _pthread_jit_write_with_callback_np, _pthread_join, '_pthread_join$NOCANCEL',
3173 _pthread_key_create, _pthread_key_delete, _pthread_key_init_np,
3174 _pthread_kill, _pthread_layout_offsets, _pthread_mach_thread_np,
3175 _pthread_main_np, _pthread_main_thread_np, _pthread_mutex_destroy,
3176 _pthread_mutex_getprioceiling, _pthread_mutex_init, _pthread_mutex_lock,
3177 _pthread_mutex_setprioceiling, _pthread_mutex_trylock, _pthread_mutex_unlock,
3178 _pthread_mutexattr_destroy, _pthread_mutexattr_getpolicy_np,
3179 _pthread_mutexattr_getprioceiling, _pthread_mutexattr_getprotocol,
3180 _pthread_mutexattr_getpshared, _pthread_mutexattr_gettype,
3181 _pthread_mutexattr_init, _pthread_mutexattr_setpolicy_np,
3176 _pthread_jit_write_freeze_callbacks_np, _pthread_jit_write_protect_np,
3177 _pthread_jit_write_protect_supported_np, _pthread_jit_write_with_callback_np,
3178 _pthread_join, '_pthread_join$NOCANCEL', _pthread_key_create,
3179 _pthread_key_delete, _pthread_key_init_np, _pthread_kill,
3180 _pthread_layout_offsets, _pthread_mach_thread_np, _pthread_main_np,
3181 _pthread_main_thread_np, _pthread_mutex_destroy, _pthread_mutex_getprioceiling,
3182 _pthread_mutex_init, _pthread_mutex_lock, _pthread_mutex_setprioceiling,
3183 _pthread_mutex_trylock, _pthread_mutex_unlock, _pthread_mutexattr_destroy,
3184 _pthread_mutexattr_getpolicy_np, _pthread_mutexattr_getprioceiling,
3185 _pthread_mutexattr_getprotocol, _pthread_mutexattr_getpshared,
3186 _pthread_mutexattr_gettype, _pthread_mutexattr_init, _pthread_mutexattr_setpolicy_np,
31823187 _pthread_mutexattr_setprioceiling, _pthread_mutexattr_setprotocol,
31833188 _pthread_mutexattr_setpshared, _pthread_mutexattr_settype,
31843189 _pthread_once, _pthread_override_qos_class_end_np, _pthread_override_qos_class_start_np,
3185 _pthread_prefer_alternate_amx_self, _pthread_qos_max_parallelism,
3190 _pthread_prefer_alternate_cluster_self, _pthread_qos_max_parallelism,
31863191 _pthread_rwlock_destroy, _pthread_rwlock_init, _pthread_rwlock_rdlock,
31873192 _pthread_rwlock_tryrdlock, _pthread_rwlock_trywrlock, _pthread_rwlock_unlock,
31883193 _pthread_rwlock_wrlock, _pthread_rwlockattr_destroy, _pthread_rwlockattr_getpshared,
......@@ -3204,25 +3209,25 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
32043209 arm64e-macos, arm64e-maccatalyst ]
32053210uuids:
32063211 - target: x86_64-macos
3207 value: 878A6693-2E70-3697-A941-8745C00A47D7
3212 value: F7BD34BF-4F11-3C48-BD8B-BFC81C09CF2A
32083213 - target: x86_64-maccatalyst
3209 value: 878A6693-2E70-3697-A941-8745C00A47D7
3214 value: F7BD34BF-4F11-3C48-BD8B-BFC81C09CF2A
32103215 - target: arm64-macos
32113216 value: 00000000-0000-0000-0000-000000000000
32123217 - target: arm64-maccatalyst
32133218 value: 00000000-0000-0000-0000-000000000000
32143219 - target: arm64e-macos
3215 value: 1214F568-24BF-379F-8A86-FF947EE5F18A
3220 value: 9180A377-715B-3790-81DB-AB51A9F0C3C0
32163221 - target: arm64e-maccatalyst
3217 value: 1214F568-24BF-379F-8A86-FF947EE5F18A
3222 value: 9180A377-715B-3790-81DB-AB51A9F0C3C0
32183223install-name: '/usr/lib/system/libsystem_sandbox.dylib'
3219current-version: 1656.30.23
3224current-version: 1657.101.2
32203225parent-umbrella:
32213226 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
32223227 arm64e-macos, arm64e-maccatalyst ]
32233228 umbrella: System
32243229exports:
3225 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
3230 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
32263231 arm64-macos, arm64-maccatalyst ]
32273232 symbols: [ _APP_SANDBOX_IOKIT_CLIENT, _APP_SANDBOX_MACH, _APP_SANDBOX_READ,
32283233 _APP_SANDBOX_READ_WRITE, _IOS_SANDBOX_APPLICATION_GROUP, _IOS_SANDBOX_CONTAINER,
......@@ -3251,12 +3256,12 @@ exports:
32513256 _sandbox_check_message_filter_string, _sandbox_consume_extension,
32523257 _sandbox_consume_fs_extension, _sandbox_consume_mach_extension,
32533258 _sandbox_container_path_for_audit_token, _sandbox_container_path_for_pid,
3254 _sandbox_enable_root_translation, _sandbox_extension_consume,
3255 _sandbox_extension_issue_file, _sandbox_extension_issue_file_to_process,
3256 _sandbox_extension_issue_file_to_process_by_pid, _sandbox_extension_issue_file_to_self,
3257 _sandbox_extension_issue_generic, _sandbox_extension_issue_generic_to_process,
3258 _sandbox_extension_issue_generic_to_process_by_pid, _sandbox_extension_issue_iokit_registry_entry_class,
3259 _sandbox_extension_issue_iokit_registry_entry_class_to_process,
3259 _sandbox_enable_root_translation, _sandbox_enable_state_flag,
3260 _sandbox_extension_consume, _sandbox_extension_issue_file,
3261 _sandbox_extension_issue_file_to_process, _sandbox_extension_issue_file_to_process_by_pid,
3262 _sandbox_extension_issue_file_to_self, _sandbox_extension_issue_generic,
3263 _sandbox_extension_issue_generic_to_process, _sandbox_extension_issue_generic_to_process_by_pid,
3264 _sandbox_extension_issue_iokit_registry_entry_class, _sandbox_extension_issue_iokit_registry_entry_class_to_process,
32603265 _sandbox_extension_issue_iokit_registry_entry_class_to_process_by_pid,
32613266 _sandbox_extension_issue_iokit_user_client_class, _sandbox_extension_issue_mach,
32623267 _sandbox_extension_issue_mach_to_process, _sandbox_extension_issue_mach_to_process_by_pid,
......@@ -3266,41 +3271,43 @@ exports:
32663271 _sandbox_init_from_pid, _sandbox_init_with_extensions, _sandbox_init_with_parameters,
32673272 _sandbox_issue_extension, _sandbox_issue_fs_extension, _sandbox_issue_fs_rw_extension,
32683273 _sandbox_issue_mach_extension, _sandbox_message_filter_query,
3269 _sandbox_message_filter_release, _sandbox_note, _sandbox_passthrough_access,
3270 _sandbox_proc_getcontainer, _sandbox_proc_getprofilename,
3271 _sandbox_query_approval_policy_for_path, _sandbox_query_user_intent_for_process_with_audit_token,
3272 _sandbox_reference_release, _sandbox_reference_retain_by_audit_token,
3274 _sandbox_message_filter_release, _sandbox_message_filter_retain,
3275 _sandbox_note, _sandbox_passthrough_access, _sandbox_proc_getcontainer,
3276 _sandbox_proc_getprofilename, _sandbox_query_approval_policy_for_path,
3277 _sandbox_query_user_intent_for_process_with_audit_token, _sandbox_reference_release,
3278 _sandbox_reference_retain_by_audit_token, _sandbox_register_app_bundle,
32733279 _sandbox_release_fs_extension, _sandbox_requests_integrity_protection_for_preference_domain,
32743280 _sandbox_set_container_path_for_application_group, _sandbox_set_container_path_for_application_group_with_persona,
32753281 _sandbox_set_container_path_for_signing_id, _sandbox_set_container_path_for_signing_id_with_persona,
32763282 _sandbox_spawnattrs_getcontainer, _sandbox_spawnattrs_getprofilename,
32773283 _sandbox_spawnattrs_init, _sandbox_spawnattrs_setcontainer,
3278 _sandbox_spawnattrs_setprofilename, _sandbox_suspend, _sandbox_unsuspend ]
3284 _sandbox_spawnattrs_setprofilename, _sandbox_suspend, _sandbox_unregister_app_bundle,
3285 _sandbox_unsuspend ]
32793286--- !tapi-tbd
32803287tbd-version: 4
32813288targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
32823289 arm64e-macos, arm64e-maccatalyst ]
32833290uuids:
32843291 - target: x86_64-macos
3285 value: 2A532806-2750-369B-90AB-CD9BDB0ABFB2
3292 value: 6B34D783-AAA5-3401-8CAD-B0BC5F639834
32863293 - target: x86_64-maccatalyst
3287 value: 2A532806-2750-369B-90AB-CD9BDB0ABFB2
3294 value: 6B34D783-AAA5-3401-8CAD-B0BC5F639834
32883295 - target: arm64-macos
32893296 value: 00000000-0000-0000-0000-000000000000
32903297 - target: arm64-maccatalyst
32913298 value: 00000000-0000-0000-0000-000000000000
32923299 - target: arm64e-macos
3293 value: 49553CC1-66C3-32B1-91C6-4415DE230F58
3300 value: A61664A2-D010-3674-95D9-1D06571F9F5A
32943301 - target: arm64e-maccatalyst
3295 value: 49553CC1-66C3-32B1-91C6-4415DE230F58
3302 value: A61664A2-D010-3674-95D9-1D06571F9F5A
32963303install-name: '/usr/lib/system/libsystem_secinit.dylib'
3297current-version: 106.30.2
3304current-version: 107.100.5
32983305parent-umbrella:
32993306 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
33003307 arm64e-macos, arm64e-maccatalyst ]
33013308 umbrella: System
33023309exports:
3303 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
3310 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
33043311 arm64-macos, arm64-maccatalyst ]
33053312 symbols: [ __libsecinit_initializer, _libsecinit_delete_all_data_container_content_for_current_user,
33063313 _libsecinit_fileoperation_save, _libsecinit_fileoperation_set_attributes,
......@@ -3311,24 +3318,24 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
33113318 arm64e-macos, arm64e-maccatalyst ]
33123319uuids:
33133320 - target: x86_64-macos
3314 value: B08955D2-F6C0-3630-AF94-BE2A61E78516
3321 value: 8C17C62F-C82C-3A4C-A832-70EBEED5B0CA
33153322 - target: x86_64-maccatalyst
3316 value: B08955D2-F6C0-3630-AF94-BE2A61E78516
3323 value: 8C17C62F-C82C-3A4C-A832-70EBEED5B0CA
33173324 - target: arm64-macos
33183325 value: 00000000-0000-0000-0000-000000000000
33193326 - target: arm64-maccatalyst
33203327 value: 00000000-0000-0000-0000-000000000000
33213328 - target: arm64e-macos
3322 value: 73885FA5-76B6-3AA3-8D91-60B2E0078F99
3329 value: 753D2289-1662-3922-8A94-FAC9DED81CD5
33233330 - target: arm64e-maccatalyst
3324 value: 73885FA5-76B6-3AA3-8D91-60B2E0078F99
3331 value: 753D2289-1662-3922-8A94-FAC9DED81CD5
33253332install-name: '/usr/lib/system/libsystem_symptoms.dylib'
33263333parent-umbrella:
33273334 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
33283335 arm64e-macos, arm64e-maccatalyst ]
33293336 umbrella: System
33303337exports:
3331 - targets: [ x86_64-macos, arm64e-macos, x86_64-maccatalyst, arm64e-maccatalyst,
3338 - targets: [ arm64e-macos, x86_64-macos, x86_64-maccatalyst, arm64e-maccatalyst,
33323339 arm64-macos, arm64-maccatalyst ]
33333340 symbols: [ __symptoms_daemon_fallback_initial_disposition, __symptoms_daemon_fallback_subseq_disposition,
33343341 __symptoms_is_daemon_fallback_blacklisted, _symptom_framework_init,
......@@ -3341,19 +3348,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
33413348 arm64e-macos, arm64e-maccatalyst ]
33423349uuids:
33433350 - target: x86_64-macos
3344 value: 19A279BD-191D-3114-808B-09A74E978A6B
3351 value: 5437B3FC-51DA-3F66-8C5C-31F7D5704C73
33453352 - target: x86_64-maccatalyst
3346 value: 19A279BD-191D-3114-808B-09A74E978A6B
3353 value: 5437B3FC-51DA-3F66-8C5C-31F7D5704C73
33473354 - target: arm64-macos
33483355 value: 00000000-0000-0000-0000-000000000000
33493356 - target: arm64-maccatalyst
33503357 value: 00000000-0000-0000-0000-000000000000
33513358 - target: arm64e-macos
3352 value: 362E885B-20EA-395B-BB01-6E46B864294D
3359 value: AAD0C6C8-F622-3FAC-AF4F-A2A021F9AE17
33533360 - target: arm64e-maccatalyst
3354 value: 362E885B-20EA-395B-BB01-6E46B864294D
3361 value: AAD0C6C8-F622-3FAC-AF4F-A2A021F9AE17
33553362install-name: '/usr/lib/system/libsystem_trace.dylib'
3356current-version: 1372.30.3
3363current-version: 1375.100.9
33573364parent-umbrella:
33583365 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
33593366 arm64e-macos, arm64e-maccatalyst ]
......@@ -3417,19 +3424,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
34173424 arm64e-macos, arm64e-maccatalyst ]
34183425uuids:
34193426 - target: x86_64-macos
3420 value: 3723C625-FBC2-31A2-A4CB-081FD4B807A4
3427 value: BAF19DAC-B9ED-3544-97E9-E277BA113717
34213428 - target: x86_64-maccatalyst
3422 value: 3723C625-FBC2-31A2-A4CB-081FD4B807A4
3429 value: BAF19DAC-B9ED-3544-97E9-E277BA113717
34233430 - target: arm64-macos
34243431 value: 00000000-0000-0000-0000-000000000000
34253432 - target: arm64-maccatalyst
34263433 value: 00000000-0000-0000-0000-000000000000
34273434 - target: arm64e-macos
3428 value: D0A538E3-7A75-395A-993C-A3EA7947F55A
3435 value: 687985E7-0BD0-3898-9FCA-F8BCAAE282AE
34293436 - target: arm64e-maccatalyst
3430 value: D0A538E3-7A75-395A-993C-A3EA7947F55A
3437 value: 687985E7-0BD0-3898-9FCA-F8BCAAE282AE
34313438install-name: '/usr/lib/system/libunwind.dylib'
3432current-version: 201
3439current-version: 202.2
34333440parent-umbrella:
34343441 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
34353442 arm64e-macos, arm64e-maccatalyst ]
......@@ -3490,19 +3497,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
34903497 arm64e-macos, arm64e-maccatalyst ]
34913498uuids:
34923499 - target: x86_64-macos
3493 value: A9A403F2-4D7D-3760-B4A7-4A9721A2A9B9
3500 value: FBB81F7D-564A-3971-A28E-6AA174470B4C
34943501 - target: x86_64-maccatalyst
3495 value: A9A403F2-4D7D-3760-B4A7-4A9721A2A9B9
3502 value: FBB81F7D-564A-3971-A28E-6AA174470B4C
34963503 - target: arm64-macos
34973504 value: 00000000-0000-0000-0000-000000000000
34983505 - target: arm64-maccatalyst
34993506 value: 00000000-0000-0000-0000-000000000000
35003507 - target: arm64e-macos
3501 value: A77B4CE2-0855-3C19-B4A6-47B094CF0DDA
3508 value: 4C6EB90B-BD32-3CAD-9F25-C9F234775EFB
35023509 - target: arm64e-maccatalyst
3503 value: A77B4CE2-0855-3C19-B4A6-47B094CF0DDA
3510 value: 4C6EB90B-BD32-3CAD-9F25-C9F234775EFB
35043511install-name: '/usr/lib/system/libxpc.dylib'
3505current-version: 2235.30.5
3512current-version: 2236.100.61
35063513parent-umbrella:
35073514 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
35083515 arm64e-macos, arm64e-maccatalyst ]
......@@ -3510,10 +3517,12 @@ parent-umbrella:
35103517exports:
35113518 - targets: [ x86_64-maccatalyst, x86_64-macos, arm64e-maccatalyst, arm64e-macos,
35123519 arm64-macos, arm64-maccatalyst ]
3513 symbols: [ _XPC_ACTIVITY_ALLOW_BATTERY, _XPC_ACTIVITY_APP_REFRESH, _XPC_ACTIVITY_CHECK_IN,
3514 _XPC_ACTIVITY_COMMUNICATES_WITH_PAIRED_DEVICE, _XPC_ACTIVITY_CPU_INTENSIVE,
3515 _XPC_ACTIVITY_DELAY, _XPC_ACTIVITY_DESIRED_MOTION_STATE, _XPC_ACTIVITY_DISK_INTENSIVE,
3516 _XPC_ACTIVITY_DO_IT_LATER, _XPC_ACTIVITY_DUET_ACTIVITY_SCHEDULER_DATA,
3520 symbols: [ _CEAcquireManagedContext, _CEAcquireUnmanagedContext, _CEBuffer_cmp,
3521 _CEConjureContextFromDER, _CEContextQuery, _CEGetErrorString,
3522 _CEPrepareQuery, _CEReleaseManagedContext, _CEValidate, _XPC_ACTIVITY_ALLOW_BATTERY,
3523 _XPC_ACTIVITY_APP_REFRESH, _XPC_ACTIVITY_CHECK_IN, _XPC_ACTIVITY_COMMUNICATES_WITH_PAIRED_DEVICE,
3524 _XPC_ACTIVITY_CPU_INTENSIVE, _XPC_ACTIVITY_DELAY, _XPC_ACTIVITY_DESIRED_MOTION_STATE,
3525 _XPC_ACTIVITY_DISK_INTENSIVE, _XPC_ACTIVITY_DO_IT_LATER, _XPC_ACTIVITY_DUET_ACTIVITY_SCHEDULER_DATA,
35173526 _XPC_ACTIVITY_DUET_ATTRIBUTE_COST, _XPC_ACTIVITY_DUET_ATTRIBUTE_NAME,
35183527 _XPC_ACTIVITY_DUET_ATTRIBUTE_VALUE, _XPC_ACTIVITY_DUET_RELATED_APPLICATIONS,
35193528 _XPC_ACTIVITY_EXCLUSIVE, _XPC_ACTIVITY_EXPECTED_DURATION,
......@@ -3595,8 +3604,53 @@ exports:
35953604 _bootstrap_look_up3, _bootstrap_look_up_per_user, _bootstrap_lookup_children,
35963605 _bootstrap_parent, _bootstrap_register, _bootstrap_register2,
35973606 _bootstrap_status, _bootstrap_strerror, _bootstrap_subset,
3598 _bootstrap_unprivileged, _create_and_switch_to_per_session_launchd,
3599 _launch_activate_socket, _launch_active_user_switch, _launch_add_external_service,
3607 _bootstrap_unprivileged, _cc_clear, _ccder_blob_decode_bitstring,
3608 _ccder_blob_decode_eckey, _ccder_blob_decode_len, _ccder_blob_decode_len_strict,
3609 _ccder_blob_decode_oid, _ccder_blob_decode_range, _ccder_blob_decode_range_strict,
3610 _ccder_blob_decode_seqii, _ccder_blob_decode_seqii_strict,
3611 _ccder_blob_decode_sequence_tl, _ccder_blob_decode_sequence_tl_strict,
3612 _ccder_blob_decode_tag, _ccder_blob_decode_tl, _ccder_blob_decode_tl_internal,
3613 _ccder_blob_decode_tl_strict, _ccder_blob_decode_uint, _ccder_blob_decode_uint64,
3614 _ccder_blob_decode_uint_n, _ccder_blob_decode_uint_strict,
3615 _ccder_blob_encode_body, _ccder_blob_encode_body_tl, _ccder_blob_encode_eckey,
3616 _ccder_blob_encode_implicit_integer, _ccder_blob_encode_implicit_octet_string,
3617 _ccder_blob_encode_implicit_raw_octet_string, _ccder_blob_encode_implicit_uint64,
3618 _ccder_blob_encode_integer, _ccder_blob_encode_len, _ccder_blob_encode_octet_string,
3619 _ccder_blob_encode_oid, _ccder_blob_encode_raw_octet_string,
3620 _ccder_blob_encode_tag, _ccder_blob_encode_tl, _ccder_blob_encode_uint64,
3621 _ccder_blob_reserve, _ccder_blob_reserve_tl, _ccder_decode_bitstring,
3622 _ccder_decode_constructed_tl, _ccder_decode_constructed_tl_strict,
3623 _ccder_decode_eckey, _ccder_decode_len, _ccder_decode_len_strict,
3624 _ccder_decode_oid, _ccder_decode_seqii, _ccder_decode_seqii_strict,
3625 _ccder_decode_sequence_tl, _ccder_decode_sequence_tl_strict,
3626 _ccder_decode_tag, _ccder_decode_tl, _ccder_decode_tl_strict,
3627 _ccder_decode_uint, _ccder_decode_uint64, _ccder_decode_uint_n,
3628 _ccder_decode_uint_strict, _ccder_encode_body, _ccder_encode_body_nocopy,
3629 _ccder_encode_constructed_tl, _ccder_encode_eckey, _ccder_encode_eckey_size,
3630 _ccder_encode_implicit_integer, _ccder_encode_implicit_octet_string,
3631 _ccder_encode_implicit_raw_octet_string, _ccder_encode_implicit_uint64,
3632 _ccder_encode_integer, _ccder_encode_len, _ccder_encode_octet_string,
3633 _ccder_encode_oid, _ccder_encode_raw_octet_string, _ccder_encode_tag,
3634 _ccder_encode_tl, _ccder_encode_uint64, _ccder_sizeof, _ccder_sizeof_eckey,
3635 _ccder_sizeof_implicit_integer, _ccder_sizeof_implicit_uint64,
3636 _ccder_sizeof_len, _ccder_sizeof_oid, _ccder_sizeof_tag, _ccder_sizeof_uint64,
3637 _ccn_bitlen, _ccn_read_uint, _ccn_write_int, _ccn_write_int_size,
3638 _ccn_write_uint, _ccn_write_uint_padded_ct, _ccn_write_uint_size,
3639 _create_and_switch_to_per_session_launchd, _der_decode_boolean,
3640 _der_decode_key_value, _der_decode_number, _der_decode_string,
3641 _der_encode_number_body, _der_size_array, _der_size_dictionary,
3642 _der_size_element, _der_size_number, _der_vm_CEType_from_context,
3643 _der_vm_bool_from_context, _der_vm_buffer_from_context, _der_vm_context_create,
3644 _der_vm_context_is_valid, _der_vm_execute, _der_vm_execute_match_bool,
3645 _der_vm_execute_match_integer, _der_vm_execute_match_string,
3646 _der_vm_execute_match_string_prefix, _der_vm_execute_nocopy,
3647 _der_vm_execute_select_index, _der_vm_execute_select_key,
3648 _der_vm_execute_select_longest_matching_key, _der_vm_execute_string_prefix_value_allowed,
3649 _der_vm_execute_string_value_allowed, _der_vm_integer_from_context,
3650 _der_vm_iterate, _der_vm_string_from_context, _kCEAPIMisuse,
3651 _kCEAllocationFailed, _kCEInvalidArgument, _kCEMalformedEntitlements,
3652 _kCENoError, _kCEQueryCannotBeSatisfied, _launch_activate_socket,
3653 _launch_active_user_switch, _launch_add_external_service,
36003654 _launch_bootout_user_service_4coresim, _launch_copy_busy_extension_instances,
36013655 _launch_copy_endpoints_properties_for_pid, _launch_copy_extension_properties,
36023656 _launch_copy_extension_properties_for_pid, _launch_copy_properties_for_pid_4assertiond,
......@@ -3635,10 +3689,10 @@ exports:
36353689 _os_transaction_copy_description, _os_transaction_create,
36363690 _os_transaction_get_description, _os_transaction_get_timestamp,
36373691 _os_transaction_needs_more_time, _place_hold_on_real_loginwindow,
3638 _reboot2, _reboot3, _vproc_release, _vproc_retain, _vproc_standby_begin,
3639 _vproc_standby_end, _vproc_swap_complex, _vproc_swap_integer,
3640 _vproc_swap_string, _vproc_transaction_begin, _vproc_transaction_end,
3641 _vprocmgr_lookup_vproc, _xpc_activity_add_eligibility_changed_handler,
3692 _reboot2, _reboot3, _recursivelyValidateEntitlements, _vproc_release,
3693 _vproc_retain, _vproc_standby_begin, _vproc_standby_end, _vproc_swap_complex,
3694 _vproc_swap_integer, _vproc_swap_string, _vproc_transaction_begin,
3695 _vproc_transaction_end, _vprocmgr_lookup_vproc, _xpc_activity_add_eligibility_changed_handler,
36423696 _xpc_activity_copy_criteria, _xpc_activity_copy_dispatch_queue,
36433697 _xpc_activity_copy_identifier, _xpc_activity_debug, _xpc_activity_defer_until_network_change,
36443698 _xpc_activity_defer_until_percentage, _xpc_activity_get_percentage,
......@@ -3698,6 +3752,7 @@ exports:
36983752 _xpc_copy_entitlement_for_token, _xpc_copy_entitlements_data_for_token,
36993753 _xpc_copy_entitlements_for_pid, _xpc_copy_entitlements_for_self,
37003754 _xpc_copy_event, _xpc_copy_event_entitlements, _xpc_copy_short_description,
3755 _xpc_create_from_ce_der, _xpc_create_from_ce_der_with_key,
37013756 _xpc_create_from_plist, _xpc_create_from_plist_descriptor,
37023757 _xpc_create_from_serialization, _xpc_create_from_serialization_with_ool,
37033758 _xpc_create_reply_with_format, _xpc_create_reply_with_format_and_arguments,
......@@ -3778,4 +3833,6 @@ exports:
37783833 _xpc_type_get_name, _xpc_uint64_create, _xpc_uint64_get_value,
37793834 _xpc_uuid_create, _xpc_uuid_get_bytes ]
37803835 objc-classes: [ OS_xpc_object ]
3836 - targets: [ arm64e-maccatalyst, arm64e-macos, arm64-macos, arm64-maccatalyst ]
3837 symbols: [ _cc_abort, _cc_disable_dit, _cc_try_abort, _cc_try_abort_if ]
37813838...
lib/libc/darwin/libSystem.13.tbd+209-207
......@@ -4,17 +4,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
44 arm64e-macos, arm64e-maccatalyst ]
55uuids:
66 - target: x86_64-macos
7 value: 1C88C6B7-F992-3275-9EF4-4D2CB1CEFAC3
7 value: 085E3D5D-7871-3E9E-A097-AAD940171411
88 - target: x86_64-maccatalyst
9 value: 1C88C6B7-F992-3275-9EF4-4D2CB1CEFAC3
9 value: 085E3D5D-7871-3E9E-A097-AAD940171411
1010 - target: arm64-macos
1111 value: 00000000-0000-0000-0000-000000000000
1212 - target: arm64-maccatalyst
1313 value: 00000000-0000-0000-0000-000000000000
1414 - target: arm64e-macos
15 value: 4396C12B-BA04-34F0-B859-7FC1914064A3
15 value: B54723A8-A25C-3D6C-A51B-2B8BBA733DD3
1616 - target: arm64e-maccatalyst
17 value: 4396C12B-BA04-34F0-B859-7FC1914064A3
17 value: B54723A8-A25C-3D6C-A51B-2B8BBA733DD3
1818install-name: '/usr/lib/libSystem.B.dylib'
1919current-version: 1319
2020reexported-libraries:
......@@ -59,17 +59,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
5959 arm64e-macos, arm64e-maccatalyst ]
6060uuids:
6161 - target: x86_64-macos
62 value: 0D42BFC6-F62E-342B-BDB1-E75B48AF5081
62 value: A7D96CB6-7562-3C14-8B54-ED5E484B54E2
6363 - target: x86_64-maccatalyst
64 value: 0D42BFC6-F62E-342B-BDB1-E75B48AF5081
64 value: A7D96CB6-7562-3C14-8B54-ED5E484B54E2
6565 - target: arm64-macos
6666 value: 00000000-0000-0000-0000-000000000000
6767 - target: arm64-maccatalyst
6868 value: 00000000-0000-0000-0000-000000000000
6969 - target: arm64e-macos
70 value: 9953AE27-E8CB-32B2-98AF-9E871BCDD5D3
70 value: 7A88909B-ED36-360D-ACE9-81107AF0FE14
7171 - target: arm64e-maccatalyst
72 value: 9953AE27-E8CB-32B2-98AF-9E871BCDD5D3
72 value: 7A88909B-ED36-360D-ACE9-81107AF0FE14
7373install-name: '/usr/lib/system/libcache.dylib'
7474current-version: 90
7575parent-umbrella:
......@@ -97,19 +97,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
9797 arm64e-macos, arm64e-maccatalyst ]
9898uuids:
9999 - target: x86_64-macos
100 value: DD06A475-50C9-3264-BAD5-479DA5E8B327
100 value: 6E120635-E858-30FE-95F6-64D90E33095D
101101 - target: x86_64-maccatalyst
102 value: DD06A475-50C9-3264-BAD5-479DA5E8B327
102 value: 6E120635-E858-30FE-95F6-64D90E33095D
103103 - target: arm64-macos
104104 value: 00000000-0000-0000-0000-000000000000
105105 - target: arm64-maccatalyst
106106 value: 00000000-0000-0000-0000-000000000000
107107 - target: arm64e-macos
108 value: 7510671C-686A-339D-8F50-B95BFA5D8F10
108 value: 452A7C15-97FA-32A0-B514-744E117E2B39
109109 - target: arm64e-maccatalyst
110 value: 7510671C-686A-339D-8F50-B95BFA5D8F10
110 value: 452A7C15-97FA-32A0-B514-744E117E2B39
111111install-name: '/usr/lib/system/libcommonCrypto.dylib'
112current-version: 60198.40.3
112current-version: 60198.60.2
113113parent-umbrella:
114114 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
115115 arm64e-macos, arm64e-maccatalyst ]
......@@ -191,11 +191,11 @@ tbd-version: 4
191191targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
192192uuids:
193193 - target: x86_64-macos
194 value: 9053D30C-239D-30B4-B36D-4E3490F72FE4
194 value: E9412018-811C-36B7-9F58-6471398EE465
195195 - target: arm64-macos
196 value: A7F13C10-9CEA-3A4E-86AB-F65E292E7804
196 value: 954CFCC0-97A8-329B-B5AA-FF9046F3E94F
197197 - target: arm64e-macos
198 value: 824DFF0F-A337-32EB-B5DF-3FDD0BBFF9ED
198 value: 9F57BC0A-3F18-3F00-B772-40B6A8616E26
199199install-name: '/usr/lib/system/libcompiler_rt.dylib'
200200current-version: 103.1
201201parent-umbrella:
......@@ -426,17 +426,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
426426 arm64e-macos, arm64e-maccatalyst ]
427427uuids:
428428 - target: x86_64-macos
429 value: 0CD59665-DEA3-3995-84BC-485D4EA42680
429 value: F92F30BA-35BE-3ED9-B562-FBEC1B7089B5
430430 - target: x86_64-maccatalyst
431 value: 0CD59665-DEA3-3995-84BC-485D4EA42680
431 value: F92F30BA-35BE-3ED9-B562-FBEC1B7089B5
432432 - target: arm64-macos
433433 value: 00000000-0000-0000-0000-000000000000
434434 - target: arm64-maccatalyst
435435 value: 00000000-0000-0000-0000-000000000000
436436 - target: arm64e-macos
437 value: 79AD0FC1-4F88-3589-A602-45F2AA482B59
437 value: 3689048E-9EC2-32D9-B833-B5EDE2839092
438438 - target: arm64e-maccatalyst
439 value: 79AD0FC1-4F88-3589-A602-45F2AA482B59
439 value: 3689048E-9EC2-32D9-B833-B5EDE2839092
440440install-name: '/usr/lib/system/libcopyfile.dylib'
441441parent-umbrella:
442442 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
......@@ -454,19 +454,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
454454 arm64e-macos, arm64e-maccatalyst ]
455455uuids:
456456 - target: x86_64-macos
457 value: D198406D-6F0D-3857-9CB3-9BA231DFEE00
457 value: 1A8A8D34-268F-3D42-936A-8A0029817E22
458458 - target: x86_64-maccatalyst
459 value: D198406D-6F0D-3857-9CB3-9BA231DFEE00
459 value: 1A8A8D34-268F-3D42-936A-8A0029817E22
460460 - target: arm64-macos
461461 value: 00000000-0000-0000-0000-000000000000
462462 - target: arm64-maccatalyst
463463 value: 00000000-0000-0000-0000-000000000000
464464 - target: arm64e-macos
465 value: 6A5FFEB0-E606-324E-B687-DA95C362CE05
465 value: E32C0A9B-EDD0-376D-A504-A06C215E89FE
466466 - target: arm64e-maccatalyst
467 value: 6A5FFEB0-E606-324E-B687-DA95C362CE05
467 value: E32C0A9B-EDD0-376D-A504-A06C215E89FE
468468install-name: '/usr/lib/system/libcorecrypto.dylib'
469current-version: 1386.40.5
469current-version: 1386.60.8
470470parent-umbrella:
471471 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
472472 arm64e-macos, arm64e-maccatalyst ]
......@@ -565,8 +565,9 @@ exports:
565565 _ccder_encode_tag, _ccder_encode_tl, _ccder_encode_uint64,
566566 _ccder_sizeof, _ccder_sizeof_eckey, _ccder_sizeof_implicit_integer,
567567 _ccder_sizeof_implicit_octet_string, _ccder_sizeof_implicit_raw_octet_string,
568 _ccder_sizeof_implicit_uint64, _ccder_sizeof_integer, _ccder_sizeof_len,
569 _ccder_sizeof_octet_string, _ccder_sizeof_oid, _ccder_sizeof_raw_octet_string,
568 _ccder_sizeof_implicit_raw_octet_string_overflow, _ccder_sizeof_implicit_uint64,
569 _ccder_sizeof_integer, _ccder_sizeof_len, _ccder_sizeof_octet_string,
570 _ccder_sizeof_oid, _ccder_sizeof_overflow, _ccder_sizeof_raw_octet_string,
570571 _ccder_sizeof_tag, _ccder_sizeof_uint64, _ccdes3_cbc_decrypt_mode,
571572 _ccdes3_cbc_encrypt_mode, _ccdes3_cfb8_decrypt_mode, _ccdes3_cfb8_encrypt_mode,
572573 _ccdes3_cfb_decrypt_mode, _ccdes3_cfb_encrypt_mode, _ccdes3_ctr_crypt_mode,
......@@ -767,17 +768,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
767768 arm64e-macos, arm64e-maccatalyst ]
768769uuids:
769770 - target: x86_64-macos
770 value: 817339A1-D03E-3E54-9C47-ACACF69F6193
771 value: 6282E528-6A67-334B-ACCF-1F8FD89369BD
771772 - target: x86_64-maccatalyst
772 value: 817339A1-D03E-3E54-9C47-ACACF69F6193
773 value: 6282E528-6A67-334B-ACCF-1F8FD89369BD
773774 - target: arm64-macos
774775 value: 00000000-0000-0000-0000-000000000000
775776 - target: arm64-maccatalyst
776777 value: 00000000-0000-0000-0000-000000000000
777778 - target: arm64e-macos
778 value: 40C9C98C-00D6-3E8E-9AD3-2ED6CF0D0CFE
779 value: 191028D2-0477-3EBC-9EEF-A85ACAFC7193
779780 - target: arm64e-maccatalyst
780 value: 40C9C98C-00D6-3E8E-9AD3-2ED6CF0D0CFE
781 value: 191028D2-0477-3EBC-9EEF-A85ACAFC7193
781782install-name: '/usr/lib/system/libdispatch.dylib'
782783current-version: 1412
783784parent-umbrella:
......@@ -943,17 +944,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
943944 arm64e-macos, arm64e-maccatalyst ]
944945uuids:
945946 - target: x86_64-macos
946 value: 6C8B449A-78F4-3127-BC23-910719DE96AB
947 value: 6F97B8FD-BA81-3779-ADB2-5ECD91F42B75
947948 - target: x86_64-maccatalyst
948 value: 6C8B449A-78F4-3127-BC23-910719DE96AB
949 value: 6F97B8FD-BA81-3779-ADB2-5ECD91F42B75
949950 - target: arm64-macos
950 value: C52D0F3B-0BAE-376B-A851-943F95388DD7
951 value: 427D321B-B30E-367F-8E2C-1DA6FD2D0962
951952 - target: arm64-maccatalyst
952 value: C52D0F3B-0BAE-376B-A851-943F95388DD7
953 value: 427D321B-B30E-367F-8E2C-1DA6FD2D0962
953954 - target: arm64e-macos
954 value: 668F3379-151D-3ED4-859C-8F56E7941CDE
955 value: C1700833-CCA0-3BA5-8614-C149347F5503
955956 - target: arm64e-maccatalyst
956 value: 668F3379-151D-3ED4-859C-8F56E7941CDE
957 value: C1700833-CCA0-3BA5-8614-C149347F5503
957958install-name: '/usr/lib/system/libdyld.dylib'
958959parent-umbrella:
959960 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
......@@ -1041,17 +1042,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
10411042 arm64e-macos, arm64e-maccatalyst ]
10421043uuids:
10431044 - target: x86_64-macos
1044 value: 564464C5-4B61-34E4-A937-2BDB5399DFCB
1045 value: 4C623CBE-6FF4-3731-A647-6EEF7A6F51C7
10451046 - target: x86_64-maccatalyst
1046 value: 564464C5-4B61-34E4-A937-2BDB5399DFCB
1047 value: 4C623CBE-6FF4-3731-A647-6EEF7A6F51C7
10471048 - target: arm64-macos
10481049 value: 00000000-0000-0000-0000-000000000000
10491050 - target: arm64-maccatalyst
10501051 value: 00000000-0000-0000-0000-000000000000
10511052 - target: arm64e-macos
1052 value: 50343076-2AC5-36B5-8B00-C7182678C6AC
1053 value: B63E11DD-4648-3355-A51C-C1B650654C0F
10531054 - target: arm64e-maccatalyst
1054 value: 50343076-2AC5-36B5-8B00-C7182678C6AC
1055 value: B63E11DD-4648-3355-A51C-C1B650654C0F
10551056install-name: '/usr/lib/system/libkeymgr.dylib'
10561057current-version: 31
10571058parent-umbrella:
......@@ -1071,17 +1072,17 @@ tbd-version: 4
10711072targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64e-macos ]
10721073uuids:
10731074 - target: x86_64-macos
1074 value: 4573BDD5-4817-3D26-B6A7-38AAE653FCBC
1075 value: 632C478C-AAF6-3330-AA8E-0D0FCA4C6237
10751076 - target: x86_64-maccatalyst
1076 value: 4573BDD5-4817-3D26-B6A7-38AAE653FCBC
1077 value: 632C478C-AAF6-3330-AA8E-0D0FCA4C6237
10771078 - target: arm64-macos
1078 value: B695C46E-649C-3047-AF7D-ED475E37DE56
1079 value: F71DA09E-609F-3C9A-95BF-22B22CFAD5A5
10791080 - target: arm64-maccatalyst
1080 value: B695C46E-649C-3047-AF7D-ED475E37DE56
1081 value: F71DA09E-609F-3C9A-95BF-22B22CFAD5A5
10811082 - target: arm64e-macos
1082 value: B4352C72-0618-3135-B375-BFF70DB8C3F2
1083 value: 471DA066-B65F-36B1-93B7-243C71F8838B
10831084 - target: arm64e-maccatalyst
1084 value: B4352C72-0618-3135-B375-BFF70DB8C3F2
1085 value: 471DA066-B65F-36B1-93B7-243C71F8838B
10851086install-name: '/usr/lib/system/libmacho.dylib'
10861087current-version: 1001.2
10871088parent-umbrella:
......@@ -1131,19 +1132,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
11311132 arm64e-macos, arm64e-maccatalyst ]
11321133uuids:
11331134 - target: x86_64-macos
1134 value: 928130DD-5A8D-3546-BA85-242E4051CEF2
1135 value: 9C3DCECF-ED9C-3F0F-9E9C-28DC842D4D65
11351136 - target: x86_64-maccatalyst
1136 value: 928130DD-5A8D-3546-BA85-242E4051CEF2
1137 value: 9C3DCECF-ED9C-3F0F-9E9C-28DC842D4D65
11371138 - target: arm64-macos
11381139 value: 00000000-0000-0000-0000-000000000000
11391140 - target: arm64-maccatalyst
11401141 value: 00000000-0000-0000-0000-000000000000
11411142 - target: arm64e-macos
1142 value: 2009EBC7-36D7-32AA-AD6A-25CE4128B3C0
1143 value: A052DB52-9ECA-39EC-8DD4-05A0856579B7
11431144 - target: arm64e-maccatalyst
1144 value: 2009EBC7-36D7-32AA-AD6A-25CE4128B3C0
1145 value: A052DB52-9ECA-39EC-8DD4-05A0856579B7
11451146install-name: '/usr/lib/system/libquarantine.dylib'
1146current-version: 146.40.2
1147current-version: 146.60.2
11471148parent-umbrella:
11481149 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
11491150 arm64e-macos, arm64e-maccatalyst ]
......@@ -1189,17 +1190,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
11891190 arm64e-macos, arm64e-maccatalyst ]
11901191uuids:
11911192 - target: x86_64-macos
1192 value: E922FC3F-83F1-3C07-AD9A-13ABE2883681
1193 value: A7C519E4-A2A5-33E1-B9D6-52951921392F
11931194 - target: x86_64-maccatalyst
1194 value: E922FC3F-83F1-3C07-AD9A-13ABE2883681
1195 value: A7C519E4-A2A5-33E1-B9D6-52951921392F
11951196 - target: arm64-macos
11961197 value: 00000000-0000-0000-0000-000000000000
11971198 - target: arm64-maccatalyst
11981199 value: 00000000-0000-0000-0000-000000000000
11991200 - target: arm64e-macos
1200 value: 51CF7D0E-014B-3E65-BDF3-A2DF337113BA
1201 value: E785FBDF-82C9-3642-A38D-EDB07D118303
12011202 - target: arm64e-maccatalyst
1202 value: 51CF7D0E-014B-3E65-BDF3-A2DF337113BA
1203 value: E785FBDF-82C9-3642-A38D-EDB07D118303
12031204install-name: '/usr/lib/system/libremovefile.dylib'
12041205current-version: 63
12051206parent-umbrella:
......@@ -1220,17 +1221,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
12201221 arm64e-macos, arm64e-maccatalyst ]
12211222uuids:
12221223 - target: x86_64-macos
1223 value: 136EA7B6-9D44-3363-8949-AF5D21C6D116
1224 value: D32DFE04-D5D4-3BD7-B9B5-9ED721B993EE
12241225 - target: x86_64-maccatalyst
1225 value: 136EA7B6-9D44-3363-8949-AF5D21C6D116
1226 value: D32DFE04-D5D4-3BD7-B9B5-9ED721B993EE
12261227 - target: arm64-macos
12271228 value: 00000000-0000-0000-0000-000000000000
12281229 - target: arm64-maccatalyst
12291230 value: 00000000-0000-0000-0000-000000000000
12301231 - target: arm64e-macos
1231 value: 60ADB251-3204-34C0-B826-260AEF261E02
1232 value: 1E8F925A-501E-32BD-9BE3-2EE5FDEA8818
12321233 - target: arm64e-maccatalyst
1233 value: 60ADB251-3204-34C0-B826-260AEF261E02
1234 value: 1E8F925A-501E-32BD-9BE3-2EE5FDEA8818
12341235install-name: '/usr/lib/system/libsystem_asl.dylib'
12351236current-version: 395
12361237parent-umbrella:
......@@ -1314,17 +1315,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
13141315 arm64e-macos, arm64e-maccatalyst ]
13151316uuids:
13161317 - target: x86_64-macos
1317 value: 8AE2D1DF-B8E1-3564-810B-65C611BA237B
1318 value: 942C1938-B1BC-3B74-912C-D7E7E2B6DC72
13181319 - target: x86_64-maccatalyst
1319 value: 8AE2D1DF-B8E1-3564-810B-65C611BA237B
1320 value: 942C1938-B1BC-3B74-912C-D7E7E2B6DC72
13201321 - target: arm64-macos
13211322 value: 00000000-0000-0000-0000-000000000000
13221323 - target: arm64-maccatalyst
13231324 value: 00000000-0000-0000-0000-000000000000
13241325 - target: arm64e-macos
1325 value: 2E8EE0E2-160C-3418-AFC4-3FD86B4E7A6E
1326 value: B126606C-8D07-3F9D-AD5E-9864CF11D901
13261327 - target: arm64e-maccatalyst
1327 value: 2E8EE0E2-160C-3418-AFC4-3FD86B4E7A6E
1328 value: B126606C-8D07-3F9D-AD5E-9864CF11D901
13281329install-name: '/usr/lib/system/libsystem_blocks.dylib'
13291330current-version: 84
13301331parent-umbrella:
......@@ -1346,17 +1347,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
13461347 arm64e-macos, arm64e-maccatalyst ]
13471348uuids:
13481349 - target: x86_64-macos
1349 value: 5EFAF10B-2EC1-32ED-B077-80125E552C8D
1350 value: 376F7CB7-6DD2-3E00-976F-77DD755BDB0D
13501351 - target: x86_64-maccatalyst
1351 value: 5EFAF10B-2EC1-32ED-B077-80125E552C8D
1352 value: 376F7CB7-6DD2-3E00-976F-77DD755BDB0D
13521353 - target: arm64-macos
13531354 value: 00000000-0000-0000-0000-000000000000
13541355 - target: arm64-maccatalyst
13551356 value: 00000000-0000-0000-0000-000000000000
13561357 - target: arm64e-macos
1357 value: A3869999-0792-3E09-B3FB-5E87AE4639BE
1358 value: 756CD0D2-3241-3A74-8C59-02632DCEE221
13581359 - target: arm64e-maccatalyst
1359 value: A3869999-0792-3E09-B3FB-5E87AE4639BE
1360 value: 756CD0D2-3241-3A74-8C59-02632DCEE221
13601361install-name: '/usr/lib/system/libsystem_c.dylib'
13611362current-version: 1534.40.2
13621363parent-umbrella:
......@@ -1653,17 +1654,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
16531654 arm64e-macos, arm64e-maccatalyst ]
16541655uuids:
16551656 - target: x86_64-macos
1656 value: 308C9B23-5690-30DE-8008-0C50E7C725C5
1657 value: 2053883C-79F4-3AF8-A37C-DE204E208C60
16571658 - target: x86_64-maccatalyst
1658 value: 308C9B23-5690-30DE-8008-0C50E7C725C5
1659 value: 2053883C-79F4-3AF8-A37C-DE204E208C60
16591660 - target: arm64-macos
16601661 value: 00000000-0000-0000-0000-000000000000
16611662 - target: arm64-maccatalyst
16621663 value: 00000000-0000-0000-0000-000000000000
16631664 - target: arm64e-macos
1664 value: 89E9EF9E-ED46-307F-B973-6B5C3FB67388
1665 value: CB445464-28B4-353C-976E-59DA0E229FED
16651666 - target: arm64e-maccatalyst
1666 value: 89E9EF9E-ED46-307F-B973-6B5C3FB67388
1667 value: CB445464-28B4-353C-976E-59DA0E229FED
16671668install-name: '/usr/lib/system/libsystem_collections.dylib'
16681669current-version: 1534.40.2
16691670parent-umbrella:
......@@ -1696,19 +1697,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
16961697 arm64e-macos, arm64e-maccatalyst ]
16971698uuids:
16981699 - target: x86_64-macos
1699 value: 1CCF39AE-1799-327F-BFA5-5CBBC9511318
1700 value: E7F80C5C-E18C-3201-ACB6-9A4C46B6574B
17001701 - target: x86_64-maccatalyst
1701 value: 1CCF39AE-1799-327F-BFA5-5CBBC9511318
1702 value: E7F80C5C-E18C-3201-ACB6-9A4C46B6574B
17021703 - target: arm64-macos
17031704 value: 00000000-0000-0000-0000-000000000000
17041705 - target: arm64-maccatalyst
17051706 value: 00000000-0000-0000-0000-000000000000
17061707 - target: arm64e-macos
1707 value: 3C081A70-EBBF-3746-A83F-FC93891BAA71
1708 value: 113A1DDB-1B61-3C33-9FD5-B39A2A29D779
17081709 - target: arm64e-maccatalyst
1709 value: 3C081A70-EBBF-3746-A83F-FC93891BAA71
1710 value: 113A1DDB-1B61-3C33-9FD5-B39A2A29D779
17101711install-name: '/usr/lib/system/libsystem_configuration.dylib'
1711current-version: 1241.40.2
1712current-version: 1241.60.3
17121713parent-umbrella:
17131714 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
17141715 arm64e-macos, arm64e-maccatalyst ]
......@@ -1736,17 +1737,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
17361737 arm64e-macos, arm64e-maccatalyst ]
17371738uuids:
17381739 - target: x86_64-macos
1739 value: B94F5292-7CDC-368F-8D91-0CD73AE80924
1740 value: D44E0845-001C-3C46-B3A7-E4926DAEF6B3
17401741 - target: x86_64-maccatalyst
1741 value: B94F5292-7CDC-368F-8D91-0CD73AE80924
1742 value: D44E0845-001C-3C46-B3A7-E4926DAEF6B3
17421743 - target: arm64-macos
17431744 value: 00000000-0000-0000-0000-000000000000
17441745 - target: arm64-maccatalyst
17451746 value: 00000000-0000-0000-0000-000000000000
17461747 - target: arm64e-macos
1747 value: D48AD081-4875-3F66-ABE1-9B646DD03B9C
1748 value: 2694748C-A452-3438-BB47-161D7B220AE2
17481749 - target: arm64e-maccatalyst
1749 value: D48AD081-4875-3F66-ABE1-9B646DD03B9C
1750 value: 2694748C-A452-3438-BB47-161D7B220AE2
17501751install-name: '/usr/lib/system/libsystem_containermanager.dylib'
17511752parent-umbrella:
17521753 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
......@@ -1911,17 +1912,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
19111912 arm64e-macos, arm64e-maccatalyst ]
19121913uuids:
19131914 - target: x86_64-macos
1914 value: 47275741-03DA-37A9-85B9-541F4DCB1163
1915 value: D86D13CC-2AF9-3A17-BCF3-0D16703F99A7
19151916 - target: x86_64-maccatalyst
1916 value: 47275741-03DA-37A9-85B9-541F4DCB1163
1917 value: D86D13CC-2AF9-3A17-BCF3-0D16703F99A7
19171918 - target: arm64-macos
19181919 value: 00000000-0000-0000-0000-000000000000
19191920 - target: arm64-maccatalyst
19201921 value: 00000000-0000-0000-0000-000000000000
19211922 - target: arm64e-macos
1922 value: 9F1BA0E0-8227-364B-8CF4-86D6870D6937
1923 value: 6E9DED8E-2A44-33E3-909F-74B4786482A2
19231924 - target: arm64e-maccatalyst
1924 value: 9F1BA0E0-8227-364B-8CF4-86D6870D6937
1925 value: 6E9DED8E-2A44-33E3-909F-74B4786482A2
19251926install-name: '/usr/lib/system/libsystem_coreservices.dylib'
19261927current-version: 129
19271928parent-umbrella:
......@@ -1945,17 +1946,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
19451946 arm64e-macos, arm64e-maccatalyst ]
19461947uuids:
19471948 - target: x86_64-macos
1948 value: 4B2F10CE-2D99-3B79-A05A-87DD03065ACB
1949 value: E272E2C2-8511-3C94-8C39-F5319F2812BB
19491950 - target: x86_64-maccatalyst
1950 value: 4B2F10CE-2D99-3B79-A05A-87DD03065ACB
1951 value: E272E2C2-8511-3C94-8C39-F5319F2812BB
19511952 - target: arm64-macos
19521953 value: 00000000-0000-0000-0000-000000000000
19531954 - target: arm64-maccatalyst
19541955 value: 00000000-0000-0000-0000-000000000000
19551956 - target: arm64e-macos
1956 value: 859E9F1E-85E4-3469-9733-5846C98B155D
1957 value: 74F6C923-5FF6-39D0-90DE-8FB4812EA263
19571958 - target: arm64e-maccatalyst
1958 value: 859E9F1E-85E4-3469-9733-5846C98B155D
1959 value: 74F6C923-5FF6-39D0-90DE-8FB4812EA263
19591960install-name: '/usr/lib/system/libsystem_darwin.dylib'
19601961parent-umbrella:
19611962 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
......@@ -1996,19 +1997,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
19961997 arm64e-macos, arm64e-maccatalyst ]
19971998uuids:
19981999 - target: x86_64-macos
1999 value: C352C6E4-8236-3B91-8ECA-4692191DD227
2000 value: 77610ACE-81D4-33E5-A343-5FDA27F53E10
20002001 - target: x86_64-maccatalyst
2001 value: C352C6E4-8236-3B91-8ECA-4692191DD227
2002 value: 77610ACE-81D4-33E5-A343-5FDA27F53E10
20022003 - target: arm64-macos
20032004 value: 00000000-0000-0000-0000-000000000000
20042005 - target: arm64-maccatalyst
20052006 value: 00000000-0000-0000-0000-000000000000
20062007 - target: arm64e-macos
2007 value: 1122C71F-CFA3-38EB-A329-C647E500C9B1
2008 value: F87EFC17-B673-3488-B503-C67E2FFDE6A0
20082009 - target: arm64e-maccatalyst
2009 value: 1122C71F-CFA3-38EB-A329-C647E500C9B1
2010 value: F87EFC17-B673-3488-B503-C67E2FFDE6A0
20102011install-name: '/usr/lib/system/libsystem_dnssd.dylib'
2011current-version: 1790.40.31
2012current-version: 1790.60.25
20122013parent-umbrella:
20132014 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
20142015 arm64e-macos, arm64e-maccatalyst ]
......@@ -2046,17 +2047,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
20462047 arm64e-macos, arm64e-maccatalyst ]
20472048uuids:
20482049 - target: x86_64-macos
2049 value: 2AF1974D-3A00-3461-9FDB-AF641DE4253E
2050 value: 223BBDCF-6D59-3770-9E6A-38B762676030
20502051 - target: x86_64-maccatalyst
2051 value: 2AF1974D-3A00-3461-9FDB-AF641DE4253E
2052 value: 223BBDCF-6D59-3770-9E6A-38B762676030
20522053 - target: arm64-macos
20532054 value: 00000000-0000-0000-0000-000000000000
20542055 - target: arm64-maccatalyst
20552056 value: 00000000-0000-0000-0000-000000000000
20562057 - target: arm64e-macos
2057 value: C50ECE78-12CE-377F-93BA-B0D8B0D93CE7
2058 value: EE355E15-A47F-3BED-A955-1041497449AE
20582059 - target: arm64e-maccatalyst
2059 value: C50ECE78-12CE-377F-93BA-B0D8B0D93CE7
2060 value: EE355E15-A47F-3BED-A955-1041497449AE
20602061install-name: '/usr/lib/system/libsystem_featureflags.dylib'
20612062current-version: 71
20622063parent-umbrella:
......@@ -2073,17 +2074,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
20732074 arm64e-macos, arm64e-maccatalyst ]
20742075uuids:
20752076 - target: x86_64-macos
2076 value: 37924254-46CA-3531-9BE4-E9782F4DA626
2077 value: 7B76D94D-56F7-3B8A-B63D-ED567EFA12F6
20772078 - target: x86_64-maccatalyst
2078 value: 37924254-46CA-3531-9BE4-E9782F4DA626
2079 value: 7B76D94D-56F7-3B8A-B63D-ED567EFA12F6
20792080 - target: arm64-macos
20802081 value: 00000000-0000-0000-0000-000000000000
20812082 - target: arm64-maccatalyst
20822083 value: 00000000-0000-0000-0000-000000000000
20832084 - target: arm64e-macos
2084 value: 177AEA65-CA0C-38EB-8891-7726D30EC0AB
2085 value: 67168754-ABAC-33C6-AFF7-FF53F1A8745C
20852086 - target: arm64e-maccatalyst
2086 value: 177AEA65-CA0C-38EB-8891-7726D30EC0AB
2087 value: 67168754-ABAC-33C6-AFF7-FF53F1A8745C
20872088install-name: '/usr/lib/system/libsystem_info.dylib'
20882089parent-umbrella:
20892090 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
......@@ -2210,19 +2211,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
22102211 arm64e-macos, arm64e-maccatalyst ]
22112212uuids:
22122213 - target: x86_64-macos
2213 value: 6D1DB971-27A7-3DBC-A7FF-1D25A88E5282
2214 value: 7C3DCC95-9F42-3C7C-8796-476FF67B9CF7
22142215 - target: x86_64-maccatalyst
2215 value: 6D1DB971-27A7-3DBC-A7FF-1D25A88E5282
2216 value: 7C3DCC95-9F42-3C7C-8796-476FF67B9CF7
22162217 - target: arm64-macos
2217 value: B529197C-5FB5-3ABB-915F-9EB576658F0F
2218 value: EB0327EE-CB9C-37ED-AB6A-E9AF74E814F0
22182219 - target: arm64-maccatalyst
2219 value: B529197C-5FB5-3ABB-915F-9EB576658F0F
2220 value: EB0327EE-CB9C-37ED-AB6A-E9AF74E814F0
22202221 - target: arm64e-macos
2221 value: 66D9DC04-E3C0-329C-B4CA-8C6E2CCA7FD3
2222 value: AEBF397E-E2EF-3A49-BE58-23D4558511F6
22222223 - target: arm64e-maccatalyst
2223 value: 66D9DC04-E3C0-329C-B4CA-8C6E2CCA7FD3
2224 value: AEBF397E-E2EF-3A49-BE58-23D4558511F6
22242225install-name: '/usr/lib/system/libsystem_kernel.dylib'
2225current-version: 8792.41.7
2226current-version: 8792.61.2
22262227parent-umbrella:
22272228 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
22282229 arm64e-macos, arm64e-maccatalyst ]
......@@ -2531,7 +2532,7 @@ exports:
25312532 _os_packet_set_expire_time, _os_packet_set_expiry_action,
25322533 _os_packet_set_flow_uuid, _os_packet_set_group_end, _os_packet_set_group_start,
25332534 _os_packet_set_headroom, _os_packet_set_inet_checksum, _os_packet_set_keep_alive,
2534 _os_packet_set_link_broadcast, _os_packet_set_link_ethfcs,
2535 _os_packet_set_l4s_flag, _os_packet_set_link_broadcast, _os_packet_set_link_ethfcs,
25352536 _os_packet_set_link_header_length, _os_packet_set_link_multicast,
25362537 _os_packet_set_packetid, _os_packet_set_protocol_segment_size,
25372538 _os_packet_set_service_class, _os_packet_set_token, _os_packet_set_trace_id,
......@@ -2557,45 +2558,46 @@ exports:
25572558 _posix_spawnattr_getprocesstype_np, _posix_spawnattr_getsigdefault,
25582559 _posix_spawnattr_getsigmask, _posix_spawnattr_init, _posix_spawnattr_set_alt_rosetta_np,
25592560 _posix_spawnattr_set_crash_behavior_deadline_np, _posix_spawnattr_set_crash_behavior_np,
2560 _posix_spawnattr_set_csm_np, _posix_spawnattr_set_darwin_role_np,
2561 _posix_spawnattr_set_filedesclimit_ext, _posix_spawnattr_set_gid_np,
2562 _posix_spawnattr_set_groups_np, _posix_spawnattr_set_importancewatch_port_np,
2563 _posix_spawnattr_set_jetsam_ttr_np, _posix_spawnattr_set_launch_type_np,
2564 _posix_spawnattr_set_login_np, _posix_spawnattr_set_max_addr_np,
2565 _posix_spawnattr_set_persona_gid_np, _posix_spawnattr_set_persona_groups_np,
2566 _posix_spawnattr_set_persona_np, _posix_spawnattr_set_persona_uid_np,
2567 _posix_spawnattr_set_platform_np, _posix_spawnattr_set_portlimits_ext,
2568 _posix_spawnattr_set_ptrauth_task_port_np, _posix_spawnattr_set_qos_clamp_np,
2569 _posix_spawnattr_set_registered_ports_np, _posix_spawnattr_set_subsystem_root_path_np,
2570 _posix_spawnattr_set_threadlimit_ext, _posix_spawnattr_set_uid_np,
2571 _posix_spawnattr_setarchpref_np, _posix_spawnattr_setauditsessionport_np,
2572 _posix_spawnattr_setbinpref_np, _posix_spawnattr_setcoalition_np,
2573 _posix_spawnattr_setcpumonitor, _posix_spawnattr_setcpumonitor_default,
2574 _posix_spawnattr_setexceptionports_np, _posix_spawnattr_setflags,
2575 _posix_spawnattr_setjetsam_ext, _posix_spawnattr_setmacpolicyinfo_np,
2576 _posix_spawnattr_setnosmt_np, _posix_spawnattr_setpcontrol_np,
2577 _posix_spawnattr_setpgroup, _posix_spawnattr_setprocesstype_np,
2578 _posix_spawnattr_setsigdefault, _posix_spawnattr_setsigmask,
2579 _posix_spawnattr_setspecialport_np, _pread, '_pread$NOCANCEL',
2580 _preadv, '_preadv$NOCANCEL', _proc_clear_cpulimits, _proc_clear_delayidlesleep,
2581 _proc_clear_dirty, _proc_clear_vmpressure, _proc_current_thread_schedinfo,
2582 _proc_denap_assertion_begin_with_msg, _proc_denap_assertion_complete,
2583 _proc_disable_apptype, _proc_disable_cpumon, _proc_disable_wakemon,
2584 _proc_donate_importance_boost, _proc_enable_apptype, _proc_get_cpumon_params,
2585 _proc_get_dirty, _proc_get_wakemon_params, _proc_importance_assertion_begin_with_msg,
2586 _proc_importance_assertion_complete, _proc_kmsgbuf, _proc_libversion,
2587 _proc_list_dynkqueueids, _proc_list_uptrs, _proc_listallpids,
2588 _proc_listchildpids, _proc_listcoalitions, _proc_listpgrppids,
2589 _proc_listpids, _proc_listpidspath, _proc_name, _proc_pid_rusage,
2590 _proc_piddynkqueueinfo, _proc_pidfdinfo, _proc_pidfileportinfo,
2591 _proc_pidinfo, _proc_pidoriginatorinfo, _proc_pidpath, _proc_pidpath_audittoken,
2592 _proc_regionfilename, _proc_reset_footprint_interval, _proc_resume_cpumon,
2593 _proc_rlimit_control, _proc_set_cpumon_defaults, _proc_set_cpumon_params,
2594 _proc_set_cpumon_params_fatal, _proc_set_csm, _proc_set_delayidlesleep,
2595 _proc_set_dirty, _proc_set_no_smt, _proc_set_owner_vmpressure,
2596 _proc_set_wakemon_defaults, _proc_set_wakemon_params, _proc_setcpu_percentage,
2597 _proc_setpcontrol, _proc_setthread_cpupercent, _proc_setthread_csm,
2598 _proc_setthread_no_smt, _proc_suppress, _proc_terminate, _proc_terminate_all_rsr,
2561 _posix_spawnattr_set_crash_count_np, _posix_spawnattr_set_csm_np,
2562 _posix_spawnattr_set_darwin_role_np, _posix_spawnattr_set_filedesclimit_ext,
2563 _posix_spawnattr_set_gid_np, _posix_spawnattr_set_groups_np,
2564 _posix_spawnattr_set_importancewatch_port_np, _posix_spawnattr_set_jetsam_ttr_np,
2565 _posix_spawnattr_set_launch_type_np, _posix_spawnattr_set_login_np,
2566 _posix_spawnattr_set_max_addr_np, _posix_spawnattr_set_persona_gid_np,
2567 _posix_spawnattr_set_persona_groups_np, _posix_spawnattr_set_persona_np,
2568 _posix_spawnattr_set_persona_uid_np, _posix_spawnattr_set_platform_np,
2569 _posix_spawnattr_set_portlimits_ext, _posix_spawnattr_set_ptrauth_task_port_np,
2570 _posix_spawnattr_set_qos_clamp_np, _posix_spawnattr_set_registered_ports_np,
2571 _posix_spawnattr_set_subsystem_root_path_np, _posix_spawnattr_set_threadlimit_ext,
2572 _posix_spawnattr_set_uid_np, _posix_spawnattr_setarchpref_np,
2573 _posix_spawnattr_setauditsessionport_np, _posix_spawnattr_setbinpref_np,
2574 _posix_spawnattr_setcoalition_np, _posix_spawnattr_setcpumonitor,
2575 _posix_spawnattr_setcpumonitor_default, _posix_spawnattr_setexceptionports_np,
2576 _posix_spawnattr_setflags, _posix_spawnattr_setjetsam_ext,
2577 _posix_spawnattr_setmacpolicyinfo_np, _posix_spawnattr_setnosmt_np,
2578 _posix_spawnattr_setpcontrol_np, _posix_spawnattr_setpgroup,
2579 _posix_spawnattr_setprocesstype_np, _posix_spawnattr_setsigdefault,
2580 _posix_spawnattr_setsigmask, _posix_spawnattr_setspecialport_np,
2581 _pread, '_pread$NOCANCEL', _preadv, '_preadv$NOCANCEL', _proc_clear_cpulimits,
2582 _proc_clear_delayidlesleep, _proc_clear_dirty, _proc_clear_vmpressure,
2583 _proc_current_thread_schedinfo, _proc_denap_assertion_begin_with_msg,
2584 _proc_denap_assertion_complete, _proc_disable_apptype, _proc_disable_cpumon,
2585 _proc_disable_wakemon, _proc_donate_importance_boost, _proc_enable_apptype,
2586 _proc_get_cpumon_params, _proc_get_dirty, _proc_get_wakemon_params,
2587 _proc_importance_assertion_begin_with_msg, _proc_importance_assertion_complete,
2588 _proc_kmsgbuf, _proc_libversion, _proc_list_dynkqueueids,
2589 _proc_list_uptrs, _proc_listallpids, _proc_listchildpids,
2590 _proc_listcoalitions, _proc_listpgrppids, _proc_listpids,
2591 _proc_listpidspath, _proc_name, _proc_pid_rusage, _proc_piddynkqueueinfo,
2592 _proc_pidfdinfo, _proc_pidfileportinfo, _proc_pidinfo, _proc_pidoriginatorinfo,
2593 _proc_pidpath, _proc_pidpath_audittoken, _proc_regionfilename,
2594 _proc_reset_footprint_interval, _proc_resume_cpumon, _proc_rlimit_control,
2595 _proc_set_cpumon_defaults, _proc_set_cpumon_params, _proc_set_cpumon_params_fatal,
2596 _proc_set_csm, _proc_set_delayidlesleep, _proc_set_dirty,
2597 _proc_set_no_smt, _proc_set_owner_vmpressure, _proc_set_wakemon_defaults,
2598 _proc_set_wakemon_params, _proc_setcpu_percentage, _proc_setpcontrol,
2599 _proc_setthread_cpupercent, _proc_setthread_csm, _proc_setthread_no_smt,
2600 _proc_suppress, _proc_terminate, _proc_terminate_all_rsr,
25992601 _proc_trace_log, _proc_track_dirty, _proc_udata_info, _proc_uuid_policy,
26002602 _processor_assign, _processor_control, _processor_exit, _processor_get_assignment,
26012603 _processor_info, _processor_set_create, _processor_set_default,
......@@ -2707,21 +2709,21 @@ targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-macc
27072709 arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
27082710uuids:
27092711 - target: x86_64-macos
2710 value: 5F7B0A6E-0315-3171-B806-4CCDB23007F4
2712 value: DC460796-C8A7-3507-8539-C890D9EDDC8C
27112713 - target: x86_64-maccatalyst
2712 value: 5F7B0A6E-0315-3171-B806-4CCDB23007F4
2714 value: DC460796-C8A7-3507-8539-C890D9EDDC8C
27132715 - target: x86_64h-macos
2714 value: 99FD67E1-20A8-36A7-836D-C8F156C98C5D
2716 value: 73F0FC1C-FC2A-3B36-8796-7C2C2CBA7214
27152717 - target: x86_64h-maccatalyst
2716 value: 99FD67E1-20A8-36A7-836D-C8F156C98C5D
2718 value: 73F0FC1C-FC2A-3B36-8796-7C2C2CBA7214
27172719 - target: arm64-macos
27182720 value: 00000000-0000-0000-0000-000000000000
27192721 - target: arm64-maccatalyst
27202722 value: 00000000-0000-0000-0000-000000000000
27212723 - target: arm64e-macos
2722 value: 748648A3-C1FF-3A75-8CE4-95B8334A6D58
2724 value: 6BEE17F3-04F2-3B1F-B8EB-C94379ABA9BD
27232725 - target: arm64e-maccatalyst
2724 value: 748648A3-C1FF-3A75-8CE4-95B8334A6D58
2726 value: 6BEE17F3-04F2-3B1F-B8EB-C94379ABA9BD
27252727install-name: '/usr/lib/system/libsystem_m.dylib'
27262728current-version: 3226.0.1
27272729parent-umbrella:
......@@ -2938,19 +2940,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
29382940 arm64e-macos, arm64e-maccatalyst ]
29392941uuids:
29402942 - target: x86_64-macos
2941 value: D95D8C17-9F95-3076-A449-FBC4D1E9AD57
2943 value: F609F029-BCD0-3A54-B48A-99B3CE8378CE
29422944 - target: x86_64-maccatalyst
2943 value: D95D8C17-9F95-3076-A449-FBC4D1E9AD57
2945 value: F609F029-BCD0-3A54-B48A-99B3CE8378CE
29442946 - target: arm64-macos
29452947 value: 00000000-0000-0000-0000-000000000000
29462948 - target: arm64-maccatalyst
29472949 value: 00000000-0000-0000-0000-000000000000
29482950 - target: arm64e-macos
2949 value: 030A8CB7-CD53-32E1-A0CC-6AC7D7DE93F1
2951 value: 04185997-16D2-30DA-8691-7C82612635A3
29502952 - target: arm64e-maccatalyst
2951 value: 030A8CB7-CD53-32E1-A0CC-6AC7D7DE93F1
2953 value: 04185997-16D2-30DA-8691-7C82612635A3
29522954install-name: '/usr/lib/system/libsystem_malloc.dylib'
2953current-version: 409.40.6
2955current-version: 409.60.6
29542956parent-umbrella:
29552957 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
29562958 arm64e-macos, arm64e-maccatalyst ]
......@@ -3002,17 +3004,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
30023004 arm64e-macos, arm64e-maccatalyst ]
30033005uuids:
30043006 - target: x86_64-macos
3005 value: 33130846-6A1D-33AA-BC75-06695EFCBF20
3007 value: 09114B12-EC3D-3943-A1BD-9909EE2F85B6
30063008 - target: x86_64-maccatalyst
3007 value: 33130846-6A1D-33AA-BC75-06695EFCBF20
3009 value: 09114B12-EC3D-3943-A1BD-9909EE2F85B6
30083010 - target: arm64-macos
30093011 value: 00000000-0000-0000-0000-000000000000
30103012 - target: arm64-maccatalyst
30113013 value: 00000000-0000-0000-0000-000000000000
30123014 - target: arm64e-macos
3013 value: 4972C105-1F4D-38BF-87C0-4724101B2CFA
3015 value: 8737AB7F-91FA-3C06-B797-566A62D0751C
30143016 - target: arm64e-maccatalyst
3015 value: 4972C105-1F4D-38BF-87C0-4724101B2CFA
3017 value: 8737AB7F-91FA-3C06-B797-566A62D0751C
30163018install-name: '/usr/lib/system/libsystem_networkextension.dylib'
30173019parent-umbrella:
30183020 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
......@@ -3095,17 +3097,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
30953097 arm64e-macos, arm64e-maccatalyst ]
30963098uuids:
30973099 - target: x86_64-macos
3098 value: 1F9FBDD3-694A-3FF7-A232-F07DF4845ABE
3100 value: 0463374D-9E62-3E58-A668-C9EFF9DB217C
30993101 - target: x86_64-maccatalyst
3100 value: 1F9FBDD3-694A-3FF7-A232-F07DF4845ABE
3102 value: 0463374D-9E62-3E58-A668-C9EFF9DB217C
31013103 - target: arm64-macos
31023104 value: 00000000-0000-0000-0000-000000000000
31033105 - target: arm64-maccatalyst
31043106 value: 00000000-0000-0000-0000-000000000000
31053107 - target: arm64e-macos
3106 value: B2C5AAD6-13E5-3E2E-8DFC-601BAED4AA96
3108 value: 62FA1CCF-D4BB-3606-BDC9-C2F247A12CE8
31073109 - target: arm64e-maccatalyst
3108 value: B2C5AAD6-13E5-3E2E-8DFC-601BAED4AA96
3110 value: 62FA1CCF-D4BB-3606-BDC9-C2F247A12CE8
31093111install-name: '/usr/lib/system/libsystem_notify.dylib'
31103112current-version: 306
31113113parent-umbrella:
......@@ -3128,17 +3130,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
31283130 arm64e-macos, arm64e-maccatalyst ]
31293131uuids:
31303132 - target: x86_64-macos
3131 value: F07558DB-8B15-3D96-93F9-3A61BBD52F25
3133 value: F314B62B-98F4-3A7C-8296-8739F8B6855A
31323134 - target: x86_64-maccatalyst
3133 value: F07558DB-8B15-3D96-93F9-3A61BBD52F25
3135 value: F314B62B-98F4-3A7C-8296-8739F8B6855A
31343136 - target: arm64-macos
3135 value: 372B6A5F-EE6F-3F9C-84D1-E8027DB6FA17
3137 value: ABF0BAEB-706B-3AC1-B6AD-B5CF380B8963
31363138 - target: arm64-maccatalyst
3137 value: 372B6A5F-EE6F-3F9C-84D1-E8027DB6FA17
3139 value: ABF0BAEB-706B-3AC1-B6AD-B5CF380B8963
31383140 - target: arm64e-macos
3139 value: 78189670-2F47-332C-9A59-A210157AA97B
3141 value: B215AE90-4ED2-3FCD-8CCC-6C0D93CC4F41
31403142 - target: arm64e-maccatalyst
3141 value: 78189670-2F47-332C-9A59-A210157AA97B
3143 value: B215AE90-4ED2-3FCD-8CCC-6C0D93CC4F41
31423144install-name: '/usr/lib/system/libsystem_platform.dylib'
31433145current-version: 288
31443146parent-umbrella:
......@@ -3220,17 +3222,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
32203222 arm64e-macos, arm64e-maccatalyst ]
32213223uuids:
32223224 - target: x86_64-macos
3223 value: 13B5E252-77D1-31E1-888D-1C5F4426EA87
3225 value: 5920E36F-53EC-33F0-B675-8AE48B58418C
32243226 - target: x86_64-maccatalyst
3225 value: 13B5E252-77D1-31E1-888D-1C5F4426EA87
3227 value: 5920E36F-53EC-33F0-B675-8AE48B58418C
32263228 - target: arm64-macos
3227 value: 030D2641-514F-373F-9688-582D9D3B369A
3229 value: 51C613E3-4ABF-359C-B275-2608BB1BE0B6
32283230 - target: arm64-maccatalyst
3229 value: 030D2641-514F-373F-9688-582D9D3B369A
3231 value: 51C613E3-4ABF-359C-B275-2608BB1BE0B6
32303232 - target: arm64e-macos
3231 value: 886CACA0-5762-3640-8DB2-3FA3B911C062
3233 value: 132084C6-C347-3489-9AC2-FCAAD21CDB73
32323234 - target: arm64e-maccatalyst
3233 value: 886CACA0-5762-3640-8DB2-3FA3B911C062
3235 value: 132084C6-C347-3489-9AC2-FCAAD21CDB73
32343236install-name: '/usr/lib/system/libsystem_pthread.dylib'
32353237current-version: 514
32363238parent-umbrella:
......@@ -3328,19 +3330,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
33283330 arm64e-macos, arm64e-maccatalyst ]
33293331uuids:
33303332 - target: x86_64-macos
3331 value: A064D0A7-139F-33E5-959C-7067CF94DC2E
3333 value: D199B283-8F09-3F2F-A17E-274BFF7733BE
33323334 - target: x86_64-maccatalyst
3333 value: A064D0A7-139F-33E5-959C-7067CF94DC2E
3335 value: D199B283-8F09-3F2F-A17E-274BFF7733BE
33343336 - target: arm64-macos
33353337 value: 00000000-0000-0000-0000-000000000000
33363338 - target: arm64-maccatalyst
33373339 value: 00000000-0000-0000-0000-000000000000
33383340 - target: arm64e-macos
3339 value: 3ADBD543-3E57-332F-972C-A958D9E4FBF8
3341 value: 3680811A-78F7-361A-ABBE-8E783165AC81
33403342 - target: arm64e-maccatalyst
3341 value: 3ADBD543-3E57-332F-972C-A958D9E4FBF8
3343 value: 3680811A-78F7-361A-ABBE-8E783165AC81
33423344install-name: '/usr/lib/system/libsystem_sandbox.dylib'
3343current-version: 1845.41.2
3345current-version: 1845.60.12
33443346parent-umbrella:
33453347 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
33463348 arm64e-macos, arm64e-maccatalyst ]
......@@ -3415,17 +3417,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
34153417 arm64e-macos, arm64e-maccatalyst ]
34163418uuids:
34173419 - target: x86_64-macos
3418 value: 15425DC5-5AEF-3711-A6B1-E3979FBEC662
3420 value: F24B1FA9-5692-35BA-9A9C-E071B7BFA5D7
34193421 - target: x86_64-maccatalyst
3420 value: 15425DC5-5AEF-3711-A6B1-E3979FBEC662
3422 value: F24B1FA9-5692-35BA-9A9C-E071B7BFA5D7
34213423 - target: arm64-macos
34223424 value: 00000000-0000-0000-0000-000000000000
34233425 - target: arm64-maccatalyst
34243426 value: 00000000-0000-0000-0000-000000000000
34253427 - target: arm64e-macos
3426 value: B8D75446-A5A3-3D0C-9C89-B65092333CD2
3428 value: 82513DC5-565F-3A4E-9431-4511FB0C22FA
34273429 - target: arm64e-maccatalyst
3428 value: B8D75446-A5A3-3D0C-9C89-B65092333CD2
3430 value: 82513DC5-565F-3A4E-9431-4511FB0C22FA
34293431install-name: '/usr/lib/system/libsystem_secinit.dylib'
34303432current-version: 119.40.2
34313433parent-umbrella:
......@@ -3444,17 +3446,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
34443446 arm64e-macos, arm64e-maccatalyst ]
34453447uuids:
34463448 - target: x86_64-macos
3447 value: CA62E5A0-80F0-3798-B8B6-71088A61F03C
3449 value: A5915FB2-F0C9-3BF0-ADC6-BEB571C73E57
34483450 - target: x86_64-maccatalyst
3449 value: CA62E5A0-80F0-3798-B8B6-71088A61F03C
3451 value: A5915FB2-F0C9-3BF0-ADC6-BEB571C73E57
34503452 - target: arm64-macos
34513453 value: 00000000-0000-0000-0000-000000000000
34523454 - target: arm64-maccatalyst
34533455 value: 00000000-0000-0000-0000-000000000000
34543456 - target: arm64e-macos
3455 value: DE393954-A39B-305C-BF0D-CF7563473762
3457 value: B31CD553-083B-39C6-BCB9-B0413ECAF562
34563458 - target: arm64e-maccatalyst
3457 value: DE393954-A39B-305C-BF0D-CF7563473762
3459 value: B31CD553-083B-39C6-BCB9-B0413ECAF562
34583460install-name: '/usr/lib/system/libsystem_symptoms.dylib'
34593461parent-umbrella:
34603462 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
......@@ -3474,19 +3476,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
34743476 arm64e-macos, arm64e-maccatalyst ]
34753477uuids:
34763478 - target: x86_64-macos
3477 value: EBFC896A-380B-39AB-949F-06BEADFCDBF8
3479 value: C5359E6E-7B63-3E51-A664-3E3581E15F52
34783480 - target: x86_64-maccatalyst
3479 value: EBFC896A-380B-39AB-949F-06BEADFCDBF8
3481 value: C5359E6E-7B63-3E51-A664-3E3581E15F52
34803482 - target: arm64-macos
34813483 value: 00000000-0000-0000-0000-000000000000
34823484 - target: arm64-maccatalyst
34833485 value: 00000000-0000-0000-0000-000000000000
34843486 - target: arm64e-macos
3485 value: 73557AF9-086C-3CB4-9E95-CA1D774CAA41
3487 value: 616F473A-EB21-377D-B3B4-F1581F127F0D
34863488 - target: arm64e-maccatalyst
3487 value: 73557AF9-086C-3CB4-9E95-CA1D774CAA41
3489 value: 616F473A-EB21-377D-B3B4-F1581F127F0D
34883490install-name: '/usr/lib/system/libsystem_trace.dylib'
3489current-version: 1406.0.15
3491current-version: 1406.60.2
34903492parent-umbrella:
34913493 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
34923494 arm64e-macos, arm64e-maccatalyst ]
......@@ -3551,17 +3553,17 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
35513553 arm64e-macos, arm64e-maccatalyst ]
35523554uuids:
35533555 - target: x86_64-macos
3554 value: 31C10303-6B57-3219-8DEF-ED784DCC67BA
3556 value: E45FA86E-48EB-3926-A24C-323DB84D3700
35553557 - target: x86_64-maccatalyst
3556 value: 31C10303-6B57-3219-8DEF-ED784DCC67BA
3558 value: E45FA86E-48EB-3926-A24C-323DB84D3700
35573559 - target: arm64-macos
35583560 value: 00000000-0000-0000-0000-000000000000
35593561 - target: arm64-maccatalyst
35603562 value: 00000000-0000-0000-0000-000000000000
35613563 - target: arm64e-macos
3562 value: 60F56A64-C75D-3E87-B275-E1FB9D078C5E
3564 value: 1228EDDF-7C61-3674-8C42-B537FFE9EDDA
35633565 - target: arm64e-maccatalyst
3564 value: 60F56A64-C75D-3E87-B275-E1FB9D078C5E
3566 value: 1228EDDF-7C61-3674-8C42-B537FFE9EDDA
35653567install-name: '/usr/lib/system/libunwind.dylib'
35663568current-version: 202.100
35673569parent-umbrella:
......@@ -3624,19 +3626,19 @@ targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatal
36243626 arm64e-macos, arm64e-maccatalyst ]
36253627uuids:
36263628 - target: x86_64-macos
3627 value: 38124BDF-4424-32BF-A60B-B4E96BC0EF70
3629 value: 7E56F9FE-DC35-3354-BA23-4103C09E22DD
36283630 - target: x86_64-maccatalyst
3629 value: 38124BDF-4424-32BF-A60B-B4E96BC0EF70
3631 value: 7E56F9FE-DC35-3354-BA23-4103C09E22DD
36303632 - target: arm64-macos
36313633 value: 00000000-0000-0000-0000-000000000000
36323634 - target: arm64-maccatalyst
36333635 value: 00000000-0000-0000-0000-000000000000
36343636 - target: arm64e-macos
3635 value: 44992A1E-D222-3D40-841D-E2CF9E26F67E
3637 value: 8EF4547D-1AF8-37CF-B15A-29405BF12642
36363638 - target: arm64e-maccatalyst
3637 value: 44992A1E-D222-3D40-841D-E2CF9E26F67E
3639 value: 8EF4547D-1AF8-37CF-B15A-29405BF12642
36383640install-name: '/usr/lib/system/libxpc.dylib'
3639current-version: 2462.41.2
3641current-version: 2462.60.15
36403642parent-umbrella:
36413643 - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
36423644 arm64e-macos, arm64e-maccatalyst ]
lib/libc/include/aarch64-macos.11-none/arm/_limits.h-4
......@@ -4,10 +4,6 @@
44#ifndef _ARM__LIMITS_H_
55#define _ARM__LIMITS_H_
66
7#if defined (__arm__) || defined (__arm64__)
8
97#define __DARWIN_CLK_TCK 100 /* ticks per second */
108
11#endif /* defined (__arm__) || defined (__arm64__) */
12
139#endif /* _ARM__LIMITS_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/arm/_mcontext.h-4
......@@ -29,8 +29,6 @@
2929#ifndef __ARM_MCONTEXT_H_
3030#define __ARM_MCONTEXT_H_
3131
32#if defined (__arm__) || defined (__arm64__)
33
3432#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
3533#include <sys/appleapiopts.h>
3634#include <mach/machine/_structs.h>
......@@ -90,6 +88,4 @@ typedef _STRUCT_MCONTEXT32 *mcontext_t;
9088#endif
9189#endif /* _MCONTEXT_T */
9290
93#endif /* defined (__arm__) || defined (__arm64__) */
94
9591#endif /* __ARM_MCONTEXT_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/arm/_param.h-3
......@@ -5,8 +5,6 @@
55#ifndef _ARM__PARAM_H_
66#define _ARM__PARAM_H_
77
8#if defined (__arm__) || defined (__arm64__)
9
108#include <arm/_types.h>
119
1210/*
......@@ -20,6 +18,5 @@
2018#define __DARWIN_ALIGNBYTES32 (sizeof(__uint32_t) - 1)
2119#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32)
2220
23#endif /* defined (__arm__) || defined (__arm64__) */
2421
2522#endif /* _ARM__PARAM_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/arm/_types.h-4
......@@ -4,8 +4,6 @@
44#ifndef _BSD_ARM__TYPES_H_
55#define _BSD_ARM__TYPES_H_
66
7#if defined (__arm__) || defined (__arm64__)
8
97/*
108 * This header file contains integer types. It's intended to also contain
119 * flotaing point and other arithmetic types, as needed, later.
......@@ -97,6 +95,4 @@ typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
9795typedef long __darwin_ssize_t; /* byte count or error */
9896typedef long __darwin_time_t; /* time() */
9997
100#endif /* defined (__arm__) || defined (__arm64__) */
101
10298#endif /* _BSD_ARM__TYPES_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/arm/arch.h-4
......@@ -28,8 +28,6 @@
2828#ifndef _ARM_ARCH_H
2929#define _ARM_ARCH_H
3030
31#if defined (__arm__) || defined (__arm64__)
32
3331/* Collect the __ARM_ARCH_*__ compiler flags into something easier to use. */
3432#if defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7S__) || defined (__ARM_ARCH_7F__) || defined (__ARM_ARCH_7K__)
3533#define _ARM_ARCH_7
......@@ -66,6 +64,4 @@
6664#define _ARM_ARCH_4
6765#endif
6866
69#endif /* defined (__arm__) || defined (__arm64__) */
70
7167#endif
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/arm/endian.h-3
......@@ -42,8 +42,6 @@
4242#ifndef _ARM__ENDIAN_H_
4343#define _ARM__ENDIAN_H_
4444
45#if defined (__arm__) || defined (__arm64__)
46
4745#include <sys/cdefs.h>
4846/*
4947 * Define _NOQUAD if the compiler does NOT support 64-bit integers.
......@@ -77,5 +75,4 @@
7775#include <sys/_endian.h>
7876
7977#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
80#endif /* defined (__arm__) || defined (__arm64__) */
8178#endif /* !_ARM__ENDIAN_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/arm/limits.h-4
......@@ -39,8 +39,6 @@
3939#ifndef _ARM_LIMITS_H_
4040#define _ARM_LIMITS_H_
4141
42#if defined (__arm__) || defined (__arm64__)
43
4442#include <sys/cdefs.h>
4543#include <arm/_limits.h>
4644
......@@ -109,6 +107,4 @@
109107#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
110108#endif /* !_ANSI_SOURCE */
111109
112#endif /* defined (__arm__) || defined (__arm64__) */
113
114110#endif /* _ARM_LIMITS_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/arm/param.h-4
......@@ -48,8 +48,6 @@
4848#ifndef _ARM_PARAM_H_
4949#define _ARM_PARAM_H_
5050
51#if defined (__arm__) || defined (__arm64__)
52
5351#include <arm/_param.h>
5452
5553/*
......@@ -146,6 +144,4 @@
146144#define DELAY(n) { int N = (n); while (--N > 0); }
147145#endif /* defined(KERNEL) || defined(STANDALONE) */
148146
149#endif /* defined (__arm__) || defined (__arm64__) */
150
151147#endif /* _ARM_PARAM_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/arm/signal.h-4
......@@ -9,14 +9,10 @@
99#ifndef _ARM_SIGNAL_
1010#define _ARM_SIGNAL_ 1
1111
12#if defined (__arm__) || defined (__arm64__)
13
1412#include <sys/cdefs.h>
1513
1614#ifndef _ANSI_SOURCE
1715typedef int sig_atomic_t;
1816#endif /* ! _ANSI_SOURCE */
1917
20#endif /* defined (__arm__) || defined (__arm64__) */
21
2218#endif /* _ARM_SIGNAL_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/arm/types.h+2-6
......@@ -39,12 +39,9 @@
3939 * @(#)types.h 8.3 (Berkeley) 1/5/94
4040 */
4141
42#ifndef _ARM_MACHTYPES_H_
43#define _ARM_MACHTYPES_H_
42#ifndef _MACHTYPES_H_
4443#define _MACHTYPES_H_
4544
46#if defined (__arm__) || defined (__arm64__)
47
4845#ifndef __ASSEMBLER__
4946#include <arm/_types.h>
5047#include <sys/cdefs.h>
......@@ -107,5 +104,4 @@ typedef u_int64_t syscall_arg_t;
107104#endif
108105
109106#endif /* __ASSEMBLER__ */
110#endif /* defined (__arm__) || defined (__arm64__) */
111#endif /* _ARM_MACHTYPES_H_ */
\ No newline at end of file
107#endif /* _MACHTYPES_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/mach/arm/_structs.h+19-4
......@@ -31,8 +31,6 @@
3131#ifndef _MACH_ARM__STRUCTS_H_
3232#define _MACH_ARM__STRUCTS_H_
3333
34#if defined (__arm__) || defined (__arm64__)
35
3634#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
3735#include <machine/types.h> /* __uint32_t */
3836
......@@ -509,6 +507,25 @@ _STRUCT_ARM_NEON_STATE
509507
510508#endif /* __DARWIN_UNIX03 */
511509
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 */
512529
513530#define _STRUCT_ARM_PAGEIN_STATE struct __arm_pagein_state
514531_STRUCT_ARM_PAGEIN_STATE
......@@ -625,6 +642,4 @@ _STRUCT_ARM_CPMU_STATE64
625642};
626643#endif /* !__DARWIN_UNIX03 */
627644
628#endif /* defined (__arm__) || defined (__arm64__) */
629
630645#endif /* _MACH_ARM__STRUCTS_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/mach/arm/boolean.h-4
......@@ -65,10 +65,6 @@
6565#ifndef _MACH_ARM_BOOLEAN_H_
6666#define _MACH_ARM_BOOLEAN_H_
6767
68#if defined (__arm__) || defined (__arm64__)
69
7068typedef int boolean_t;
7169
72#endif /* defined (__arm__) || defined (__arm64__) */
73
7470#endif /* _MACH_ARM_BOOLEAN_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/mach/arm/exception.h-3
......@@ -29,8 +29,6 @@
2929#ifndef _MACH_ARM_EXCEPTION_H_
3030#define _MACH_ARM_EXCEPTION_H_
3131
32#if defined (__arm__) || defined (__arm64__)
33
3432#define EXC_TYPES_COUNT 14 /* incl. illegal exception 0 */
3533
3634#define EXC_MASK_MACHINE 0
......@@ -77,6 +75,5 @@
7775
7876#define EXC_ARM_BREAKPOINT 1 /* breakpoint trap */
7977
80#endif /* defined (__arm__) || defined (__arm64__) */
8178
8279#endif /* _MACH_ARM_EXCEPTION_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/mach/arm/kern_return.h-4
......@@ -67,12 +67,8 @@
6767#ifndef _MACH_ARM_KERN_RETURN_H_
6868#define _MACH_ARM_KERN_RETURN_H_
6969
70#if defined (__arm__) || defined (__arm64__)
71
7270#ifndef ASSEMBLER
7371typedef int kern_return_t;
7472#endif /* ASSEMBLER */
7573
76#endif /* defined (__arm__) || defined (__arm64__) */
77
7874#endif /* _MACH_ARM_KERN_RETURN_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/mach/arm/processor_info.h-4
......@@ -29,8 +29,6 @@
2929#ifndef _MACH_ARM_PROCESSOR_INFO_H_
3030#define _MACH_ARM_PROCESSOR_INFO_H_
3131
32#if defined (__arm__) || defined (__arm64__)
33
3432#define PROCESSOR_CPU_STAT 0x10000003 /* Low-level CPU statistics */
3533#define PROCESSOR_CPU_STAT64 0x10000004 /* Low-level CPU statistics, in full 64-bit */
3634
......@@ -71,6 +69,4 @@ typedef struct processor_cpu_stat64 *processor_cpu_stat64_t;
7169#define PROCESSOR_CPU_STAT64_COUNT ((mach_msg_type_number_t) \
7270 (sizeof(processor_cpu_stat64_data_t) / sizeof(integer_t)))
7371
74#endif /* defined (__arm__) || defined (__arm64__) */
75
7672#endif /* _MACH_ARM_PROCESSOR_INFO_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/mach/arm/rpc.h-4
......@@ -32,8 +32,4 @@
3232#ifndef _MACH_ARM_RPC_H_
3333#define _MACH_ARM_RPC_H_
3434
35#if defined (__arm__) || defined (__arm64__)
36
37#endif /* defined (__arm__) || defined (__arm64__) */
38
3935#endif /* _MACH_ARM_RPC_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/mach/arm/thread_state.h+5-3
......@@ -32,11 +32,13 @@
3232#ifndef _MACH_ARM_THREAD_STATE_H_
3333#define _MACH_ARM_THREAD_STATE_H_
3434
35#if defined (__arm__) || defined (__arm64__)
36
3735/* Size of maximum exported thread state in words */
3836#define ARM_THREAD_STATE_MAX (1296) /* Size of biggest state possible */
3937
40#endif /* defined (__arm__) || defined (__arm64__) */
38#if defined (__arm__) || defined(__arm64__)
39#define THREAD_STATE_MAX ARM_THREAD_STATE_MAX
40#else
41#error Unsupported arch
42#endif
4143
4244#endif /* _MACH_ARM_THREAD_STATE_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/mach/arm/thread_status.h+23-9
......@@ -33,12 +33,10 @@
3333#ifndef _ARM_THREAD_STATUS_H_
3434#define _ARM_THREAD_STATUS_H_
3535
36#if defined (__arm__) || defined (__arm64__)
37
3836#include <mach/machine/_structs.h>
39#include <mach/machine/thread_state.h>
4037#include <mach/message.h>
4138#include <mach/vm_types.h>
39#include <mach/arm/thread_state.h>
4240
4341/*
4442 * Support for determining the state of a thread
......@@ -69,12 +67,13 @@
6967#define ARM_CPMU_STATE64 18
7068
7169
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)
7275#define ARM_PAGEIN_STATE 27
7376
74#ifndef ARM_STATE_FLAVOR_IS_OTHER_VALID
75#define ARM_STATE_FLAVOR_IS_OTHER_VALID(_flavor_) 0
76#endif
77
7877#define VALID_THREAD_STATE_FLAVOR(x) \
7978 ((x == ARM_THREAD_STATE) || \
8079 (x == ARM_VFP_STATE) || \
......@@ -171,6 +170,7 @@ typedef _STRUCT_ARM_NEON_STATE arm_neon_state_t;
171170typedef _STRUCT_ARM_NEON_STATE arm_neon_state32_t;
172171typedef _STRUCT_ARM_NEON_STATE64 arm_neon_state64_t;
173172
173typedef _STRUCT_ARM_AMX_STATE_V1 arm_amx_state_v1_t;
174174
175175typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state_t;
176176typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state32_t;
......@@ -224,12 +224,26 @@ typedef _STRUCT_ARM_LEGACY_DEBUG_STATE arm_debug_state_t;
224224#define MACHINE_THREAD_STATE_COUNT ARM_UNIFIED_THREAD_STATE_COUNT
225225
226226
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
227243/*
228244 * Largest state on this machine:
229245 */
230246#define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX
231247
232248
233#endif /* defined (__arm__) || defined (__arm64__) */
234
235249#endif /* _ARM_THREAD_STATUS_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/mach/arm/vm_param.h-4
......@@ -36,8 +36,6 @@
3636#ifndef _MACH_ARM_VM_PARAM_H_
3737#define _MACH_ARM_VM_PARAM_H_
3838
39#if defined (__arm__) || defined (__arm64__)
40
4139
4240#if !defined (KERNEL) && !defined (__ASSEMBLER__)
4341#include <mach/vm_page_size.h>
......@@ -106,6 +104,4 @@
106104
107105#define SWI_SYSCALL 0x80
108106
109#endif /* defined (__arm__) || defined (__arm64__) */
110
111107#endif /* _MACH_ARM_VM_PARAM_H_ */
\ No newline at end of file
lib/libc/include/aarch64-macos.11-none/mach/arm/vm_types.h+10-15
......@@ -67,14 +67,11 @@
6767#ifndef _MACH_ARM_VM_TYPES_H_
6868#define _MACH_ARM_VM_TYPES_H_
6969
70#if defined (__arm__) || defined (__arm64__)
71
7270#ifndef ASSEMBLER
7371
7472#include <arm/_types.h>
7573#include <stdint.h>
7674#include <Availability.h>
77#include <sys/cdefs.h>
7875
7976/*
8077 * natural_t and integer_t are Mach's legacy types for machine-
......@@ -101,18 +98,18 @@ typedef int integer_t;
10198 * e.g. an offset into a virtual memory space.
10299 */
103100#ifdef __LP64__
104typedef uintptr_t vm_offset_t __kernel_ptr_semantics;
101typedef uintptr_t vm_offset_t;
105102typedef uintptr_t vm_size_t;
106103
107typedef uint64_t mach_vm_address_t __kernel_ptr_semantics;
108typedef uint64_t mach_vm_offset_t __kernel_ptr_semantics;
104typedef uint64_t mach_vm_address_t;
105typedef uint64_t mach_vm_offset_t;
109106typedef uint64_t mach_vm_size_t;
110107
111typedef uint64_t vm_map_offset_t __kernel_ptr_semantics;
112typedef uint64_t vm_map_address_t __kernel_ptr_semantics;
108typedef uint64_t vm_map_offset_t;
109typedef uint64_t vm_map_address_t;
113110typedef uint64_t vm_map_size_t;
114111#else
115typedef natural_t vm_offset_t __kernel_ptr_semantics;
112typedef natural_t vm_offset_t;
116113/*
117114 * A vm_size_t is the proper type for e.g.
118115 * expressing the difference between two
......@@ -132,13 +129,13 @@ typedef uint32_t mach_vm_address_t;
132129typedef uint32_t mach_vm_offset_t;
133130typedef uint32_t mach_vm_size_t;
134131#else
135typedef uint64_t mach_vm_address_t __kernel_ptr_semantics;
136typedef uint64_t mach_vm_offset_t __kernel_ptr_semantics;
132typedef uint64_t mach_vm_address_t;
133typedef uint64_t mach_vm_offset_t;
137134typedef uint64_t mach_vm_size_t;
138135#endif
139136
140typedef uint32_t vm_map_offset_t __kernel_ptr_semantics;
141typedef uint32_t vm_map_address_t __kernel_ptr_semantics;
137typedef uint32_t vm_map_offset_t;
138typedef uint32_t vm_map_address_t;
142139typedef uint32_t vm_map_size_t;
143140#endif /* __LP64__ */
144141
......@@ -157,6 +154,4 @@ typedef vm_offset_t mach_port_context_t;
157154 */
158155#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32
159156
160#endif /* defined (__arm__) || defined (__arm64__) */
161
162157#endif /* _MACH_ARM_VM_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/AvailabilityMacros.h deleted-4016
......@@ -1,4016 +0,0 @@
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#define MAC_OS_VERSION_11_1 110100
122#define MAC_OS_VERSION_11_3 110300
123#define MAC_OS_VERSION_12_0 120000
124
125/*
126 * If min OS not specified, assume 10.4 for intel
127 * Note: compiler driver may set _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ based on MACOSX_DEPLOYMENT_TARGET environment variable
128 */
129#ifndef MAC_OS_X_VERSION_MIN_REQUIRED
130 #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
131 #if (__i386__ || __x86_64__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < MAC_OS_X_VERSION_10_4)
132 #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid.
133 #endif
134 #define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
135 #else
136 #if __i386__ || __x86_64__
137 #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4
138 #elif __arm__ || __arm64__
139 #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_5
140 #else
141 #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_1
142 #endif
143 #endif
144#endif
145
146/*
147 * if max OS not specified, assume larger of (10.15, min)
148 */
149#ifndef MAC_OS_X_VERSION_MAX_ALLOWED
150 #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_VERSION_12_0
151 #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED
152 #else
153 #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_VERSION_12_0
154 #endif
155#endif
156
157/*
158 * Error on bad values
159 */
160#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_MIN_REQUIRED
161 #error MAC_OS_X_VERSION_MAX_ALLOWED must be >= MAC_OS_X_VERSION_MIN_REQUIRED
162#endif
163#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_0
164 #error MAC_OS_X_VERSION_MIN_REQUIRED must be >= MAC_OS_X_VERSION_10_0
165#endif
166
167/*
168 * only certain compilers support __attribute__((weak_import))
169 */
170#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)
171 #define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
172#elif defined(__MWERKS__) && (__MWERKS__ >= 0x3205) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) && !defined(__INTEL__)
173 #define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
174#else
175 #define WEAK_IMPORT_ATTRIBUTE
176#endif
177
178/*
179 * only certain compilers support __attribute__((deprecated))
180 */
181#if defined(__has_feature) && defined(__has_attribute)
182 #if __has_attribute(deprecated)
183 #define DEPRECATED_ATTRIBUTE __attribute__((deprecated))
184 #if __has_feature(attribute_deprecated_with_message)
185 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
186 #else
187 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated))
188 #endif
189 #else
190 #define DEPRECATED_ATTRIBUTE
191 #define DEPRECATED_MSG_ATTRIBUTE(s)
192 #endif
193#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
194 #define DEPRECATED_ATTRIBUTE __attribute__((deprecated))
195 #if (__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))
196 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
197 #else
198 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated))
199 #endif
200#else
201 #define DEPRECATED_ATTRIBUTE
202 #define DEPRECATED_MSG_ATTRIBUTE(s)
203#endif
204
205/*
206 * only certain compilers support __attribute__((unavailable))
207 */
208#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
209 #define UNAVAILABLE_ATTRIBUTE __attribute__((unavailable))
210#else
211 #define UNAVAILABLE_ATTRIBUTE
212#endif
213
214
215/*
216 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
217 *
218 * Used on functions introduced in Mac OS X 10.0
219 */
220#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
221
222/*
223 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED
224 *
225 * Used on functions introduced in Mac OS X 10.0,
226 * and deprecated in Mac OS X 10.0
227 */
228#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
229
230/*
231 * DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER
232 *
233 * Used on types deprecated in Mac OS X 10.0
234 */
235#define DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER DEPRECATED_ATTRIBUTE
236
237#ifndef __AVAILABILITY_MACROS_USES_AVAILABILITY
238 #ifdef __has_attribute
239 #if __has_attribute(availability)
240 #include <Availability.h>
241 #define __AVAILABILITY_MACROS_USES_AVAILABILITY 1
242 #endif
243 #endif
244#endif
245
246#if TARGET_OS_OSX
247#define __IPHONE_COMPAT_VERSION __IPHONE_NA
248#elif TARGET_OS_MACCATALYST
249#define __IPHONE_COMPAT_VERSION __IPHONE_NA
250#else
251#define __IPHONE_COMPAT_VERSION __IPHONE_4_0
252#endif
253
254/*
255 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
256 *
257 * Used on declarations introduced in Mac OS X 10.1
258 */
259#if __AVAILABILITY_MACROS_USES_AVAILABILITY
260 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_COMPAT_VERSION)
261#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_1
262 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER UNAVAILABLE_ATTRIBUTE
263#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_1
264 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER WEAK_IMPORT_ATTRIBUTE
265#else
266 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
267#endif
268
269/*
270 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED
271 *
272 * Used on declarations introduced in Mac OS X 10.1,
273 * and deprecated in Mac OS X 10.1
274 */
275#if __AVAILABILITY_MACROS_USES_AVAILABILITY
276 #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)
277#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
278 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
279#else
280 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
281#endif
282
283/*
284 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1
285 *
286 * Used on declarations introduced in Mac OS X 10.0,
287 * but later deprecated in Mac OS X 10.1
288 */
289#if __AVAILABILITY_MACROS_USES_AVAILABILITY
290 #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)
291#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
292 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 DEPRECATED_ATTRIBUTE
293#else
294 #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
295#endif
296
297/*
298 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
299 *
300 * Used on declarations introduced in Mac OS X 10.2
301 */
302#if __AVAILABILITY_MACROS_USES_AVAILABILITY
303 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_COMPAT_VERSION)
304#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2
305 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER UNAVAILABLE_ATTRIBUTE
306#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2
307 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
308#else
309 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
310#endif
311
312/*
313 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED
314 *
315 * Used on declarations introduced in Mac OS X 10.2,
316 * and deprecated in Mac OS X 10.2
317 */
318#if __AVAILABILITY_MACROS_USES_AVAILABILITY
319 #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)
320#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
321 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
322#else
323 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
324#endif
325
326/*
327 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2
328 *
329 * Used on declarations introduced in Mac OS X 10.0,
330 * but later deprecated in Mac OS X 10.2
331 */
332#if __AVAILABILITY_MACROS_USES_AVAILABILITY
333 #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)
334#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
335 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE
336#else
337 #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
338#endif
339
340/*
341 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2
342 *
343 * Used on declarations introduced in Mac OS X 10.1,
344 * but later deprecated in Mac OS X 10.2
345 */
346#if __AVAILABILITY_MACROS_USES_AVAILABILITY
347 #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)
348#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
349 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE
350#else
351 #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
352#endif
353
354/*
355 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
356 *
357 * Used on declarations introduced in Mac OS X 10.3
358 */
359#if __AVAILABILITY_MACROS_USES_AVAILABILITY
360 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_COMPAT_VERSION)
361#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3
362 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER UNAVAILABLE_ATTRIBUTE
363#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3
364 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
365#else
366 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
367#endif
368
369/*
370 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED
371 *
372 * Used on declarations introduced in Mac OS X 10.3,
373 * and deprecated in Mac OS X 10.3
374 */
375#if __AVAILABILITY_MACROS_USES_AVAILABILITY
376 #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)
377#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
378 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
379#else
380 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
381#endif
382
383/*
384 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
385 *
386 * Used on declarations introduced in Mac OS X 10.0,
387 * but later deprecated in Mac OS X 10.3
388 */
389#if __AVAILABILITY_MACROS_USES_AVAILABILITY
390 #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)
391#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
392 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
393#else
394 #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
395#endif
396
397/*
398 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
399 *
400 * Used on declarations introduced in Mac OS X 10.1,
401 * but later deprecated in Mac OS X 10.3
402 */
403#if __AVAILABILITY_MACROS_USES_AVAILABILITY
404 #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)
405#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
406 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
407#else
408 #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
409#endif
410
411/*
412 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
413 *
414 * Used on declarations introduced in Mac OS X 10.2,
415 * but later deprecated in Mac OS X 10.3
416 */
417#if __AVAILABILITY_MACROS_USES_AVAILABILITY
418 #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)
419#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
420 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
421#else
422 #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
423#endif
424
425/*
426 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
427 *
428 * Used on declarations introduced in Mac OS X 10.4
429 */
430#if __AVAILABILITY_MACROS_USES_AVAILABILITY
431 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_COMPAT_VERSION)
432#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
433 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER UNAVAILABLE_ATTRIBUTE
434#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4
435 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
436#else
437 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
438#endif
439
440/*
441 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED
442 *
443 * Used on declarations introduced in Mac OS X 10.4,
444 * and deprecated in Mac OS X 10.4
445 */
446#if __AVAILABILITY_MACROS_USES_AVAILABILITY
447 #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)
448#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
449 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
450#else
451 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
452#endif
453
454/*
455 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
456 *
457 * Used on declarations introduced in Mac OS X 10.0,
458 * but later deprecated in Mac OS X 10.4
459 */
460#if __AVAILABILITY_MACROS_USES_AVAILABILITY
461 #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)
462#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
463 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
464#else
465 #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
466#endif
467
468/*
469 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
470 *
471 * Used on declarations introduced in Mac OS X 10.1,
472 * but later deprecated in Mac OS X 10.4
473 */
474#if __AVAILABILITY_MACROS_USES_AVAILABILITY
475 #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)
476#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
477 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
478#else
479 #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
480#endif
481
482/*
483 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
484 *
485 * Used on declarations introduced in Mac OS X 10.2,
486 * but later deprecated in Mac OS X 10.4
487 */
488#if __AVAILABILITY_MACROS_USES_AVAILABILITY
489 #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)
490#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
491 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
492#else
493 #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
494#endif
495
496/*
497 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
498 *
499 * Used on declarations introduced in Mac OS X 10.3,
500 * but later deprecated in Mac OS X 10.4
501 */
502#if __AVAILABILITY_MACROS_USES_AVAILABILITY
503 #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)
504#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
505 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
506#else
507 #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
508#endif
509
510/*
511 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
512 *
513 * Used on declarations introduced in Mac OS X 10.5
514 */
515#if __AVAILABILITY_MACROS_USES_AVAILABILITY
516 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_COMPAT_VERSION)
517#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
518 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER UNAVAILABLE_ATTRIBUTE
519#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
520 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER WEAK_IMPORT_ATTRIBUTE
521#else
522 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
523#endif
524
525/*
526 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED
527 *
528 * Used on declarations introduced in Mac OS X 10.5,
529 * and deprecated in Mac OS X 10.5
530 */
531#if __AVAILABILITY_MACROS_USES_AVAILABILITY
532 #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)
533#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
534 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
535#else
536 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
537#endif
538
539/*
540 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
541 *
542 * Used on declarations introduced in Mac OS X 10.0,
543 * but later deprecated in Mac OS X 10.5
544 */
545#if __AVAILABILITY_MACROS_USES_AVAILABILITY
546 #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)
547#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
548 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
549#else
550 #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
551#endif
552
553/*
554 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
555 *
556 * Used on declarations introduced in Mac OS X 10.1,
557 * but later deprecated in Mac OS X 10.5
558 */
559#if __AVAILABILITY_MACROS_USES_AVAILABILITY
560 #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)
561#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
562 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
563#else
564 #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
565#endif
566
567/*
568 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
569 *
570 * Used on declarations introduced in Mac OS X 10.2,
571 * but later deprecated in Mac OS X 10.5
572 */
573#if __AVAILABILITY_MACROS_USES_AVAILABILITY
574 #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)
575#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
576 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
577#else
578 #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
579#endif
580
581/*
582 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
583 *
584 * Used on declarations introduced in Mac OS X 10.3,
585 * but later deprecated in Mac OS X 10.5
586 */
587#if __AVAILABILITY_MACROS_USES_AVAILABILITY
588 #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)
589#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
590 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
591#else
592 #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
593#endif
594
595/*
596 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
597 *
598 * Used on declarations introduced in Mac OS X 10.4,
599 * but later deprecated in Mac OS X 10.5
600 */
601#if __AVAILABILITY_MACROS_USES_AVAILABILITY
602 #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)
603#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
604 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
605#else
606 #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
607#endif
608
609/*
610 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
611 *
612 * Used on declarations introduced in Mac OS X 10.6
613 */
614#if __AVAILABILITY_MACROS_USES_AVAILABILITY
615 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_COMPAT_VERSION)
616#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
617 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER UNAVAILABLE_ATTRIBUTE
618#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
619 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER WEAK_IMPORT_ATTRIBUTE
620#else
621 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
622#endif
623
624/*
625 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED
626 *
627 * Used on declarations introduced in Mac OS X 10.6,
628 * and deprecated in Mac OS X 10.6
629 */
630#if __AVAILABILITY_MACROS_USES_AVAILABILITY
631 #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)
632#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
633 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
634#else
635 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
636#endif
637
638/*
639 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
640 *
641 * Used on declarations introduced in Mac OS X 10.0,
642 * but later deprecated in Mac OS X 10.6
643 */
644#if __AVAILABILITY_MACROS_USES_AVAILABILITY
645 #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)
646#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
647 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
648#else
649 #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
650#endif
651
652/*
653 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
654 *
655 * Used on declarations introduced in Mac OS X 10.1,
656 * but later deprecated in Mac OS X 10.6
657 */
658#if __AVAILABILITY_MACROS_USES_AVAILABILITY
659 #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)
660#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
661 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
662#else
663 #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
664#endif
665
666/*
667 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
668 *
669 * Used on declarations introduced in Mac OS X 10.2,
670 * but later deprecated in Mac OS X 10.6
671 */
672#if __AVAILABILITY_MACROS_USES_AVAILABILITY
673 #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)
674#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
675 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
676#else
677 #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
678#endif
679
680/*
681 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
682 *
683 * Used on declarations introduced in Mac OS X 10.3,
684 * but later deprecated in Mac OS X 10.6
685 */
686#if __AVAILABILITY_MACROS_USES_AVAILABILITY
687 #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)
688#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
689 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
690#else
691 #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
692#endif
693
694/*
695 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
696 *
697 * Used on declarations introduced in Mac OS X 10.4,
698 * but later deprecated in Mac OS X 10.6
699 */
700#if __AVAILABILITY_MACROS_USES_AVAILABILITY
701 #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)
702#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
703 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
704#else
705 #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
706#endif
707
708/*
709 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
710 *
711 * Used on declarations introduced in Mac OS X 10.5,
712 * but later deprecated in Mac OS X 10.6
713 */
714#if __AVAILABILITY_MACROS_USES_AVAILABILITY
715 #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)
716#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
717 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
718#else
719 #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
720#endif
721
722/*
723 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
724 *
725 * Used on declarations introduced in Mac OS X 10.7
726 */
727#if __AVAILABILITY_MACROS_USES_AVAILABILITY
728 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_COMPAT_VERSION)
729#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
730 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER UNAVAILABLE_ATTRIBUTE
731#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
732 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER WEAK_IMPORT_ATTRIBUTE
733#else
734 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
735#endif
736
737/*
738 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED
739 *
740 * Used on declarations introduced in Mac OS X 10.7,
741 * and deprecated in Mac OS X 10.7
742 */
743#if __AVAILABILITY_MACROS_USES_AVAILABILITY
744 #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)
745#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
746 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
747#else
748 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
749#endif
750
751/*
752 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
753 *
754 * Used on declarations introduced in Mac OS X 10.0,
755 * but later deprecated in Mac OS X 10.7
756 */
757#if __AVAILABILITY_MACROS_USES_AVAILABILITY
758 #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)
759#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
760 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
761#else
762 #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
763#endif
764
765/*
766 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
767 *
768 * Used on declarations introduced in Mac OS X 10.1,
769 * but later deprecated in Mac OS X 10.7
770 */
771#if __AVAILABILITY_MACROS_USES_AVAILABILITY
772 #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)
773#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
774 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
775#else
776 #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
777#endif
778
779/*
780 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
781 *
782 * Used on declarations introduced in Mac OS X 10.2,
783 * but later deprecated in Mac OS X 10.7
784 */
785#if __AVAILABILITY_MACROS_USES_AVAILABILITY
786 #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)
787#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
788 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
789#else
790 #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
791#endif
792
793/*
794 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
795 *
796 * Used on declarations introduced in Mac OS X 10.3,
797 * but later deprecated in Mac OS X 10.7
798 */
799#if __AVAILABILITY_MACROS_USES_AVAILABILITY
800 #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)
801#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
802 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
803#else
804 #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
805#endif
806
807/*
808 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
809 *
810 * Used on declarations introduced in Mac OS X 10.4,
811 * but later deprecated in Mac OS X 10.7
812 */
813#if __AVAILABILITY_MACROS_USES_AVAILABILITY
814 #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)
815#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
816 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
817#else
818 #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
819#endif
820
821/*
822 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
823 *
824 * Used on declarations introduced in Mac OS X 10.5,
825 * but later deprecated in Mac OS X 10.7
826 */
827#if __AVAILABILITY_MACROS_USES_AVAILABILITY
828 #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)
829#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
830 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
831#else
832 #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
833#endif
834
835/*
836 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
837 *
838 * Used on declarations introduced in Mac OS X 10.6,
839 * but later deprecated in Mac OS X 10.7
840 */
841#if __AVAILABILITY_MACROS_USES_AVAILABILITY
842 #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)
843#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
844 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
845#else
846 #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
847#endif
848
849/*
850 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_13
851 *
852 * Used on declarations introduced in Mac OS X 10.6,
853 * but later deprecated in Mac OS X 10.13
854 */
855#if __AVAILABILITY_MACROS_USES_AVAILABILITY
856#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)
857#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
858#define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_13 DEPRECATED_ATTRIBUTE
859#else
860#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
861#endif
862
863/*
864 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
865 *
866 * Used on declarations introduced in Mac OS X 10.8
867 */
868#if __AVAILABILITY_MACROS_USES_AVAILABILITY
869 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_COMPAT_VERSION)
870#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8
871 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER UNAVAILABLE_ATTRIBUTE
872#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
873 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER WEAK_IMPORT_ATTRIBUTE
874#else
875 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
876#endif
877
878/*
879 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED
880 *
881 * Used on declarations introduced in Mac OS X 10.8,
882 * and deprecated in Mac OS X 10.8
883 */
884#if __AVAILABILITY_MACROS_USES_AVAILABILITY
885 #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)
886#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
887 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
888#else
889 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
890#endif
891
892/*
893 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
894 *
895 * Used on declarations introduced in Mac OS X 10.0,
896 * but later deprecated in Mac OS X 10.8
897 */
898#if __AVAILABILITY_MACROS_USES_AVAILABILITY
899 #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)
900#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
901 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
902#else
903 #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
904#endif
905
906/*
907 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
908 *
909 * Used on declarations introduced in Mac OS X 10.1,
910 * but later deprecated in Mac OS X 10.8
911 */
912#if __AVAILABILITY_MACROS_USES_AVAILABILITY
913 #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)
914#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
915 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
916#else
917 #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
918#endif
919
920/*
921 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
922 *
923 * Used on declarations introduced in Mac OS X 10.2,
924 * but later deprecated in Mac OS X 10.8
925 */
926#if __AVAILABILITY_MACROS_USES_AVAILABILITY
927 #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)
928#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
929 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
930#else
931 #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
932#endif
933
934/*
935 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
936 *
937 * Used on declarations introduced in Mac OS X 10.3,
938 * but later deprecated in Mac OS X 10.8
939 */
940#if __AVAILABILITY_MACROS_USES_AVAILABILITY
941 #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)
942#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
943 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
944#else
945 #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
946#endif
947
948/*
949 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
950 *
951 * Used on declarations introduced in Mac OS X 10.4,
952 * but later deprecated in Mac OS X 10.8
953 */
954#if __AVAILABILITY_MACROS_USES_AVAILABILITY
955 #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)
956#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
957 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
958#else
959 #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
960#endif
961
962/*
963 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
964 *
965 * Used on declarations introduced in Mac OS X 10.5,
966 * but later deprecated in Mac OS X 10.8
967 */
968#if __AVAILABILITY_MACROS_USES_AVAILABILITY
969 #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)
970#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
971 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
972#else
973 #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
974#endif
975
976/*
977 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
978 *
979 * Used on declarations introduced in Mac OS X 10.6,
980 * but later deprecated in Mac OS X 10.8
981 */
982#if __AVAILABILITY_MACROS_USES_AVAILABILITY
983 #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)
984#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
985 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
986#else
987 #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
988#endif
989
990/*
991 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
992 *
993 * Used on declarations introduced in Mac OS X 10.7,
994 * but later deprecated in Mac OS X 10.8
995 */
996#if __AVAILABILITY_MACROS_USES_AVAILABILITY
997 #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)
998#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
999 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
1000#else
1001 #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
1002#endif
1003
1004/*
1005 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
1006 *
1007 * Used on declarations introduced in Mac OS X 10.9
1008 */
1009#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1010 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_COMPAT_VERSION)
1011#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
1012 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER UNAVAILABLE_ATTRIBUTE
1013#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9
1014 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER WEAK_IMPORT_ATTRIBUTE
1015#else
1016 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
1017#endif
1018
1019/*
1020 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED
1021 *
1022 * Used on declarations introduced in Mac OS X 10.9,
1023 * and deprecated in Mac OS X 10.9
1024 */
1025#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1026 #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)
1027#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1028 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1029#else
1030 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
1031#endif
1032
1033/*
1034 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1035 *
1036 * Used on declarations introduced in Mac OS X 10.0,
1037 * but later deprecated in Mac OS X 10.9
1038 */
1039#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1040 #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)
1041#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1042 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1043#else
1044 #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
1045#endif
1046
1047/*
1048 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1049 *
1050 * Used on declarations introduced in Mac OS X 10.1,
1051 * but later deprecated in Mac OS X 10.9
1052 */
1053#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1054 #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)
1055#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1056 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1057#else
1058 #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
1059#endif
1060
1061/*
1062 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1063 *
1064 * Used on declarations introduced in Mac OS X 10.2,
1065 * but later deprecated in Mac OS X 10.9
1066 */
1067#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1068 #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)
1069#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1070 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1071#else
1072 #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
1073#endif
1074
1075/*
1076 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1077 *
1078 * Used on declarations introduced in Mac OS X 10.3,
1079 * but later deprecated in Mac OS X 10.9
1080 */
1081#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1082 #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)
1083#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1084 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1085#else
1086 #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
1087#endif
1088
1089/*
1090 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1091 *
1092 * Used on declarations introduced in Mac OS X 10.4,
1093 * but later deprecated in Mac OS X 10.9
1094 */
1095#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1096 #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)
1097#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1098 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1099#else
1100 #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
1101#endif
1102
1103/*
1104 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1105 *
1106 * Used on declarations introduced in Mac OS X 10.5,
1107 * but later deprecated in Mac OS X 10.9
1108 */
1109#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1110 #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)
1111#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1112 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1113#else
1114 #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
1115#endif
1116
1117/*
1118 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1119 *
1120 * Used on declarations introduced in Mac OS X 10.6,
1121 * but later deprecated in Mac OS X 10.9
1122 */
1123#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1124 #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)
1125#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1126 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1127#else
1128 #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
1129#endif
1130
1131/*
1132 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1133 *
1134 * Used on declarations introduced in Mac OS X 10.7,
1135 * but later deprecated in Mac OS X 10.9
1136 */
1137#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1138 #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)
1139#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1140 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1141#else
1142 #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
1143#endif
1144
1145/*
1146 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1147 *
1148 * Used on declarations introduced in Mac OS X 10.8,
1149 * but later deprecated in Mac OS X 10.9
1150 */
1151#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1152 #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)
1153#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1154 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1155#else
1156 #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
1157#endif
1158
1159/*
1160 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
1161 *
1162 * Used on declarations introduced in Mac OS X 10.10
1163 */
1164#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1165 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_COMPAT_VERSION)
1166#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10
1167 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER UNAVAILABLE_ATTRIBUTE
1168#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
1169 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER WEAK_IMPORT_ATTRIBUTE
1170#else
1171 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
1172#endif
1173
1174/*
1175 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED
1176 *
1177 * Used on declarations introduced in Mac OS X 10.10,
1178 * and deprecated in Mac OS X 10.10
1179 */
1180#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1181 #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)
1182#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1183 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1184#else
1185 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
1186#endif
1187
1188/*
1189 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1190 *
1191 * Used on declarations introduced in Mac OS X 10.0,
1192 * but later deprecated in Mac OS X 10.10
1193 */
1194#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1195 #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)
1196#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1197 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1198#else
1199 #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
1200#endif
1201
1202/*
1203 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1204 *
1205 * Used on declarations introduced in Mac OS X 10.1,
1206 * but later deprecated in Mac OS X 10.10
1207 */
1208#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1209 #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)
1210#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1211 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1212#else
1213 #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
1214#endif
1215
1216/*
1217 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1218 *
1219 * Used on declarations introduced in Mac OS X 10.2,
1220 * but later deprecated in Mac OS X 10.10
1221 */
1222#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1223 #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)
1224#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1225 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1226#else
1227 #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
1228#endif
1229
1230/*
1231 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1232 *
1233 * Used on declarations introduced in Mac OS X 10.3,
1234 * but later deprecated in Mac OS X 10.10
1235 */
1236#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1237 #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)
1238#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1239 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1240#else
1241 #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
1242#endif
1243
1244/*
1245 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1246 *
1247 * Used on declarations introduced in Mac OS X 10.4,
1248 * but later deprecated in Mac OS X 10.10
1249 */
1250#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1251 #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)
1252#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1253 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1254#else
1255 #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
1256#endif
1257
1258/*
1259 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1260 *
1261 * Used on declarations introduced in Mac OS X 10.5,
1262 * but later deprecated in Mac OS X 10.10
1263 */
1264#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1265 #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)
1266#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1267 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1268#else
1269 #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
1270#endif
1271
1272/*
1273 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1274 *
1275 * Used on declarations introduced in Mac OS X 10.6,
1276 * but later deprecated in Mac OS X 10.10
1277 */
1278#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1279 #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)
1280#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1281 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1282#else
1283 #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
1284#endif
1285
1286/*
1287 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1288 *
1289 * Used on declarations introduced in Mac OS X 10.7,
1290 * but later deprecated in Mac OS X 10.10
1291 */
1292#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1293 #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)
1294#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1295 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1296#else
1297 #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
1298#endif
1299
1300/*
1301 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1302 *
1303 * Used on declarations introduced in Mac OS X 10.8,
1304 * but later deprecated in Mac OS X 10.10
1305 */
1306#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1307 #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)
1308#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1309 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1310#else
1311 #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
1312#endif
1313
1314/*
1315 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1316 *
1317 * Used on declarations introduced in Mac OS X 10.9,
1318 * but later deprecated in Mac OS X 10.10
1319 */
1320#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1321 #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)
1322#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1323 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1324#else
1325 #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
1326#endif
1327
1328/*
1329 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER
1330 *
1331 * Used on declarations introduced in Mac OS X 10.10.2
1332 */
1333#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1334 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10_2, __IPHONE_COMPAT_VERSION)
1335#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10_2
1336 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER UNAVAILABLE_ATTRIBUTE
1337#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10_2
1338 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
1339#else
1340 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER
1341#endif
1342
1343/*
1344 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED
1345 *
1346 * Used on declarations introduced in Mac OS X 10.10.2,
1347 * and deprecated in Mac OS X 10.10.2
1348 */
1349#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1350 #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)
1351#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1352 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1353#else
1354 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER
1355#endif
1356
1357/*
1358 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1359 *
1360 * Used on declarations introduced in Mac OS X 10.0,
1361 * but later deprecated in Mac OS X 10.10.2
1362 */
1363#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1364 #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)
1365#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1366 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1367#else
1368 #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
1369#endif
1370
1371/*
1372 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1373 *
1374 * Used on declarations introduced in Mac OS X 10.1,
1375 * but later deprecated in Mac OS X 10.10.2
1376 */
1377#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1378 #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)
1379#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1380 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1381#else
1382 #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
1383#endif
1384
1385/*
1386 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1387 *
1388 * Used on declarations introduced in Mac OS X 10.2,
1389 * but later deprecated in Mac OS X 10.10.2
1390 */
1391#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1392 #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)
1393#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1394 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1395#else
1396 #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
1397#endif
1398
1399/*
1400 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1401 *
1402 * Used on declarations introduced in Mac OS X 10.3,
1403 * but later deprecated in Mac OS X 10.10.2
1404 */
1405#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1406 #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)
1407#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1408 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1409#else
1410 #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
1411#endif
1412
1413/*
1414 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1415 *
1416 * Used on declarations introduced in Mac OS X 10.4,
1417 * but later deprecated in Mac OS X 10.10.2
1418 */
1419#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1420 #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)
1421#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1422 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1423#else
1424 #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
1425#endif
1426
1427/*
1428 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1429 *
1430 * Used on declarations introduced in Mac OS X 10.5,
1431 * but later deprecated in Mac OS X 10.10.2
1432 */
1433#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1434 #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)
1435#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1436 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1437#else
1438 #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
1439#endif
1440
1441/*
1442 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1443 *
1444 * Used on declarations introduced in Mac OS X 10.6,
1445 * but later deprecated in Mac OS X 10.10.2
1446 */
1447#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1448 #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)
1449#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1450 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1451#else
1452 #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
1453#endif
1454
1455/*
1456 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1457 *
1458 * Used on declarations introduced in Mac OS X 10.7,
1459 * but later deprecated in Mac OS X 10.10.2
1460 */
1461#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1462 #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)
1463#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1464 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1465#else
1466 #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
1467#endif
1468
1469/*
1470 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1471 *
1472 * Used on declarations introduced in Mac OS X 10.8,
1473 * but later deprecated in Mac OS X 10.10.2
1474 */
1475#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1476 #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)
1477#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1478 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1479#else
1480 #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
1481#endif
1482
1483/*
1484 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1485 *
1486 * Used on declarations introduced in Mac OS X 10.9,
1487 * but later deprecated in Mac OS X 10.10.2
1488 */
1489#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1490 #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)
1491#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1492 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1493#else
1494 #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
1495#endif
1496
1497/*
1498 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1499 *
1500 * Used on declarations introduced in Mac OS X 10.10,
1501 * but later deprecated in Mac OS X 10.10.2
1502 */
1503#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1504 #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)
1505#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1506 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1507#else
1508 #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
1509#endif
1510
1511/*
1512 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER
1513 *
1514 * Used on declarations introduced in Mac OS X 10.10.3
1515 */
1516#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1517 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10_3, __IPHONE_COMPAT_VERSION)
1518#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10_3
1519 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER UNAVAILABLE_ATTRIBUTE
1520#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10_3
1521 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
1522#else
1523 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER
1524#endif
1525
1526/*
1527 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED
1528 *
1529 * Used on declarations introduced in Mac OS X 10.10.3,
1530 * and deprecated in Mac OS X 10.10.3
1531 */
1532#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1533 #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)
1534#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1535 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1536#else
1537 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER
1538#endif
1539
1540/*
1541 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1542 *
1543 * Used on declarations introduced in Mac OS X 10.0,
1544 * but later deprecated in Mac OS X 10.10.3
1545 */
1546#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1547 #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)
1548#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1549 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1550#else
1551 #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
1552#endif
1553
1554/*
1555 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1556 *
1557 * Used on declarations introduced in Mac OS X 10.1,
1558 * but later deprecated in Mac OS X 10.10.3
1559 */
1560#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1561 #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)
1562#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1563 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1564#else
1565 #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
1566#endif
1567
1568/*
1569 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1570 *
1571 * Used on declarations introduced in Mac OS X 10.2,
1572 * but later deprecated in Mac OS X 10.10.3
1573 */
1574#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1575 #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)
1576#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1577 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1578#else
1579 #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
1580#endif
1581
1582/*
1583 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1584 *
1585 * Used on declarations introduced in Mac OS X 10.3,
1586 * but later deprecated in Mac OS X 10.10.3
1587 */
1588#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1589 #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)
1590#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1591 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1592#else
1593 #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
1594#endif
1595
1596/*
1597 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1598 *
1599 * Used on declarations introduced in Mac OS X 10.4,
1600 * but later deprecated in Mac OS X 10.10.3
1601 */
1602#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1603 #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)
1604#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1605 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1606#else
1607 #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
1608#endif
1609
1610/*
1611 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1612 *
1613 * Used on declarations introduced in Mac OS X 10.5,
1614 * but later deprecated in Mac OS X 10.10.3
1615 */
1616#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1617 #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)
1618#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1619 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1620#else
1621 #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
1622#endif
1623
1624/*
1625 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1626 *
1627 * Used on declarations introduced in Mac OS X 10.6,
1628 * but later deprecated in Mac OS X 10.10.3
1629 */
1630#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1631 #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)
1632#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1633 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1634#else
1635 #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
1636#endif
1637
1638/*
1639 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1640 *
1641 * Used on declarations introduced in Mac OS X 10.7,
1642 * but later deprecated in Mac OS X 10.10.3
1643 */
1644#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1645 #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)
1646#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1647 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1648#else
1649 #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
1650#endif
1651
1652/*
1653 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1654 *
1655 * Used on declarations introduced in Mac OS X 10.8,
1656 * but later deprecated in Mac OS X 10.10.3
1657 */
1658#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1659 #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)
1660#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1661 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1662#else
1663 #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
1664#endif
1665
1666/*
1667 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1668 *
1669 * Used on declarations introduced in Mac OS X 10.9,
1670 * but later deprecated in Mac OS X 10.10.3
1671 */
1672#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1673 #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)
1674#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1675 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1676#else
1677 #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
1678#endif
1679
1680/*
1681 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1682 *
1683 * Used on declarations introduced in Mac OS X 10.10,
1684 * but later deprecated in Mac OS X 10.10.3
1685 */
1686#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1687 #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)
1688#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1689 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1690#else
1691 #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
1692#endif
1693
1694/*
1695 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1696 *
1697 * Used on declarations introduced in Mac OS X 10.10.2,
1698 * but later deprecated in Mac OS X 10.10.3
1699 */
1700#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1701 #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)
1702#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1703 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1704#else
1705 #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
1706#endif
1707
1708/*
1709 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER
1710 *
1711 * Used on declarations introduced in Mac OS X 10.11
1712 */
1713#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1714 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_COMPAT_VERSION)
1715#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11
1716 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER UNAVAILABLE_ATTRIBUTE
1717#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11
1718 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER WEAK_IMPORT_ATTRIBUTE
1719#else
1720 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER
1721#endif
1722
1723/*
1724 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED
1725 *
1726 * Used on declarations introduced in Mac OS X 10.11,
1727 * and deprecated in Mac OS X 10.11
1728 */
1729#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1730 #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)
1731#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1732 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1733#else
1734 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER
1735#endif
1736
1737/*
1738 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1739 *
1740 * Used on declarations introduced in Mac OS X 10.0,
1741 * but later deprecated in Mac OS X 10.11
1742 */
1743#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1744 #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)
1745#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1746 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1747#else
1748 #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
1749#endif
1750
1751/*
1752 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1753 *
1754 * Used on declarations introduced in Mac OS X 10.1,
1755 * but later deprecated in Mac OS X 10.11
1756 */
1757#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1758 #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)
1759#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1760 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1761#else
1762 #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
1763#endif
1764
1765/*
1766 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1767 *
1768 * Used on declarations introduced in Mac OS X 10.2,
1769 * but later deprecated in Mac OS X 10.11
1770 */
1771#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1772 #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)
1773#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1774 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1775#else
1776 #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
1777#endif
1778
1779/*
1780 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1781 *
1782 * Used on declarations introduced in Mac OS X 10.3,
1783 * but later deprecated in Mac OS X 10.11
1784 */
1785#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1786 #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)
1787#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1788 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1789#else
1790 #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
1791#endif
1792
1793/*
1794 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1795 *
1796 * Used on declarations introduced in Mac OS X 10.4,
1797 * but later deprecated in Mac OS X 10.11
1798 */
1799#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1800 #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)
1801#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1802 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1803#else
1804 #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
1805#endif
1806
1807/*
1808 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1809 *
1810 * Used on declarations introduced in Mac OS X 10.5,
1811 * but later deprecated in Mac OS X 10.11
1812 */
1813#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1814 #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)
1815#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1816 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1817#else
1818 #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
1819#endif
1820
1821/*
1822 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1823 *
1824 * Used on declarations introduced in Mac OS X 10.6,
1825 * but later deprecated in Mac OS X 10.11
1826 */
1827#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1828 #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)
1829#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1830 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1831#else
1832 #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
1833#endif
1834
1835/*
1836 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1837 *
1838 * Used on declarations introduced in Mac OS X 10.7,
1839 * but later deprecated in Mac OS X 10.11
1840 */
1841#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1842 #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)
1843#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1844 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1845#else
1846 #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
1847#endif
1848
1849/*
1850 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1851 *
1852 * Used on declarations introduced in Mac OS X 10.8,
1853 * but later deprecated in Mac OS X 10.11
1854 */
1855#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1856 #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)
1857#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1858 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1859#else
1860 #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
1861#endif
1862
1863/*
1864 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1865 *
1866 * Used on declarations introduced in Mac OS X 10.9,
1867 * but later deprecated in Mac OS X 10.11
1868 */
1869#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1870 #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)
1871#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1872 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1873#else
1874 #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
1875#endif
1876
1877/*
1878 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1879 *
1880 * Used on declarations introduced in Mac OS X 10.10,
1881 * but later deprecated in Mac OS X 10.11
1882 */
1883#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1884 #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)
1885#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1886 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1887#else
1888 #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
1889#endif
1890
1891/*
1892 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1893 *
1894 * Used on declarations introduced in Mac OS X 10.10.2,
1895 * but later deprecated in Mac OS X 10.11
1896 */
1897#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1898 #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)
1899#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1900 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1901#else
1902 #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
1903#endif
1904
1905/*
1906 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1907 *
1908 * Used on declarations introduced in Mac OS X 10.10.3,
1909 * but later deprecated in Mac OS X 10.11
1910 */
1911#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1912 #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)
1913#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1914 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1915#else
1916 #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
1917#endif
1918
1919/*
1920 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER
1921 *
1922 * Used on declarations introduced in Mac OS X 10.11.2
1923 */
1924#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1925 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_2, __IPHONE_COMPAT_VERSION)
1926#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_2
1927 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER UNAVAILABLE_ATTRIBUTE
1928#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_2
1929 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
1930#else
1931 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER
1932#endif
1933
1934/*
1935 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED
1936 *
1937 * Used on declarations introduced in Mac OS X 10.11.2,
1938 * and deprecated in Mac OS X 10.11.2
1939 */
1940#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1941 #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)
1942#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1943 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1944#else
1945 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER
1946#endif
1947
1948/*
1949 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1950 *
1951 * Used on declarations introduced in Mac OS X 10.0,
1952 * but later deprecated in Mac OS X 10.11.2
1953 */
1954#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1955 #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)
1956#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1957 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
1958#else
1959 #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
1960#endif
1961
1962/*
1963 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1964 *
1965 * Used on declarations introduced in Mac OS X 10.1,
1966 * but later deprecated in Mac OS X 10.11.2
1967 */
1968#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1969 #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)
1970#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1971 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
1972#else
1973 #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
1974#endif
1975
1976/*
1977 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1978 *
1979 * Used on declarations introduced in Mac OS X 10.2,
1980 * but later deprecated in Mac OS X 10.11.2
1981 */
1982#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1983 #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)
1984#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1985 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
1986#else
1987 #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
1988#endif
1989
1990/*
1991 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1992 *
1993 * Used on declarations introduced in Mac OS X 10.3,
1994 * but later deprecated in Mac OS X 10.11.2
1995 */
1996#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1997 #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)
1998#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1999 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2000#else
2001 #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
2002#endif
2003
2004/*
2005 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2006 *
2007 * Used on declarations introduced in Mac OS X 10.4,
2008 * but later deprecated in Mac OS X 10.11.2
2009 */
2010#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2011 #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)
2012#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2013 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2014#else
2015 #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
2016#endif
2017
2018/*
2019 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2020 *
2021 * Used on declarations introduced in Mac OS X 10.5,
2022 * but later deprecated in Mac OS X 10.11.2
2023 */
2024#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2025 #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)
2026#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2027 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2028#else
2029 #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
2030#endif
2031
2032/*
2033 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2034 *
2035 * Used on declarations introduced in Mac OS X 10.6,
2036 * but later deprecated in Mac OS X 10.11.2
2037 */
2038#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2039 #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)
2040#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2041 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2042#else
2043 #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
2044#endif
2045
2046/*
2047 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2048 *
2049 * Used on declarations introduced in Mac OS X 10.7,
2050 * but later deprecated in Mac OS X 10.11.2
2051 */
2052#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2053 #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)
2054#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2055 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2056#else
2057 #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
2058#endif
2059
2060/*
2061 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2062 *
2063 * Used on declarations introduced in Mac OS X 10.8,
2064 * but later deprecated in Mac OS X 10.11.2
2065 */
2066#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2067 #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)
2068#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2069 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2070#else
2071 #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
2072#endif
2073
2074/*
2075 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2076 *
2077 * Used on declarations introduced in Mac OS X 10.9,
2078 * but later deprecated in Mac OS X 10.11.2
2079 */
2080#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2081 #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)
2082#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2083 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2084#else
2085 #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
2086#endif
2087
2088/*
2089 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2090 *
2091 * Used on declarations introduced in Mac OS X 10.10,
2092 * but later deprecated in Mac OS X 10.11.2
2093 */
2094#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2095 #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)
2096#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2097 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2098#else
2099 #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
2100#endif
2101
2102/*
2103 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2104 *
2105 * Used on declarations introduced in Mac OS X 10.10.2,
2106 * but later deprecated in Mac OS X 10.11.2
2107 */
2108#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2109 #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)
2110#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2111 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2112#else
2113 #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
2114#endif
2115
2116/*
2117 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2118 *
2119 * Used on declarations introduced in Mac OS X 10.10.3,
2120 * but later deprecated in Mac OS X 10.11.2
2121 */
2122#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2123 #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)
2124#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2125 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2126#else
2127 #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
2128#endif
2129
2130/*
2131 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2132 *
2133 * Used on declarations introduced in Mac OS X 10.11,
2134 * but later deprecated in Mac OS X 10.11.2
2135 */
2136#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2137 #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)
2138#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2139 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2140#else
2141 #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
2142#endif
2143
2144/*
2145 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER
2146 *
2147 * Used on declarations introduced in Mac OS X 10.11.3
2148 */
2149#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2150 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_3, __IPHONE_COMPAT_VERSION)
2151#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_3
2152 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER UNAVAILABLE_ATTRIBUTE
2153#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_3
2154 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
2155#else
2156 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER
2157#endif
2158
2159/*
2160 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED
2161 *
2162 * Used on declarations introduced in Mac OS X 10.11.3,
2163 * and deprecated in Mac OS X 10.11.3
2164 */
2165#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2166 #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)
2167#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2168 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2169#else
2170 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER
2171#endif
2172
2173/*
2174 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2175 *
2176 * Used on declarations introduced in Mac OS X 10.0,
2177 * but later deprecated in Mac OS X 10.11.3
2178 */
2179#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2180 #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)
2181#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2182 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2183#else
2184 #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
2185#endif
2186
2187/*
2188 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2189 *
2190 * Used on declarations introduced in Mac OS X 10.1,
2191 * but later deprecated in Mac OS X 10.11.3
2192 */
2193#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2194 #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)
2195#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2196 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2197#else
2198 #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
2199#endif
2200
2201/*
2202 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2203 *
2204 * Used on declarations introduced in Mac OS X 10.2,
2205 * but later deprecated in Mac OS X 10.11.3
2206 */
2207#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2208 #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)
2209#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2210 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2211#else
2212 #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
2213#endif
2214
2215/*
2216 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2217 *
2218 * Used on declarations introduced in Mac OS X 10.3,
2219 * but later deprecated in Mac OS X 10.11.3
2220 */
2221#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2222 #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)
2223#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2224 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2225#else
2226 #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
2227#endif
2228
2229/*
2230 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2231 *
2232 * Used on declarations introduced in Mac OS X 10.4,
2233 * but later deprecated in Mac OS X 10.11.3
2234 */
2235#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2236 #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)
2237#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2238 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2239#else
2240 #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
2241#endif
2242
2243/*
2244 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2245 *
2246 * Used on declarations introduced in Mac OS X 10.5,
2247 * but later deprecated in Mac OS X 10.11.3
2248 */
2249#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2250 #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)
2251#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2252 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2253#else
2254 #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
2255#endif
2256
2257/*
2258 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2259 *
2260 * Used on declarations introduced in Mac OS X 10.6,
2261 * but later deprecated in Mac OS X 10.11.3
2262 */
2263#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2264 #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)
2265#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2266 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2267#else
2268 #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
2269#endif
2270
2271/*
2272 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2273 *
2274 * Used on declarations introduced in Mac OS X 10.7,
2275 * but later deprecated in Mac OS X 10.11.3
2276 */
2277#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2278 #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)
2279#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2280 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2281#else
2282 #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
2283#endif
2284
2285/*
2286 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2287 *
2288 * Used on declarations introduced in Mac OS X 10.8,
2289 * but later deprecated in Mac OS X 10.11.3
2290 */
2291#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2292 #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)
2293#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2294 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2295#else
2296 #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
2297#endif
2298
2299/*
2300 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2301 *
2302 * Used on declarations introduced in Mac OS X 10.9,
2303 * but later deprecated in Mac OS X 10.11.3
2304 */
2305#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2306 #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)
2307#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2308 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2309#else
2310 #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
2311#endif
2312
2313/*
2314 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2315 *
2316 * Used on declarations introduced in Mac OS X 10.10,
2317 * but later deprecated in Mac OS X 10.11.3
2318 */
2319#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2320 #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)
2321#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2322 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2323#else
2324 #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
2325#endif
2326
2327/*
2328 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2329 *
2330 * Used on declarations introduced in Mac OS X 10.10.2,
2331 * but later deprecated in Mac OS X 10.11.3
2332 */
2333#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2334 #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)
2335#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2336 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2337#else
2338 #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
2339#endif
2340
2341/*
2342 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2343 *
2344 * Used on declarations introduced in Mac OS X 10.10.3,
2345 * but later deprecated in Mac OS X 10.11.3
2346 */
2347#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2348 #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)
2349#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2350 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2351#else
2352 #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
2353#endif
2354
2355/*
2356 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2357 *
2358 * Used on declarations introduced in Mac OS X 10.11,
2359 * but later deprecated in Mac OS X 10.11.3
2360 */
2361#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2362 #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)
2363#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2364 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2365#else
2366 #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
2367#endif
2368
2369/*
2370 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2371 *
2372 * Used on declarations introduced in Mac OS X 10.11.2,
2373 * but later deprecated in Mac OS X 10.11.3
2374 */
2375#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2376 #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)
2377#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2378 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2379#else
2380 #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
2381#endif
2382
2383/*
2384 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER
2385 *
2386 * Used on declarations introduced in Mac OS X 10.11.4
2387 */
2388#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2389 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_4, __IPHONE_COMPAT_VERSION)
2390#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_4
2391 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER UNAVAILABLE_ATTRIBUTE
2392#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_4
2393 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
2394#else
2395 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER
2396#endif
2397
2398/*
2399 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED
2400 *
2401 * Used on declarations introduced in Mac OS X 10.11.4,
2402 * and deprecated in Mac OS X 10.11.4
2403 */
2404#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2405 #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)
2406#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2407 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2408#else
2409 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER
2410#endif
2411
2412/*
2413 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2414 *
2415 * Used on declarations introduced in Mac OS X 10.0,
2416 * but later deprecated in Mac OS X 10.11.4
2417 */
2418#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2419 #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)
2420#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2421 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2422#else
2423 #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
2424#endif
2425
2426/*
2427 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2428 *
2429 * Used on declarations introduced in Mac OS X 10.1,
2430 * but later deprecated in Mac OS X 10.11.4
2431 */
2432#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2433 #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)
2434#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2435 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2436#else
2437 #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
2438#endif
2439
2440/*
2441 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2442 *
2443 * Used on declarations introduced in Mac OS X 10.2,
2444 * but later deprecated in Mac OS X 10.11.4
2445 */
2446#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2447 #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)
2448#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2449 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2450#else
2451 #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
2452#endif
2453
2454/*
2455 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2456 *
2457 * Used on declarations introduced in Mac OS X 10.3,
2458 * but later deprecated in Mac OS X 10.11.4
2459 */
2460#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2461 #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)
2462#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2463 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2464#else
2465 #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
2466#endif
2467
2468/*
2469 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2470 *
2471 * Used on declarations introduced in Mac OS X 10.4,
2472 * but later deprecated in Mac OS X 10.11.4
2473 */
2474#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2475 #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)
2476#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2477 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2478#else
2479 #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
2480#endif
2481
2482/*
2483 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2484 *
2485 * Used on declarations introduced in Mac OS X 10.5,
2486 * but later deprecated in Mac OS X 10.11.4
2487 */
2488#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2489 #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)
2490#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2491 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2492#else
2493 #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
2494#endif
2495
2496/*
2497 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2498 *
2499 * Used on declarations introduced in Mac OS X 10.6,
2500 * but later deprecated in Mac OS X 10.11.4
2501 */
2502#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2503 #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)
2504#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2505 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2506#else
2507 #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
2508#endif
2509
2510/*
2511 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2512 *
2513 * Used on declarations introduced in Mac OS X 10.7,
2514 * but later deprecated in Mac OS X 10.11.4
2515 */
2516#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2517 #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)
2518#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2519 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2520#else
2521 #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
2522#endif
2523
2524/*
2525 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2526 *
2527 * Used on declarations introduced in Mac OS X 10.8,
2528 * but later deprecated in Mac OS X 10.11.4
2529 */
2530#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2531 #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)
2532#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2533 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2534#else
2535 #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
2536#endif
2537
2538/*
2539 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2540 *
2541 * Used on declarations introduced in Mac OS X 10.9,
2542 * but later deprecated in Mac OS X 10.11.4
2543 */
2544#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2545 #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)
2546#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2547 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2548#else
2549 #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
2550#endif
2551
2552/*
2553 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2554 *
2555 * Used on declarations introduced in Mac OS X 10.10,
2556 * but later deprecated in Mac OS X 10.11.4
2557 */
2558#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2559 #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)
2560#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2561 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2562#else
2563 #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
2564#endif
2565
2566/*
2567 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2568 *
2569 * Used on declarations introduced in Mac OS X 10.10.2,
2570 * but later deprecated in Mac OS X 10.11.4
2571 */
2572#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2573 #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)
2574#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2575 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2576#else
2577 #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
2578#endif
2579
2580/*
2581 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2582 *
2583 * Used on declarations introduced in Mac OS X 10.10.3,
2584 * but later deprecated in Mac OS X 10.11.4
2585 */
2586#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2587 #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)
2588#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2589 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2590#else
2591 #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
2592#endif
2593
2594/*
2595 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2596 *
2597 * Used on declarations introduced in Mac OS X 10.11,
2598 * but later deprecated in Mac OS X 10.11.4
2599 */
2600#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2601 #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)
2602#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2603 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2604#else
2605 #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
2606#endif
2607
2608/*
2609 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2610 *
2611 * Used on declarations introduced in Mac OS X 10.11.2,
2612 * but later deprecated in Mac OS X 10.11.4
2613 */
2614#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2615 #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)
2616#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2617 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2618#else
2619 #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
2620#endif
2621
2622/*
2623 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2624 *
2625 * Used on declarations introduced in Mac OS X 10.11.3,
2626 * but later deprecated in Mac OS X 10.11.4
2627 */
2628#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2629 #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)
2630#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2631 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2632#else
2633 #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
2634#endif
2635
2636/*
2637 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
2638 *
2639 * Used on declarations introduced in Mac OS X 10.12
2640 */
2641#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2642 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_COMPAT_VERSION)
2643#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
2644 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER UNAVAILABLE_ATTRIBUTE
2645#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
2646 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER WEAK_IMPORT_ATTRIBUTE
2647#else
2648 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
2649#endif
2650
2651/*
2652 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED
2653 *
2654 * Used on declarations introduced in Mac OS X 10.12,
2655 * and deprecated in Mac OS X 10.12
2656 */
2657#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2658 #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)
2659#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2660 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2661#else
2662 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
2663#endif
2664
2665/*
2666 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2667 *
2668 * Used on declarations introduced in Mac OS X 10.0,
2669 * but later deprecated in Mac OS X 10.12
2670 */
2671#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2672 #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)
2673#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2674 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2675#else
2676 #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
2677#endif
2678
2679/*
2680 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2681 *
2682 * Used on declarations introduced in Mac OS X 10.1,
2683 * but later deprecated in Mac OS X 10.12
2684 */
2685#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2686 #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)
2687#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2688 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2689#else
2690 #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
2691#endif
2692
2693/*
2694 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2695 *
2696 * Used on declarations introduced in Mac OS X 10.2,
2697 * but later deprecated in Mac OS X 10.12
2698 */
2699#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2700 #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)
2701#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2702 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2703#else
2704 #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
2705#endif
2706
2707/*
2708 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2709 *
2710 * Used on declarations introduced in Mac OS X 10.3,
2711 * but later deprecated in Mac OS X 10.12
2712 */
2713#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2714 #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)
2715#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2716 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2717#else
2718 #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
2719#endif
2720
2721/*
2722 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2723 *
2724 * Used on declarations introduced in Mac OS X 10.4,
2725 * but later deprecated in Mac OS X 10.12
2726 */
2727#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2728 #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)
2729#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2730 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2731#else
2732 #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
2733#endif
2734
2735/*
2736 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2737 *
2738 * Used on declarations introduced in Mac OS X 10.5,
2739 * but later deprecated in Mac OS X 10.12
2740 */
2741#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2742 #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)
2743#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2744 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2745#else
2746 #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
2747#endif
2748
2749/*
2750 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2751 *
2752 * Used on declarations introduced in Mac OS X 10.6,
2753 * but later deprecated in Mac OS X 10.12
2754 */
2755#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2756 #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)
2757#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2758 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2759#else
2760 #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
2761#endif
2762
2763/*
2764 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2765 *
2766 * Used on declarations introduced in Mac OS X 10.7,
2767 * but later deprecated in Mac OS X 10.12
2768 */
2769#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2770 #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)
2771#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2772 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2773#else
2774 #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
2775#endif
2776
2777/*
2778 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2779 *
2780 * Used on declarations introduced in Mac OS X 10.8,
2781 * but later deprecated in Mac OS X 10.12
2782 */
2783#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2784 #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)
2785#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2786 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2787#else
2788 #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
2789#endif
2790
2791/*
2792 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2793 *
2794 * Used on declarations introduced in Mac OS X 10.9,
2795 * but later deprecated in Mac OS X 10.12
2796 */
2797#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2798 #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)
2799#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2800 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2801#else
2802 #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
2803#endif
2804
2805/*
2806 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2807 *
2808 * Used on declarations introduced in Mac OS X 10.10,
2809 * but later deprecated in Mac OS X 10.12
2810 */
2811#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2812 #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)
2813#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2814 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2815#else
2816 #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
2817#endif
2818
2819/*
2820 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2821 *
2822 * Used on declarations introduced in Mac OS X 10.10.2,
2823 * but later deprecated in Mac OS X 10.12
2824 */
2825#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2826 #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)
2827#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2828 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2829#else
2830 #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
2831#endif
2832
2833/*
2834 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2835 *
2836 * Used on declarations introduced in Mac OS X 10.10.3,
2837 * but later deprecated in Mac OS X 10.12
2838 */
2839#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2840 #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)
2841#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2842 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2843#else
2844 #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
2845#endif
2846
2847/*
2848 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2849 *
2850 * Used on declarations introduced in Mac OS X 10.11,
2851 * but later deprecated in Mac OS X 10.12
2852 */
2853#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2854 #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)
2855#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2856 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2857#else
2858 #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
2859#endif
2860
2861/*
2862 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2863 *
2864 * Used on declarations introduced in Mac OS X 10.11.2,
2865 * but later deprecated in Mac OS X 10.12
2866 */
2867#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2868 #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)
2869#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2870 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2871#else
2872 #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
2873#endif
2874
2875/*
2876 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2877 *
2878 * Used on declarations introduced in Mac OS X 10.11.3,
2879 * but later deprecated in Mac OS X 10.12
2880 */
2881#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2882 #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)
2883#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2884 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2885#else
2886 #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
2887#endif
2888
2889/*
2890 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2891 *
2892 * Used on declarations introduced in Mac OS X 10.11.4,
2893 * but later deprecated in Mac OS X 10.12
2894 */
2895#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2896 #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)
2897#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2898 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2899#else
2900 #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
2901#endif
2902
2903/*
2904 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER
2905 *
2906 * Used on declarations introduced in Mac OS X 10.12.1
2907 */
2908#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2909 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_1, __IPHONE_COMPAT_VERSION)
2910#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_1
2911 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER UNAVAILABLE_ATTRIBUTE
2912#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_1
2913 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER WEAK_IMPORT_ATTRIBUTE
2914#else
2915 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER
2916#endif
2917
2918/*
2919 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED
2920 *
2921 * Used on declarations introduced in Mac OS X 10.12.1,
2922 * and deprecated in Mac OS X 10.12.1
2923 */
2924#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2925 #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)
2926#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2927 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2928#else
2929 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER
2930#endif
2931
2932/*
2933 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2934 *
2935 * Used on declarations introduced in Mac OS X 10.0,
2936 * but later deprecated in Mac OS X 10.12.1
2937 */
2938#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2939 #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)
2940#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2941 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2942#else
2943 #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
2944#endif
2945
2946/*
2947 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2948 *
2949 * Used on declarations introduced in Mac OS X 10.1,
2950 * but later deprecated in Mac OS X 10.12.1
2951 */
2952#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2953 #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)
2954#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2955 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2956#else
2957 #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
2958#endif
2959
2960/*
2961 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2962 *
2963 * Used on declarations introduced in Mac OS X 10.2,
2964 * but later deprecated in Mac OS X 10.12.1
2965 */
2966#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2967 #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)
2968#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2969 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2970#else
2971 #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
2972#endif
2973
2974/*
2975 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2976 *
2977 * Used on declarations introduced in Mac OS X 10.3,
2978 * but later deprecated in Mac OS X 10.12.1
2979 */
2980#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2981 #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)
2982#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2983 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2984#else
2985 #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
2986#endif
2987
2988/*
2989 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2990 *
2991 * Used on declarations introduced in Mac OS X 10.4,
2992 * but later deprecated in Mac OS X 10.12.1
2993 */
2994#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2995 #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)
2996#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2997 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2998#else
2999 #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
3000#endif
3001
3002/*
3003 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3004 *
3005 * Used on declarations introduced in Mac OS X 10.5,
3006 * but later deprecated in Mac OS X 10.12.1
3007 */
3008#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3009 #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)
3010#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3011 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3012#else
3013 #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
3014#endif
3015
3016/*
3017 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3018 *
3019 * Used on declarations introduced in Mac OS X 10.6,
3020 * but later deprecated in Mac OS X 10.12.1
3021 */
3022#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3023 #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)
3024#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3025 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3026#else
3027 #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
3028#endif
3029
3030/*
3031 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3032 *
3033 * Used on declarations introduced in Mac OS X 10.7,
3034 * but later deprecated in Mac OS X 10.12.1
3035 */
3036#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3037 #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)
3038#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3039 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3040#else
3041 #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
3042#endif
3043
3044/*
3045 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3046 *
3047 * Used on declarations introduced in Mac OS X 10.8,
3048 * but later deprecated in Mac OS X 10.12.1
3049 */
3050#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3051 #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)
3052#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3053 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3054#else
3055 #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
3056#endif
3057
3058/*
3059 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3060 *
3061 * Used on declarations introduced in Mac OS X 10.9,
3062 * but later deprecated in Mac OS X 10.12.1
3063 */
3064#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3065 #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)
3066#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3067 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3068#else
3069 #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
3070#endif
3071
3072/*
3073 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3074 *
3075 * Used on declarations introduced in Mac OS X 10.10,
3076 * but later deprecated in Mac OS X 10.12.1
3077 */
3078#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3079 #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)
3080#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3081 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3082#else
3083 #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
3084#endif
3085
3086/*
3087 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3088 *
3089 * Used on declarations introduced in Mac OS X 10.10.2,
3090 * but later deprecated in Mac OS X 10.12.1
3091 */
3092#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3093 #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)
3094#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3095 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3096#else
3097 #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
3098#endif
3099
3100/*
3101 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3102 *
3103 * Used on declarations introduced in Mac OS X 10.10.3,
3104 * but later deprecated in Mac OS X 10.12.1
3105 */
3106#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3107 #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)
3108#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3109 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3110#else
3111 #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
3112#endif
3113
3114/*
3115 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3116 *
3117 * Used on declarations introduced in Mac OS X 10.11,
3118 * but later deprecated in Mac OS X 10.12.1
3119 */
3120#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3121 #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)
3122#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3123 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3124#else
3125 #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
3126#endif
3127
3128/*
3129 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3130 *
3131 * Used on declarations introduced in Mac OS X 10.11.2,
3132 * but later deprecated in Mac OS X 10.12.1
3133 */
3134#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3135 #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)
3136#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3137 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3138#else
3139 #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
3140#endif
3141
3142/*
3143 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3144 *
3145 * Used on declarations introduced in Mac OS X 10.11.3,
3146 * but later deprecated in Mac OS X 10.12.1
3147 */
3148#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3149 #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)
3150#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3151 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3152#else
3153 #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
3154#endif
3155
3156/*
3157 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3158 *
3159 * Used on declarations introduced in Mac OS X 10.11.4,
3160 * but later deprecated in Mac OS X 10.12.1
3161 */
3162#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3163 #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)
3164#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3165 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3166#else
3167 #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
3168#endif
3169
3170/*
3171 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3172 *
3173 * Used on declarations introduced in Mac OS X 10.12,
3174 * but later deprecated in Mac OS X 10.12.1
3175 */
3176#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3177 #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)
3178#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3179 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3180#else
3181 #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
3182#endif
3183
3184/*
3185 * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER
3186 *
3187 * Used on declarations introduced in Mac OS X 10.12.2
3188 */
3189#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3190 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_2, __IPHONE_COMPAT_VERSION)
3191#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_2
3192 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER UNAVAILABLE_ATTRIBUTE
3193#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_2
3194 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
3195#else
3196 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER
3197#endif
3198
3199/*
3200 * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED
3201 *
3202 * Used on declarations introduced in Mac OS X 10.12.2,
3203 * and deprecated in Mac OS X 10.12.2
3204 */
3205#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3206 #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)
3207#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3208 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
3209#else
3210 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER
3211#endif
3212
3213/*
3214 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3215 *
3216 * Used on declarations introduced in Mac OS X 10.0,
3217 * but later deprecated in Mac OS X 10.12.2
3218 */
3219#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3220 #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)
3221#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3222 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3223#else
3224 #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
3225#endif
3226
3227/*
3228 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3229 *
3230 * Used on declarations introduced in Mac OS X 10.1,
3231 * but later deprecated in Mac OS X 10.12.2
3232 */
3233#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3234 #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)
3235#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3236 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3237#else
3238 #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
3239#endif
3240
3241/*
3242 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3243 *
3244 * Used on declarations introduced in Mac OS X 10.2,
3245 * but later deprecated in Mac OS X 10.12.2
3246 */
3247#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3248 #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)
3249#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3250 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3251#else
3252 #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
3253#endif
3254
3255/*
3256 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3257 *
3258 * Used on declarations introduced in Mac OS X 10.3,
3259 * but later deprecated in Mac OS X 10.12.2
3260 */
3261#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3262 #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)
3263#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3264 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3265#else
3266 #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
3267#endif
3268
3269/*
3270 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3271 *
3272 * Used on declarations introduced in Mac OS X 10.4,
3273 * but later deprecated in Mac OS X 10.12.2
3274 */
3275#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3276 #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)
3277#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3278 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3279#else
3280 #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
3281#endif
3282
3283/*
3284 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3285 *
3286 * Used on declarations introduced in Mac OS X 10.5,
3287 * but later deprecated in Mac OS X 10.12.2
3288 */
3289#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3290 #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)
3291#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3292 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3293#else
3294 #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
3295#endif
3296
3297/*
3298 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3299 *
3300 * Used on declarations introduced in Mac OS X 10.6,
3301 * but later deprecated in Mac OS X 10.12.2
3302 */
3303#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3304 #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)
3305#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3306 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3307#else
3308 #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
3309#endif
3310
3311/*
3312 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3313 *
3314 * Used on declarations introduced in Mac OS X 10.7,
3315 * but later deprecated in Mac OS X 10.12.2
3316 */
3317#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3318 #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)
3319#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3320 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3321#else
3322 #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
3323#endif
3324
3325/*
3326 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3327 *
3328 * Used on declarations introduced in Mac OS X 10.8,
3329 * but later deprecated in Mac OS X 10.12.2
3330 */
3331#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3332 #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)
3333#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3334 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3335#else
3336 #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
3337#endif
3338
3339/*
3340 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3341 *
3342 * Used on declarations introduced in Mac OS X 10.9,
3343 * but later deprecated in Mac OS X 10.12.2
3344 */
3345#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3346 #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)
3347#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3348 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3349#else
3350 #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
3351#endif
3352
3353/*
3354 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3355 *
3356 * Used on declarations introduced in Mac OS X 10.10,
3357 * but later deprecated in Mac OS X 10.12.2
3358 */
3359#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3360 #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)
3361#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3362 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3363#else
3364 #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
3365#endif
3366
3367/*
3368 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3369 *
3370 * Used on declarations introduced in Mac OS X 10.10.2,
3371 * but later deprecated in Mac OS X 10.12.2
3372 */
3373#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3374 #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)
3375#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3376 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3377#else
3378 #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
3379#endif
3380
3381/*
3382 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3383 *
3384 * Used on declarations introduced in Mac OS X 10.10.3,
3385 * but later deprecated in Mac OS X 10.12.2
3386 */
3387#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3388 #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)
3389#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3390 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3391#else
3392 #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
3393#endif
3394
3395/*
3396 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3397 *
3398 * Used on declarations introduced in Mac OS X 10.11,
3399 * but later deprecated in Mac OS X 10.12.2
3400 */
3401#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3402 #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)
3403#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3404 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3405#else
3406 #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
3407#endif
3408
3409/*
3410 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3411 *
3412 * Used on declarations introduced in Mac OS X 10.11.2,
3413 * but later deprecated in Mac OS X 10.12.2
3414 */
3415#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3416 #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)
3417#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3418 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3419#else
3420 #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
3421#endif
3422
3423/*
3424 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3425 *
3426 * Used on declarations introduced in Mac OS X 10.11.3,
3427 * but later deprecated in Mac OS X 10.12.2
3428 */
3429#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3430 #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)
3431#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3432 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3433#else
3434 #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
3435#endif
3436
3437/*
3438 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3439 *
3440 * Used on declarations introduced in Mac OS X 10.11.4,
3441 * but later deprecated in Mac OS X 10.12.2
3442 */
3443#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3444 #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)
3445#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3446 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3447#else
3448 #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
3449#endif
3450
3451/*
3452 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3453 *
3454 * Used on declarations introduced in Mac OS X 10.12,
3455 * but later deprecated in Mac OS X 10.12.2
3456 */
3457#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3458 #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)
3459#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3460 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3461#else
3462 #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
3463#endif
3464
3465/*
3466 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3467 *
3468 * Used on declarations introduced in Mac OS X 10.12.1,
3469 * but later deprecated in Mac OS X 10.12.2
3470 */
3471#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3472 #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)
3473#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3474 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3475#else
3476 #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
3477#endif
3478
3479/*
3480 * AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER
3481 *
3482 * Used on declarations introduced in Mac OS X 10.12.4
3483 */
3484#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3485 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_4, __IPHONE_COMPAT_VERSION)
3486#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_4
3487 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER UNAVAILABLE_ATTRIBUTE
3488#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_4
3489 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
3490#else
3491 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER
3492#endif
3493
3494/*
3495 * AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED
3496 *
3497 * Used on declarations introduced in Mac OS X 10.12.4,
3498 * and deprecated in Mac OS X 10.12.4
3499 */
3500#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3501 #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)
3502#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3503 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
3504#else
3505 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER
3506#endif
3507
3508/*
3509 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3510 *
3511 * Used on declarations introduced in Mac OS X 10.0,
3512 * but later deprecated in Mac OS X 10.12.4
3513 */
3514#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3515 #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)
3516#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3517 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3518#else
3519 #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
3520#endif
3521
3522/*
3523 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3524 *
3525 * Used on declarations introduced in Mac OS X 10.1,
3526 * but later deprecated in Mac OS X 10.12.4
3527 */
3528#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3529 #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)
3530#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3531 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3532#else
3533 #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
3534#endif
3535
3536/*
3537 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3538 *
3539 * Used on declarations introduced in Mac OS X 10.2,
3540 * but later deprecated in Mac OS X 10.12.4
3541 */
3542#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3543 #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)
3544#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3545 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3546#else
3547 #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
3548#endif
3549
3550/*
3551 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3552 *
3553 * Used on declarations introduced in Mac OS X 10.3,
3554 * but later deprecated in Mac OS X 10.12.4
3555 */
3556#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3557 #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)
3558#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3559 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3560#else
3561 #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
3562#endif
3563
3564/*
3565 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3566 *
3567 * Used on declarations introduced in Mac OS X 10.4,
3568 * but later deprecated in Mac OS X 10.12.4
3569 */
3570#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3571 #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)
3572#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3573 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3574#else
3575 #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
3576#endif
3577
3578/*
3579 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3580 *
3581 * Used on declarations introduced in Mac OS X 10.5,
3582 * but later deprecated in Mac OS X 10.12.4
3583 */
3584#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3585 #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)
3586#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3587 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3588#else
3589 #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
3590#endif
3591
3592/*
3593 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3594 *
3595 * Used on declarations introduced in Mac OS X 10.6,
3596 * but later deprecated in Mac OS X 10.12.4
3597 */
3598#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3599 #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)
3600#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3601 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3602#else
3603 #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
3604#endif
3605
3606/*
3607 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3608 *
3609 * Used on declarations introduced in Mac OS X 10.7,
3610 * but later deprecated in Mac OS X 10.12.4
3611 */
3612#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3613 #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)
3614#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3615 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3616#else
3617 #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
3618#endif
3619
3620/*
3621 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3622 *
3623 * Used on declarations introduced in Mac OS X 10.8,
3624 * but later deprecated in Mac OS X 10.12.4
3625 */
3626#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3627 #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)
3628#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3629 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3630#else
3631 #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
3632#endif
3633
3634/*
3635 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3636 *
3637 * Used on declarations introduced in Mac OS X 10.9,
3638 * but later deprecated in Mac OS X 10.12.4
3639 */
3640#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3641 #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)
3642#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3643 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3644#else
3645 #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
3646#endif
3647
3648/*
3649 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3650 *
3651 * Used on declarations introduced in Mac OS X 10.10,
3652 * but later deprecated in Mac OS X 10.12.4
3653 */
3654#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3655 #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)
3656#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3657 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3658#else
3659 #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
3660#endif
3661
3662/*
3663 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3664 *
3665 * Used on declarations introduced in Mac OS X 10.10.2,
3666 * but later deprecated in Mac OS X 10.12.4
3667 */
3668#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3669 #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)
3670#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3671 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3672#else
3673 #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
3674#endif
3675
3676/*
3677 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3678 *
3679 * Used on declarations introduced in Mac OS X 10.10.3,
3680 * but later deprecated in Mac OS X 10.12.4
3681 */
3682#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3683 #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)
3684#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3685 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3686#else
3687 #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
3688#endif
3689
3690/*
3691 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3692 *
3693 * Used on declarations introduced in Mac OS X 10.11,
3694 * but later deprecated in Mac OS X 10.12.4
3695 */
3696#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3697 #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)
3698#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3699 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3700#else
3701 #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
3702#endif
3703
3704/*
3705 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3706 *
3707 * Used on declarations introduced in Mac OS X 10.11.2,
3708 * but later deprecated in Mac OS X 10.12.4
3709 */
3710#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3711 #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)
3712#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3713 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3714#else
3715 #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
3716#endif
3717
3718/*
3719 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3720 *
3721 * Used on declarations introduced in Mac OS X 10.11.3,
3722 * but later deprecated in Mac OS X 10.12.4
3723 */
3724#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3725 #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)
3726#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3727 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3728#else
3729 #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
3730#endif
3731
3732/*
3733 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3734 *
3735 * Used on declarations introduced in Mac OS X 10.11.4,
3736 * but later deprecated in Mac OS X 10.12.4
3737 */
3738#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3739 #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)
3740#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3741 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3742#else
3743 #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
3744#endif
3745
3746/*
3747 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3748 *
3749 * Used on declarations introduced in Mac OS X 10.12,
3750 * but later deprecated in Mac OS X 10.12.4
3751 */
3752#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3753 #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)
3754#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3755 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3756#else
3757 #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
3758#endif
3759
3760/*
3761 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3762 *
3763 * Used on declarations introduced in Mac OS X 10.12.1,
3764 * but later deprecated in Mac OS X 10.12.4
3765 */
3766#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3767 #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)
3768#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3769 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3770#else
3771 #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
3772#endif
3773
3774/*
3775 * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3776 *
3777 * Used on declarations introduced in Mac OS X 10.12.2,
3778 * but later deprecated in Mac OS X 10.12.4
3779 */
3780#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3781 #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)
3782#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3783 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3784#else
3785 #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
3786#endif
3787
3788/*
3789 * AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
3790 *
3791 * Used on declarations introduced in Mac OS X 10.13
3792 */
3793#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3794 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_13, __IPHONE_COMPAT_VERSION)
3795#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13
3796 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER UNAVAILABLE_ATTRIBUTE
3797#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_13
3798 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER WEAK_IMPORT_ATTRIBUTE
3799#else
3800 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
3801#endif
3802
3803/*
3804 * AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER
3805 *
3806 * Used on declarations introduced in Mac OS X 10.14
3807 */
3808#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3809 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_14, __IPHONE_COMPAT_VERSION)
3810#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_14
3811 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER UNAVAILABLE_ATTRIBUTE
3812#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14
3813 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER WEAK_IMPORT_ATTRIBUTE
3814#else
3815 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER
3816#endif
3817
3818/*
3819 * AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER
3820 *
3821 * Used on declarations introduced in Mac OS X 10.15
3822 */
3823#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3824 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_15, __IPHONE_COMPAT_VERSION)
3825#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_15
3826 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER UNAVAILABLE_ATTRIBUTE
3827#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
3828 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER WEAK_IMPORT_ATTRIBUTE
3829#else
3830 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER
3831#endif
3832
3833/*
3834 * DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER
3835 *
3836 * Used on types deprecated in Mac OS X 10.1
3837 */
3838#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3839 #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)
3840#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
3841 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER DEPRECATED_ATTRIBUTE
3842#else
3843 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER
3844#endif
3845
3846/*
3847 * DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER
3848 *
3849 * Used on types deprecated in Mac OS X 10.2
3850 */
3851#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3852 #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)
3853#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
3854 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER DEPRECATED_ATTRIBUTE
3855#else
3856 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER
3857#endif
3858
3859/*
3860 * DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER
3861 *
3862 * Used on types deprecated in Mac OS X 10.3
3863 */
3864#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3865 #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)
3866#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
3867 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER DEPRECATED_ATTRIBUTE
3868#else
3869 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER
3870#endif
3871
3872/*
3873 * DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER
3874 *
3875 * Used on types deprecated in Mac OS X 10.4
3876 */
3877#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3878 #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)
3879#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
3880 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER DEPRECATED_ATTRIBUTE
3881#else
3882 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER
3883#endif
3884
3885
3886/*
3887 * DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
3888 *
3889 * Used on types deprecated in Mac OS X 10.5
3890 */
3891#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3892 #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)
3893#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
3894 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER DEPRECATED_ATTRIBUTE
3895#else
3896 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
3897#endif
3898
3899/*
3900 * DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER
3901 *
3902 * Used on types deprecated in Mac OS X 10.6
3903 */
3904#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3905 #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)
3906#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
3907 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER DEPRECATED_ATTRIBUTE
3908#else
3909 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER
3910#endif
3911
3912/*
3913 * DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
3914 *
3915 * Used on types deprecated in Mac OS X 10.7
3916 */
3917#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3918 #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)
3919#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
3920 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER DEPRECATED_ATTRIBUTE
3921#else
3922 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
3923#endif
3924
3925/*
3926 * DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER
3927 *
3928 * Used on types deprecated in Mac OS X 10.8
3929 */
3930#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3931 #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)
3932#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
3933 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER DEPRECATED_ATTRIBUTE
3934#else
3935 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER
3936#endif
3937
3938/*
3939 * DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER
3940 *
3941 * Used on types deprecated in Mac OS X 10.9
3942 */
3943#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3944 #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)
3945#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
3946 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER DEPRECATED_ATTRIBUTE
3947#else
3948 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER
3949#endif
3950
3951/*
3952 * DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER
3953 *
3954 * Used on types deprecated in Mac OS X 10.10
3955 */
3956#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3957 #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)
3958#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
3959 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER DEPRECATED_ATTRIBUTE
3960#else
3961 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER
3962#endif
3963
3964/*
3965 * DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER
3966 *
3967 * Used on types deprecated in Mac OS X 10.11
3968 */
3969#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3970 #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)
3971#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
3972 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER DEPRECATED_ATTRIBUTE
3973#else
3974 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER
3975#endif
3976
3977/*
3978 * DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER
3979 *
3980 * Used on types deprecated in Mac OS X 10.12
3981 */
3982#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3983 #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)
3984#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
3985 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER DEPRECATED_ATTRIBUTE
3986#else
3987 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER
3988#endif
3989
3990/*
3991 * DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER
3992 *
3993 * Used on types deprecated in Mac OS X 10.13
3994 */
3995#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3996 #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)
3997#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
3998 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER DEPRECATED_ATTRIBUTE
3999#else
4000 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER
4001#endif
4002
4003/*
4004 * DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER
4005 *
4006 * Used on types deprecated in Mac OS X 10.14.4
4007 */
4008#if __AVAILABILITY_MACROS_USES_AVAILABILITY
4009 #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)
4010#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_14_4
4011 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER DEPRECATED_ATTRIBUTE
4012#else
4013 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER
4014#endif
4015
4016#endif /* __AVAILABILITYMACROS__ */
\ No newline at end of file
lib/libc/include/any-macos-any/db.h created+219
......@@ -0,0 +1,219 @@
1/*-
2 * Copyright (c) 1990, 1993, 1994
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 * @(#)db.h 8.7 (Berkeley) 6/16/94
34 * $FreeBSD: src/include/db.h,v 1.5 2002/03/26 01:35:05 bde Exp $
35 */
36
37#ifndef _DB_H_
38#define _DB_H_
39
40#include <sys/types.h>
41#include <sys/cdefs.h>
42
43#include <limits.h>
44
45#define RET_ERROR -1 /* Return values. */
46#define RET_SUCCESS 0
47#define RET_SPECIAL 1
48
49#define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */
50typedef u_int32_t pgno_t;
51#define MAX_PAGE_OFFSET 65535 /* >= # of bytes in a page */
52typedef u_int16_t indx_t;
53#define MAX_REC_NUMBER 0xffffffff /* >= # of records in a tree */
54typedef u_int32_t recno_t;
55
56/* Key/data structure -- a Data-Base Thang. */
57typedef struct {
58 void *data; /* data */
59 size_t size; /* data length */
60} DBT;
61
62/* Routine flags. */
63#define R_CURSOR 1 /* del, put, seq */
64#define __R_UNUSED 2 /* UNUSED */
65#define R_FIRST 3 /* seq */
66#define R_IAFTER 4 /* put (RECNO) */
67#define R_IBEFORE 5 /* put (RECNO) */
68#define R_LAST 6 /* seq (BTREE, RECNO) */
69#define R_NEXT 7 /* seq */
70#define R_NOOVERWRITE 8 /* put */
71#define R_PREV 9 /* seq (BTREE, RECNO) */
72#define R_SETCURSOR 10 /* put (RECNO) */
73#define R_RECNOSYNC 11 /* sync (RECNO) */
74
75typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
76
77/*
78 * !!!
79 * The following flags are included in the dbopen(3) call as part of the
80 * open(2) flags. In order to avoid conflicts with the open flags, start
81 * at the top of the 16 or 32-bit number space and work our way down. If
82 * the open flags were significantly expanded in the future, it could be
83 * a problem. Wish I'd left another flags word in the dbopen call.
84 *
85 * !!!
86 * None of this stuff is implemented yet. The only reason that it's here
87 * is so that the access methods can skip copying the key/data pair when
88 * the DB_LOCK flag isn't set.
89 */
90#if UINT_MAX > 65535
91#define DB_LOCK 0x20000000 /* Do locking. */
92#define DB_SHMEM 0x40000000 /* Use shared memory. */
93#define DB_TXN 0x80000000 /* Do transactions. */
94#else
95#define DB_LOCK 0x2000 /* Do locking. */
96#define DB_SHMEM 0x4000 /* Use shared memory. */
97#define DB_TXN 0x8000 /* Do transactions. */
98#endif
99
100/* Access method description structure. */
101typedef struct __db {
102 DBTYPE type; /* Underlying db type. */
103 int (*close)(struct __db *);
104 int (*del)(const struct __db *, const DBT *, unsigned int);
105 int (*get)(const struct __db *, const DBT *, DBT *, unsigned int);
106 int (*put)(const struct __db *, DBT *, const DBT *, unsigned int);
107 int (*seq)(const struct __db *, DBT *, DBT *, unsigned int);
108 int (*sync)(const struct __db *, unsigned int);
109 void *internal; /* Access method private. */
110 int (*fd)(const struct __db *);
111} DB;
112
113#define BTREEMAGIC 0x053162
114#define BTREEVERSION 3
115
116/* Structure used to pass parameters to the btree routines. */
117typedef struct {
118#define R_DUP 0x01 /* duplicate keys */
119 unsigned long flags;
120 unsigned int cachesize; /* bytes to cache */
121 int maxkeypage; /* maximum keys per page */
122 int minkeypage; /* minimum keys per page */
123 unsigned int psize; /* page size */
124 int (*compare) /* comparison function */
125 (const DBT *, const DBT *);
126 size_t (*prefix) /* prefix function */
127 (const DBT *, const DBT *);
128 int lorder; /* byte order */
129} BTREEINFO;
130
131#define HASHMAGIC 0x061561
132#define HASHVERSION 2
133
134/* Structure used to pass parameters to the hashing routines. */
135typedef struct {
136 unsigned int bsize; /* bucket size */
137 unsigned int ffactor; /* fill factor */
138 unsigned int nelem; /* number of elements */
139 unsigned int cachesize; /* bytes to cache */
140 u_int32_t /* hash function */
141 (*hash)(const void *, size_t);
142 int lorder; /* byte order */
143} HASHINFO;
144
145/* Structure used to pass parameters to the record routines. */
146typedef struct {
147#define R_FIXEDLEN 0x01 /* fixed-length records */
148#define R_NOKEY 0x02 /* key not required */
149#define R_SNAPSHOT 0x04 /* snapshot the input */
150 unsigned long flags;
151 unsigned int cachesize; /* bytes to cache */
152 unsigned int psize; /* page size */
153 int lorder; /* byte order */
154 size_t reclen; /* record length (fixed-length records) */
155 unsigned char bval; /* delimiting byte (variable-length records */
156 char *bfname; /* btree file name */
157} RECNOINFO;
158
159#ifdef __DBINTERFACE_PRIVATE
160/*
161 * Little endian <==> big endian 32-bit swap macros.
162 * M_32_SWAP swap a memory location
163 * P_32_SWAP swap a referenced memory location
164 * P_32_COPY swap from one location to another
165 */
166#define M_32_SWAP(a) { \
167 u_int32_t _tmp = a; \
168 ((char *)&a)[0] = ((char *)&_tmp)[3]; \
169 ((char *)&a)[1] = ((char *)&_tmp)[2]; \
170 ((char *)&a)[2] = ((char *)&_tmp)[1]; \
171 ((char *)&a)[3] = ((char *)&_tmp)[0]; \
172}
173#define P_32_SWAP(a) { \
174 u_int32_t _tmp = *(u_int32_t *)a; \
175 ((char *)a)[0] = ((char *)&_tmp)[3]; \
176 ((char *)a)[1] = ((char *)&_tmp)[2]; \
177 ((char *)a)[2] = ((char *)&_tmp)[1]; \
178 ((char *)a)[3] = ((char *)&_tmp)[0]; \
179}
180#define P_32_COPY(a, b) { \
181 ((char *)&(b))[0] = ((char *)&(a))[3]; \
182 ((char *)&(b))[1] = ((char *)&(a))[2]; \
183 ((char *)&(b))[2] = ((char *)&(a))[1]; \
184 ((char *)&(b))[3] = ((char *)&(a))[0]; \
185}
186
187/*
188 * Little endian <==> big endian 16-bit swap macros.
189 * M_16_SWAP swap a memory location
190 * P_16_SWAP swap a referenced memory location
191 * P_16_COPY swap from one location to another
192 */
193#define M_16_SWAP(a) { \
194 u_int16_t _tmp = a; \
195 ((char *)&a)[0] = ((char *)&_tmp)[1]; \
196 ((char *)&a)[1] = ((char *)&_tmp)[0]; \
197}
198#define P_16_SWAP(a) { \
199 u_int16_t _tmp = *(u_int16_t *)a; \
200 ((char *)a)[0] = ((char *)&_tmp)[1]; \
201 ((char *)a)[1] = ((char *)&_tmp)[0]; \
202}
203#define P_16_COPY(a, b) { \
204 ((char *)&(b))[0] = ((char *)&(a))[1]; \
205 ((char *)&(b))[1] = ((char *)&(a))[0]; \
206}
207#endif
208
209__BEGIN_DECLS
210DB *dbopen(const char *, int, int, DBTYPE, const void *);
211
212#ifdef __DBINTERFACE_PRIVATE
213DB *__bt_open(const char *, int, int, const BTREEINFO *, int);
214DB *__hash_open(const char *, int, int, const HASHINFO *, int);
215DB *__rec_open(const char *, int, int, const RECNOINFO *, int);
216void __dbpanic(DB *dbp);
217#endif
218__END_DECLS
219#endif /* !_DB_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/dispatch/base.h deleted-333
......@@ -1,333 +0,0 @@
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#if defined(__cplusplus)
131# if __cplusplus >= 201703L
132# define DISPATCH_FALLTHROUGH [[fallthrough]]
133# elif __cplusplus >= 201103L
134# if defined(__clang__)
135# define DISPATCH_FALLTHROUGH [[clang::fallthrough]]
136# elif defined(__GNUC__) && __GNUC__ >= 7
137# define DISPATCH_FALLTHROUGH [[gnu::fallthrough]]
138# else
139# define DISPATCH_FALLTHROUGH
140# endif
141# else
142# define DISPATCH_FALLTHROUGH
143# endif
144#elif defined(__GNUC__) && __GNUC__ >= 7
145# define DISPATCH_FALLTHROUGH __attribute__((__fallthrough__))
146#elif defined(__clang__)
147# if __has_attribute(fallthrough) && __clang_major__ >= 5
148# define DISPATCH_FALLTHROUGH __attribute__((__fallthrough__))
149# else
150# define DISPATCH_FALLTHROUGH
151# endif
152#else
153# define DISPATCH_FALLTHROUGH
154#endif
155
156
157#define DISPATCH_LINUX_UNAVAILABLE()
158
159#ifdef __FreeBSD__
160#define DISPATCH_FREEBSD_UNAVAILABLE() \
161 DISPATCH_UNAVAILABLE_MSG( \
162 "This interface is unavailable on FreeBSD systems")
163#else
164#define DISPATCH_FREEBSD_UNAVAILABLE()
165#endif
166
167#ifndef DISPATCH_ALIAS_V2
168#if TARGET_OS_MAC
169#define DISPATCH_ALIAS_V2(sym) __asm__("_" #sym "$V2")
170#else
171#define DISPATCH_ALIAS_V2(sym)
172#endif
173#endif
174
175#if defined(_WIN32)
176#if defined(__cplusplus)
177#define DISPATCH_EXPORT extern "C" __declspec(dllimport)
178#else
179#define DISPATCH_EXPORT extern __declspec(dllimport)
180#endif
181#elif __GNUC__
182#define DISPATCH_EXPORT extern __attribute__((visibility("default")))
183#else
184#define DISPATCH_EXPORT extern
185#endif
186
187#if __GNUC__
188#define DISPATCH_INLINE static __inline__
189#else
190#define DISPATCH_INLINE static inline
191#endif
192
193#if __GNUC__
194#define DISPATCH_EXPECT(x, v) __builtin_expect((x), (v))
195#define dispatch_compiler_barrier() __asm__ __volatile__("" ::: "memory")
196#else
197#define DISPATCH_EXPECT(x, v) (x)
198#define dispatch_compiler_barrier() do { } while (0)
199#endif
200
201#if __has_attribute(not_tail_called)
202#define DISPATCH_NOT_TAIL_CALLED __attribute__((__not_tail_called__))
203#else
204#define DISPATCH_NOT_TAIL_CALLED
205#endif
206
207#if __has_builtin(__builtin_assume)
208#define DISPATCH_COMPILER_CAN_ASSUME(expr) __builtin_assume(expr)
209#else
210#define DISPATCH_COMPILER_CAN_ASSUME(expr) ((void)(expr))
211#endif
212
213#if __has_attribute(noescape)
214#define DISPATCH_NOESCAPE __attribute__((__noescape__))
215#else
216#define DISPATCH_NOESCAPE
217#endif
218
219#if __has_attribute(cold)
220#define DISPATCH_COLD __attribute__((__cold__))
221#else
222#define DISPATCH_COLD
223#endif
224
225#if __has_feature(assume_nonnull)
226#define DISPATCH_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
227#define DISPATCH_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
228#else
229#define DISPATCH_ASSUME_NONNULL_BEGIN
230#define DISPATCH_ASSUME_NONNULL_END
231#endif
232
233#if !__has_feature(nullability)
234#ifndef _Nullable
235#define _Nullable
236#endif
237#ifndef _Nonnull
238#define _Nonnull
239#endif
240#ifndef _Null_unspecified
241#define _Null_unspecified
242#endif
243#endif
244
245#ifndef DISPATCH_RETURNS_RETAINED_BLOCK
246#if __has_attribute(ns_returns_retained)
247#define DISPATCH_RETURNS_RETAINED_BLOCK __attribute__((__ns_returns_retained__))
248#else
249#define DISPATCH_RETURNS_RETAINED_BLOCK
250#endif
251#endif
252
253#if __has_attribute(enum_extensibility)
254#define __DISPATCH_ENUM_ATTR __attribute__((__enum_extensibility__(open)))
255#define __DISPATCH_ENUM_ATTR_CLOSED __attribute__((__enum_extensibility__(closed)))
256#else
257#define __DISPATCH_ENUM_ATTR
258#define __DISPATCH_ENUM_ATTR_CLOSED
259#endif // __has_attribute(enum_extensibility)
260
261#if __has_attribute(flag_enum)
262#define __DISPATCH_OPTIONS_ATTR __attribute__((__flag_enum__))
263#else
264#define __DISPATCH_OPTIONS_ATTR
265#endif // __has_attribute(flag_enum)
266
267
268#if __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums) || \
269 __has_extension(cxx_fixed_enum) || defined(_WIN32)
270#define DISPATCH_ENUM(name, type, ...) \
271 typedef enum : type { __VA_ARGS__ } __DISPATCH_ENUM_ATTR name##_t
272#define DISPATCH_OPTIONS(name, type, ...) \
273 typedef enum : type { __VA_ARGS__ } __DISPATCH_OPTIONS_ATTR __DISPATCH_ENUM_ATTR name##_t
274#else
275#define DISPATCH_ENUM(name, type, ...) \
276 enum { __VA_ARGS__ } __DISPATCH_ENUM_ATTR; typedef type name##_t
277#define DISPATCH_OPTIONS(name, type, ...) \
278 enum { __VA_ARGS__ } __DISPATCH_OPTIONS_ATTR __DISPATCH_ENUM_ATTR; typedef type name##_t
279#endif // __has_feature(objc_fixed_enum) ...
280
281
282
283#if __has_feature(enumerator_attributes)
284#define DISPATCH_ENUM_API_AVAILABLE(...) API_AVAILABLE(__VA_ARGS__)
285#define DISPATCH_ENUM_API_DEPRECATED(...) API_DEPRECATED(__VA_ARGS__)
286#define DISPATCH_ENUM_API_DEPRECATED_WITH_REPLACEMENT(...) \
287 API_DEPRECATED_WITH_REPLACEMENT(__VA_ARGS__)
288#else
289#define DISPATCH_ENUM_API_AVAILABLE(...)
290#define DISPATCH_ENUM_API_DEPRECATED(...)
291#define DISPATCH_ENUM_API_DEPRECATED_WITH_REPLACEMENT(...)
292#endif
293
294#ifdef __swift__
295#define DISPATCH_SWIFT3_OVERLAY 1
296#else // __swift__
297#define DISPATCH_SWIFT3_OVERLAY 0
298#endif // __swift__
299
300#if __has_feature(attribute_availability_swift)
301#define DISPATCH_SWIFT_UNAVAILABLE(_msg) \
302 __attribute__((__availability__(swift, unavailable, message=_msg)))
303#else
304#define DISPATCH_SWIFT_UNAVAILABLE(_msg)
305#endif
306
307#if DISPATCH_SWIFT3_OVERLAY
308#define DISPATCH_SWIFT3_UNAVAILABLE(_msg) DISPATCH_SWIFT_UNAVAILABLE(_msg)
309#else
310#define DISPATCH_SWIFT3_UNAVAILABLE(_msg)
311#endif
312
313#if __has_attribute(swift_private)
314#define DISPATCH_REFINED_FOR_SWIFT __attribute__((__swift_private__))
315#else
316#define DISPATCH_REFINED_FOR_SWIFT
317#endif
318
319#if __has_attribute(swift_name)
320#define DISPATCH_SWIFT_NAME(_name) __attribute__((__swift_name__(#_name)))
321#else
322#define DISPATCH_SWIFT_NAME(_name)
323#endif
324
325#ifndef __cplusplus
326#define DISPATCH_TRANSPARENT_UNION __attribute__((__transparent_union__))
327#else
328#define DISPATCH_TRANSPARENT_UNION
329#endif
330
331typedef void (*dispatch_function_t)(void *_Nullable);
332
333#endif
\ No newline at end of file
lib/libc/include/any-macos-any/err.h created+93
......@@ -0,0 +1,93 @@
1/*
2 * Copyright (c) 2000, 2003, 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 * Copyright (c) 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 * @(#)err.h 8.1 (Berkeley) 6/2/93
56 */
57
58#ifndef _ERR_H_
59#define _ERR_H_
60
61/*
62 * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two
63 * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one
64 * of them here we may collide with the utility's includes. It's unreasonable
65 * for utilities to have to include one of them to include err.h, so we get
66 * __darwin_va_list from <machine/_type.h> and use it.
67 */
68#include <sys/cdefs.h>
69#include <_types.h>
70#include <Availability.h>
71
72__BEGIN_DECLS
73void err(int, const char *, ...) __cold __dead2 __printflike(2, 3);
74void verr(int, const char *, __darwin_va_list) __cold __dead2 __printflike(2, 0);
75void errc(int, int, const char *, ...) __cold __dead2 __printflike(3, 4);
76void verrc(int, int, const char *, __darwin_va_list) __cold __dead2 __printflike(3, 0);
77void errx(int, const char *, ...) __cold __dead2 __printflike(2, 3);
78void verrx(int, const char *, __darwin_va_list) __cold __dead2 __printflike(2, 0);
79void warn(const char *, ...) __cold __printflike(1, 2);
80void vwarn(const char *, __darwin_va_list) __cold __printflike(1, 0);
81void warnc(int, const char *, ...) __cold __printflike(2, 3);
82void vwarnc(int, const char *, __darwin_va_list) __cold __printflike(2, 0);
83void warnx(const char *, ...) __cold __printflike(1, 2);
84void vwarnx(const char *, __darwin_va_list) __cold __printflike(1, 0);
85void err_set_file(void *);
86void err_set_exit(void (* _Nullable)(int));
87#ifdef __BLOCKS__
88void err_set_exit_b(void (^ _Nullable)(int)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
89#endif /* __BLOCKS__ */
90
91__END_DECLS
92
93#endif /* !_ERR_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/fts.h created+190
......@@ -0,0 +1,190 @@
1/*
2 * Copyright (c) 2000, 2003-2006, 2008, 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) 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 * @(#)fts.h 8.3 (Berkeley) 8/14/94
56 */
57
58#ifndef _FTS_H_
59#define _FTS_H_
60
61#include <sys/_types.h>
62#include <sys/_types/_dev_t.h>
63#include <sys/_types/_ino_t.h>
64#include <sys/_types/_nlink_t.h>
65
66#include <Availability.h>
67
68#pragma clang diagnostic push
69#pragma clang diagnostic ignored "-Wstrict-prototypes"
70
71typedef struct {
72 struct _ftsent *fts_cur; /* current node */
73 struct _ftsent *fts_child; /* linked list of children */
74 struct _ftsent **fts_array; /* sort array */
75 dev_t fts_dev; /* starting device # */
76 char *fts_path; /* path for this descent */
77 int fts_rfd; /* fd for root */
78 int fts_pathlen; /* sizeof(path) */
79 int fts_nitems; /* elements in the sort array */
80#ifdef __BLOCKS__
81 union {
82#endif /* __BLOCKS__ */
83 int (*fts_compar)(); /* compare function */
84#ifdef __BLOCKS__
85 int (^fts_compar_b)(); /* compare block */
86 };
87#endif /* __BLOCKS__ */
88
89#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */
90#define FTS_LOGICAL 0x002 /* logical walk */
91#define FTS_NOCHDIR 0x004 /* don't change directories */
92#define FTS_NOSTAT 0x008 /* don't get stat info */
93#define FTS_PHYSICAL 0x010 /* physical walk */
94#define FTS_SEEDOT 0x020 /* return dot and dot-dot */
95#define FTS_XDEV 0x040 /* don't cross devices */
96#define FTS_WHITEOUT 0x080 /* (no longer supported) return whiteout information */
97#define FTS_COMFOLLOWDIR 0x400 /* (non-std) follow command line symlinks for directories only */
98#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090) || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 70000)
99#define FTS_OPTIONMASK 0x4ff /* valid user option mask */
100#else
101#define FTS_NOSTAT_TYPE 0x800 /* (non-std) no stat, but use d_type in struct dirent when available */
102#define FTS_OPTIONMASK 0xcff /* valid user option mask */
103#endif
104
105#define FTS_NAMEONLY 0x100 /* (private) child names only */
106#define FTS_STOP 0x200 /* (private) unrecoverable error */
107#ifdef __BLOCKS__
108#define FTS_BLOCK_COMPAR 0x80000000 /* fts_compar is a block */
109#endif /* __BLOCKS__ */
110 int fts_options; /* fts_open options, global flags */
111} FTS;
112
113typedef struct _ftsent {
114 struct _ftsent *fts_cycle; /* cycle node */
115 struct _ftsent *fts_parent; /* parent directory */
116 struct _ftsent *fts_link; /* next file in directory */
117 long fts_number; /* local numeric value */
118 void *fts_pointer; /* local address value */
119 char *fts_accpath; /* access path */
120 char *fts_path; /* root path */
121 int fts_errno; /* errno for this node */
122 int fts_symfd; /* fd for symlink or chdir */
123 unsigned short fts_pathlen; /* strlen(fts_path) */
124 unsigned short fts_namelen; /* strlen(fts_name) */
125
126 ino_t fts_ino; /* inode */
127 dev_t fts_dev; /* device */
128 nlink_t fts_nlink; /* link count */
129
130#define FTS_ROOTPARENTLEVEL -1
131#define FTS_ROOTLEVEL 0
132#define FTS_MAXLEVEL 0x7fffffff
133 short fts_level; /* depth (-1 to N) */
134
135#define FTS_D 1 /* preorder directory */
136#define FTS_DC 2 /* directory that causes cycles */
137#define FTS_DEFAULT 3 /* none of the above */
138#define FTS_DNR 4 /* unreadable directory */
139#define FTS_DOT 5 /* dot or dot-dot */
140#define FTS_DP 6 /* postorder directory */
141#define FTS_ERR 7 /* error; errno is set */
142#define FTS_F 8 /* regular file */
143#define FTS_INIT 9 /* initialized only */
144#define FTS_NS 10 /* stat(2) failed */
145#define FTS_NSOK 11 /* no stat(2) requested */
146#define FTS_SL 12 /* symbolic link */
147#define FTS_SLNONE 13 /* symbolic link without target */
148#define FTS_W 14 /* whiteout object */
149 unsigned short fts_info; /* user flags for FTSENT structure */
150
151#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
152#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
153#define FTS_ISW 0x04 /* this is a whiteout object */
154#define FTS_CHDIRFD 0x08 /* indicates the fts_symfd field was set for chdir */
155 unsigned short fts_flags; /* private flags for FTSENT structure */
156
157#define FTS_AGAIN 1 /* read node again */
158#define FTS_FOLLOW 2 /* follow symbolic link */
159#define FTS_NOINSTR 3 /* no instructions */
160#define FTS_SKIP 4 /* discard node */
161 unsigned short fts_instr; /* fts_set() instructions */
162
163 struct stat *fts_statp; /* stat(2) information */
164 char fts_name[1]; /* file name */
165} FTSENT;
166
167#include <sys/cdefs.h>
168#include <Availability.h>
169
170__BEGIN_DECLS
171FTSENT *fts_children(FTS *, int) __DARWIN_INODE64(fts_children);
172int fts_close(FTS *) __DARWIN_INODE64(fts_close);
173FTS *fts_open(char * const *, int,
174 int (*)(const FTSENT **, const FTSENT **)) __DARWIN_INODE64(fts_open);
175#ifdef __BLOCKS__
176#if __has_attribute(noescape)
177#define __fts_noescape __attribute__((__noescape__))
178#else
179#define __fts_noescape
180#endif
181FTS *fts_open_b(char * const *, int,
182 int (^)(const FTSENT **, const FTSENT **) __fts_noescape)
183 __DARWIN_INODE64(fts_open_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
184#endif /* __BLOCKS__ */
185FTSENT *fts_read(FTS *) __DARWIN_INODE64(fts_read);
186int fts_set(FTS *, FTSENT *, int) __DARWIN_INODE64(fts_set);
187__END_DECLS
188
189#pragma clang diagnostic pop
190#endif /* !_FTS_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/iso646.h created+52
......@@ -0,0 +1,52 @@
1/*-
2 * Copyright (c) 1998 Alex Nash
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/iso646.h,v 1.4 2002/09/18 22:23:59 mike Exp $
27 */
28
29#ifndef _ISO646_H_
30#define _ISO646_H_
31
32#include <sys/cdefs.h>
33
34#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
35
36#ifndef __cplusplus
37#define and &&
38#define and_eq &=
39#define bitand &
40#define bitor |
41#define compl ~
42#define not !
43#define not_eq !=
44#define or ||
45#define or_eq |=
46#define xor ^
47#define xor_eq ^=
48#endif /* ! __cplusplus */
49
50#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
51
52#endif /* !_ISO646_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/libkern/OSCacheControl.h created+66
......@@ -0,0 +1,66 @@
1/*
2 * Copyright (c) 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
24#ifndef _OS_CACHE_CONTROL_H_
25#define _OS_CACHE_CONTROL_H_
26
27#include <stddef.h>
28#include <sys/cdefs.h>
29#include <stdint.h>
30#include <Availability.h>
31
32__BEGIN_DECLS
33
34
35/* Functions performed by sys_cache_control(): */
36
37/* Prepare memory for execution. This should be called
38 * after writing machine instructions to memory, before
39 * executing them. It syncs the dcache and icache.
40 * On IA32 processors this function is a NOP, because
41 * no synchronization is required.
42 */
43#define kCacheFunctionPrepareForExecution 1
44
45/* Flush data cache(s). This ensures that cached data
46 * makes it all the way out to DRAM, and then removes
47 * copies of the data from all processor caches.
48 * It can be useful when dealing with cache incoherent
49 * devices or DMA.
50 */
51#define kCacheFunctionFlushDcache 2
52
53
54/* perform one of the above cache functions: */
55int sys_cache_control( int function, void *start, size_t len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
56
57/* equivalent to sys_cache_control(kCacheFunctionPrepareForExecution): */
58void sys_icache_invalidate( void *start, size_t len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
59
60/* equivalent to sys_cache_control(kCacheFunctionFlushDcache): */
61void sys_dcache_flush( void *start, size_t len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
62
63
64__END_DECLS
65
66#endif /* _OS_CACHE_CONTROL_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/libkern/OSDebug.h created+59
......@@ -0,0 +1,59 @@
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) 1999 Apple Computer, Inc. All rights reserved.
30 *
31 * HISTORY
32 *
33 */
34
35#ifndef _OS_OSDEBBUG_H
36#define _OS_OSDEBBUG_H
37
38#include <sys/cdefs.h>
39#include <mach/mach_types.h>
40
41__BEGIN_DECLS
42
43/* Report a message with a 4 entry backtrace - very slow */
44extern void OSReportWithBacktrace(const char *str, ...) __printflike(1, 2);
45extern unsigned OSBacktrace(void **bt, unsigned maxAddrs);
46
47/* Simple dump of 20 backtrace entries */
48extern void OSPrintBacktrace(void);
49
50/*! @function OSKernelStackRemaining
51 * @abstract Returns bytes available below the current stack frame.
52 * @discussion Returns bytes available below the current stack frame. Safe for interrupt or thread context.
53 * @result Approximate byte count available. */
54
55vm_offset_t OSKernelStackRemaining( void );
56
57__END_DECLS
58
59#endif /* !_OS_OSDEBBUG_H */
\ No newline at end of file
lib/libc/include/any-macos-any/libkern/OSKextLib.h created+571
......@@ -0,0 +1,571 @@
1/*
2 * Copyright (c) 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 _LIBKERN_OSKEXTLIB_H
30#define _LIBKERN_OSKEXTLIB_H
31
32#include <sys/cdefs.h>
33__BEGIN_DECLS
34
35#include <stdint.h>
36#include <mach/kmod.h>
37#include <mach/vm_types.h>
38#include <uuid/uuid.h>
39
40#include <libkern/OSReturn.h>
41
42/*!
43 * @header
44 *
45 * Declares functions, basic return values, and other constants
46 * related to kernel extensions (kexts).
47 */
48
49#if PRAGMA_MARK
50#pragma mark -
51/********************************************************************/
52#pragma mark OSReturn Values for Kernel Extensions
53/********************************************************************/
54#endif
55/*!
56 * @group OSReturn Values for Kernel Extensions
57 * Many kext-related functions return these values,
58 * as well as those defined under
59 * <code>@link //apple_ref/c/tdef/OSReturn OSReturn@/link</code>
60 * and other variants of <code>kern_return_t</code>.
61 */
62
63
64#define sub_libkern_kext err_sub(2)
65#define libkern_kext_err(code) (sys_libkern|sub_libkern_kext|(code))
66
67
68/*!
69 * @define kOSKextReturnInternalError
70 * @abstract An internal error in the kext library.
71 * Contrast with <code>@link //apple_ref/c/econst/OSReturnError
72 * OSReturnError@/link</code>.
73 */
74#define kOSKextReturnInternalError libkern_kext_err(0x1)
75
76/*!
77 * @define kOSKextReturnNoMemory
78 * @abstract Memory allocation failed.
79 */
80#define kOSKextReturnNoMemory libkern_kext_err(0x2)
81
82/*!
83 * @define kOSKextReturnNoResources
84 * @abstract Some resource other than memory (such as available load tags)
85 * is exhausted.
86 */
87#define kOSKextReturnNoResources libkern_kext_err(0x3)
88
89/*!
90 * @define kOSKextReturnNotPrivileged
91 * @abstract The caller lacks privileges to perform the requested operation.
92 */
93#define kOSKextReturnNotPrivileged libkern_kext_err(0x4)
94
95/*!
96 * @define kOSKextReturnInvalidArgument
97 * @abstract Invalid argument.
98 */
99#define kOSKextReturnInvalidArgument libkern_kext_err(0x5)
100
101/*!
102 * @define kOSKextReturnNotFound
103 * @abstract Search item not found.
104 */
105#define kOSKextReturnNotFound libkern_kext_err(0x6)
106
107/*!
108 * @define kOSKextReturnBadData
109 * @abstract Malformed data (not used for XML).
110 */
111#define kOSKextReturnBadData libkern_kext_err(0x7)
112
113/*!
114 * @define kOSKextReturnSerialization
115 * @abstract Error converting or (un)serializing URL, string, or XML.
116 */
117#define kOSKextReturnSerialization libkern_kext_err(0x8)
118
119/*!
120 * @define kOSKextReturnUnsupported
121 * @abstract Operation is no longer or not yet supported.
122 */
123#define kOSKextReturnUnsupported libkern_kext_err(0x9)
124
125/*!
126 * @define kOSKextReturnDisabled
127 * @abstract Operation is currently disabled.
128 */
129#define kOSKextReturnDisabled libkern_kext_err(0xa)
130
131/*!
132 * @define kOSKextReturnNotAKext
133 * @abstract Bundle is not a kernel extension.
134 */
135#define kOSKextReturnNotAKext libkern_kext_err(0xb)
136
137/*!
138 * @define kOSKextReturnValidation
139 * @abstract Validation failures encountered; check diagnostics for details.
140 */
141#define kOSKextReturnValidation libkern_kext_err(0xc)
142
143/*!
144 * @define kOSKextReturnAuthentication
145 * @abstract Authetication failures encountered; check diagnostics for details.
146 */
147#define kOSKextReturnAuthentication libkern_kext_err(0xd)
148
149/*!
150 * @define kOSKextReturnDependencies
151 * @abstract Dependency resolution failures encountered; check diagnostics for details.
152 */
153#define kOSKextReturnDependencies libkern_kext_err(0xe)
154
155/*!
156 * @define kOSKextReturnArchNotFound
157 * @abstract Kext does not contain code for the requested architecture.
158 */
159#define kOSKextReturnArchNotFound libkern_kext_err(0xf)
160
161/*!
162 * @define kOSKextReturnCache
163 * @abstract An error occurred processing a system kext cache.
164 */
165#define kOSKextReturnCache libkern_kext_err(0x10)
166
167/*!
168 * @define kOSKextReturnDeferred
169 * @abstract Operation has been posted asynchronously to user space (kernel only).
170 */
171#define kOSKextReturnDeferred libkern_kext_err(0x11)
172
173/*!
174 * @define kOSKextReturnBootLevel
175 * @abstract Kext not loadable or operation not allowed at current boot level.
176 */
177#define kOSKextReturnBootLevel libkern_kext_err(0x12)
178
179/*!
180 * @define kOSKextReturnNotLoadable
181 * @abstract Kext cannot be loaded; check diagnostics for details.
182 */
183#define kOSKextReturnNotLoadable libkern_kext_err(0x13)
184
185/*!
186 * @define kOSKextReturnLoadedVersionDiffers
187 * @abstract A different version (or executable UUID, or executable by checksum)
188 * of the requested kext is already loaded.
189 */
190#define kOSKextReturnLoadedVersionDiffers libkern_kext_err(0x14)
191
192/*!
193 * @define kOSKextReturnDependencyLoadError
194 * @abstract A load error occurred on a dependency of the kext being loaded.
195 */
196#define kOSKextReturnDependencyLoadError libkern_kext_err(0x15)
197
198/*!
199 * @define kOSKextReturnLinkError
200 * @abstract A link failure occured with this kext or a dependency.
201 */
202#define kOSKextReturnLinkError libkern_kext_err(0x16)
203
204/*!
205 * @define kOSKextReturnStartStopError
206 * @abstract The kext start or stop routine returned an error.
207 */
208#define kOSKextReturnStartStopError libkern_kext_err(0x17)
209
210/*!
211 * @define kOSKextReturnInUse
212 * @abstract The kext is currently in use or has outstanding references,
213 * and cannot be unloaded.
214 */
215#define kOSKextReturnInUse libkern_kext_err(0x18)
216
217/*!
218 * @define kOSKextReturnTimeout
219 * @abstract A kext request has timed out.
220 */
221#define kOSKextReturnTimeout libkern_kext_err(0x19)
222
223/*!
224 * @define kOSKextReturnStopping
225 * @abstract The kext is in the process of stopping; requests cannot be made.
226 */
227#define kOSKextReturnStopping libkern_kext_err(0x1a)
228
229/*!
230 * @define kOSKextReturnSystemPolicy
231 * @abstract The kext was prevented from loading due to system policy.
232 */
233#define kOSKextReturnSystemPolicy libkern_kext_err(0x1b)
234
235/*!
236 * @define kOSKextReturnKCLoadFailure
237 * @abstract Loading of the System KC failed
238 */
239#define kOSKextReturnKCLoadFailure libkern_kext_err(0x1c)
240
241/*!
242 * @define kOSKextReturnKCLoadFailureSystemKC
243 * @abstract Loading of the System KC failed
244 *
245 * This a sub-code of kOSKextReturnKCLoadFailure. It can be OR'd together
246 * with: kOSKextReturnKCLoadFailureAuxKC
247 *
248 * If both the System and Aux KCs fail to load, then the error code will be:
249 * libkern_kext_err(0x1f)
250 */
251#define kOSKextReturnKCLoadFailureSystemKC libkern_kext_err(0x1d)
252
253/*!
254 * @define kOSKextReturnKCLoadFailureAuxKC
255 * @abstract Loading of the Aux KC failed
256 *
257 * This a sub-code of kOSKextReturnKCLoadFailure. It can be OR'd together
258 * with: kOSKextReturnKCLoadFailureSystemKC
259 *
260 * If both the System and Aux KCs fail to load, then the error code will be:
261 * libkern_kext_err(0x1f)
262 */
263#define kOSKextReturnKCLoadFailureAuxKC libkern_kext_err(0x1e)
264
265/* next available error is: libkern_kext_err(0x20) */
266
267#if PRAGMA_MARK
268#pragma mark -
269/********************************************************************/
270#pragma mark Kext/OSBundle Property List Keys
271/********************************************************************/
272#endif
273/*!
274 * @group Kext Property List Keys
275 * These constants cover CFBundle properties defined for kernel extensions.
276 * Because they are used in the kernel, if you want to use one with
277 * CFBundle APIs you'll need to wrap it in a <code>CFSTR()</code> macro.
278 */
279
280
281/*!
282 * @define kOSBundleCompatibleVersionKey
283 * @abstract A string giving the backwards-compatible version of a library kext
284 * in extended Mac OS 'vers' format (####.##.##s{1-255} where 's'
285 * is a build stage 'd', 'a', 'b', 'f' or 'fc').
286 */
287#define kOSBundleCompatibleVersionKey "OSBundleCompatibleVersion"
288
289/*!
290 * @define kOSBundleEnableKextLoggingKey
291 * @abstract Set to true to have the kernel kext logging spec applied
292 * to the kext.
293 * See <code>@link //apple_ref/c/econst/OSKextLogSpec
294 * OSKextLogSpec@/link</code>.
295 */
296#define kOSBundleEnableKextLoggingKey "OSBundleEnableKextLogging"
297
298/*!
299 * @define kOSBundleIsInterfaceKey
300 * @abstract A boolean value indicating whether the kext executable
301 * contains only symbol references.
302 */
303#define kOSBundleIsInterfaceKey "OSBundleIsInterface"
304
305/*!
306 * @define kOSBundleLibrariesKey
307 * @abstract A dictionary listing link dependencies for this kext.
308 * Keys are bundle identifiers, values are version strings.
309 */
310#define kOSBundleLibrariesKey "OSBundleLibraries"
311
312/*!
313 * @define kOSBundleRequiredKey
314 * @abstract A string indicating in which kinds of startup this kext
315 * may need to load during early startup (before
316 * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code>).
317 * @discussion
318 * The value is one of:
319 * <ul>
320 * <li>@link kOSBundleRequiredRoot "OSBundleRequiredRoot"@/link</li>
321 * <li>@link kOSBundleRequiredLocalRoot "OSBundleRequiredLocalRoot"@/link</li>
322 * <li>@link kOSBundleRequiredNetworkRoot "OSBundleRequiredNetworkRoot"@/link</li>
323 * <li>@link kOSBundleRequiredSafeBoot "OSBundleRequiredSafeBoot"@/link</li>
324 * <li>@link kOSBundleRequiredConsole "OSBundleRequiredConsole"@/link</li>
325 * </ul>
326 *
327 * Use this property judiciously.
328 * Every kext that declares a value other than "OSBundleRequiredSafeBoot"
329 * increases startup time, as the booter must read it into memory,
330 * or startup kext caches must include it.
331 */
332#define kOSBundleRequiredKey "OSBundleRequired"
333
334/*!
335 * @define kOSBundleRequireExplicitLoadKey
336 * @abstract A boolean value indicating whether the kext requires an
337 * explicit kextload in order to start/match.
338 */
339#define kOSBundleRequireExplicitLoadKey "OSBundleRequireExplicitLoad"
340
341/*!
342 * @define kOSBundleAllowUserLoadKey
343 * @abstract A boolean value indicating whether
344 * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code>
345 * will honor a non-root process's request to load a kext.
346 * @discussion
347 * See <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithURL
348 * KextManagerLoadKextWithURL@/link</code>
349 * and <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithIdentifier
350 * KextManagerLoadKextWithIdentifier@/link</code>.
351 */
352#define kOSBundleAllowUserLoadKey "OSBundleAllowUserLoad"
353
354/*!
355 * @define kOSBundleAllowUserTerminateKey
356 * @abstract A boolean value indicating whether the kextunload tool
357 * is allowed to issue IOService terminate to classes defined in this kext.
358 * @discussion A boolean value indicating whether the kextunload tool
359 * is allowed to issue IOService terminate to classes defined in this kext.
360 */
361#define kOSBundleAllowUserTerminateKey "OSBundleAllowUserTerminate"
362
363/*!
364 * @define kOSKernelResourceKey
365 * @abstract A boolean value indicating whether the kext represents a built-in
366 * component of the kernel.
367 */
368#define kOSKernelResourceKey "OSKernelResource"
369
370/*!
371 * @define kOSKextVariantOverrideKey
372 * @abstract A dictionary with target names as key and a target-specific variant
373 * name as value.
374 */
375#define kOSKextVariantOverrideKey "OSKextVariantOverride"
376
377/*!
378 * @define kIOKitPersonalitiesKey
379 * @abstract A dictionary of dictionaries used in matching for I/O Kit drivers.
380 */
381#define kIOKitPersonalitiesKey "IOKitPersonalities"
382
383/*
384 * @define kIOPersonalityPublisherKey
385 * @abstract Used in personalities sent to the I/O Kit,
386 * contains the CFBundleIdentifier of the kext
387 * that the personality originated in.
388 */
389#define kIOPersonalityPublisherKey "IOPersonalityPublisher"
390
391#if CONFIG_KEC_FIPS
392/*
393 * @define kAppleTextHashesKey
394 * @abstract A dictionary conataining hashes for corecrypto kext.
395 */
396#define kAppleTextHashesKey "AppleTextHashes"
397#endif
398
399/*!
400 * @define kOSMutableSegmentCopy
401 * @abstract A boolean value indicating whether the kext requires a copy of
402 * its mutable segments to be kept in memory, and then reset when the kext
403 * unloads. This should be used with caution as it will increase the
404 * amount of memory used by the kext.
405 */
406#define kOSMutableSegmentCopy "OSMutableSegmentCopy"
407
408
409#if PRAGMA_MARK
410/********************************************************************/
411#pragma mark Kext/OSBundle Property Deprecated Keys
412/********************************************************************/
413#endif
414/*
415 * @define kOSBundleDebugLevelKey
416 * @abstract
417 * Deprecated (used on some releases of Mac OS X prior to 10.6 Snow Leopard).
418 * Value is an integer from 1-6, corresponding to the verbose levels
419 * of kext tools on those releases.
420 * On 10.6 Snow Leopard, use <code>@link OSKextEnableKextLogging
421 * OSKextEnableKextLogging@/link</code>.
422 */
423#define kOSBundleDebugLevelKey "OSBundleDebugLevel"
424
425/*!
426 * @define kOSBundleSharedExecutableIdentifierKey
427 * @abstract Deprecated (used on some releases of Mac OS X
428 * prior to 10.6 Snow Leopard).
429 * Value is the bundle identifier of the pseudokext
430 * that contains an executable shared by this kext.
431 */
432#define kOSBundleSharedExecutableIdentifierKey "OSBundleSharedExecutableIdentifier"
433
434
435#if PRAGMA_MARK
436/********************************************************************/
437#pragma mark Kext/OSBundle Property List Values
438/********************************************************************/
439#endif
440
441/*!
442 * @group Kext Property List Values
443 * These constants encompass established values
444 * for kernel extension bundle properties.
445 */
446
447/*!
448 * @define kOSKextKernelIdentifier
449 * @abstract
450 * This is the CFBundleIdentifier user for the kernel itself.
451 */
452#define kOSKextKernelIdentifier "__kernel__"
453
454/*!
455 * @define kOSKextBundlePackageTypeKext
456 * @abstract
457 * The bundle type value for Kernel Extensions.
458 */
459#define kOSKextBundlePackageTypeKext "KEXT"
460
461/*!
462 * @define kOSKextBundlePackageTypeDriverKit
463 * @abstract
464 * The bundle type value for Driver Extensions.
465 */
466#define kOSKextBundlePackageTypeDriverKit "DEXT"
467
468/*!
469 * @define kOSBundleRequiredRoot
470 * @abstract
471 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
472 * value indicates that the kext may be needed to mount the root filesystem
473 * whether starting from a local or a network volume.
474 */
475#define kOSBundleRequiredRoot "Root"
476
477/*!
478 * @define kOSBundleRequiredLocalRoot
479 * @abstract
480 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
481 * value indicates that the kext may be needed to mount the root filesystem
482 * when starting from a local disk.
483 */
484#define kOSBundleRequiredLocalRoot "Local-Root"
485
486/*!
487 * @define kOSBundleRequiredNetworkRoot
488 * @abstract
489 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
490 * value indicates that the kext may be needed to mount the root filesystem
491 * when starting over a network connection.
492 */
493#define kOSBundleRequiredNetworkRoot "Network-Root"
494
495/*!
496 * @define kOSBundleRequiredSafeBoot
497 * @abstract
498 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
499 * value indicates that the kext can be loaded during a safe startup.
500 * This value does not normally cause the kext to be read by the booter
501 * or included in startup kext caches.
502 */
503#define kOSBundleRequiredSafeBoot "Safe Boot"
504
505/*!
506 * @define kOSBundleRequiredConsole
507 * @abstract
508 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
509 * value indicates that the kext may be needed for console access
510 * (specifically in a single-user startup when
511 * <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code>.
512 * does not run)
513 * and should be loaded during early startup.
514 */
515#define kOSBundleRequiredConsole "Console"
516
517/*!
518 * @define kOSBundleRequiredDriverKit
519 * @abstract
520 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
521 * value indicates that the driver extension's (DriverKit driver's)
522 * personalities must be present in the kernel at early boot (specifically
523 * before <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code> starts)
524 * in order to compete with kexts built into the prelinkedkernel. Note that
525 * kextd is still required to launch the user space driver binary. The IOKit
526 * matching will happen during early boot, and the actual driver launch
527 * will happen after kextd starts.
528 */
529#define kOSBundleRequiredDriverKit "DriverKit"
530
531#if PRAGMA_MARK
532#pragma mark -
533/********************************************************************/
534#pragma mark Kext Information
535/********************************************************************/
536#endif
537/*!
538 * @group Kext Information
539 * Types, constants, and macros providing a kext with information
540 * about itself.
541 */
542
543/*!
544 * @typedef OSKextLoadTag
545 *
546 * @abstract
547 * A unique identifier assigned to a loaded instanace of a kext.
548 *
549 * @discussion
550 * If a kext is unloaded and later reloaded, the new instance
551 * has a different load tag.
552 *
553 * A kext can get its own load tag in the <code>kmod_info_t</code>
554 * structure passed into its module start routine, as the
555 * <code>id</code> field (cast to this type).
556 */
557typedef uint32_t OSKextLoadTag;
558
559/*!
560 * @define kOSKextInvalidLoadTag
561 *
562 * @abstract
563 * A load tag value that will never be used for a loaded kext;
564 * indicates kext not found.
565 */
566#define kOSKextInvalidLoadTag ((OSKextLoadTag)(-1))
567
568
569__END_DECLS
570
571#endif /* _LIBKERN_OSKEXTLIB_H */
\ No newline at end of file
lib/libc/include/any-macos-any/libkern/OSReturn.h created+198
......@@ -0,0 +1,198 @@
1/*
2 * Copyright (c) 2000 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see 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) 1998 Apple Inc. All rights reserved.
30 *
31 * HISTORY
32 *
33 */
34
35/*
36 * Core OSReturn values.
37 */
38
39#ifndef __LIBKERN_OSRETURN_H
40#define __LIBKERN_OSRETURN_H
41
42#include <sys/cdefs.h>
43
44__BEGIN_DECLS
45
46#include <mach/error.h>
47
48
49/*!
50 * @header
51 *
52 * Declares functions, basic return values, and other constants
53 * related to kernel extensions (kexts).
54 */
55
56#if PRAGMA_MARK
57#pragma mark Core OSReturn Values for Libkern
58#endif
59/*********************************************************************
60* Core OSReturn Values for Libkern
61*********************************************************************/
62/*!
63 * @group Core OSReturn Values for Libkern
64 * Some kext and I/O Kit functions can return these values,
65 * as well as other values of
66 * <code>kern_return_t</code>.
67 *
68 * Many of these return values represent internal errors
69 * in the Libkern C++ run-time typing information system
70 * based on @link //apple_ref/doc/class/OSMetaClass OSMetaClass@/link;
71 * you are unlikely to ever see them.
72 *
73 */
74
75
76/*!
77 * @typedef OSReturn
78 * @abstract The return type for many Libkern functions.
79 */
80typedef kern_return_t OSReturn;
81
82#ifndef sys_libkern
83#define sys_libkern err_system(0x37)
84#endif /* sys_libkern */
85
86#define sub_libkern_common err_sub(0)
87#define sub_libkern_metaclass err_sub(1)
88#define sub_libkern_reserved err_sub(-1)
89
90#define libkern_common_err(return ) (sys_libkern|sub_libkern_common|(return))
91#define libkern_metaclass_err(return ) (sys_libkern|sub_libkern_metaclass|(return))
92
93/* See OSKextLib.h for these
94 * #define sub_libkern_kext err_sub(2)
95 * #define libkern_kext_err(code) (sys_libkern|sub_libkern_kext|(code))
96 */
97
98/*!
99 * @define kOSReturnSuccess
100 * @abstract Operation successful.
101 * Equal to <code>@link //apple_ref/c/econst/KERN_SUCCESS
102 * KERN_SUCCESS@/link</code>.
103 */
104#define kOSReturnSuccess KERN_SUCCESS
105
106/*!
107 * @define kOSReturnError
108 * @abstract Unspecified Libkern error.
109 * <b>Not equal</b> to
110 * <code>@link //apple_ref/c/econst/KERN_FAILURE
111 * KERN_FAILURE@/link</code>.
112 */
113#define kOSReturnError libkern_common_err(1)
114
115/*!
116 * @define kOSMetaClassInternal
117 * @abstract Internal OSMetaClass run-time error.
118 */
119#define kOSMetaClassInternal libkern_metaclass_err(1)
120
121/*!
122 * @define kOSMetaClassHasInstances
123 * @abstract A kext cannot be unloaded because there are instances
124 * derived from Libkern C++ classes that it defines.
125 */
126#define kOSMetaClassHasInstances libkern_metaclass_err(2)
127
128/*!
129 * @define kOSMetaClassNoInit
130 * @abstract Internal error: The Libkern C++ class registration system
131 * was not properly initialized during kext loading.
132 */
133#define kOSMetaClassNoInit libkern_metaclass_err(3)
134// OSMetaClass::preModLoad wasn't called, runtime internal error
135
136/*!
137 * @define kOSMetaClassNoTempData
138 * @abstract Internal error: An allocation failure occurred
139 * registering Libkern C++ classes during kext loading.
140 */
141#define kOSMetaClassNoTempData libkern_metaclass_err(4)
142// Allocation failure internal data
143
144/*!
145 * @define kOSMetaClassNoDicts
146 * @abstract Internal error: An allocation failure occurred
147 * registering Libkern C++ classes during kext loading.
148 */
149#define kOSMetaClassNoDicts libkern_metaclass_err(5)
150// Allocation failure for Metaclass internal dictionaries
151
152/*!
153 * @define kOSMetaClassNoKModSet
154 * @abstract Internal error: An allocation failure occurred
155 * registering Libkern C++ classes during kext loading.
156 */
157#define kOSMetaClassNoKModSet libkern_metaclass_err(6)
158// Allocation failure for internal kmodule set
159
160/*!
161 * @define kOSMetaClassNoInsKModSet
162 * @abstract Internal error: An error occurred registering
163 * a specific Libkern C++ class during kext loading.
164 */
165#define kOSMetaClassNoInsKModSet libkern_metaclass_err(7)
166// Can't insert the KMod set into the module dictionary
167
168/*!
169 * @define kOSMetaClassNoSuper
170 * @abstract Internal error: No superclass can be found
171 * for a specific Libkern C++ class during kext loading.
172 */
173#define kOSMetaClassNoSuper libkern_metaclass_err(8)
174
175/*!
176 * @define kOSMetaClassInstNoSuper
177 * @abstract Internal error: No superclass can be found when constructing
178 * an instance of a Libkern C++ class.
179 */
180#define kOSMetaClassInstNoSuper libkern_metaclass_err(9)
181
182/*!
183 * @define kOSMetaClassDuplicateClass
184 * @abstract A duplicate Libkern C++ classname was encountered
185 * during kext loading.
186 */
187#define kOSMetaClassDuplicateClass libkern_metaclass_err(10)
188
189/*!
190 * @define kOSMetaClassNoKext
191 * @abstract Internal error: The kext for a Libkern C++ class
192 * can't be found during kext loading.
193 */
194#define kOSMetaClassNoKext libkern_metaclass_err(11)
195
196__END_DECLS
197
198#endif /* ! __LIBKERN_OSRETURN_H */
\ No newline at end of file
lib/libc/include/any-macos-any/libkern/OSThermalNotification.h created+135
......@@ -0,0 +1,135 @@
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
24#ifndef _OSTHERMALNOTIFICATION_H_
25#define _OSTHERMALNOTIFICATION_H_
26
27#include <sys/cdefs.h>
28#include <Availability.h>
29
30/*
31** OSThermalNotification.h
32**
33** Notification mechanism to alert registered tasks when device thermal conditions
34** reach certain thresholds. Notifications are triggered in both directions
35** so clients can manage their memory usage more and less aggressively.
36**
37*/
38
39__BEGIN_DECLS
40
41/* Define pressure levels usable by OSThermalPressureLevel */
42typedef enum {
43#if TARGET_OS_OSX || TARGET_OS_MACCATALYST
44 kOSThermalPressureLevelNominal = 0,
45 kOSThermalPressureLevelModerate,
46 kOSThermalPressureLevelHeavy,
47 kOSThermalPressureLevelTrapping,
48 kOSThermalPressureLevelSleeping
49#else
50 kOSThermalPressureLevelNominal = 0,
51 kOSThermalPressureLevelLight = 10,
52 kOSThermalPressureLevelModerate = 20,
53 kOSThermalPressureLevelHeavy = 30,
54 kOSThermalPressureLevelTrapping = 40,
55 kOSThermalPressureLevelSleeping = 50
56#endif
57} OSThermalPressureLevel;
58
59/*
60 ** External notify(3) string for thermal pressure level notification
61 */
62__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_7_0)
63extern const char * const kOSThermalNotificationPressureLevelName;
64
65
66#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && \
67 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_2_0
68
69typedef enum {
70 OSThermalNotificationLevelAny = -1,
71 OSThermalNotificationLevelNormal = 0,
72} OSThermalNotificationLevel;
73
74extern OSThermalNotificationLevel _OSThermalNotificationLevelForBehavior(int) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_4_2);
75extern void _OSThermalNotificationSetLevelForBehavior(int, int) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_4_2);
76
77enum {
78 kOSThermalMitigationNone,
79 kOSThermalMitigation70PercentTorch,
80 kOSThermalMitigation70PercentBacklight,
81 kOSThermalMitigation50PercentTorch,
82 kOSThermalMitigation50PercentBacklight,
83 kOSThermalMitigationDisableTorch,
84 kOSThermalMitigation25PercentBacklight,
85 kOSThermalMitigationDisableMapsHalo,
86 kOSThermalMitigationAppTerminate,
87 kOSThermalMitigationDeviceRestart,
88 kOSThermalMitigationThermalTableReady,
89 kOSThermalMitigationCount
90};
91
92#define OSThermalNotificationLevel70PercentTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigation70PercentTorch)
93#define OSThermalNotificationLevel70PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation70PercentBacklight)
94#define OSThermalNotificationLevel50PercentTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigation50PercentTorch)
95#define OSThermalNotificationLevel50PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation50PercentBacklight)
96#define OSThermalNotificationLevelDisableTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDisableTorch)
97#define OSThermalNotificationLevel25PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation25PercentBacklight)
98#define OSThermalNotificationLevelDisableMapsHalo _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDisableMapsHalo)
99#define OSThermalNotificationLevelAppTerminate _OSThermalNotificationLevelForBehavior(kOSThermalMitigationAppTerminate)
100#define OSThermalNotificationLevelDeviceRestart _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDeviceRestart)
101
102/* Backwards compatibility */
103#define OSThermalNotificationLevelWarning OSThermalNotificationLevel70PercentBacklight
104#define OSThermalNotificationLevelUrgent OSThermalNotificationLevelAppTerminate
105#define OSThermalNotificationLevelCritical OSThermalNotificationLevelDeviceRestart
106
107/*
108** Simple polling interface to detect current thermal level
109*/
110__OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_2_0)
111extern OSThermalNotificationLevel OSThermalNotificationCurrentLevel(void);
112
113/*
114** External notify(3) string for manual notification setup
115*/
116__OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_2_0)
117extern const char * const kOSThermalNotificationName;
118
119/*
120** External notify(3) string for alerting user of a thermal condition
121*/
122__OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_6_0)
123extern const char * const kOSThermalNotificationAlert;
124
125/*
126** External notify(3) string for notifying system the options taken to resolve thermal condition
127*/
128__OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_6_0)
129extern const char * const kOSThermalNotificationDecision;
130
131#endif // __IPHONE_OS_VERSION_MIN_REQUIRED
132
133__END_DECLS
134
135#endif /* _OSTHERMALNOTIFICATION_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/libproc.h deleted-172
......@@ -1,172 +0,0 @@
1/*
2 * Copyright (c) 2006, 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#ifndef _LIBPROC_H_
24#define _LIBPROC_H_
25
26#include <sys/cdefs.h>
27#include <sys/param.h>
28#include <sys/types.h>
29#include <sys/stat.h>
30#include <sys/mount.h>
31#include <sys/resource.h>
32#include <stdint.h>
33#include <stdbool.h>
34#include <mach/message.h> /* for audit_token_t */
35
36#include <sys/proc_info.h>
37
38#include <Availability.h>
39#include <os/availability.h>
40
41/*
42 * This header file contains private interfaces to obtain process information.
43 * These interfaces are subject to change in future releases.
44 */
45
46/*!
47 * @define PROC_LISTPIDSPATH_PATH_IS_VOLUME
48 * @discussion This flag indicates that all processes that hold open
49 * file references on the volume associated with the specified
50 * path should be returned.
51 */
52#define PROC_LISTPIDSPATH_PATH_IS_VOLUME 1
53
54
55/*!
56 * @define PROC_LISTPIDSPATH_EXCLUDE_EVTONLY
57 * @discussion This flag indicates that file references that were opened
58 * with the O_EVTONLY flag should be excluded from the matching
59 * criteria.
60 */
61#define PROC_LISTPIDSPATH_EXCLUDE_EVTONLY 2
62
63__BEGIN_DECLS
64
65
66/*!
67 * @function proc_listpidspath
68 * @discussion A function which will search through the current
69 * processes looking for open file references which match
70 * a specified path or volume.
71 * @param type types of processes to be searched (see proc_listpids)
72 * @param typeinfo adjunct information for type
73 * @param path file or volume path
74 * @param pathflags flags to control which files should be considered
75 * during the process search.
76 * @param buffer a C array of int-sized values to be filled with
77 * process identifiers that hold an open file reference
78 * matching the specified path or volume. Pass NULL to
79 * obtain the minimum buffer size needed to hold the
80 * currently active processes.
81 * @param buffersize the size (in bytes) of the provided buffer.
82 * @result the number of bytes of data returned in the provided buffer;
83 * -1 if an error was encountered;
84 */
85int proc_listpidspath(uint32_t type,
86 uint32_t typeinfo,
87 const char *path,
88 uint32_t pathflags,
89 void *buffer,
90 int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
91
92int proc_listpids(uint32_t type, uint32_t typeinfo, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
93int proc_listallpids(void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
94int proc_listpgrppids(pid_t pgrpid, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
95int proc_listchildpids(pid_t ppid, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
96int proc_pidinfo(int pid, int flavor, uint64_t arg, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
97int proc_pidfdinfo(int pid, int fd, int flavor, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
98int proc_pidfileportinfo(int pid, uint32_t fileport, int flavor, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
99int proc_name(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
100int proc_regionfilename(int pid, uint64_t address, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
101int proc_kmsgbuf(void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
102int proc_pidpath(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
103int proc_pidpath_audittoken(audit_token_t *audittoken, void * buffer, uint32_t buffersize) API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));
104int proc_libversion(int *major, int * minor) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
105
106/*
107 * Return resource usage information for the given pid, which can be a live process or a zombie.
108 *
109 * Returns 0 on success; or -1 on failure, with errno set to indicate the specific error.
110 */
111int proc_pid_rusage(int pid, int flavor, rusage_info_t *buffer) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
112
113/*
114 * A process can use the following api to set its own process control
115 * state on resoure starvation. The argument can have one of the PROC_SETPC_XX values
116 */
117#define PROC_SETPC_NONE 0
118#define PROC_SETPC_THROTTLEMEM 1
119#define PROC_SETPC_SUSPEND 2
120#define PROC_SETPC_TERMINATE 3
121
122int proc_setpcontrol(const int control) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
123int proc_setpcontrol(const int control);
124
125int proc_track_dirty(pid_t pid, uint32_t flags);
126int proc_set_dirty(pid_t pid, bool dirty);
127int proc_get_dirty(pid_t pid, uint32_t *flags);
128int proc_clear_dirty(pid_t pid, uint32_t flags);
129
130int proc_terminate(pid_t pid, int *sig);
131
132/*
133 * NO_SMT means that on an SMT CPU, this thread must be scheduled alone,
134 * with the paired CPU idle.
135 *
136 * Set NO_SMT on the current proc (all existing and future threads)
137 * This attribute is inherited on fork and exec
138 */
139int proc_set_no_smt(void) __API_AVAILABLE(macos(11.0));
140
141/* Set NO_SMT on the current thread */
142int proc_setthread_no_smt(void) __API_AVAILABLE(macos(11.0));
143
144/*
145 * CPU Security Mitigation APIs
146 *
147 * Set CPU security mitigation on the current proc (all existing and future threads)
148 * This attribute is inherited on fork and exec
149 */
150int proc_set_csm(uint32_t flags) __API_AVAILABLE(macos(11.0));
151
152/* Set CPU security mitigation on the current thread */
153int proc_setthread_csm(uint32_t flags) __API_AVAILABLE(macos(11.0));
154
155/*
156 * flags for CPU Security Mitigation APIs
157 * PROC_CSM_ALL should be used in most cases,
158 * the individual flags are provided only for performance evaluation etc
159 */
160#define PROC_CSM_ALL 0x0001 /* Set all available mitigations */
161#define PROC_CSM_NOSMT 0x0002 /* Set NO_SMT - see above */
162#define PROC_CSM_TECS 0x0004 /* Execute VERW on every return to user mode */
163
164int proc_udata_info(int pid, int flavor, void *buffer, int buffersize);
165
166#if __has_include(<libproc_private.h>)
167#include <libproc_private.h>
168#endif
169
170__END_DECLS
171
172#endif /*_LIBPROC_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/clock.h deleted-246
......@@ -1,246 +0,0 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.h>
59#include <mach/mach_types.h>
60#include <mach/mach_types.h>
61
62#ifdef __BeforeMigUserHeader
63__BeforeMigUserHeader
64#endif /* __BeforeMigUserHeader */
65
66#include <sys/cdefs.h>
67__BEGIN_DECLS
68
69
70/* Routine clock_get_time */
71#ifdef mig_external
72mig_external
73#else
74extern
75#endif /* mig_external */
76kern_return_t clock_get_time
77(
78 clock_serv_t clock_serv,
79 mach_timespec_t *cur_time
80);
81
82/* Routine clock_get_attributes */
83#ifdef mig_external
84mig_external
85#else
86extern
87#endif /* mig_external */
88kern_return_t clock_get_attributes
89(
90 clock_serv_t clock_serv,
91 clock_flavor_t flavor,
92 clock_attr_t clock_attr,
93 mach_msg_type_number_t *clock_attrCnt
94);
95
96/* Routine clock_alarm */
97#ifdef mig_external
98mig_external
99#else
100extern
101#endif /* mig_external */
102kern_return_t clock_alarm
103(
104 clock_serv_t clock_serv,
105 alarm_type_t alarm_type,
106 mach_timespec_t alarm_time,
107 clock_reply_t alarm_port
108);
109
110__END_DECLS
111
112/********************** Caution **************************/
113/* The following data types should be used to calculate */
114/* maximum message sizes only. The actual message may be */
115/* smaller, and the position of the arguments within the */
116/* message layout may vary from what is presented here. */
117/* For example, if any of the arguments are variable- */
118/* sized, and less than the maximum is sent, the data */
119/* will be packed tight in the actual message to reduce */
120/* the presence of holes. */
121/********************** Caution **************************/
122
123/* typedefs for all requests */
124
125#ifndef __Request__clock_subsystem__defined
126#define __Request__clock_subsystem__defined
127
128#ifdef __MigPackStructs
129#pragma pack(push, 4)
130#endif
131 typedef struct {
132 mach_msg_header_t Head;
133 } __Request__clock_get_time_t __attribute__((unused));
134#ifdef __MigPackStructs
135#pragma pack(pop)
136#endif
137
138#ifdef __MigPackStructs
139#pragma pack(push, 4)
140#endif
141 typedef struct {
142 mach_msg_header_t Head;
143 NDR_record_t NDR;
144 clock_flavor_t flavor;
145 mach_msg_type_number_t clock_attrCnt;
146 } __Request__clock_get_attributes_t __attribute__((unused));
147#ifdef __MigPackStructs
148#pragma pack(pop)
149#endif
150
151#ifdef __MigPackStructs
152#pragma pack(push, 4)
153#endif
154 typedef struct {
155 mach_msg_header_t Head;
156 /* start of the kernel processed data */
157 mach_msg_body_t msgh_body;
158 mach_msg_port_descriptor_t alarm_port;
159 /* end of the kernel processed data */
160 NDR_record_t NDR;
161 alarm_type_t alarm_type;
162 mach_timespec_t alarm_time;
163 } __Request__clock_alarm_t __attribute__((unused));
164#ifdef __MigPackStructs
165#pragma pack(pop)
166#endif
167#endif /* !__Request__clock_subsystem__defined */
168
169/* union of all requests */
170
171#ifndef __RequestUnion__clock_subsystem__defined
172#define __RequestUnion__clock_subsystem__defined
173union __RequestUnion__clock_subsystem {
174 __Request__clock_get_time_t Request_clock_get_time;
175 __Request__clock_get_attributes_t Request_clock_get_attributes;
176 __Request__clock_alarm_t Request_clock_alarm;
177};
178#endif /* !__RequestUnion__clock_subsystem__defined */
179/* typedefs for all replies */
180
181#ifndef __Reply__clock_subsystem__defined
182#define __Reply__clock_subsystem__defined
183
184#ifdef __MigPackStructs
185#pragma pack(push, 4)
186#endif
187 typedef struct {
188 mach_msg_header_t Head;
189 NDR_record_t NDR;
190 kern_return_t RetCode;
191 mach_timespec_t cur_time;
192 } __Reply__clock_get_time_t __attribute__((unused));
193#ifdef __MigPackStructs
194#pragma pack(pop)
195#endif
196
197#ifdef __MigPackStructs
198#pragma pack(push, 4)
199#endif
200 typedef struct {
201 mach_msg_header_t Head;
202 NDR_record_t NDR;
203 kern_return_t RetCode;
204 mach_msg_type_number_t clock_attrCnt;
205 int clock_attr[1];
206 } __Reply__clock_get_attributes_t __attribute__((unused));
207#ifdef __MigPackStructs
208#pragma pack(pop)
209#endif
210
211#ifdef __MigPackStructs
212#pragma pack(push, 4)
213#endif
214 typedef struct {
215 mach_msg_header_t Head;
216 NDR_record_t NDR;
217 kern_return_t RetCode;
218 } __Reply__clock_alarm_t __attribute__((unused));
219#ifdef __MigPackStructs
220#pragma pack(pop)
221#endif
222#endif /* !__Reply__clock_subsystem__defined */
223
224/* union of all replies */
225
226#ifndef __ReplyUnion__clock_subsystem__defined
227#define __ReplyUnion__clock_subsystem__defined
228union __ReplyUnion__clock_subsystem {
229 __Reply__clock_get_time_t Reply_clock_get_time;
230 __Reply__clock_get_attributes_t Reply_clock_get_attributes;
231 __Reply__clock_alarm_t Reply_clock_alarm;
232};
233#endif /* !__RequestUnion__clock_subsystem__defined */
234
235#ifndef subsystem_to_name_map_clock
236#define subsystem_to_name_map_clock \
237 { "clock_get_time", 1000 },\
238 { "clock_get_attributes", 1001 },\
239 { "clock_alarm", 1002 }
240#endif
241
242#ifdef __AfterMigUserHeader
243__AfterMigUserHeader
244#endif /* __AfterMigUserHeader */
245
246#endif /* _clock_user_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/clock_priv.h deleted-200
......@@ -1,200 +0,0 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.h>
59#include <mach/mach_types.h>
60#include <mach/mach_types.h>
61
62#ifdef __BeforeMigUserHeader
63__BeforeMigUserHeader
64#endif /* __BeforeMigUserHeader */
65
66#include <sys/cdefs.h>
67__BEGIN_DECLS
68
69
70/* Routine clock_set_time */
71#ifdef mig_external
72mig_external
73#else
74extern
75#endif /* mig_external */
76kern_return_t clock_set_time
77(
78 clock_ctrl_t clock_ctrl,
79 mach_timespec_t new_time
80);
81
82/* Routine clock_set_attributes */
83#ifdef mig_external
84mig_external
85#else
86extern
87#endif /* mig_external */
88kern_return_t clock_set_attributes
89(
90 clock_ctrl_t clock_ctrl,
91 clock_flavor_t flavor,
92 clock_attr_t clock_attr,
93 mach_msg_type_number_t clock_attrCnt
94);
95
96__END_DECLS
97
98/********************** Caution **************************/
99/* The following data types should be used to calculate */
100/* maximum message sizes only. The actual message may be */
101/* smaller, and the position of the arguments within the */
102/* message layout may vary from what is presented here. */
103/* For example, if any of the arguments are variable- */
104/* sized, and less than the maximum is sent, the data */
105/* will be packed tight in the actual message to reduce */
106/* the presence of holes. */
107/********************** Caution **************************/
108
109/* typedefs for all requests */
110
111#ifndef __Request__clock_priv_subsystem__defined
112#define __Request__clock_priv_subsystem__defined
113
114#ifdef __MigPackStructs
115#pragma pack(push, 4)
116#endif
117 typedef struct {
118 mach_msg_header_t Head;
119 NDR_record_t NDR;
120 mach_timespec_t new_time;
121 } __Request__clock_set_time_t __attribute__((unused));
122#ifdef __MigPackStructs
123#pragma pack(pop)
124#endif
125
126#ifdef __MigPackStructs
127#pragma pack(push, 4)
128#endif
129 typedef struct {
130 mach_msg_header_t Head;
131 NDR_record_t NDR;
132 clock_flavor_t flavor;
133 mach_msg_type_number_t clock_attrCnt;
134 int clock_attr[1];
135 } __Request__clock_set_attributes_t __attribute__((unused));
136#ifdef __MigPackStructs
137#pragma pack(pop)
138#endif
139#endif /* !__Request__clock_priv_subsystem__defined */
140
141/* union of all requests */
142
143#ifndef __RequestUnion__clock_priv_subsystem__defined
144#define __RequestUnion__clock_priv_subsystem__defined
145union __RequestUnion__clock_priv_subsystem {
146 __Request__clock_set_time_t Request_clock_set_time;
147 __Request__clock_set_attributes_t Request_clock_set_attributes;
148};
149#endif /* !__RequestUnion__clock_priv_subsystem__defined */
150/* typedefs for all replies */
151
152#ifndef __Reply__clock_priv_subsystem__defined
153#define __Reply__clock_priv_subsystem__defined
154
155#ifdef __MigPackStructs
156#pragma pack(push, 4)
157#endif
158 typedef struct {
159 mach_msg_header_t Head;
160 NDR_record_t NDR;
161 kern_return_t RetCode;
162 } __Reply__clock_set_time_t __attribute__((unused));
163#ifdef __MigPackStructs
164#pragma pack(pop)
165#endif
166
167#ifdef __MigPackStructs
168#pragma pack(push, 4)
169#endif
170 typedef struct {
171 mach_msg_header_t Head;
172 NDR_record_t NDR;
173 kern_return_t RetCode;
174 } __Reply__clock_set_attributes_t __attribute__((unused));
175#ifdef __MigPackStructs
176#pragma pack(pop)
177#endif
178#endif /* !__Reply__clock_priv_subsystem__defined */
179
180/* union of all replies */
181
182#ifndef __ReplyUnion__clock_priv_subsystem__defined
183#define __ReplyUnion__clock_priv_subsystem__defined
184union __ReplyUnion__clock_priv_subsystem {
185 __Reply__clock_set_time_t Reply_clock_set_time;
186 __Reply__clock_set_attributes_t Reply_clock_set_attributes;
187};
188#endif /* !__RequestUnion__clock_priv_subsystem__defined */
189
190#ifndef subsystem_to_name_map_clock_priv
191#define subsystem_to_name_map_clock_priv \
192 { "clock_set_time", 1200 },\
193 { "clock_set_attributes", 1201 }
194#endif
195
196#ifdef __AfterMigUserHeader
197__AfterMigUserHeader
198#endif /* __AfterMigUserHeader */
199
200#endif /* _clock_priv_user_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/exception_types.h deleted-211
......@@ -1,211 +0,0 @@
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 EXCEPTION_IDENTITY_PROTECTED 4
127/* Send a catch_exception_raise message including protected task
128 * and thread identity.
129 */
130
131#define MACH_EXCEPTION_ERRORS 0x40000000
132/* include additional exception specific errors, not used yet. */
133
134#define MACH_EXCEPTION_CODES 0x80000000
135/* Send 64-bit code and subcode in the exception header */
136
137#define MACH_EXCEPTION_MASK (MACH_EXCEPTION_CODES | MACH_EXCEPTION_ERRORS)
138/*
139 * Masks for exception definitions, above
140 * bit zero is unused, therefore 1 word = 31 exception types
141 */
142
143#define EXC_MASK_BAD_ACCESS (1 << EXC_BAD_ACCESS)
144#define EXC_MASK_BAD_INSTRUCTION (1 << EXC_BAD_INSTRUCTION)
145#define EXC_MASK_ARITHMETIC (1 << EXC_ARITHMETIC)
146#define EXC_MASK_EMULATION (1 << EXC_EMULATION)
147#define EXC_MASK_SOFTWARE (1 << EXC_SOFTWARE)
148#define EXC_MASK_BREAKPOINT (1 << EXC_BREAKPOINT)
149#define EXC_MASK_SYSCALL (1 << EXC_SYSCALL)
150#define EXC_MASK_MACH_SYSCALL (1 << EXC_MACH_SYSCALL)
151#define EXC_MASK_RPC_ALERT (1 << EXC_RPC_ALERT)
152#define EXC_MASK_CRASH (1 << EXC_CRASH)
153#define EXC_MASK_RESOURCE (1 << EXC_RESOURCE)
154#define EXC_MASK_GUARD (1 << EXC_GUARD)
155#define EXC_MASK_CORPSE_NOTIFY (1 << EXC_CORPSE_NOTIFY)
156
157#define EXC_MASK_ALL (EXC_MASK_BAD_ACCESS | \
158 EXC_MASK_BAD_INSTRUCTION | \
159 EXC_MASK_ARITHMETIC | \
160 EXC_MASK_EMULATION | \
161 EXC_MASK_SOFTWARE | \
162 EXC_MASK_BREAKPOINT | \
163 EXC_MASK_SYSCALL | \
164 EXC_MASK_MACH_SYSCALL | \
165 EXC_MASK_RPC_ALERT | \
166 EXC_MASK_RESOURCE | \
167 EXC_MASK_GUARD | \
168 EXC_MASK_MACHINE)
169
170
171#define FIRST_EXCEPTION 1 /* ZERO is illegal */
172
173/*
174 * Machine independent codes for EXC_SOFTWARE
175 * Codes 0x10000 - 0x1FFFF reserved for OS emulation (Unix)
176 * 0x10000 - 0x10002 in use for unix signals
177 * 0x20000 - 0x2FFFF reserved for MACF
178 */
179#define EXC_SOFT_SIGNAL 0x10003 /* Unix signal exceptions */
180
181#define EXC_MACF_MIN 0x20000 /* MACF exceptions */
182#define EXC_MACF_MAX 0x2FFFF
183
184#ifndef ASSEMBLER
185
186#include <mach/port.h>
187#include <mach/thread_status.h>
188#include <mach/machine/vm_types.h>
189#include <mach_debug/ipc_info.h>
190/*
191 * Exported types
192 */
193
194typedef int exception_type_t;
195typedef integer_t exception_data_type_t;
196typedef int64_t mach_exception_data_type_t;
197typedef int exception_behavior_t;
198typedef exception_data_type_t *exception_data_t;
199typedef mach_exception_data_type_t *mach_exception_data_t;
200typedef unsigned int exception_mask_t;
201typedef exception_mask_t *exception_mask_array_t;
202typedef exception_behavior_t *exception_behavior_array_t;
203typedef thread_state_flavor_t *exception_flavor_array_t;
204typedef mach_port_t *exception_port_array_t;
205typedef ipc_info_port_t *exception_port_info_array_t;
206typedef mach_exception_data_type_t mach_exception_code_t;
207typedef mach_exception_data_type_t mach_exception_subcode_t;
208
209#endif /* ASSEMBLER */
210
211#endif /* _MACH_EXCEPTION_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/host_priv.h deleted-1164
......@@ -1,1164 +0,0 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.h>
59#include <mach/mach_types.h>
60#include <mach/mach_types.h>
61#include <mach_debug/mach_debug_types.h>
62
63#ifdef __BeforeMigUserHeader
64__BeforeMigUserHeader
65#endif /* __BeforeMigUserHeader */
66
67#include <sys/cdefs.h>
68__BEGIN_DECLS
69
70
71/* Routine host_get_boot_info */
72#ifdef mig_external
73mig_external
74#else
75extern
76#endif /* mig_external */
77kern_return_t host_get_boot_info
78(
79 host_priv_t host_priv,
80 kernel_boot_info_t boot_info
81);
82
83/* Routine host_reboot */
84#ifdef mig_external
85mig_external
86#else
87extern
88#endif /* mig_external */
89kern_return_t host_reboot
90(
91 host_priv_t host_priv,
92 int options
93);
94
95/* Routine host_priv_statistics */
96#ifdef mig_external
97mig_external
98#else
99extern
100#endif /* mig_external */
101kern_return_t host_priv_statistics
102(
103 host_priv_t host_priv,
104 host_flavor_t flavor,
105 host_info_t host_info_out,
106 mach_msg_type_number_t *host_info_outCnt
107);
108
109/* Routine host_default_memory_manager */
110#ifdef mig_external
111mig_external
112#else
113extern
114#endif /* mig_external */
115kern_return_t host_default_memory_manager
116(
117 host_priv_t host_priv,
118 memory_object_default_t *default_manager,
119 memory_object_cluster_size_t cluster_size
120);
121
122/* Routine vm_wire */
123#ifdef mig_external
124mig_external
125#else
126extern
127#endif /* mig_external */
128kern_return_t vm_wire
129(
130 host_priv_t host_priv,
131 vm_map_t task,
132 vm_address_t address,
133 vm_size_t size,
134 vm_prot_t desired_access
135);
136
137/* Routine thread_wire */
138#ifdef mig_external
139mig_external
140#else
141extern
142#endif /* mig_external */
143kern_return_t thread_wire
144(
145 host_priv_t host_priv,
146 thread_act_t thread,
147 boolean_t wired
148);
149
150/* Routine vm_allocate_cpm */
151#ifdef mig_external
152mig_external
153#else
154extern
155#endif /* mig_external */
156kern_return_t vm_allocate_cpm
157(
158 host_priv_t host_priv,
159 vm_map_t task,
160 vm_address_t *address,
161 vm_size_t size,
162 int flags
163);
164
165/* Routine host_processors */
166#ifdef mig_external
167mig_external
168#else
169extern
170#endif /* mig_external */
171kern_return_t host_processors
172(
173 host_priv_t host_priv,
174 processor_array_t *out_processor_list,
175 mach_msg_type_number_t *out_processor_listCnt
176);
177
178/* Routine host_get_clock_control */
179#ifdef mig_external
180mig_external
181#else
182extern
183#endif /* mig_external */
184kern_return_t host_get_clock_control
185(
186 host_priv_t host_priv,
187 clock_id_t clock_id,
188 clock_ctrl_t *clock_ctrl
189);
190
191/* Routine kmod_create */
192#ifdef mig_external
193mig_external
194#else
195extern
196#endif /* mig_external */
197kern_return_t kmod_create
198(
199 host_priv_t host_priv,
200 vm_address_t info,
201 kmod_t *module
202);
203
204/* Routine kmod_destroy */
205#ifdef mig_external
206mig_external
207#else
208extern
209#endif /* mig_external */
210kern_return_t kmod_destroy
211(
212 host_priv_t host_priv,
213 kmod_t module
214);
215
216/* Routine kmod_control */
217#ifdef mig_external
218mig_external
219#else
220extern
221#endif /* mig_external */
222kern_return_t kmod_control
223(
224 host_priv_t host_priv,
225 kmod_t module,
226 kmod_control_flavor_t flavor,
227 kmod_args_t *data,
228 mach_msg_type_number_t *dataCnt
229);
230
231/* Routine host_get_special_port */
232#ifdef mig_external
233mig_external
234#else
235extern
236#endif /* mig_external */
237kern_return_t host_get_special_port
238(
239 host_priv_t host_priv,
240 int node,
241 int which,
242 mach_port_t *port
243);
244
245/* Routine host_set_special_port */
246#ifdef mig_external
247mig_external
248#else
249extern
250#endif /* mig_external */
251kern_return_t host_set_special_port
252(
253 host_priv_t host_priv,
254 int which,
255 mach_port_t port
256);
257
258/* Routine host_set_exception_ports */
259#ifdef mig_external
260mig_external
261#else
262extern
263#endif /* mig_external */
264kern_return_t host_set_exception_ports
265(
266 host_priv_t host_priv,
267 exception_mask_t exception_mask,
268 mach_port_t new_port,
269 exception_behavior_t behavior,
270 thread_state_flavor_t new_flavor
271);
272
273/* Routine host_get_exception_ports */
274#ifdef mig_external
275mig_external
276#else
277extern
278#endif /* mig_external */
279kern_return_t host_get_exception_ports
280(
281 host_priv_t host_priv,
282 exception_mask_t exception_mask,
283 exception_mask_array_t masks,
284 mach_msg_type_number_t *masksCnt,
285 exception_handler_array_t old_handlers,
286 exception_behavior_array_t old_behaviors,
287 exception_flavor_array_t old_flavors
288);
289
290/* Routine host_swap_exception_ports */
291#ifdef mig_external
292mig_external
293#else
294extern
295#endif /* mig_external */
296kern_return_t host_swap_exception_ports
297(
298 host_priv_t host_priv,
299 exception_mask_t exception_mask,
300 mach_port_t new_port,
301 exception_behavior_t behavior,
302 thread_state_flavor_t new_flavor,
303 exception_mask_array_t masks,
304 mach_msg_type_number_t *masksCnt,
305 exception_handler_array_t old_handlerss,
306 exception_behavior_array_t old_behaviors,
307 exception_flavor_array_t old_flavors
308);
309
310/* Routine mach_vm_wire */
311#ifdef mig_external
312mig_external
313#else
314extern
315#endif /* mig_external */
316kern_return_t mach_vm_wire
317(
318 host_priv_t host_priv,
319 vm_map_t task,
320 mach_vm_address_t address,
321 mach_vm_size_t size,
322 vm_prot_t desired_access
323);
324
325/* Routine host_processor_sets */
326#ifdef mig_external
327mig_external
328#else
329extern
330#endif /* mig_external */
331kern_return_t host_processor_sets
332(
333 host_priv_t host_priv,
334 processor_set_name_array_t *processor_sets,
335 mach_msg_type_number_t *processor_setsCnt
336);
337
338/* Routine host_processor_set_priv */
339#ifdef mig_external
340mig_external
341#else
342extern
343#endif /* mig_external */
344kern_return_t host_processor_set_priv
345(
346 host_priv_t host_priv,
347 processor_set_name_t set_name,
348 processor_set_t *set
349);
350
351/* Routine host_set_UNDServer */
352#ifdef mig_external
353mig_external
354#else
355extern
356#endif /* mig_external */
357kern_return_t host_set_UNDServer
358(
359 host_priv_t host,
360 UNDServerRef server
361);
362
363/* Routine host_get_UNDServer */
364#ifdef mig_external
365mig_external
366#else
367extern
368#endif /* mig_external */
369kern_return_t host_get_UNDServer
370(
371 host_priv_t host,
372 UNDServerRef *server
373);
374
375/* Routine kext_request */
376#ifdef mig_external
377mig_external
378#else
379extern
380#endif /* mig_external */
381kern_return_t kext_request
382(
383 host_priv_t host_priv,
384 uint32_t user_log_flags,
385 vm_offset_t request_data,
386 mach_msg_type_number_t request_dataCnt,
387 vm_offset_t *response_data,
388 mach_msg_type_number_t *response_dataCnt,
389 vm_offset_t *log_data,
390 mach_msg_type_number_t *log_dataCnt,
391 kern_return_t *op_result
392);
393
394__END_DECLS
395
396/********************** Caution **************************/
397/* The following data types should be used to calculate */
398/* maximum message sizes only. The actual message may be */
399/* smaller, and the position of the arguments within the */
400/* message layout may vary from what is presented here. */
401/* For example, if any of the arguments are variable- */
402/* sized, and less than the maximum is sent, the data */
403/* will be packed tight in the actual message to reduce */
404/* the presence of holes. */
405/********************** Caution **************************/
406
407/* typedefs for all requests */
408
409#ifndef __Request__host_priv_subsystem__defined
410#define __Request__host_priv_subsystem__defined
411
412#ifdef __MigPackStructs
413#pragma pack(push, 4)
414#endif
415 typedef struct {
416 mach_msg_header_t Head;
417 } __Request__host_get_boot_info_t __attribute__((unused));
418#ifdef __MigPackStructs
419#pragma pack(pop)
420#endif
421
422#ifdef __MigPackStructs
423#pragma pack(push, 4)
424#endif
425 typedef struct {
426 mach_msg_header_t Head;
427 NDR_record_t NDR;
428 int options;
429 } __Request__host_reboot_t __attribute__((unused));
430#ifdef __MigPackStructs
431#pragma pack(pop)
432#endif
433
434#ifdef __MigPackStructs
435#pragma pack(push, 4)
436#endif
437 typedef struct {
438 mach_msg_header_t Head;
439 NDR_record_t NDR;
440 host_flavor_t flavor;
441 mach_msg_type_number_t host_info_outCnt;
442 } __Request__host_priv_statistics_t __attribute__((unused));
443#ifdef __MigPackStructs
444#pragma pack(pop)
445#endif
446
447#ifdef __MigPackStructs
448#pragma pack(push, 4)
449#endif
450 typedef struct {
451 mach_msg_header_t Head;
452 /* start of the kernel processed data */
453 mach_msg_body_t msgh_body;
454 mach_msg_port_descriptor_t default_manager;
455 /* end of the kernel processed data */
456 NDR_record_t NDR;
457 memory_object_cluster_size_t cluster_size;
458 } __Request__host_default_memory_manager_t __attribute__((unused));
459#ifdef __MigPackStructs
460#pragma pack(pop)
461#endif
462
463#ifdef __MigPackStructs
464#pragma pack(push, 4)
465#endif
466 typedef struct {
467 mach_msg_header_t Head;
468 /* start of the kernel processed data */
469 mach_msg_body_t msgh_body;
470 mach_msg_port_descriptor_t task;
471 /* end of the kernel processed data */
472 NDR_record_t NDR;
473 vm_address_t address;
474 vm_size_t size;
475 vm_prot_t desired_access;
476 } __Request__vm_wire_t __attribute__((unused));
477#ifdef __MigPackStructs
478#pragma pack(pop)
479#endif
480
481#ifdef __MigPackStructs
482#pragma pack(push, 4)
483#endif
484 typedef struct {
485 mach_msg_header_t Head;
486 /* start of the kernel processed data */
487 mach_msg_body_t msgh_body;
488 mach_msg_port_descriptor_t thread;
489 /* end of the kernel processed data */
490 NDR_record_t NDR;
491 boolean_t wired;
492 } __Request__thread_wire_t __attribute__((unused));
493#ifdef __MigPackStructs
494#pragma pack(pop)
495#endif
496
497#ifdef __MigPackStructs
498#pragma pack(push, 4)
499#endif
500 typedef struct {
501 mach_msg_header_t Head;
502 /* start of the kernel processed data */
503 mach_msg_body_t msgh_body;
504 mach_msg_port_descriptor_t task;
505 /* end of the kernel processed data */
506 NDR_record_t NDR;
507 vm_address_t address;
508 vm_size_t size;
509 int flags;
510 } __Request__vm_allocate_cpm_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 } __Request__host_processors_t __attribute__((unused));
521#ifdef __MigPackStructs
522#pragma pack(pop)
523#endif
524
525#ifdef __MigPackStructs
526#pragma pack(push, 4)
527#endif
528 typedef struct {
529 mach_msg_header_t Head;
530 NDR_record_t NDR;
531 clock_id_t clock_id;
532 } __Request__host_get_clock_control_t __attribute__((unused));
533#ifdef __MigPackStructs
534#pragma pack(pop)
535#endif
536
537#ifdef __MigPackStructs
538#pragma pack(push, 4)
539#endif
540 typedef struct {
541 mach_msg_header_t Head;
542 NDR_record_t NDR;
543 vm_address_t info;
544 } __Request__kmod_create_t __attribute__((unused));
545#ifdef __MigPackStructs
546#pragma pack(pop)
547#endif
548
549#ifdef __MigPackStructs
550#pragma pack(push, 4)
551#endif
552 typedef struct {
553 mach_msg_header_t Head;
554 NDR_record_t NDR;
555 kmod_t module;
556 } __Request__kmod_destroy_t __attribute__((unused));
557#ifdef __MigPackStructs
558#pragma pack(pop)
559#endif
560
561#ifdef __MigPackStructs
562#pragma pack(push, 4)
563#endif
564 typedef struct {
565 mach_msg_header_t Head;
566 /* start of the kernel processed data */
567 mach_msg_body_t msgh_body;
568 mach_msg_ool_descriptor_t data;
569 /* end of the kernel processed data */
570 NDR_record_t NDR;
571 kmod_t module;
572 kmod_control_flavor_t flavor;
573 mach_msg_type_number_t dataCnt;
574 } __Request__kmod_control_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 NDR_record_t NDR;
585 int node;
586 int which;
587 } __Request__host_get_special_port_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 port;
600 /* end of the kernel processed data */
601 NDR_record_t NDR;
602 int which;
603 } __Request__host_set_special_port_t __attribute__((unused));
604#ifdef __MigPackStructs
605#pragma pack(pop)
606#endif
607
608#ifdef __MigPackStructs
609#pragma pack(push, 4)
610#endif
611 typedef struct {
612 mach_msg_header_t Head;
613 /* start of the kernel processed data */
614 mach_msg_body_t msgh_body;
615 mach_msg_port_descriptor_t new_port;
616 /* end of the kernel processed data */
617 NDR_record_t NDR;
618 exception_mask_t exception_mask;
619 exception_behavior_t behavior;
620 thread_state_flavor_t new_flavor;
621 } __Request__host_set_exception_ports_t __attribute__((unused));
622#ifdef __MigPackStructs
623#pragma pack(pop)
624#endif
625
626#ifdef __MigPackStructs
627#pragma pack(push, 4)
628#endif
629 typedef struct {
630 mach_msg_header_t Head;
631 NDR_record_t NDR;
632 exception_mask_t exception_mask;
633 } __Request__host_get_exception_ports_t __attribute__((unused));
634#ifdef __MigPackStructs
635#pragma pack(pop)
636#endif
637
638#ifdef __MigPackStructs
639#pragma pack(push, 4)
640#endif
641 typedef struct {
642 mach_msg_header_t Head;
643 /* start of the kernel processed data */
644 mach_msg_body_t msgh_body;
645 mach_msg_port_descriptor_t new_port;
646 /* end of the kernel processed data */
647 NDR_record_t NDR;
648 exception_mask_t exception_mask;
649 exception_behavior_t behavior;
650 thread_state_flavor_t new_flavor;
651 } __Request__host_swap_exception_ports_t __attribute__((unused));
652#ifdef __MigPackStructs
653#pragma pack(pop)
654#endif
655
656#ifdef __MigPackStructs
657#pragma pack(push, 4)
658#endif
659 typedef struct {
660 mach_msg_header_t Head;
661 /* start of the kernel processed data */
662 mach_msg_body_t msgh_body;
663 mach_msg_port_descriptor_t task;
664 /* end of the kernel processed data */
665 NDR_record_t NDR;
666 mach_vm_address_t address;
667 mach_vm_size_t size;
668 vm_prot_t desired_access;
669 } __Request__mach_vm_wire_t __attribute__((unused));
670#ifdef __MigPackStructs
671#pragma pack(pop)
672#endif
673
674#ifdef __MigPackStructs
675#pragma pack(push, 4)
676#endif
677 typedef struct {
678 mach_msg_header_t Head;
679 } __Request__host_processor_sets_t __attribute__((unused));
680#ifdef __MigPackStructs
681#pragma pack(pop)
682#endif
683
684#ifdef __MigPackStructs
685#pragma pack(push, 4)
686#endif
687 typedef struct {
688 mach_msg_header_t Head;
689 /* start of the kernel processed data */
690 mach_msg_body_t msgh_body;
691 mach_msg_port_descriptor_t set_name;
692 /* end of the kernel processed data */
693 } __Request__host_processor_set_priv_t __attribute__((unused));
694#ifdef __MigPackStructs
695#pragma pack(pop)
696#endif
697
698#ifdef __MigPackStructs
699#pragma pack(push, 4)
700#endif
701 typedef struct {
702 mach_msg_header_t Head;
703 /* start of the kernel processed data */
704 mach_msg_body_t msgh_body;
705 mach_msg_port_descriptor_t server;
706 /* end of the kernel processed data */
707 } __Request__host_set_UNDServer_t __attribute__((unused));
708#ifdef __MigPackStructs
709#pragma pack(pop)
710#endif
711
712#ifdef __MigPackStructs
713#pragma pack(push, 4)
714#endif
715 typedef struct {
716 mach_msg_header_t Head;
717 } __Request__host_get_UNDServer_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_ool_descriptor_t request_data;
730 /* end of the kernel processed data */
731 NDR_record_t NDR;
732 uint32_t user_log_flags;
733 mach_msg_type_number_t request_dataCnt;
734 } __Request__kext_request_t __attribute__((unused));
735#ifdef __MigPackStructs
736#pragma pack(pop)
737#endif
738#endif /* !__Request__host_priv_subsystem__defined */
739
740/* union of all requests */
741
742#ifndef __RequestUnion__host_priv_subsystem__defined
743#define __RequestUnion__host_priv_subsystem__defined
744union __RequestUnion__host_priv_subsystem {
745 __Request__host_get_boot_info_t Request_host_get_boot_info;
746 __Request__host_reboot_t Request_host_reboot;
747 __Request__host_priv_statistics_t Request_host_priv_statistics;
748 __Request__host_default_memory_manager_t Request_host_default_memory_manager;
749 __Request__vm_wire_t Request_vm_wire;
750 __Request__thread_wire_t Request_thread_wire;
751 __Request__vm_allocate_cpm_t Request_vm_allocate_cpm;
752 __Request__host_processors_t Request_host_processors;
753 __Request__host_get_clock_control_t Request_host_get_clock_control;
754 __Request__kmod_create_t Request_kmod_create;
755 __Request__kmod_destroy_t Request_kmod_destroy;
756 __Request__kmod_control_t Request_kmod_control;
757 __Request__host_get_special_port_t Request_host_get_special_port;
758 __Request__host_set_special_port_t Request_host_set_special_port;
759 __Request__host_set_exception_ports_t Request_host_set_exception_ports;
760 __Request__host_get_exception_ports_t Request_host_get_exception_ports;
761 __Request__host_swap_exception_ports_t Request_host_swap_exception_ports;
762 __Request__mach_vm_wire_t Request_mach_vm_wire;
763 __Request__host_processor_sets_t Request_host_processor_sets;
764 __Request__host_processor_set_priv_t Request_host_processor_set_priv;
765 __Request__host_set_UNDServer_t Request_host_set_UNDServer;
766 __Request__host_get_UNDServer_t Request_host_get_UNDServer;
767 __Request__kext_request_t Request_kext_request;
768};
769#endif /* !__RequestUnion__host_priv_subsystem__defined */
770/* typedefs for all replies */
771
772#ifndef __Reply__host_priv_subsystem__defined
773#define __Reply__host_priv_subsystem__defined
774
775#ifdef __MigPackStructs
776#pragma pack(push, 4)
777#endif
778 typedef struct {
779 mach_msg_header_t Head;
780 NDR_record_t NDR;
781 kern_return_t RetCode;
782 mach_msg_type_number_t boot_infoOffset; /* MiG doesn't use it */
783 mach_msg_type_number_t boot_infoCnt;
784 char boot_info[4096];
785 } __Reply__host_get_boot_info_t __attribute__((unused));
786#ifdef __MigPackStructs
787#pragma pack(pop)
788#endif
789
790#ifdef __MigPackStructs
791#pragma pack(push, 4)
792#endif
793 typedef struct {
794 mach_msg_header_t Head;
795 NDR_record_t NDR;
796 kern_return_t RetCode;
797 } __Reply__host_reboot_t __attribute__((unused));
798#ifdef __MigPackStructs
799#pragma pack(pop)
800#endif
801
802#ifdef __MigPackStructs
803#pragma pack(push, 4)
804#endif
805 typedef struct {
806 mach_msg_header_t Head;
807 NDR_record_t NDR;
808 kern_return_t RetCode;
809 mach_msg_type_number_t host_info_outCnt;
810 integer_t host_info_out[68];
811 } __Reply__host_priv_statistics_t __attribute__((unused));
812#ifdef __MigPackStructs
813#pragma pack(pop)
814#endif
815
816#ifdef __MigPackStructs
817#pragma pack(push, 4)
818#endif
819 typedef struct {
820 mach_msg_header_t Head;
821 /* start of the kernel processed data */
822 mach_msg_body_t msgh_body;
823 mach_msg_port_descriptor_t default_manager;
824 /* end of the kernel processed data */
825 } __Reply__host_default_memory_manager_t __attribute__((unused));
826#ifdef __MigPackStructs
827#pragma pack(pop)
828#endif
829
830#ifdef __MigPackStructs
831#pragma pack(push, 4)
832#endif
833 typedef struct {
834 mach_msg_header_t Head;
835 NDR_record_t NDR;
836 kern_return_t RetCode;
837 } __Reply__vm_wire_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 kern_return_t RetCode;
849 } __Reply__thread_wire_t __attribute__((unused));
850#ifdef __MigPackStructs
851#pragma pack(pop)
852#endif
853
854#ifdef __MigPackStructs
855#pragma pack(push, 4)
856#endif
857 typedef struct {
858 mach_msg_header_t Head;
859 NDR_record_t NDR;
860 kern_return_t RetCode;
861 vm_address_t address;
862 } __Reply__vm_allocate_cpm_t __attribute__((unused));
863#ifdef __MigPackStructs
864#pragma pack(pop)
865#endif
866
867#ifdef __MigPackStructs
868#pragma pack(push, 4)
869#endif
870 typedef struct {
871 mach_msg_header_t Head;
872 /* start of the kernel processed data */
873 mach_msg_body_t msgh_body;
874 mach_msg_ool_ports_descriptor_t out_processor_list;
875 /* end of the kernel processed data */
876 NDR_record_t NDR;
877 mach_msg_type_number_t out_processor_listCnt;
878 } __Reply__host_processors_t __attribute__((unused));
879#ifdef __MigPackStructs
880#pragma pack(pop)
881#endif
882
883#ifdef __MigPackStructs
884#pragma pack(push, 4)
885#endif
886 typedef struct {
887 mach_msg_header_t Head;
888 /* start of the kernel processed data */
889 mach_msg_body_t msgh_body;
890 mach_msg_port_descriptor_t clock_ctrl;
891 /* end of the kernel processed data */
892 } __Reply__host_get_clock_control_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 NDR_record_t NDR;
903 kern_return_t RetCode;
904 kmod_t module;
905 } __Reply__kmod_create_t __attribute__((unused));
906#ifdef __MigPackStructs
907#pragma pack(pop)
908#endif
909
910#ifdef __MigPackStructs
911#pragma pack(push, 4)
912#endif
913 typedef struct {
914 mach_msg_header_t Head;
915 NDR_record_t NDR;
916 kern_return_t RetCode;
917 } __Reply__kmod_destroy_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 /* start of the kernel processed data */
928 mach_msg_body_t msgh_body;
929 mach_msg_ool_descriptor_t data;
930 /* end of the kernel processed data */
931 NDR_record_t NDR;
932 mach_msg_type_number_t dataCnt;
933 } __Reply__kmod_control_t __attribute__((unused));
934#ifdef __MigPackStructs
935#pragma pack(pop)
936#endif
937
938#ifdef __MigPackStructs
939#pragma pack(push, 4)
940#endif
941 typedef struct {
942 mach_msg_header_t Head;
943 /* start of the kernel processed data */
944 mach_msg_body_t msgh_body;
945 mach_msg_port_descriptor_t port;
946 /* end of the kernel processed data */
947 } __Reply__host_get_special_port_t __attribute__((unused));
948#ifdef __MigPackStructs
949#pragma pack(pop)
950#endif
951
952#ifdef __MigPackStructs
953#pragma pack(push, 4)
954#endif
955 typedef struct {
956 mach_msg_header_t Head;
957 NDR_record_t NDR;
958 kern_return_t RetCode;
959 } __Reply__host_set_special_port_t __attribute__((unused));
960#ifdef __MigPackStructs
961#pragma pack(pop)
962#endif
963
964#ifdef __MigPackStructs
965#pragma pack(push, 4)
966#endif
967 typedef struct {
968 mach_msg_header_t Head;
969 NDR_record_t NDR;
970 kern_return_t RetCode;
971 } __Reply__host_set_exception_ports_t __attribute__((unused));
972#ifdef __MigPackStructs
973#pragma pack(pop)
974#endif
975
976#ifdef __MigPackStructs
977#pragma pack(push, 4)
978#endif
979 typedef struct {
980 mach_msg_header_t Head;
981 /* start of the kernel processed data */
982 mach_msg_body_t msgh_body;
983 mach_msg_port_descriptor_t old_handlers[32];
984 /* end of the kernel processed data */
985 NDR_record_t NDR;
986 mach_msg_type_number_t masksCnt;
987 exception_mask_t masks[32];
988 exception_behavior_t old_behaviors[32];
989 thread_state_flavor_t old_flavors[32];
990 } __Reply__host_get_exception_ports_t __attribute__((unused));
991#ifdef __MigPackStructs
992#pragma pack(pop)
993#endif
994
995#ifdef __MigPackStructs
996#pragma pack(push, 4)
997#endif
998 typedef struct {
999 mach_msg_header_t Head;
1000 /* start of the kernel processed data */
1001 mach_msg_body_t msgh_body;
1002 mach_msg_port_descriptor_t old_handlerss[32];
1003 /* end of the kernel processed data */
1004 NDR_record_t NDR;
1005 mach_msg_type_number_t masksCnt;
1006 exception_mask_t masks[32];
1007 exception_behavior_t old_behaviors[32];
1008 thread_state_flavor_t old_flavors[32];
1009 } __Reply__host_swap_exception_ports_t __attribute__((unused));
1010#ifdef __MigPackStructs
1011#pragma pack(pop)
1012#endif
1013
1014#ifdef __MigPackStructs
1015#pragma pack(push, 4)
1016#endif
1017 typedef struct {
1018 mach_msg_header_t Head;
1019 NDR_record_t NDR;
1020 kern_return_t RetCode;
1021 } __Reply__mach_vm_wire_t __attribute__((unused));
1022#ifdef __MigPackStructs
1023#pragma pack(pop)
1024#endif
1025
1026#ifdef __MigPackStructs
1027#pragma pack(push, 4)
1028#endif
1029 typedef struct {
1030 mach_msg_header_t Head;
1031 /* start of the kernel processed data */
1032 mach_msg_body_t msgh_body;
1033 mach_msg_ool_ports_descriptor_t processor_sets;
1034 /* end of the kernel processed data */
1035 NDR_record_t NDR;
1036 mach_msg_type_number_t processor_setsCnt;
1037 } __Reply__host_processor_sets_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 /* start of the kernel processed data */
1048 mach_msg_body_t msgh_body;
1049 mach_msg_port_descriptor_t set;
1050 /* end of the kernel processed data */
1051 } __Reply__host_processor_set_priv_t __attribute__((unused));
1052#ifdef __MigPackStructs
1053#pragma pack(pop)
1054#endif
1055
1056#ifdef __MigPackStructs
1057#pragma pack(push, 4)
1058#endif
1059 typedef struct {
1060 mach_msg_header_t Head;
1061 NDR_record_t NDR;
1062 kern_return_t RetCode;
1063 } __Reply__host_set_UNDServer_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 /* start of the kernel processed data */
1074 mach_msg_body_t msgh_body;
1075 mach_msg_port_descriptor_t server;
1076 /* end of the kernel processed data */
1077 } __Reply__host_get_UNDServer_t __attribute__((unused));
1078#ifdef __MigPackStructs
1079#pragma pack(pop)
1080#endif
1081
1082#ifdef __MigPackStructs
1083#pragma pack(push, 4)
1084#endif
1085 typedef struct {
1086 mach_msg_header_t Head;
1087 /* start of the kernel processed data */
1088 mach_msg_body_t msgh_body;
1089 mach_msg_ool_descriptor_t response_data;
1090 mach_msg_ool_descriptor_t log_data;
1091 /* end of the kernel processed data */
1092 NDR_record_t NDR;
1093 mach_msg_type_number_t response_dataCnt;
1094 mach_msg_type_number_t log_dataCnt;
1095 kern_return_t op_result;
1096 } __Reply__kext_request_t __attribute__((unused));
1097#ifdef __MigPackStructs
1098#pragma pack(pop)
1099#endif
1100#endif /* !__Reply__host_priv_subsystem__defined */
1101
1102/* union of all replies */
1103
1104#ifndef __ReplyUnion__host_priv_subsystem__defined
1105#define __ReplyUnion__host_priv_subsystem__defined
1106union __ReplyUnion__host_priv_subsystem {
1107 __Reply__host_get_boot_info_t Reply_host_get_boot_info;
1108 __Reply__host_reboot_t Reply_host_reboot;
1109 __Reply__host_priv_statistics_t Reply_host_priv_statistics;
1110 __Reply__host_default_memory_manager_t Reply_host_default_memory_manager;
1111 __Reply__vm_wire_t Reply_vm_wire;
1112 __Reply__thread_wire_t Reply_thread_wire;
1113 __Reply__vm_allocate_cpm_t Reply_vm_allocate_cpm;
1114 __Reply__host_processors_t Reply_host_processors;
1115 __Reply__host_get_clock_control_t Reply_host_get_clock_control;
1116 __Reply__kmod_create_t Reply_kmod_create;
1117 __Reply__kmod_destroy_t Reply_kmod_destroy;
1118 __Reply__kmod_control_t Reply_kmod_control;
1119 __Reply__host_get_special_port_t Reply_host_get_special_port;
1120 __Reply__host_set_special_port_t Reply_host_set_special_port;
1121 __Reply__host_set_exception_ports_t Reply_host_set_exception_ports;
1122 __Reply__host_get_exception_ports_t Reply_host_get_exception_ports;
1123 __Reply__host_swap_exception_ports_t Reply_host_swap_exception_ports;
1124 __Reply__mach_vm_wire_t Reply_mach_vm_wire;
1125 __Reply__host_processor_sets_t Reply_host_processor_sets;
1126 __Reply__host_processor_set_priv_t Reply_host_processor_set_priv;
1127 __Reply__host_set_UNDServer_t Reply_host_set_UNDServer;
1128 __Reply__host_get_UNDServer_t Reply_host_get_UNDServer;
1129 __Reply__kext_request_t Reply_kext_request;
1130};
1131#endif /* !__RequestUnion__host_priv_subsystem__defined */
1132
1133#ifndef subsystem_to_name_map_host_priv
1134#define subsystem_to_name_map_host_priv \
1135 { "host_get_boot_info", 400 },\
1136 { "host_reboot", 401 },\
1137 { "host_priv_statistics", 402 },\
1138 { "host_default_memory_manager", 403 },\
1139 { "vm_wire", 404 },\
1140 { "thread_wire", 405 },\
1141 { "vm_allocate_cpm", 406 },\
1142 { "host_processors", 407 },\
1143 { "host_get_clock_control", 408 },\
1144 { "kmod_create", 409 },\
1145 { "kmod_destroy", 410 },\
1146 { "kmod_control", 411 },\
1147 { "host_get_special_port", 412 },\
1148 { "host_set_special_port", 413 },\
1149 { "host_set_exception_ports", 414 },\
1150 { "host_get_exception_ports", 415 },\
1151 { "host_swap_exception_ports", 416 },\
1152 { "mach_vm_wire", 418 },\
1153 { "host_processor_sets", 419 },\
1154 { "host_processor_set_priv", 420 },\
1155 { "host_set_UNDServer", 423 },\
1156 { "host_get_UNDServer", 424 },\
1157 { "kext_request", 425 }
1158#endif
1159
1160#ifdef __AfterMigUserHeader
1161__AfterMigUserHeader
1162#endif /* __AfterMigUserHeader */
1163
1164#endif /* _host_priv_user_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/host_security.h deleted-222
......@@ -1,222 +0,0 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 host_security_create_task_token */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t host_security_create_task_token
76(
77 host_security_t host_security,
78 task_t parent_task,
79 security_token_t sec_token,
80 audit_token_t audit_token,
81 host_t host,
82 ledger_array_t ledgers,
83 mach_msg_type_number_t ledgersCnt,
84 boolean_t inherit_memory,
85 task_t *child_task
86);
87
88/* Routine host_security_set_task_token */
89#ifdef mig_external
90mig_external
91#else
92extern
93#endif /* mig_external */
94kern_return_t host_security_set_task_token
95(
96 host_security_t host_security,
97 task_t target_task,
98 security_token_t sec_token,
99 audit_token_t audit_token,
100 host_t host
101);
102
103__END_DECLS
104
105/********************** Caution **************************/
106/* The following data types should be used to calculate */
107/* maximum message sizes only. The actual message may be */
108/* smaller, and the position of the arguments within the */
109/* message layout may vary from what is presented here. */
110/* For example, if any of the arguments are variable- */
111/* sized, and less than the maximum is sent, the data */
112/* will be packed tight in the actual message to reduce */
113/* the presence of holes. */
114/********************** Caution **************************/
115
116/* typedefs for all requests */
117
118#ifndef __Request__host_security_subsystem__defined
119#define __Request__host_security_subsystem__defined
120
121#ifdef __MigPackStructs
122#pragma pack(push, 4)
123#endif
124 typedef struct {
125 mach_msg_header_t Head;
126 /* start of the kernel processed data */
127 mach_msg_body_t msgh_body;
128 mach_msg_port_descriptor_t parent_task;
129 mach_msg_port_descriptor_t host;
130 mach_msg_ool_ports_descriptor_t ledgers;
131 /* end of the kernel processed data */
132 NDR_record_t NDR;
133 security_token_t sec_token;
134 audit_token_t audit_token;
135 mach_msg_type_number_t ledgersCnt;
136 boolean_t inherit_memory;
137 } __Request__host_security_create_task_token_t __attribute__((unused));
138#ifdef __MigPackStructs
139#pragma pack(pop)
140#endif
141
142#ifdef __MigPackStructs
143#pragma pack(push, 4)
144#endif
145 typedef struct {
146 mach_msg_header_t Head;
147 /* start of the kernel processed data */
148 mach_msg_body_t msgh_body;
149 mach_msg_port_descriptor_t target_task;
150 mach_msg_port_descriptor_t host;
151 /* end of the kernel processed data */
152 NDR_record_t NDR;
153 security_token_t sec_token;
154 audit_token_t audit_token;
155 } __Request__host_security_set_task_token_t __attribute__((unused));
156#ifdef __MigPackStructs
157#pragma pack(pop)
158#endif
159#endif /* !__Request__host_security_subsystem__defined */
160
161/* union of all requests */
162
163#ifndef __RequestUnion__host_security_subsystem__defined
164#define __RequestUnion__host_security_subsystem__defined
165union __RequestUnion__host_security_subsystem {
166 __Request__host_security_create_task_token_t Request_host_security_create_task_token;
167 __Request__host_security_set_task_token_t Request_host_security_set_task_token;
168};
169#endif /* !__RequestUnion__host_security_subsystem__defined */
170/* typedefs for all replies */
171
172#ifndef __Reply__host_security_subsystem__defined
173#define __Reply__host_security_subsystem__defined
174
175#ifdef __MigPackStructs
176#pragma pack(push, 4)
177#endif
178 typedef struct {
179 mach_msg_header_t Head;
180 /* start of the kernel processed data */
181 mach_msg_body_t msgh_body;
182 mach_msg_port_descriptor_t child_task;
183 /* end of the kernel processed data */
184 } __Reply__host_security_create_task_token_t __attribute__((unused));
185#ifdef __MigPackStructs
186#pragma pack(pop)
187#endif
188
189#ifdef __MigPackStructs
190#pragma pack(push, 4)
191#endif
192 typedef struct {
193 mach_msg_header_t Head;
194 NDR_record_t NDR;
195 kern_return_t RetCode;
196 } __Reply__host_security_set_task_token_t __attribute__((unused));
197#ifdef __MigPackStructs
198#pragma pack(pop)
199#endif
200#endif /* !__Reply__host_security_subsystem__defined */
201
202/* union of all replies */
203
204#ifndef __ReplyUnion__host_security_subsystem__defined
205#define __ReplyUnion__host_security_subsystem__defined
206union __ReplyUnion__host_security_subsystem {
207 __Reply__host_security_create_task_token_t Reply_host_security_create_task_token;
208 __Reply__host_security_set_task_token_t Reply_host_security_set_task_token;
209};
210#endif /* !__RequestUnion__host_security_subsystem__defined */
211
212#ifndef subsystem_to_name_map_host_security
213#define subsystem_to_name_map_host_security \
214 { "host_security_create_task_token", 600 },\
215 { "host_security_set_task_token", 601 }
216#endif
217
218#ifdef __AfterMigUserHeader
219__AfterMigUserHeader
220#endif /* __AfterMigUserHeader */
221
222#endif /* _host_security_user_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/lock_set.h deleted-351
......@@ -1,351 +0,0 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 lock_acquire */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t lock_acquire
76(
77 lock_set_t lock_set,
78 int lock_id
79);
80
81/* Routine lock_release */
82#ifdef mig_external
83mig_external
84#else
85extern
86#endif /* mig_external */
87kern_return_t lock_release
88(
89 lock_set_t lock_set,
90 int lock_id
91);
92
93/* Routine lock_try */
94#ifdef mig_external
95mig_external
96#else
97extern
98#endif /* mig_external */
99kern_return_t lock_try
100(
101 lock_set_t lock_set,
102 int lock_id
103);
104
105/* Routine lock_make_stable */
106#ifdef mig_external
107mig_external
108#else
109extern
110#endif /* mig_external */
111kern_return_t lock_make_stable
112(
113 lock_set_t lock_set,
114 int lock_id
115);
116
117/* Routine lock_handoff */
118#ifdef mig_external
119mig_external
120#else
121extern
122#endif /* mig_external */
123kern_return_t lock_handoff
124(
125 lock_set_t lock_set,
126 int lock_id
127);
128
129/* Routine lock_handoff_accept */
130#ifdef mig_external
131mig_external
132#else
133extern
134#endif /* mig_external */
135kern_return_t lock_handoff_accept
136(
137 lock_set_t lock_set,
138 int lock_id
139);
140
141__END_DECLS
142
143/********************** Caution **************************/
144/* The following data types should be used to calculate */
145/* maximum message sizes only. The actual message may be */
146/* smaller, and the position of the arguments within the */
147/* message layout may vary from what is presented here. */
148/* For example, if any of the arguments are variable- */
149/* sized, and less than the maximum is sent, the data */
150/* will be packed tight in the actual message to reduce */
151/* the presence of holes. */
152/********************** Caution **************************/
153
154/* typedefs for all requests */
155
156#ifndef __Request__lock_set_subsystem__defined
157#define __Request__lock_set_subsystem__defined
158
159#ifdef __MigPackStructs
160#pragma pack(push, 4)
161#endif
162 typedef struct {
163 mach_msg_header_t Head;
164 NDR_record_t NDR;
165 int lock_id;
166 } __Request__lock_acquire_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 NDR_record_t NDR;
177 int lock_id;
178 } __Request__lock_release_t __attribute__((unused));
179#ifdef __MigPackStructs
180#pragma pack(pop)
181#endif
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 int lock_id;
190 } __Request__lock_try_t __attribute__((unused));
191#ifdef __MigPackStructs
192#pragma pack(pop)
193#endif
194
195#ifdef __MigPackStructs
196#pragma pack(push, 4)
197#endif
198 typedef struct {
199 mach_msg_header_t Head;
200 NDR_record_t NDR;
201 int lock_id;
202 } __Request__lock_make_stable_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 NDR_record_t NDR;
213 int lock_id;
214 } __Request__lock_handoff_t __attribute__((unused));
215#ifdef __MigPackStructs
216#pragma pack(pop)
217#endif
218
219#ifdef __MigPackStructs
220#pragma pack(push, 4)
221#endif
222 typedef struct {
223 mach_msg_header_t Head;
224 NDR_record_t NDR;
225 int lock_id;
226 } __Request__lock_handoff_accept_t __attribute__((unused));
227#ifdef __MigPackStructs
228#pragma pack(pop)
229#endif
230#endif /* !__Request__lock_set_subsystem__defined */
231
232/* union of all requests */
233
234#ifndef __RequestUnion__lock_set_subsystem__defined
235#define __RequestUnion__lock_set_subsystem__defined
236union __RequestUnion__lock_set_subsystem {
237 __Request__lock_acquire_t Request_lock_acquire;
238 __Request__lock_release_t Request_lock_release;
239 __Request__lock_try_t Request_lock_try;
240 __Request__lock_make_stable_t Request_lock_make_stable;
241 __Request__lock_handoff_t Request_lock_handoff;
242 __Request__lock_handoff_accept_t Request_lock_handoff_accept;
243};
244#endif /* !__RequestUnion__lock_set_subsystem__defined */
245/* typedefs for all replies */
246
247#ifndef __Reply__lock_set_subsystem__defined
248#define __Reply__lock_set_subsystem__defined
249
250#ifdef __MigPackStructs
251#pragma pack(push, 4)
252#endif
253 typedef struct {
254 mach_msg_header_t Head;
255 NDR_record_t NDR;
256 kern_return_t RetCode;
257 } __Reply__lock_acquire_t __attribute__((unused));
258#ifdef __MigPackStructs
259#pragma pack(pop)
260#endif
261
262#ifdef __MigPackStructs
263#pragma pack(push, 4)
264#endif
265 typedef struct {
266 mach_msg_header_t Head;
267 NDR_record_t NDR;
268 kern_return_t RetCode;
269 } __Reply__lock_release_t __attribute__((unused));
270#ifdef __MigPackStructs
271#pragma pack(pop)
272#endif
273
274#ifdef __MigPackStructs
275#pragma pack(push, 4)
276#endif
277 typedef struct {
278 mach_msg_header_t Head;
279 NDR_record_t NDR;
280 kern_return_t RetCode;
281 } __Reply__lock_try_t __attribute__((unused));
282#ifdef __MigPackStructs
283#pragma pack(pop)
284#endif
285
286#ifdef __MigPackStructs
287#pragma pack(push, 4)
288#endif
289 typedef struct {
290 mach_msg_header_t Head;
291 NDR_record_t NDR;
292 kern_return_t RetCode;
293 } __Reply__lock_make_stable_t __attribute__((unused));
294#ifdef __MigPackStructs
295#pragma pack(pop)
296#endif
297
298#ifdef __MigPackStructs
299#pragma pack(push, 4)
300#endif
301 typedef struct {
302 mach_msg_header_t Head;
303 NDR_record_t NDR;
304 kern_return_t RetCode;
305 } __Reply__lock_handoff_t __attribute__((unused));
306#ifdef __MigPackStructs
307#pragma pack(pop)
308#endif
309
310#ifdef __MigPackStructs
311#pragma pack(push, 4)
312#endif
313 typedef struct {
314 mach_msg_header_t Head;
315 NDR_record_t NDR;
316 kern_return_t RetCode;
317 } __Reply__lock_handoff_accept_t __attribute__((unused));
318#ifdef __MigPackStructs
319#pragma pack(pop)
320#endif
321#endif /* !__Reply__lock_set_subsystem__defined */
322
323/* union of all replies */
324
325#ifndef __ReplyUnion__lock_set_subsystem__defined
326#define __ReplyUnion__lock_set_subsystem__defined
327union __ReplyUnion__lock_set_subsystem {
328 __Reply__lock_acquire_t Reply_lock_acquire;
329 __Reply__lock_release_t Reply_lock_release;
330 __Reply__lock_try_t Reply_lock_try;
331 __Reply__lock_make_stable_t Reply_lock_make_stable;
332 __Reply__lock_handoff_t Reply_lock_handoff;
333 __Reply__lock_handoff_accept_t Reply_lock_handoff_accept;
334};
335#endif /* !__RequestUnion__lock_set_subsystem__defined */
336
337#ifndef subsystem_to_name_map_lock_set
338#define subsystem_to_name_map_lock_set \
339 { "lock_acquire", 617000 },\
340 { "lock_release", 617001 },\
341 { "lock_try", 617002 },\
342 { "lock_make_stable", 617003 },\
343 { "lock_handoff", 617004 },\
344 { "lock_handoff_accept", 617005 }
345#endif
346
347#ifdef __AfterMigUserHeader
348__AfterMigUserHeader
349#endif /* __AfterMigUserHeader */
350
351#endif /* _lock_set_user_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/mach.h deleted-241
......@@ -1,241 +0,0 @@
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 slot_name(cpu_type_t,
89 cpu_subtype_t,
90 char **,
91 char **);
92
93extern void mig_reply_setup(mach_msg_header_t *,
94 mach_msg_header_t *);
95
96__WATCHOS_PROHIBITED __TVOS_PROHIBITED
97extern void mach_msg_destroy(mach_msg_header_t *);
98
99__WATCHOS_PROHIBITED __TVOS_PROHIBITED
100extern mach_msg_return_t mach_msg_receive(mach_msg_header_t *);
101
102__WATCHOS_PROHIBITED __TVOS_PROHIBITED
103extern mach_msg_return_t mach_msg_send(mach_msg_header_t *);
104
105__WATCHOS_PROHIBITED __TVOS_PROHIBITED
106extern mach_msg_return_t mach_msg_server_once(boolean_t (*)
107 (mach_msg_header_t *,
108 mach_msg_header_t *),
109 mach_msg_size_t,
110 mach_port_t,
111 mach_msg_options_t);
112
113__WATCHOS_PROHIBITED __TVOS_PROHIBITED
114extern mach_msg_return_t mach_msg_server(boolean_t (*)
115 (mach_msg_header_t *,
116 mach_msg_header_t *),
117 mach_msg_size_t,
118 mach_port_t,
119 mach_msg_options_t);
120
121__WATCHOS_PROHIBITED __TVOS_PROHIBITED
122extern mach_msg_return_t mach_msg_server_importance(boolean_t (*)
123 (mach_msg_header_t *,
124 mach_msg_header_t *),
125 mach_msg_size_t,
126 mach_port_t,
127 mach_msg_options_t);
128
129/*
130 * Prototypes for compatibility
131 */
132extern kern_return_t clock_get_res(mach_port_t,
133 clock_res_t *);
134extern kern_return_t clock_set_res(mach_port_t,
135 clock_res_t);
136
137extern kern_return_t clock_sleep(mach_port_t,
138 int,
139 mach_timespec_t,
140 mach_timespec_t *);
141
142/*!
143 * @group voucher_mach_msg Prototypes
144 */
145
146#define VOUCHER_MACH_MSG_API_VERSION 20140205
147
148/*!
149 * @typedef voucher_mach_msg_state_t
150 *
151 * @abstract
152 * Opaque object encapsulating state changed by voucher_mach_msg_adopt().
153 */
154typedef struct voucher_mach_msg_state_s *voucher_mach_msg_state_t;
155
156/*!
157 * @const VOUCHER_MACH_MSG_STATE_UNCHANGED
158 *
159 * @discussion
160 * Constant indicating no state change occurred.
161 */
162#define VOUCHER_MACH_MSG_STATE_UNCHANGED ((voucher_mach_msg_state_t)~0ul)
163
164/*!
165 * @function voucher_mach_msg_set
166 *
167 * @abstract
168 * Change specified message header to contain current mach voucher with a
169 * COPY_SEND disposition.
170 * Does not change message if it already has non-zero MACH_MSGH_BITS_VOUCHER.
171 *
172 * @discussion
173 * Borrows reference to current thread voucher so message should be sent
174 * immediately (without intervening calls that might change that voucher).
175 *
176 * @param msg
177 * The message to modify.
178 *
179 * @result
180 * True if header was changed.
181 */
182extern boolean_t voucher_mach_msg_set(mach_msg_header_t *msg);
183
184/*!
185 * @function voucher_mach_msg_clear
186 *
187 * @abstract
188 * Removes changes made to specified message header by voucher_mach_msg_set()
189 * and any mach_msg() send operations (successful or not).
190 * If the message is not needed further, mach_msg_destroy() should be called
191 * instead.
192 *
193 * @discussion
194 * Not intended to be called if voucher_mach_msg_set() returned false.
195 * Releases reference to message mach voucher if an extra reference was
196 * acquired due to an unsuccessful send operation (pseudo-receive).
197 *
198 * @param msg
199 * The message to modify.
200 */
201extern void voucher_mach_msg_clear(mach_msg_header_t *msg);
202
203/*!
204 * @function voucher_mach_msg_adopt
205 *
206 * @abstract
207 * Adopt the voucher contained in the specified message on the current thread
208 * and return the previous thread voucher state.
209 *
210 * @discussion
211 * Ownership of the mach voucher in the message is transferred to the current
212 * thread and the message header voucher fields are cleared.
213 *
214 * @param msg
215 * The message to query and modify.
216 *
217 * @result
218 * The previous thread voucher state or VOUCHER_MACH_MSG_STATE_UNCHANGED if no
219 * state change occurred.
220 */
221extern voucher_mach_msg_state_t voucher_mach_msg_adopt(mach_msg_header_t *msg);
222
223/*!
224 * @function voucher_mach_msg_revert
225 *
226 * @abstract
227 * Restore thread voucher state previously modified by voucher_mach_msg_adopt().
228 *
229 * @discussion
230 * Current thread voucher reference is released.
231 * No change to thread voucher state if passed VOUCHER_MACH_MSG_STATE_UNCHANGED.
232 *
233 * @param state
234 * The thread voucher state to restore.
235 */
236
237extern void voucher_mach_msg_revert(voucher_mach_msg_state_t state);
238
239__END_DECLS
240
241#endif /* _MACH_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/mach_host.h deleted-1289
......@@ -1,1289 +0,0 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.h>
59#include <mach/mach_types.h>
60#include <mach/mach_types.h>
61#include <mach_debug/mach_debug_types.h>
62#include <mach/mach_init.h>
63
64#ifdef __BeforeMigUserHeader
65__BeforeMigUserHeader
66#endif /* __BeforeMigUserHeader */
67
68#include <sys/cdefs.h>
69__BEGIN_DECLS
70
71
72/* Routine host_info */
73#ifdef mig_external
74mig_external
75#else
76extern
77#endif /* mig_external */
78__TVOS_PROHIBITED __WATCHOS_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__TVOS_PROHIBITED __WATCHOS_PROHIBITED
255kern_return_t host_request_notification
256(
257 host_t host,
258 host_flavor_t notify_type,
259 mach_port_t notify_port
260);
261
262/* Routine host_lockgroup_info */
263#ifdef mig_external
264mig_external
265#else
266extern
267#endif /* mig_external */
268kern_return_t host_lockgroup_info
269(
270 host_t host,
271 lockgroup_info_array_t *lockgroup_info,
272 mach_msg_type_number_t *lockgroup_infoCnt
273);
274
275/* Routine host_statistics64 */
276#ifdef mig_external
277mig_external
278#else
279extern
280#endif /* mig_external */
281kern_return_t host_statistics64
282(
283 host_t host_priv,
284 host_flavor_t flavor,
285 host_info64_t host_info64_out,
286 mach_msg_type_number_t *host_info64_outCnt
287);
288
289/* Routine mach_zone_info */
290#ifdef mig_external
291mig_external
292#else
293extern
294#endif /* mig_external */
295kern_return_t mach_zone_info
296(
297 host_priv_t host,
298 mach_zone_name_array_t *names,
299 mach_msg_type_number_t *namesCnt,
300 mach_zone_info_array_t *info,
301 mach_msg_type_number_t *infoCnt
302);
303
304/* Routine host_create_mach_voucher */
305#ifdef mig_external
306mig_external
307#else
308extern
309#endif /* mig_external */
310__TVOS_PROHIBITED __WATCHOS_PROHIBITED
311kern_return_t host_create_mach_voucher
312(
313 host_t host,
314 mach_voucher_attr_raw_recipe_array_t recipes,
315 mach_msg_type_number_t recipesCnt,
316 ipc_voucher_t *voucher
317);
318
319/* Routine host_register_mach_voucher_attr_manager */
320#ifdef mig_external
321mig_external
322#else
323extern
324#endif /* mig_external */
325__TVOS_PROHIBITED __WATCHOS_PROHIBITED
326kern_return_t host_register_mach_voucher_attr_manager
327(
328 host_t host,
329 mach_voucher_attr_manager_t attr_manager,
330 mach_voucher_attr_value_handle_t default_value,
331 mach_voucher_attr_key_t *new_key,
332 ipc_voucher_attr_control_t *new_attr_control
333);
334
335/* Routine host_register_well_known_mach_voucher_attr_manager */
336#ifdef mig_external
337mig_external
338#else
339extern
340#endif /* mig_external */
341__TVOS_PROHIBITED __WATCHOS_PROHIBITED
342kern_return_t host_register_well_known_mach_voucher_attr_manager
343(
344 host_t host,
345 mach_voucher_attr_manager_t attr_manager,
346 mach_voucher_attr_value_handle_t default_value,
347 mach_voucher_attr_key_t key,
348 ipc_voucher_attr_control_t *new_attr_control
349);
350
351/* Routine host_set_atm_diagnostic_flag */
352#ifdef mig_external
353mig_external
354#else
355extern
356#endif /* mig_external */
357__TVOS_PROHIBITED __WATCHOS_PROHIBITED
358kern_return_t host_set_atm_diagnostic_flag
359(
360 host_t host,
361 uint32_t diagnostic_flag
362);
363
364/* Routine host_get_atm_diagnostic_flag */
365#ifdef mig_external
366mig_external
367#else
368extern
369#endif /* mig_external */
370__TVOS_PROHIBITED __WATCHOS_PROHIBITED
371kern_return_t host_get_atm_diagnostic_flag
372(
373 host_t host,
374 uint32_t *diagnostic_flag
375);
376
377/* Routine mach_memory_info */
378#ifdef mig_external
379mig_external
380#else
381extern
382#endif /* mig_external */
383kern_return_t mach_memory_info
384(
385 host_priv_t host,
386 mach_zone_name_array_t *names,
387 mach_msg_type_number_t *namesCnt,
388 mach_zone_info_array_t *info,
389 mach_msg_type_number_t *infoCnt,
390 mach_memory_info_array_t *memory_info,
391 mach_msg_type_number_t *memory_infoCnt
392);
393
394/* Routine host_set_multiuser_config_flags */
395#ifdef mig_external
396mig_external
397#else
398extern
399#endif /* mig_external */
400kern_return_t host_set_multiuser_config_flags
401(
402 host_priv_t host_priv,
403 uint32_t multiuser_flags
404);
405
406/* Routine host_get_multiuser_config_flags */
407#ifdef mig_external
408mig_external
409#else
410extern
411#endif /* mig_external */
412kern_return_t host_get_multiuser_config_flags
413(
414 host_t host,
415 uint32_t *multiuser_flags
416);
417
418/* Routine host_check_multiuser_mode */
419#ifdef mig_external
420mig_external
421#else
422extern
423#endif /* mig_external */
424kern_return_t host_check_multiuser_mode
425(
426 host_t host,
427 uint32_t *multiuser_mode
428);
429
430/* Routine mach_zone_info_for_zone */
431#ifdef mig_external
432mig_external
433#else
434extern
435#endif /* mig_external */
436kern_return_t mach_zone_info_for_zone
437(
438 host_priv_t host,
439 mach_zone_name_t name,
440 mach_zone_info_t *info
441);
442
443__END_DECLS
444
445/********************** Caution **************************/
446/* The following data types should be used to calculate */
447/* maximum message sizes only. The actual message may be */
448/* smaller, and the position of the arguments within the */
449/* message layout may vary from what is presented here. */
450/* For example, if any of the arguments are variable- */
451/* sized, and less than the maximum is sent, the data */
452/* will be packed tight in the actual message to reduce */
453/* the presence of holes. */
454/********************** Caution **************************/
455
456/* typedefs for all requests */
457
458#ifndef __Request__mach_host_subsystem__defined
459#define __Request__mach_host_subsystem__defined
460
461#ifdef __MigPackStructs
462#pragma pack(push, 4)
463#endif
464 typedef struct {
465 mach_msg_header_t Head;
466 NDR_record_t NDR;
467 host_flavor_t flavor;
468 mach_msg_type_number_t host_info_outCnt;
469 } __Request__host_info_t __attribute__((unused));
470#ifdef __MigPackStructs
471#pragma pack(pop)
472#endif
473
474#ifdef __MigPackStructs
475#pragma pack(push, 4)
476#endif
477 typedef struct {
478 mach_msg_header_t Head;
479 } __Request__host_kernel_version_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 } __Request___host_page_size_t __attribute__((unused));
490#ifdef __MigPackStructs
491#pragma pack(pop)
492#endif
493
494#ifdef __MigPackStructs
495#pragma pack(push, 4)
496#endif
497 typedef struct {
498 mach_msg_header_t Head;
499 /* start of the kernel processed data */
500 mach_msg_body_t msgh_body;
501 mach_msg_port_descriptor_t pager;
502 /* end of the kernel processed data */
503 NDR_record_t NDR;
504 boolean_t internal;
505 vm_size_t size;
506 vm_prot_t permission;
507 } __Request__mach_memory_object_memory_entry_t __attribute__((unused));
508#ifdef __MigPackStructs
509#pragma pack(pop)
510#endif
511
512#ifdef __MigPackStructs
513#pragma pack(push, 4)
514#endif
515 typedef struct {
516 mach_msg_header_t Head;
517 NDR_record_t NDR;
518 processor_flavor_t flavor;
519 } __Request__host_processor_info_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 } __Request__host_get_io_master_t __attribute__((unused));
530#ifdef __MigPackStructs
531#pragma pack(pop)
532#endif
533
534#ifdef __MigPackStructs
535#pragma pack(push, 4)
536#endif
537 typedef struct {
538 mach_msg_header_t Head;
539 NDR_record_t NDR;
540 clock_id_t clock_id;
541 } __Request__host_get_clock_service_t __attribute__((unused));
542#ifdef __MigPackStructs
543#pragma pack(pop)
544#endif
545
546#ifdef __MigPackStructs
547#pragma pack(push, 4)
548#endif
549 typedef struct {
550 mach_msg_header_t Head;
551 } __Request__kmod_get_info_t __attribute__((unused));
552#ifdef __MigPackStructs
553#pragma pack(pop)
554#endif
555
556#ifdef __MigPackStructs
557#pragma pack(push, 4)
558#endif
559 typedef struct {
560 mach_msg_header_t Head;
561 } __Request__host_virtual_physical_table_info_t __attribute__((unused));
562#ifdef __MigPackStructs
563#pragma pack(pop)
564#endif
565
566#ifdef __MigPackStructs
567#pragma pack(push, 4)
568#endif
569 typedef struct {
570 mach_msg_header_t Head;
571 } __Request__processor_set_default_t __attribute__((unused));
572#ifdef __MigPackStructs
573#pragma pack(pop)
574#endif
575
576#ifdef __MigPackStructs
577#pragma pack(push, 4)
578#endif
579 typedef struct {
580 mach_msg_header_t Head;
581 } __Request__processor_set_create_t __attribute__((unused));
582#ifdef __MigPackStructs
583#pragma pack(pop)
584#endif
585
586#ifdef __MigPackStructs
587#pragma pack(push, 4)
588#endif
589 typedef struct {
590 mach_msg_header_t Head;
591 /* start of the kernel processed data */
592 mach_msg_body_t msgh_body;
593 mach_msg_port_descriptor_t pager;
594 /* end of the kernel processed data */
595 NDR_record_t NDR;
596 boolean_t internal;
597 memory_object_size_t size;
598 vm_prot_t permission;
599 } __Request__mach_memory_object_memory_entry_64_t __attribute__((unused));
600#ifdef __MigPackStructs
601#pragma pack(pop)
602#endif
603
604#ifdef __MigPackStructs
605#pragma pack(push, 4)
606#endif
607 typedef struct {
608 mach_msg_header_t Head;
609 NDR_record_t NDR;
610 host_flavor_t flavor;
611 mach_msg_type_number_t host_info_outCnt;
612 } __Request__host_statistics_t __attribute__((unused));
613#ifdef __MigPackStructs
614#pragma pack(pop)
615#endif
616
617#ifdef __MigPackStructs
618#pragma pack(push, 4)
619#endif
620 typedef struct {
621 mach_msg_header_t Head;
622 /* start of the kernel processed data */
623 mach_msg_body_t msgh_body;
624 mach_msg_port_descriptor_t notify_port;
625 /* end of the kernel processed data */
626 NDR_record_t NDR;
627 host_flavor_t notify_type;
628 } __Request__host_request_notification_t __attribute__((unused));
629#ifdef __MigPackStructs
630#pragma pack(pop)
631#endif
632
633#ifdef __MigPackStructs
634#pragma pack(push, 4)
635#endif
636 typedef struct {
637 mach_msg_header_t Head;
638 } __Request__host_lockgroup_info_t __attribute__((unused));
639#ifdef __MigPackStructs
640#pragma pack(pop)
641#endif
642
643#ifdef __MigPackStructs
644#pragma pack(push, 4)
645#endif
646 typedef struct {
647 mach_msg_header_t Head;
648 NDR_record_t NDR;
649 host_flavor_t flavor;
650 mach_msg_type_number_t host_info64_outCnt;
651 } __Request__host_statistics64_t __attribute__((unused));
652#ifdef __MigPackStructs
653#pragma pack(pop)
654#endif
655
656#ifdef __MigPackStructs
657#pragma pack(push, 4)
658#endif
659 typedef struct {
660 mach_msg_header_t Head;
661 } __Request__mach_zone_info_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_msg_type_number_t recipesCnt;
673 uint8_t recipes[5120];
674 } __Request__host_create_mach_voucher_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 /* start of the kernel processed data */
685 mach_msg_body_t msgh_body;
686 mach_msg_port_descriptor_t attr_manager;
687 /* end of the kernel processed data */
688 NDR_record_t NDR;
689 mach_voucher_attr_value_handle_t default_value;
690 } __Request__host_register_mach_voucher_attr_manager_t __attribute__((unused));
691#ifdef __MigPackStructs
692#pragma pack(pop)
693#endif
694
695#ifdef __MigPackStructs
696#pragma pack(push, 4)
697#endif
698 typedef struct {
699 mach_msg_header_t Head;
700 /* start of the kernel processed data */
701 mach_msg_body_t msgh_body;
702 mach_msg_port_descriptor_t attr_manager;
703 /* end of the kernel processed data */
704 NDR_record_t NDR;
705 mach_voucher_attr_value_handle_t default_value;
706 mach_voucher_attr_key_t key;
707 } __Request__host_register_well_known_mach_voucher_attr_manager_t __attribute__((unused));
708#ifdef __MigPackStructs
709#pragma pack(pop)
710#endif
711
712#ifdef __MigPackStructs
713#pragma pack(push, 4)
714#endif
715 typedef struct {
716 mach_msg_header_t Head;
717 NDR_record_t NDR;
718 uint32_t diagnostic_flag;
719 } __Request__host_set_atm_diagnostic_flag_t __attribute__((unused));
720#ifdef __MigPackStructs
721#pragma pack(pop)
722#endif
723
724#ifdef __MigPackStructs
725#pragma pack(push, 4)
726#endif
727 typedef struct {
728 mach_msg_header_t Head;
729 } __Request__host_get_atm_diagnostic_flag_t __attribute__((unused));
730#ifdef __MigPackStructs
731#pragma pack(pop)
732#endif
733
734#ifdef __MigPackStructs
735#pragma pack(push, 4)
736#endif
737 typedef struct {
738 mach_msg_header_t Head;
739 } __Request__mach_memory_info_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 uint32_t multiuser_flags;
751 } __Request__host_set_multiuser_config_flags_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 } __Request__host_get_multiuser_config_flags_t __attribute__((unused));
762#ifdef __MigPackStructs
763#pragma pack(pop)
764#endif
765
766#ifdef __MigPackStructs
767#pragma pack(push, 4)
768#endif
769 typedef struct {
770 mach_msg_header_t Head;
771 } __Request__host_check_multiuser_mode_t __attribute__((unused));
772#ifdef __MigPackStructs
773#pragma pack(pop)
774#endif
775
776#ifdef __MigPackStructs
777#pragma pack(push, 4)
778#endif
779 typedef struct {
780 mach_msg_header_t Head;
781 NDR_record_t NDR;
782 mach_zone_name_t name;
783 } __Request__mach_zone_info_for_zone_t __attribute__((unused));
784#ifdef __MigPackStructs
785#pragma pack(pop)
786#endif
787#endif /* !__Request__mach_host_subsystem__defined */
788
789/* union of all requests */
790
791#ifndef __RequestUnion__mach_host_subsystem__defined
792#define __RequestUnion__mach_host_subsystem__defined
793union __RequestUnion__mach_host_subsystem {
794 __Request__host_info_t Request_host_info;
795 __Request__host_kernel_version_t Request_host_kernel_version;
796 __Request___host_page_size_t Request__host_page_size;
797 __Request__mach_memory_object_memory_entry_t Request_mach_memory_object_memory_entry;
798 __Request__host_processor_info_t Request_host_processor_info;
799 __Request__host_get_io_master_t Request_host_get_io_master;
800 __Request__host_get_clock_service_t Request_host_get_clock_service;
801 __Request__kmod_get_info_t Request_kmod_get_info;
802 __Request__host_virtual_physical_table_info_t Request_host_virtual_physical_table_info;
803 __Request__processor_set_default_t Request_processor_set_default;
804 __Request__processor_set_create_t Request_processor_set_create;
805 __Request__mach_memory_object_memory_entry_64_t Request_mach_memory_object_memory_entry_64;
806 __Request__host_statistics_t Request_host_statistics;
807 __Request__host_request_notification_t Request_host_request_notification;
808 __Request__host_lockgroup_info_t Request_host_lockgroup_info;
809 __Request__host_statistics64_t Request_host_statistics64;
810 __Request__mach_zone_info_t Request_mach_zone_info;
811 __Request__host_create_mach_voucher_t Request_host_create_mach_voucher;
812 __Request__host_register_mach_voucher_attr_manager_t Request_host_register_mach_voucher_attr_manager;
813 __Request__host_register_well_known_mach_voucher_attr_manager_t Request_host_register_well_known_mach_voucher_attr_manager;
814 __Request__host_set_atm_diagnostic_flag_t Request_host_set_atm_diagnostic_flag;
815 __Request__host_get_atm_diagnostic_flag_t Request_host_get_atm_diagnostic_flag;
816 __Request__mach_memory_info_t Request_mach_memory_info;
817 __Request__host_set_multiuser_config_flags_t Request_host_set_multiuser_config_flags;
818 __Request__host_get_multiuser_config_flags_t Request_host_get_multiuser_config_flags;
819 __Request__host_check_multiuser_mode_t Request_host_check_multiuser_mode;
820 __Request__mach_zone_info_for_zone_t Request_mach_zone_info_for_zone;
821};
822#endif /* !__RequestUnion__mach_host_subsystem__defined */
823/* typedefs for all replies */
824
825#ifndef __Reply__mach_host_subsystem__defined
826#define __Reply__mach_host_subsystem__defined
827
828#ifdef __MigPackStructs
829#pragma pack(push, 4)
830#endif
831 typedef struct {
832 mach_msg_header_t Head;
833 NDR_record_t NDR;
834 kern_return_t RetCode;
835 mach_msg_type_number_t host_info_outCnt;
836 integer_t host_info_out[68];
837 } __Reply__host_info_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 kern_return_t RetCode;
849 mach_msg_type_number_t kernel_versionOffset; /* MiG doesn't use it */
850 mach_msg_type_number_t kernel_versionCnt;
851 char kernel_version[512];
852 } __Reply__host_kernel_version_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 NDR_record_t NDR;
863 kern_return_t RetCode;
864 vm_size_t out_page_size;
865 } __Reply___host_page_size_t __attribute__((unused));
866#ifdef __MigPackStructs
867#pragma pack(pop)
868#endif
869
870#ifdef __MigPackStructs
871#pragma pack(push, 4)
872#endif
873 typedef struct {
874 mach_msg_header_t Head;
875 /* start of the kernel processed data */
876 mach_msg_body_t msgh_body;
877 mach_msg_port_descriptor_t entry_handle;
878 /* end of the kernel processed data */
879 } __Reply__mach_memory_object_memory_entry_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 /* start of the kernel processed data */
890 mach_msg_body_t msgh_body;
891 mach_msg_ool_descriptor_t out_processor_info;
892 /* end of the kernel processed data */
893 NDR_record_t NDR;
894 natural_t out_processor_count;
895 mach_msg_type_number_t out_processor_infoCnt;
896 } __Reply__host_processor_info_t __attribute__((unused));
897#ifdef __MigPackStructs
898#pragma pack(pop)
899#endif
900
901#ifdef __MigPackStructs
902#pragma pack(push, 4)
903#endif
904 typedef struct {
905 mach_msg_header_t Head;
906 /* start of the kernel processed data */
907 mach_msg_body_t msgh_body;
908 mach_msg_port_descriptor_t io_master;
909 /* end of the kernel processed data */
910 } __Reply__host_get_io_master_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 /* start of the kernel processed data */
921 mach_msg_body_t msgh_body;
922 mach_msg_port_descriptor_t clock_serv;
923 /* end of the kernel processed data */
924 } __Reply__host_get_clock_service_t __attribute__((unused));
925#ifdef __MigPackStructs
926#pragma pack(pop)
927#endif
928
929#ifdef __MigPackStructs
930#pragma pack(push, 4)
931#endif
932 typedef struct {
933 mach_msg_header_t Head;
934 /* start of the kernel processed data */
935 mach_msg_body_t msgh_body;
936 mach_msg_ool_descriptor_t modules;
937 /* end of the kernel processed data */
938 NDR_record_t NDR;
939 mach_msg_type_number_t modulesCnt;
940 } __Reply__kmod_get_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 /* start of the kernel processed data */
951 mach_msg_body_t msgh_body;
952 mach_msg_ool_descriptor_t info;
953 /* end of the kernel processed data */
954 NDR_record_t NDR;
955 mach_msg_type_number_t infoCnt;
956 } __Reply__host_virtual_physical_table_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 /* start of the kernel processed data */
967 mach_msg_body_t msgh_body;
968 mach_msg_port_descriptor_t default_set;
969 /* end of the kernel processed data */
970 } __Reply__processor_set_default_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 new_set;
983 mach_msg_port_descriptor_t new_name;
984 /* end of the kernel processed data */
985 } __Reply__processor_set_create_t __attribute__((unused));
986#ifdef __MigPackStructs
987#pragma pack(pop)
988#endif
989
990#ifdef __MigPackStructs
991#pragma pack(push, 4)
992#endif
993 typedef struct {
994 mach_msg_header_t Head;
995 /* start of the kernel processed data */
996 mach_msg_body_t msgh_body;
997 mach_msg_port_descriptor_t entry_handle;
998 /* end of the kernel processed data */
999 } __Reply__mach_memory_object_memory_entry_64_t __attribute__((unused));
1000#ifdef __MigPackStructs
1001#pragma pack(pop)
1002#endif
1003
1004#ifdef __MigPackStructs
1005#pragma pack(push, 4)
1006#endif
1007 typedef struct {
1008 mach_msg_header_t Head;
1009 NDR_record_t NDR;
1010 kern_return_t RetCode;
1011 mach_msg_type_number_t host_info_outCnt;
1012 integer_t host_info_out[68];
1013 } __Reply__host_statistics_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__host_request_notification_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 /* start of the kernel processed data */
1036 mach_msg_body_t msgh_body;
1037 mach_msg_ool_descriptor_t lockgroup_info;
1038 /* end of the kernel processed data */
1039 NDR_record_t NDR;
1040 mach_msg_type_number_t lockgroup_infoCnt;
1041 } __Reply__host_lockgroup_info_t __attribute__((unused));
1042#ifdef __MigPackStructs
1043#pragma pack(pop)
1044#endif
1045
1046#ifdef __MigPackStructs
1047#pragma pack(push, 4)
1048#endif
1049 typedef struct {
1050 mach_msg_header_t Head;
1051 NDR_record_t NDR;
1052 kern_return_t RetCode;
1053 mach_msg_type_number_t host_info64_outCnt;
1054 integer_t host_info64_out[256];
1055 } __Reply__host_statistics64_t __attribute__((unused));
1056#ifdef __MigPackStructs
1057#pragma pack(pop)
1058#endif
1059
1060#ifdef __MigPackStructs
1061#pragma pack(push, 4)
1062#endif
1063 typedef struct {
1064 mach_msg_header_t Head;
1065 /* start of the kernel processed data */
1066 mach_msg_body_t msgh_body;
1067 mach_msg_ool_descriptor_t names;
1068 mach_msg_ool_descriptor_t info;
1069 /* end of the kernel processed data */
1070 NDR_record_t NDR;
1071 mach_msg_type_number_t namesCnt;
1072 mach_msg_type_number_t infoCnt;
1073 } __Reply__mach_zone_info_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 /* start of the kernel processed data */
1084 mach_msg_body_t msgh_body;
1085 mach_msg_port_descriptor_t voucher;
1086 /* end of the kernel processed data */
1087 } __Reply__host_create_mach_voucher_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 new_attr_control;
1100 /* end of the kernel processed data */
1101 NDR_record_t NDR;
1102 mach_voucher_attr_key_t new_key;
1103 } __Reply__host_register_mach_voucher_attr_manager_t __attribute__((unused));
1104#ifdef __MigPackStructs
1105#pragma pack(pop)
1106#endif
1107
1108#ifdef __MigPackStructs
1109#pragma pack(push, 4)
1110#endif
1111 typedef struct {
1112 mach_msg_header_t Head;
1113 /* start of the kernel processed data */
1114 mach_msg_body_t msgh_body;
1115 mach_msg_port_descriptor_t new_attr_control;
1116 /* end of the kernel processed data */
1117 } __Reply__host_register_well_known_mach_voucher_attr_manager_t __attribute__((unused));
1118#ifdef __MigPackStructs
1119#pragma pack(pop)
1120#endif
1121
1122#ifdef __MigPackStructs
1123#pragma pack(push, 4)
1124#endif
1125 typedef struct {
1126 mach_msg_header_t Head;
1127 NDR_record_t NDR;
1128 kern_return_t RetCode;
1129 } __Reply__host_set_atm_diagnostic_flag_t __attribute__((unused));
1130#ifdef __MigPackStructs
1131#pragma pack(pop)
1132#endif
1133
1134#ifdef __MigPackStructs
1135#pragma pack(push, 4)
1136#endif
1137 typedef struct {
1138 mach_msg_header_t Head;
1139 NDR_record_t NDR;
1140 kern_return_t RetCode;
1141 uint32_t diagnostic_flag;
1142 } __Reply__host_get_atm_diagnostic_flag_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 /* start of the kernel processed data */
1153 mach_msg_body_t msgh_body;
1154 mach_msg_ool_descriptor_t names;
1155 mach_msg_ool_descriptor_t info;
1156 mach_msg_ool_descriptor_t memory_info;
1157 /* end of the kernel processed data */
1158 NDR_record_t NDR;
1159 mach_msg_type_number_t namesCnt;
1160 mach_msg_type_number_t infoCnt;
1161 mach_msg_type_number_t memory_infoCnt;
1162 } __Reply__mach_memory_info_t __attribute__((unused));
1163#ifdef __MigPackStructs
1164#pragma pack(pop)
1165#endif
1166
1167#ifdef __MigPackStructs
1168#pragma pack(push, 4)
1169#endif
1170 typedef struct {
1171 mach_msg_header_t Head;
1172 NDR_record_t NDR;
1173 kern_return_t RetCode;
1174 } __Reply__host_set_multiuser_config_flags_t __attribute__((unused));
1175#ifdef __MigPackStructs
1176#pragma pack(pop)
1177#endif
1178
1179#ifdef __MigPackStructs
1180#pragma pack(push, 4)
1181#endif
1182 typedef struct {
1183 mach_msg_header_t Head;
1184 NDR_record_t NDR;
1185 kern_return_t RetCode;
1186 uint32_t multiuser_flags;
1187 } __Reply__host_get_multiuser_config_flags_t __attribute__((unused));
1188#ifdef __MigPackStructs
1189#pragma pack(pop)
1190#endif
1191
1192#ifdef __MigPackStructs
1193#pragma pack(push, 4)
1194#endif
1195 typedef struct {
1196 mach_msg_header_t Head;
1197 NDR_record_t NDR;
1198 kern_return_t RetCode;
1199 uint32_t multiuser_mode;
1200 } __Reply__host_check_multiuser_mode_t __attribute__((unused));
1201#ifdef __MigPackStructs
1202#pragma pack(pop)
1203#endif
1204
1205#ifdef __MigPackStructs
1206#pragma pack(push, 4)
1207#endif
1208 typedef struct {
1209 mach_msg_header_t Head;
1210 NDR_record_t NDR;
1211 kern_return_t RetCode;
1212 mach_zone_info_t info;
1213 } __Reply__mach_zone_info_for_zone_t __attribute__((unused));
1214#ifdef __MigPackStructs
1215#pragma pack(pop)
1216#endif
1217#endif /* !__Reply__mach_host_subsystem__defined */
1218
1219/* union of all replies */
1220
1221#ifndef __ReplyUnion__mach_host_subsystem__defined
1222#define __ReplyUnion__mach_host_subsystem__defined
1223union __ReplyUnion__mach_host_subsystem {
1224 __Reply__host_info_t Reply_host_info;
1225 __Reply__host_kernel_version_t Reply_host_kernel_version;
1226 __Reply___host_page_size_t Reply__host_page_size;
1227 __Reply__mach_memory_object_memory_entry_t Reply_mach_memory_object_memory_entry;
1228 __Reply__host_processor_info_t Reply_host_processor_info;
1229 __Reply__host_get_io_master_t Reply_host_get_io_master;
1230 __Reply__host_get_clock_service_t Reply_host_get_clock_service;
1231 __Reply__kmod_get_info_t Reply_kmod_get_info;
1232 __Reply__host_virtual_physical_table_info_t Reply_host_virtual_physical_table_info;
1233 __Reply__processor_set_default_t Reply_processor_set_default;
1234 __Reply__processor_set_create_t Reply_processor_set_create;
1235 __Reply__mach_memory_object_memory_entry_64_t Reply_mach_memory_object_memory_entry_64;
1236 __Reply__host_statistics_t Reply_host_statistics;
1237 __Reply__host_request_notification_t Reply_host_request_notification;
1238 __Reply__host_lockgroup_info_t Reply_host_lockgroup_info;
1239 __Reply__host_statistics64_t Reply_host_statistics64;
1240 __Reply__mach_zone_info_t Reply_mach_zone_info;
1241 __Reply__host_create_mach_voucher_t Reply_host_create_mach_voucher;
1242 __Reply__host_register_mach_voucher_attr_manager_t Reply_host_register_mach_voucher_attr_manager;
1243 __Reply__host_register_well_known_mach_voucher_attr_manager_t Reply_host_register_well_known_mach_voucher_attr_manager;
1244 __Reply__host_set_atm_diagnostic_flag_t Reply_host_set_atm_diagnostic_flag;
1245 __Reply__host_get_atm_diagnostic_flag_t Reply_host_get_atm_diagnostic_flag;
1246 __Reply__mach_memory_info_t Reply_mach_memory_info;
1247 __Reply__host_set_multiuser_config_flags_t Reply_host_set_multiuser_config_flags;
1248 __Reply__host_get_multiuser_config_flags_t Reply_host_get_multiuser_config_flags;
1249 __Reply__host_check_multiuser_mode_t Reply_host_check_multiuser_mode;
1250 __Reply__mach_zone_info_for_zone_t Reply_mach_zone_info_for_zone;
1251};
1252#endif /* !__RequestUnion__mach_host_subsystem__defined */
1253
1254#ifndef subsystem_to_name_map_mach_host
1255#define subsystem_to_name_map_mach_host \
1256 { "host_info", 200 },\
1257 { "host_kernel_version", 201 },\
1258 { "_host_page_size", 202 },\
1259 { "mach_memory_object_memory_entry", 203 },\
1260 { "host_processor_info", 204 },\
1261 { "host_get_io_master", 205 },\
1262 { "host_get_clock_service", 206 },\
1263 { "kmod_get_info", 207 },\
1264 { "host_virtual_physical_table_info", 209 },\
1265 { "processor_set_default", 213 },\
1266 { "processor_set_create", 214 },\
1267 { "mach_memory_object_memory_entry_64", 215 },\
1268 { "host_statistics", 216 },\
1269 { "host_request_notification", 217 },\
1270 { "host_lockgroup_info", 218 },\
1271 { "host_statistics64", 219 },\
1272 { "mach_zone_info", 220 },\
1273 { "host_create_mach_voucher", 222 },\
1274 { "host_register_mach_voucher_attr_manager", 223 },\
1275 { "host_register_well_known_mach_voucher_attr_manager", 224 },\
1276 { "host_set_atm_diagnostic_flag", 225 },\
1277 { "host_get_atm_diagnostic_flag", 226 },\
1278 { "mach_memory_info", 227 },\
1279 { "host_set_multiuser_config_flags", 228 },\
1280 { "host_get_multiuser_config_flags", 229 },\
1281 { "host_check_multiuser_mode", 230 },\
1282 { "mach_zone_info_for_zone", 231 }
1283#endif
1284
1285#ifdef __AfterMigUserHeader
1286__AfterMigUserHeader
1287#endif /* __AfterMigUserHeader */
1288
1289#endif /* _mach_host_user_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/mach_port.h deleted-1939
......@@ -1,1939 +0,0 @@
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 43
53#endif /* mach_port_MSG_COUNT */
54
55#include <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 mach_port_names */
71#ifdef mig_external
72mig_external
73#else
74extern
75#endif /* mig_external */
76kern_return_t mach_port_names
77(
78 ipc_space_t task,
79 mach_port_name_array_t *names,
80 mach_msg_type_number_t *namesCnt,
81 mach_port_type_array_t *types,
82 mach_msg_type_number_t *typesCnt
83);
84
85/* Routine mach_port_type */
86#ifdef mig_external
87mig_external
88#else
89extern
90#endif /* mig_external */
91kern_return_t mach_port_type
92(
93 ipc_space_t task,
94 mach_port_name_t name,
95 mach_port_type_t *ptype
96);
97
98/* Routine mach_port_rename */
99#ifdef mig_external
100mig_external
101#else
102extern
103#endif /* mig_external */
104kern_return_t mach_port_rename
105(
106 ipc_space_t task,
107 mach_port_name_t old_name,
108 mach_port_name_t new_name
109);
110
111/* Routine mach_port_allocate_name */
112#ifdef mig_external
113mig_external
114#else
115extern
116#endif /* mig_external */
117__TVOS_PROHIBITED __WATCHOS_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 */
144__API_DEPRECATED("Inherently unsafe API: instead manage rights with "
145 "mach_port_destruct(), mach_port_deallocate() or mach_port_mod_refs()",
146 macos(10.0, 12.0), ios(2.0, 15.0), tvos(9.0, 15.0), watchos(2.0, 8.0))
147kern_return_t mach_port_destroy
148(
149 ipc_space_t task,
150 mach_port_name_t name
151);
152
153/* Routine mach_port_deallocate */
154#ifdef mig_external
155mig_external
156#else
157extern
158#endif /* mig_external */
159kern_return_t mach_port_deallocate
160(
161 ipc_space_t task,
162 mach_port_name_t name
163);
164
165/* Routine mach_port_get_refs */
166#ifdef mig_external
167mig_external
168#else
169extern
170#endif /* mig_external */
171kern_return_t mach_port_get_refs
172(
173 ipc_space_t task,
174 mach_port_name_t name,
175 mach_port_right_t right,
176 mach_port_urefs_t *refs
177);
178
179/* Routine mach_port_mod_refs */
180#ifdef mig_external
181mig_external
182#else
183extern
184#endif /* mig_external */
185kern_return_t mach_port_mod_refs
186(
187 ipc_space_t task,
188 mach_port_name_t name,
189 mach_port_right_t right,
190 mach_port_delta_t delta
191);
192
193/* Routine mach_port_peek */
194#ifdef mig_external
195mig_external
196#else
197extern
198#endif /* mig_external */
199kern_return_t mach_port_peek
200(
201 ipc_space_t task,
202 mach_port_name_t name,
203 mach_msg_trailer_type_t trailer_type,
204 mach_port_seqno_t *request_seqnop,
205 mach_msg_size_t *msg_sizep,
206 mach_msg_id_t *msg_idp,
207 mach_msg_trailer_info_t trailer_infop,
208 mach_msg_type_number_t *trailer_infopCnt
209);
210
211/* Routine mach_port_set_mscount */
212#ifdef mig_external
213mig_external
214#else
215extern
216#endif /* mig_external */
217kern_return_t mach_port_set_mscount
218(
219 ipc_space_t task,
220 mach_port_name_t name,
221 mach_port_mscount_t mscount
222);
223
224/* Routine mach_port_get_set_status */
225#ifdef mig_external
226mig_external
227#else
228extern
229#endif /* mig_external */
230kern_return_t mach_port_get_set_status
231(
232 ipc_space_read_t task,
233 mach_port_name_t name,
234 mach_port_name_array_t *members,
235 mach_msg_type_number_t *membersCnt
236);
237
238/* Routine mach_port_move_member */
239#ifdef mig_external
240mig_external
241#else
242extern
243#endif /* mig_external */
244kern_return_t mach_port_move_member
245(
246 ipc_space_t task,
247 mach_port_name_t member,
248 mach_port_name_t after
249);
250
251/* Routine mach_port_request_notification */
252#ifdef mig_external
253mig_external
254#else
255extern
256#endif /* mig_external */
257kern_return_t mach_port_request_notification
258(
259 ipc_space_t task,
260 mach_port_name_t name,
261 mach_msg_id_t msgid,
262 mach_port_mscount_t sync,
263 mach_port_t notify,
264 mach_msg_type_name_t notifyPoly,
265 mach_port_t *previous
266);
267
268/* Routine mach_port_insert_right */
269#ifdef mig_external
270mig_external
271#else
272extern
273#endif /* mig_external */
274kern_return_t mach_port_insert_right
275(
276 ipc_space_t task,
277 mach_port_name_t name,
278 mach_port_t poly,
279 mach_msg_type_name_t polyPoly
280);
281
282/* Routine mach_port_extract_right */
283#ifdef mig_external
284mig_external
285#else
286extern
287#endif /* mig_external */
288kern_return_t mach_port_extract_right
289(
290 ipc_space_t task,
291 mach_port_name_t name,
292 mach_msg_type_name_t msgt_name,
293 mach_port_t *poly,
294 mach_msg_type_name_t *polyPoly
295);
296
297/* Routine mach_port_set_seqno */
298#ifdef mig_external
299mig_external
300#else
301extern
302#endif /* mig_external */
303kern_return_t mach_port_set_seqno
304(
305 ipc_space_t task,
306 mach_port_name_t name,
307 mach_port_seqno_t seqno
308);
309
310/* Routine mach_port_get_attributes */
311#ifdef mig_external
312mig_external
313#else
314extern
315#endif /* mig_external */
316kern_return_t mach_port_get_attributes
317(
318 ipc_space_read_t task,
319 mach_port_name_t name,
320 mach_port_flavor_t flavor,
321 mach_port_info_t port_info_out,
322 mach_msg_type_number_t *port_info_outCnt
323);
324
325/* Routine mach_port_set_attributes */
326#ifdef mig_external
327mig_external
328#else
329extern
330#endif /* mig_external */
331kern_return_t mach_port_set_attributes
332(
333 ipc_space_t task,
334 mach_port_name_t name,
335 mach_port_flavor_t flavor,
336 mach_port_info_t port_info,
337 mach_msg_type_number_t port_infoCnt
338);
339
340/* Routine mach_port_allocate_qos */
341#ifdef mig_external
342mig_external
343#else
344extern
345#endif /* mig_external */
346kern_return_t mach_port_allocate_qos
347(
348 ipc_space_t task,
349 mach_port_right_t right,
350 mach_port_qos_t *qos,
351 mach_port_name_t *name
352);
353
354/* Routine mach_port_allocate_full */
355#ifdef mig_external
356mig_external
357#else
358extern
359#endif /* mig_external */
360kern_return_t mach_port_allocate_full
361(
362 ipc_space_t task,
363 mach_port_right_t right,
364 mach_port_t proto,
365 mach_port_qos_t *qos,
366 mach_port_name_t *name
367);
368
369/* Routine task_set_port_space */
370#ifdef mig_external
371mig_external
372#else
373extern
374#endif /* mig_external */
375__TVOS_PROHIBITED __WATCHOS_PROHIBITED
376kern_return_t task_set_port_space
377(
378 ipc_space_t task,
379 int table_entries
380);
381
382/* Routine mach_port_get_srights */
383#ifdef mig_external
384mig_external
385#else
386extern
387#endif /* mig_external */
388kern_return_t mach_port_get_srights
389(
390 ipc_space_t task,
391 mach_port_name_t name,
392 mach_port_rights_t *srights
393);
394
395/* Routine mach_port_space_info */
396#ifdef mig_external
397mig_external
398#else
399extern
400#endif /* mig_external */
401kern_return_t mach_port_space_info
402(
403 ipc_space_read_t space,
404 ipc_info_space_t *space_info,
405 ipc_info_name_array_t *table_info,
406 mach_msg_type_number_t *table_infoCnt,
407 ipc_info_tree_name_array_t *tree_info,
408 mach_msg_type_number_t *tree_infoCnt
409);
410
411/* Routine mach_port_dnrequest_info */
412#ifdef mig_external
413mig_external
414#else
415extern
416#endif /* mig_external */
417kern_return_t mach_port_dnrequest_info
418(
419 ipc_space_t task,
420 mach_port_name_t name,
421 unsigned *dnr_total,
422 unsigned *dnr_used
423);
424
425/* Routine mach_port_kernel_object */
426#ifdef mig_external
427mig_external
428#else
429extern
430#endif /* mig_external */
431kern_return_t mach_port_kernel_object
432(
433 ipc_space_read_t task,
434 mach_port_name_t name,
435 unsigned *object_type,
436 unsigned *object_addr
437);
438
439/* Routine mach_port_insert_member */
440#ifdef mig_external
441mig_external
442#else
443extern
444#endif /* mig_external */
445kern_return_t mach_port_insert_member
446(
447 ipc_space_t task,
448 mach_port_name_t name,
449 mach_port_name_t pset
450);
451
452/* Routine mach_port_extract_member */
453#ifdef mig_external
454mig_external
455#else
456extern
457#endif /* mig_external */
458kern_return_t mach_port_extract_member
459(
460 ipc_space_t task,
461 mach_port_name_t name,
462 mach_port_name_t pset
463);
464
465/* Routine mach_port_get_context */
466#ifdef mig_external
467mig_external
468#else
469extern
470#endif /* mig_external */
471kern_return_t mach_port_get_context
472(
473 ipc_space_read_t task,
474 mach_port_name_t name,
475 mach_port_context_t *context
476);
477
478/* Routine mach_port_set_context */
479#ifdef mig_external
480mig_external
481#else
482extern
483#endif /* mig_external */
484kern_return_t mach_port_set_context
485(
486 ipc_space_t task,
487 mach_port_name_t name,
488 mach_port_context_t context
489);
490
491/* Routine mach_port_kobject */
492#ifdef mig_external
493mig_external
494#else
495extern
496#endif /* mig_external */
497kern_return_t mach_port_kobject
498(
499 ipc_space_read_t task,
500 mach_port_name_t name,
501 natural_t *object_type,
502 mach_vm_address_t *object_addr
503);
504
505/* Routine mach_port_construct */
506#ifdef mig_external
507mig_external
508#else
509extern
510#endif /* mig_external */
511kern_return_t mach_port_construct
512(
513 ipc_space_t task,
514 mach_port_options_ptr_t options,
515 mach_port_context_t context,
516 mach_port_name_t *name
517);
518
519/* Routine mach_port_destruct */
520#ifdef mig_external
521mig_external
522#else
523extern
524#endif /* mig_external */
525kern_return_t mach_port_destruct
526(
527 ipc_space_t task,
528 mach_port_name_t name,
529 mach_port_delta_t srdelta,
530 mach_port_context_t guard
531);
532
533/* Routine mach_port_guard */
534#ifdef mig_external
535mig_external
536#else
537extern
538#endif /* mig_external */
539kern_return_t mach_port_guard
540(
541 ipc_space_t task,
542 mach_port_name_t name,
543 mach_port_context_t guard,
544 boolean_t strict
545);
546
547/* Routine mach_port_unguard */
548#ifdef mig_external
549mig_external
550#else
551extern
552#endif /* mig_external */
553kern_return_t mach_port_unguard
554(
555 ipc_space_t task,
556 mach_port_name_t name,
557 mach_port_context_t guard
558);
559
560/* Routine mach_port_space_basic_info */
561#ifdef mig_external
562mig_external
563#else
564extern
565#endif /* mig_external */
566kern_return_t mach_port_space_basic_info
567(
568 ipc_space_inspect_t task,
569 ipc_info_space_basic_t *basic_info
570);
571
572/* Routine mach_port_guard_with_flags */
573#ifdef mig_external
574mig_external
575#else
576extern
577#endif /* mig_external */
578kern_return_t mach_port_guard_with_flags
579(
580 ipc_space_t task,
581 mach_port_name_t name,
582 mach_port_context_t guard,
583 uint64_t flags
584);
585
586/* Routine mach_port_swap_guard */
587#ifdef mig_external
588mig_external
589#else
590extern
591#endif /* mig_external */
592kern_return_t mach_port_swap_guard
593(
594 ipc_space_t task,
595 mach_port_name_t name,
596 mach_port_context_t old_guard,
597 mach_port_context_t new_guard
598);
599
600/* Routine mach_port_kobject_description */
601#ifdef mig_external
602mig_external
603#else
604extern
605#endif /* mig_external */
606kern_return_t mach_port_kobject_description
607(
608 ipc_space_read_t task,
609 mach_port_name_t name,
610 natural_t *object_type,
611 mach_vm_address_t *object_addr,
612 kobject_description_t description
613);
614
615/* Routine mach_port_is_connection_for_service */
616#ifdef mig_external
617mig_external
618#else
619extern
620#endif /* mig_external */
621kern_return_t mach_port_is_connection_for_service
622(
623 ipc_space_t task,
624 mach_port_name_t connection_port,
625 mach_port_name_t service_port,
626 uint64_t *filter_policy_id
627);
628
629/* Routine mach_port_get_service_port_info */
630#ifdef mig_external
631mig_external
632#else
633extern
634#endif /* mig_external */
635kern_return_t mach_port_get_service_port_info
636(
637 ipc_space_read_t task,
638 mach_port_name_t name,
639 mach_service_port_info_data_t *sp_info_out
640);
641
642/* Routine mach_port_assert_attributes */
643#ifdef mig_external
644mig_external
645#else
646extern
647#endif /* mig_external */
648kern_return_t mach_port_assert_attributes
649(
650 ipc_space_t task,
651 mach_port_name_t name,
652 mach_port_flavor_t flavor,
653 mach_port_info_t info,
654 mach_msg_type_number_t infoCnt
655);
656
657__END_DECLS
658
659/********************** Caution **************************/
660/* The following data types should be used to calculate */
661/* maximum message sizes only. The actual message may be */
662/* smaller, and the position of the arguments within the */
663/* message layout may vary from what is presented here. */
664/* For example, if any of the arguments are variable- */
665/* sized, and less than the maximum is sent, the data */
666/* will be packed tight in the actual message to reduce */
667/* the presence of holes. */
668/********************** Caution **************************/
669
670/* typedefs for all requests */
671
672#ifndef __Request__mach_port_subsystem__defined
673#define __Request__mach_port_subsystem__defined
674
675#ifdef __MigPackStructs
676#pragma pack(push, 4)
677#endif
678 typedef struct {
679 mach_msg_header_t Head;
680 } __Request__mach_port_names_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 NDR_record_t NDR;
691 mach_port_name_t name;
692 } __Request__mach_port_type_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 NDR_record_t NDR;
703 mach_port_name_t old_name;
704 mach_port_name_t new_name;
705 } __Request__mach_port_rename_t __attribute__((unused));
706#ifdef __MigPackStructs
707#pragma pack(pop)
708#endif
709
710#ifdef __MigPackStructs
711#pragma pack(push, 4)
712#endif
713 typedef struct {
714 mach_msg_header_t Head;
715 NDR_record_t NDR;
716 mach_port_right_t right;
717 mach_port_name_t name;
718 } __Request__mach_port_allocate_name_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 mach_port_right_t right;
730 } __Request__mach_port_allocate_t __attribute__((unused));
731#ifdef __MigPackStructs
732#pragma pack(pop)
733#endif
734
735#ifdef __MigPackStructs
736#pragma pack(push, 4)
737#endif
738 typedef struct {
739 mach_msg_header_t Head;
740 NDR_record_t NDR;
741 mach_port_name_t name;
742 } __Request__mach_port_destroy_t __attribute__((unused));
743#ifdef __MigPackStructs
744#pragma pack(pop)
745#endif
746
747#ifdef __MigPackStructs
748#pragma pack(push, 4)
749#endif
750 typedef struct {
751 mach_msg_header_t Head;
752 NDR_record_t NDR;
753 mach_port_name_t name;
754 } __Request__mach_port_deallocate_t __attribute__((unused));
755#ifdef __MigPackStructs
756#pragma pack(pop)
757#endif
758
759#ifdef __MigPackStructs
760#pragma pack(push, 4)
761#endif
762 typedef struct {
763 mach_msg_header_t Head;
764 NDR_record_t NDR;
765 mach_port_name_t name;
766 mach_port_right_t right;
767 } __Request__mach_port_get_refs_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 NDR_record_t NDR;
778 mach_port_name_t name;
779 mach_port_right_t right;
780 mach_port_delta_t delta;
781 } __Request__mach_port_mod_refs_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 mach_port_name_t name;
793 mach_msg_trailer_type_t trailer_type;
794 mach_port_seqno_t request_seqnop;
795 mach_msg_type_number_t trailer_infopCnt;
796 } __Request__mach_port_peek_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 mach_port_name_t name;
808 mach_port_mscount_t mscount;
809 } __Request__mach_port_set_mscount_t __attribute__((unused));
810#ifdef __MigPackStructs
811#pragma pack(pop)
812#endif
813
814#ifdef __MigPackStructs
815#pragma pack(push, 4)
816#endif
817 typedef struct {
818 mach_msg_header_t Head;
819 NDR_record_t NDR;
820 mach_port_name_t name;
821 } __Request__mach_port_get_set_status_t __attribute__((unused));
822#ifdef __MigPackStructs
823#pragma pack(pop)
824#endif
825
826#ifdef __MigPackStructs
827#pragma pack(push, 4)
828#endif
829 typedef struct {
830 mach_msg_header_t Head;
831 NDR_record_t NDR;
832 mach_port_name_t member;
833 mach_port_name_t after;
834 } __Request__mach_port_move_member_t __attribute__((unused));
835#ifdef __MigPackStructs
836#pragma pack(pop)
837#endif
838
839#ifdef __MigPackStructs
840#pragma pack(push, 4)
841#endif
842 typedef struct {
843 mach_msg_header_t Head;
844 /* start of the kernel processed data */
845 mach_msg_body_t msgh_body;
846 mach_msg_port_descriptor_t notify;
847 /* end of the kernel processed data */
848 NDR_record_t NDR;
849 mach_port_name_t name;
850 mach_msg_id_t msgid;
851 mach_port_mscount_t sync;
852 } __Request__mach_port_request_notification_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 poly;
865 /* end of the kernel processed data */
866 NDR_record_t NDR;
867 mach_port_name_t name;
868 } __Request__mach_port_insert_right_t __attribute__((unused));
869#ifdef __MigPackStructs
870#pragma pack(pop)
871#endif
872
873#ifdef __MigPackStructs
874#pragma pack(push, 4)
875#endif
876 typedef struct {
877 mach_msg_header_t Head;
878 NDR_record_t NDR;
879 mach_port_name_t name;
880 mach_msg_type_name_t msgt_name;
881 } __Request__mach_port_extract_right_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 NDR_record_t NDR;
892 mach_port_name_t name;
893 mach_port_seqno_t seqno;
894 } __Request__mach_port_set_seqno_t __attribute__((unused));
895#ifdef __MigPackStructs
896#pragma pack(pop)
897#endif
898
899#ifdef __MigPackStructs
900#pragma pack(push, 4)
901#endif
902 typedef struct {
903 mach_msg_header_t Head;
904 NDR_record_t NDR;
905 mach_port_name_t name;
906 mach_port_flavor_t flavor;
907 mach_msg_type_number_t port_info_outCnt;
908 } __Request__mach_port_get_attributes_t __attribute__((unused));
909#ifdef __MigPackStructs
910#pragma pack(pop)
911#endif
912
913#ifdef __MigPackStructs
914#pragma pack(push, 4)
915#endif
916 typedef struct {
917 mach_msg_header_t Head;
918 NDR_record_t NDR;
919 mach_port_name_t name;
920 mach_port_flavor_t flavor;
921 mach_msg_type_number_t port_infoCnt;
922 integer_t port_info[17];
923 } __Request__mach_port_set_attributes_t __attribute__((unused));
924#ifdef __MigPackStructs
925#pragma pack(pop)
926#endif
927
928#ifdef __MigPackStructs
929#pragma pack(push, 4)
930#endif
931 typedef struct {
932 mach_msg_header_t Head;
933 NDR_record_t NDR;
934 mach_port_right_t right;
935 mach_port_qos_t qos;
936 } __Request__mach_port_allocate_qos_t __attribute__((unused));
937#ifdef __MigPackStructs
938#pragma pack(pop)
939#endif
940
941#ifdef __MigPackStructs
942#pragma pack(push, 4)
943#endif
944 typedef struct {
945 mach_msg_header_t Head;
946 /* start of the kernel processed data */
947 mach_msg_body_t msgh_body;
948 mach_msg_port_descriptor_t proto;
949 /* end of the kernel processed data */
950 NDR_record_t NDR;
951 mach_port_right_t right;
952 mach_port_qos_t qos;
953 mach_port_name_t name;
954 } __Request__mach_port_allocate_full_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 NDR_record_t NDR;
965 int table_entries;
966 } __Request__task_set_port_space_t __attribute__((unused));
967#ifdef __MigPackStructs
968#pragma pack(pop)
969#endif
970
971#ifdef __MigPackStructs
972#pragma pack(push, 4)
973#endif
974 typedef struct {
975 mach_msg_header_t Head;
976 NDR_record_t NDR;
977 mach_port_name_t name;
978 } __Request__mach_port_get_srights_t __attribute__((unused));
979#ifdef __MigPackStructs
980#pragma pack(pop)
981#endif
982
983#ifdef __MigPackStructs
984#pragma pack(push, 4)
985#endif
986 typedef struct {
987 mach_msg_header_t Head;
988 } __Request__mach_port_space_info_t __attribute__((unused));
989#ifdef __MigPackStructs
990#pragma pack(pop)
991#endif
992
993#ifdef __MigPackStructs
994#pragma pack(push, 4)
995#endif
996 typedef struct {
997 mach_msg_header_t Head;
998 NDR_record_t NDR;
999 mach_port_name_t name;
1000 } __Request__mach_port_dnrequest_info_t __attribute__((unused));
1001#ifdef __MigPackStructs
1002#pragma pack(pop)
1003#endif
1004
1005#ifdef __MigPackStructs
1006#pragma pack(push, 4)
1007#endif
1008 typedef struct {
1009 mach_msg_header_t Head;
1010 NDR_record_t NDR;
1011 mach_port_name_t name;
1012 } __Request__mach_port_kernel_object_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 mach_port_name_t name;
1024 mach_port_name_t pset;
1025 } __Request__mach_port_insert_member_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 mach_port_name_t name;
1037 mach_port_name_t pset;
1038 } __Request__mach_port_extract_member_t __attribute__((unused));
1039#ifdef __MigPackStructs
1040#pragma pack(pop)
1041#endif
1042
1043#ifdef __MigPackStructs
1044#pragma pack(push, 4)
1045#endif
1046 typedef struct {
1047 mach_msg_header_t Head;
1048 NDR_record_t NDR;
1049 mach_port_name_t name;
1050 } __Request__mach_port_get_context_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 mach_port_name_t name;
1062 mach_port_context_t context;
1063 } __Request__mach_port_set_context_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 mach_port_name_t name;
1075 } __Request__mach_port_kobject_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 /* start of the kernel processed data */
1086 mach_msg_body_t msgh_body;
1087 mach_msg_ool_descriptor_t options;
1088 /* end of the kernel processed data */
1089 NDR_record_t NDR;
1090 mach_port_context_t context;
1091 } __Request__mach_port_construct_t __attribute__((unused));
1092#ifdef __MigPackStructs
1093#pragma pack(pop)
1094#endif
1095
1096#ifdef __MigPackStructs
1097#pragma pack(push, 4)
1098#endif
1099 typedef struct {
1100 mach_msg_header_t Head;
1101 NDR_record_t NDR;
1102 mach_port_name_t name;
1103 mach_port_delta_t srdelta;
1104 mach_port_context_t guard;
1105 } __Request__mach_port_destruct_t __attribute__((unused));
1106#ifdef __MigPackStructs
1107#pragma pack(pop)
1108#endif
1109
1110#ifdef __MigPackStructs
1111#pragma pack(push, 4)
1112#endif
1113 typedef struct {
1114 mach_msg_header_t Head;
1115 NDR_record_t NDR;
1116 mach_port_name_t name;
1117 mach_port_context_t guard;
1118 boolean_t strict;
1119 } __Request__mach_port_guard_t __attribute__((unused));
1120#ifdef __MigPackStructs
1121#pragma pack(pop)
1122#endif
1123
1124#ifdef __MigPackStructs
1125#pragma pack(push, 4)
1126#endif
1127 typedef struct {
1128 mach_msg_header_t Head;
1129 NDR_record_t NDR;
1130 mach_port_name_t name;
1131 mach_port_context_t guard;
1132 } __Request__mach_port_unguard_t __attribute__((unused));
1133#ifdef __MigPackStructs
1134#pragma pack(pop)
1135#endif
1136
1137#ifdef __MigPackStructs
1138#pragma pack(push, 4)
1139#endif
1140 typedef struct {
1141 mach_msg_header_t Head;
1142 } __Request__mach_port_space_basic_info_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 mach_port_name_t name;
1154 mach_port_context_t guard;
1155 uint64_t flags;
1156 } __Request__mach_port_guard_with_flags_t __attribute__((unused));
1157#ifdef __MigPackStructs
1158#pragma pack(pop)
1159#endif
1160
1161#ifdef __MigPackStructs
1162#pragma pack(push, 4)
1163#endif
1164 typedef struct {
1165 mach_msg_header_t Head;
1166 NDR_record_t NDR;
1167 mach_port_name_t name;
1168 mach_port_context_t old_guard;
1169 mach_port_context_t new_guard;
1170 } __Request__mach_port_swap_guard_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 mach_port_name_t name;
1182 } __Request__mach_port_kobject_description_t __attribute__((unused));
1183#ifdef __MigPackStructs
1184#pragma pack(pop)
1185#endif
1186
1187#ifdef __MigPackStructs
1188#pragma pack(push, 4)
1189#endif
1190 typedef struct {
1191 mach_msg_header_t Head;
1192 NDR_record_t NDR;
1193 mach_port_name_t connection_port;
1194 mach_port_name_t service_port;
1195 } __Request__mach_port_is_connection_for_service_t __attribute__((unused));
1196#ifdef __MigPackStructs
1197#pragma pack(pop)
1198#endif
1199
1200#ifdef __MigPackStructs
1201#pragma pack(push, 4)
1202#endif
1203 typedef struct {
1204 mach_msg_header_t Head;
1205 NDR_record_t NDR;
1206 mach_port_name_t name;
1207 } __Request__mach_port_get_service_port_info_t __attribute__((unused));
1208#ifdef __MigPackStructs
1209#pragma pack(pop)
1210#endif
1211
1212#ifdef __MigPackStructs
1213#pragma pack(push, 4)
1214#endif
1215 typedef struct {
1216 mach_msg_header_t Head;
1217 NDR_record_t NDR;
1218 mach_port_name_t name;
1219 mach_port_flavor_t flavor;
1220 mach_msg_type_number_t infoCnt;
1221 integer_t info[17];
1222 } __Request__mach_port_assert_attributes_t __attribute__((unused));
1223#ifdef __MigPackStructs
1224#pragma pack(pop)
1225#endif
1226#endif /* !__Request__mach_port_subsystem__defined */
1227
1228/* union of all requests */
1229
1230#ifndef __RequestUnion__mach_port_subsystem__defined
1231#define __RequestUnion__mach_port_subsystem__defined
1232union __RequestUnion__mach_port_subsystem {
1233 __Request__mach_port_names_t Request_mach_port_names;
1234 __Request__mach_port_type_t Request_mach_port_type;
1235 __Request__mach_port_rename_t Request_mach_port_rename;
1236 __Request__mach_port_allocate_name_t Request_mach_port_allocate_name;
1237 __Request__mach_port_allocate_t Request_mach_port_allocate;
1238 __Request__mach_port_destroy_t Request_mach_port_destroy;
1239 __Request__mach_port_deallocate_t Request_mach_port_deallocate;
1240 __Request__mach_port_get_refs_t Request_mach_port_get_refs;
1241 __Request__mach_port_mod_refs_t Request_mach_port_mod_refs;
1242 __Request__mach_port_peek_t Request_mach_port_peek;
1243 __Request__mach_port_set_mscount_t Request_mach_port_set_mscount;
1244 __Request__mach_port_get_set_status_t Request_mach_port_get_set_status;
1245 __Request__mach_port_move_member_t Request_mach_port_move_member;
1246 __Request__mach_port_request_notification_t Request_mach_port_request_notification;
1247 __Request__mach_port_insert_right_t Request_mach_port_insert_right;
1248 __Request__mach_port_extract_right_t Request_mach_port_extract_right;
1249 __Request__mach_port_set_seqno_t Request_mach_port_set_seqno;
1250 __Request__mach_port_get_attributes_t Request_mach_port_get_attributes;
1251 __Request__mach_port_set_attributes_t Request_mach_port_set_attributes;
1252 __Request__mach_port_allocate_qos_t Request_mach_port_allocate_qos;
1253 __Request__mach_port_allocate_full_t Request_mach_port_allocate_full;
1254 __Request__task_set_port_space_t Request_task_set_port_space;
1255 __Request__mach_port_get_srights_t Request_mach_port_get_srights;
1256 __Request__mach_port_space_info_t Request_mach_port_space_info;
1257 __Request__mach_port_dnrequest_info_t Request_mach_port_dnrequest_info;
1258 __Request__mach_port_kernel_object_t Request_mach_port_kernel_object;
1259 __Request__mach_port_insert_member_t Request_mach_port_insert_member;
1260 __Request__mach_port_extract_member_t Request_mach_port_extract_member;
1261 __Request__mach_port_get_context_t Request_mach_port_get_context;
1262 __Request__mach_port_set_context_t Request_mach_port_set_context;
1263 __Request__mach_port_kobject_t Request_mach_port_kobject;
1264 __Request__mach_port_construct_t Request_mach_port_construct;
1265 __Request__mach_port_destruct_t Request_mach_port_destruct;
1266 __Request__mach_port_guard_t Request_mach_port_guard;
1267 __Request__mach_port_unguard_t Request_mach_port_unguard;
1268 __Request__mach_port_space_basic_info_t Request_mach_port_space_basic_info;
1269 __Request__mach_port_guard_with_flags_t Request_mach_port_guard_with_flags;
1270 __Request__mach_port_swap_guard_t Request_mach_port_swap_guard;
1271 __Request__mach_port_kobject_description_t Request_mach_port_kobject_description;
1272 __Request__mach_port_is_connection_for_service_t Request_mach_port_is_connection_for_service;
1273 __Request__mach_port_get_service_port_info_t Request_mach_port_get_service_port_info;
1274 __Request__mach_port_assert_attributes_t Request_mach_port_assert_attributes;
1275};
1276#endif /* !__RequestUnion__mach_port_subsystem__defined */
1277/* typedefs for all replies */
1278
1279#ifndef __Reply__mach_port_subsystem__defined
1280#define __Reply__mach_port_subsystem__defined
1281
1282#ifdef __MigPackStructs
1283#pragma pack(push, 4)
1284#endif
1285 typedef struct {
1286 mach_msg_header_t Head;
1287 /* start of the kernel processed data */
1288 mach_msg_body_t msgh_body;
1289 mach_msg_ool_descriptor_t names;
1290 mach_msg_ool_descriptor_t types;
1291 /* end of the kernel processed data */
1292 NDR_record_t NDR;
1293 mach_msg_type_number_t namesCnt;
1294 mach_msg_type_number_t typesCnt;
1295 } __Reply__mach_port_names_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 mach_port_type_t ptype;
1308 } __Reply__mach_port_type_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 kern_return_t RetCode;
1320 } __Reply__mach_port_rename_t __attribute__((unused));
1321#ifdef __MigPackStructs
1322#pragma pack(pop)
1323#endif
1324
1325#ifdef __MigPackStructs
1326#pragma pack(push, 4)
1327#endif
1328 typedef struct {
1329 mach_msg_header_t Head;
1330 NDR_record_t NDR;
1331 kern_return_t RetCode;
1332 } __Reply__mach_port_allocate_name_t __attribute__((unused));
1333#ifdef __MigPackStructs
1334#pragma pack(pop)
1335#endif
1336
1337#ifdef __MigPackStructs
1338#pragma pack(push, 4)
1339#endif
1340 typedef struct {
1341 mach_msg_header_t Head;
1342 NDR_record_t NDR;
1343 kern_return_t RetCode;
1344 mach_port_name_t name;
1345 } __Reply__mach_port_allocate_t __attribute__((unused));
1346#ifdef __MigPackStructs
1347#pragma pack(pop)
1348#endif
1349
1350#ifdef __MigPackStructs
1351#pragma pack(push, 4)
1352#endif
1353 typedef struct {
1354 mach_msg_header_t Head;
1355 NDR_record_t NDR;
1356 kern_return_t RetCode;
1357 } __Reply__mach_port_destroy_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 NDR_record_t NDR;
1368 kern_return_t RetCode;
1369 } __Reply__mach_port_deallocate_t __attribute__((unused));
1370#ifdef __MigPackStructs
1371#pragma pack(pop)
1372#endif
1373
1374#ifdef __MigPackStructs
1375#pragma pack(push, 4)
1376#endif
1377 typedef struct {
1378 mach_msg_header_t Head;
1379 NDR_record_t NDR;
1380 kern_return_t RetCode;
1381 mach_port_urefs_t refs;
1382 } __Reply__mach_port_get_refs_t __attribute__((unused));
1383#ifdef __MigPackStructs
1384#pragma pack(pop)
1385#endif
1386
1387#ifdef __MigPackStructs
1388#pragma pack(push, 4)
1389#endif
1390 typedef struct {
1391 mach_msg_header_t Head;
1392 NDR_record_t NDR;
1393 kern_return_t RetCode;
1394 } __Reply__mach_port_mod_refs_t __attribute__((unused));
1395#ifdef __MigPackStructs
1396#pragma pack(pop)
1397#endif
1398
1399#ifdef __MigPackStructs
1400#pragma pack(push, 4)
1401#endif
1402 typedef struct {
1403 mach_msg_header_t Head;
1404 NDR_record_t NDR;
1405 kern_return_t RetCode;
1406 mach_port_seqno_t request_seqnop;
1407 mach_msg_size_t msg_sizep;
1408 mach_msg_id_t msg_idp;
1409 mach_msg_type_number_t trailer_infopCnt;
1410 char trailer_infop[68];
1411 } __Reply__mach_port_peek_t __attribute__((unused));
1412#ifdef __MigPackStructs
1413#pragma pack(pop)
1414#endif
1415
1416#ifdef __MigPackStructs
1417#pragma pack(push, 4)
1418#endif
1419 typedef struct {
1420 mach_msg_header_t Head;
1421 NDR_record_t NDR;
1422 kern_return_t RetCode;
1423 } __Reply__mach_port_set_mscount_t __attribute__((unused));
1424#ifdef __MigPackStructs
1425#pragma pack(pop)
1426#endif
1427
1428#ifdef __MigPackStructs
1429#pragma pack(push, 4)
1430#endif
1431 typedef struct {
1432 mach_msg_header_t Head;
1433 /* start of the kernel processed data */
1434 mach_msg_body_t msgh_body;
1435 mach_msg_ool_descriptor_t members;
1436 /* end of the kernel processed data */
1437 NDR_record_t NDR;
1438 mach_msg_type_number_t membersCnt;
1439 } __Reply__mach_port_get_set_status_t __attribute__((unused));
1440#ifdef __MigPackStructs
1441#pragma pack(pop)
1442#endif
1443
1444#ifdef __MigPackStructs
1445#pragma pack(push, 4)
1446#endif
1447 typedef struct {
1448 mach_msg_header_t Head;
1449 NDR_record_t NDR;
1450 kern_return_t RetCode;
1451 } __Reply__mach_port_move_member_t __attribute__((unused));
1452#ifdef __MigPackStructs
1453#pragma pack(pop)
1454#endif
1455
1456#ifdef __MigPackStructs
1457#pragma pack(push, 4)
1458#endif
1459 typedef struct {
1460 mach_msg_header_t Head;
1461 /* start of the kernel processed data */
1462 mach_msg_body_t msgh_body;
1463 mach_msg_port_descriptor_t previous;
1464 /* end of the kernel processed data */
1465 } __Reply__mach_port_request_notification_t __attribute__((unused));
1466#ifdef __MigPackStructs
1467#pragma pack(pop)
1468#endif
1469
1470#ifdef __MigPackStructs
1471#pragma pack(push, 4)
1472#endif
1473 typedef struct {
1474 mach_msg_header_t Head;
1475 NDR_record_t NDR;
1476 kern_return_t RetCode;
1477 } __Reply__mach_port_insert_right_t __attribute__((unused));
1478#ifdef __MigPackStructs
1479#pragma pack(pop)
1480#endif
1481
1482#ifdef __MigPackStructs
1483#pragma pack(push, 4)
1484#endif
1485 typedef struct {
1486 mach_msg_header_t Head;
1487 /* start of the kernel processed data */
1488 mach_msg_body_t msgh_body;
1489 mach_msg_port_descriptor_t poly;
1490 /* end of the kernel processed data */
1491 } __Reply__mach_port_extract_right_t __attribute__((unused));
1492#ifdef __MigPackStructs
1493#pragma pack(pop)
1494#endif
1495
1496#ifdef __MigPackStructs
1497#pragma pack(push, 4)
1498#endif
1499 typedef struct {
1500 mach_msg_header_t Head;
1501 NDR_record_t NDR;
1502 kern_return_t RetCode;
1503 } __Reply__mach_port_set_seqno_t __attribute__((unused));
1504#ifdef __MigPackStructs
1505#pragma pack(pop)
1506#endif
1507
1508#ifdef __MigPackStructs
1509#pragma pack(push, 4)
1510#endif
1511 typedef struct {
1512 mach_msg_header_t Head;
1513 NDR_record_t NDR;
1514 kern_return_t RetCode;
1515 mach_msg_type_number_t port_info_outCnt;
1516 integer_t port_info_out[17];
1517 } __Reply__mach_port_get_attributes_t __attribute__((unused));
1518#ifdef __MigPackStructs
1519#pragma pack(pop)
1520#endif
1521
1522#ifdef __MigPackStructs
1523#pragma pack(push, 4)
1524#endif
1525 typedef struct {
1526 mach_msg_header_t Head;
1527 NDR_record_t NDR;
1528 kern_return_t RetCode;
1529 } __Reply__mach_port_set_attributes_t __attribute__((unused));
1530#ifdef __MigPackStructs
1531#pragma pack(pop)
1532#endif
1533
1534#ifdef __MigPackStructs
1535#pragma pack(push, 4)
1536#endif
1537 typedef struct {
1538 mach_msg_header_t Head;
1539 NDR_record_t NDR;
1540 kern_return_t RetCode;
1541 mach_port_qos_t qos;
1542 mach_port_name_t name;
1543 } __Reply__mach_port_allocate_qos_t __attribute__((unused));
1544#ifdef __MigPackStructs
1545#pragma pack(pop)
1546#endif
1547
1548#ifdef __MigPackStructs
1549#pragma pack(push, 4)
1550#endif
1551 typedef struct {
1552 mach_msg_header_t Head;
1553 NDR_record_t NDR;
1554 kern_return_t RetCode;
1555 mach_port_qos_t qos;
1556 mach_port_name_t name;
1557 } __Reply__mach_port_allocate_full_t __attribute__((unused));
1558#ifdef __MigPackStructs
1559#pragma pack(pop)
1560#endif
1561
1562#ifdef __MigPackStructs
1563#pragma pack(push, 4)
1564#endif
1565 typedef struct {
1566 mach_msg_header_t Head;
1567 NDR_record_t NDR;
1568 kern_return_t RetCode;
1569 } __Reply__task_set_port_space_t __attribute__((unused));
1570#ifdef __MigPackStructs
1571#pragma pack(pop)
1572#endif
1573
1574#ifdef __MigPackStructs
1575#pragma pack(push, 4)
1576#endif
1577 typedef struct {
1578 mach_msg_header_t Head;
1579 NDR_record_t NDR;
1580 kern_return_t RetCode;
1581 mach_port_rights_t srights;
1582 } __Reply__mach_port_get_srights_t __attribute__((unused));
1583#ifdef __MigPackStructs
1584#pragma pack(pop)
1585#endif
1586
1587#ifdef __MigPackStructs
1588#pragma pack(push, 4)
1589#endif
1590 typedef struct {
1591 mach_msg_header_t Head;
1592 /* start of the kernel processed data */
1593 mach_msg_body_t msgh_body;
1594 mach_msg_ool_descriptor_t table_info;
1595 mach_msg_ool_descriptor_t tree_info;
1596 /* end of the kernel processed data */
1597 NDR_record_t NDR;
1598 ipc_info_space_t space_info;
1599 mach_msg_type_number_t table_infoCnt;
1600 mach_msg_type_number_t tree_infoCnt;
1601 } __Reply__mach_port_space_info_t __attribute__((unused));
1602#ifdef __MigPackStructs
1603#pragma pack(pop)
1604#endif
1605
1606#ifdef __MigPackStructs
1607#pragma pack(push, 4)
1608#endif
1609 typedef struct {
1610 mach_msg_header_t Head;
1611 NDR_record_t NDR;
1612 kern_return_t RetCode;
1613 unsigned dnr_total;
1614 unsigned dnr_used;
1615 } __Reply__mach_port_dnrequest_info_t __attribute__((unused));
1616#ifdef __MigPackStructs
1617#pragma pack(pop)
1618#endif
1619
1620#ifdef __MigPackStructs
1621#pragma pack(push, 4)
1622#endif
1623 typedef struct {
1624 mach_msg_header_t Head;
1625 NDR_record_t NDR;
1626 kern_return_t RetCode;
1627 unsigned object_type;
1628 unsigned object_addr;
1629 } __Reply__mach_port_kernel_object_t __attribute__((unused));
1630#ifdef __MigPackStructs
1631#pragma pack(pop)
1632#endif
1633
1634#ifdef __MigPackStructs
1635#pragma pack(push, 4)
1636#endif
1637 typedef struct {
1638 mach_msg_header_t Head;
1639 NDR_record_t NDR;
1640 kern_return_t RetCode;
1641 } __Reply__mach_port_insert_member_t __attribute__((unused));
1642#ifdef __MigPackStructs
1643#pragma pack(pop)
1644#endif
1645
1646#ifdef __MigPackStructs
1647#pragma pack(push, 4)
1648#endif
1649 typedef struct {
1650 mach_msg_header_t Head;
1651 NDR_record_t NDR;
1652 kern_return_t RetCode;
1653 } __Reply__mach_port_extract_member_t __attribute__((unused));
1654#ifdef __MigPackStructs
1655#pragma pack(pop)
1656#endif
1657
1658#ifdef __MigPackStructs
1659#pragma pack(push, 4)
1660#endif
1661 typedef struct {
1662 mach_msg_header_t Head;
1663 NDR_record_t NDR;
1664 kern_return_t RetCode;
1665 mach_port_context_t context;
1666 } __Reply__mach_port_get_context_t __attribute__((unused));
1667#ifdef __MigPackStructs
1668#pragma pack(pop)
1669#endif
1670
1671#ifdef __MigPackStructs
1672#pragma pack(push, 4)
1673#endif
1674 typedef struct {
1675 mach_msg_header_t Head;
1676 NDR_record_t NDR;
1677 kern_return_t RetCode;
1678 } __Reply__mach_port_set_context_t __attribute__((unused));
1679#ifdef __MigPackStructs
1680#pragma pack(pop)
1681#endif
1682
1683#ifdef __MigPackStructs
1684#pragma pack(push, 4)
1685#endif
1686 typedef struct {
1687 mach_msg_header_t Head;
1688 NDR_record_t NDR;
1689 kern_return_t RetCode;
1690 natural_t object_type;
1691 mach_vm_address_t object_addr;
1692 } __Reply__mach_port_kobject_t __attribute__((unused));
1693#ifdef __MigPackStructs
1694#pragma pack(pop)
1695#endif
1696
1697#ifdef __MigPackStructs
1698#pragma pack(push, 4)
1699#endif
1700 typedef struct {
1701 mach_msg_header_t Head;
1702 NDR_record_t NDR;
1703 kern_return_t RetCode;
1704 mach_port_name_t name;
1705 } __Reply__mach_port_construct_t __attribute__((unused));
1706#ifdef __MigPackStructs
1707#pragma pack(pop)
1708#endif
1709
1710#ifdef __MigPackStructs
1711#pragma pack(push, 4)
1712#endif
1713 typedef struct {
1714 mach_msg_header_t Head;
1715 NDR_record_t NDR;
1716 kern_return_t RetCode;
1717 } __Reply__mach_port_destruct_t __attribute__((unused));
1718#ifdef __MigPackStructs
1719#pragma pack(pop)
1720#endif
1721
1722#ifdef __MigPackStructs
1723#pragma pack(push, 4)
1724#endif
1725 typedef struct {
1726 mach_msg_header_t Head;
1727 NDR_record_t NDR;
1728 kern_return_t RetCode;
1729 } __Reply__mach_port_guard_t __attribute__((unused));
1730#ifdef __MigPackStructs
1731#pragma pack(pop)
1732#endif
1733
1734#ifdef __MigPackStructs
1735#pragma pack(push, 4)
1736#endif
1737 typedef struct {
1738 mach_msg_header_t Head;
1739 NDR_record_t NDR;
1740 kern_return_t RetCode;
1741 } __Reply__mach_port_unguard_t __attribute__((unused));
1742#ifdef __MigPackStructs
1743#pragma pack(pop)
1744#endif
1745
1746#ifdef __MigPackStructs
1747#pragma pack(push, 4)
1748#endif
1749 typedef struct {
1750 mach_msg_header_t Head;
1751 NDR_record_t NDR;
1752 kern_return_t RetCode;
1753 ipc_info_space_basic_t basic_info;
1754 } __Reply__mach_port_space_basic_info_t __attribute__((unused));
1755#ifdef __MigPackStructs
1756#pragma pack(pop)
1757#endif
1758
1759#ifdef __MigPackStructs
1760#pragma pack(push, 4)
1761#endif
1762 typedef struct {
1763 mach_msg_header_t Head;
1764 NDR_record_t NDR;
1765 kern_return_t RetCode;
1766 } __Reply__mach_port_guard_with_flags_t __attribute__((unused));
1767#ifdef __MigPackStructs
1768#pragma pack(pop)
1769#endif
1770
1771#ifdef __MigPackStructs
1772#pragma pack(push, 4)
1773#endif
1774 typedef struct {
1775 mach_msg_header_t Head;
1776 NDR_record_t NDR;
1777 kern_return_t RetCode;
1778 } __Reply__mach_port_swap_guard_t __attribute__((unused));
1779#ifdef __MigPackStructs
1780#pragma pack(pop)
1781#endif
1782
1783#ifdef __MigPackStructs
1784#pragma pack(push, 4)
1785#endif
1786 typedef struct {
1787 mach_msg_header_t Head;
1788 NDR_record_t NDR;
1789 kern_return_t RetCode;
1790 natural_t object_type;
1791 mach_vm_address_t object_addr;
1792 mach_msg_type_number_t descriptionOffset; /* MiG doesn't use it */
1793 mach_msg_type_number_t descriptionCnt;
1794 char description[512];
1795 } __Reply__mach_port_kobject_description_t __attribute__((unused));
1796#ifdef __MigPackStructs
1797#pragma pack(pop)
1798#endif
1799
1800#ifdef __MigPackStructs
1801#pragma pack(push, 4)
1802#endif
1803 typedef struct {
1804 mach_msg_header_t Head;
1805 NDR_record_t NDR;
1806 kern_return_t RetCode;
1807 uint64_t filter_policy_id;
1808 } __Reply__mach_port_is_connection_for_service_t __attribute__((unused));
1809#ifdef __MigPackStructs
1810#pragma pack(pop)
1811#endif
1812
1813#ifdef __MigPackStructs
1814#pragma pack(push, 4)
1815#endif
1816 typedef struct {
1817 mach_msg_header_t Head;
1818 NDR_record_t NDR;
1819 kern_return_t RetCode;
1820 mach_service_port_info_data_t sp_info_out;
1821 } __Reply__mach_port_get_service_port_info_t __attribute__((unused));
1822#ifdef __MigPackStructs
1823#pragma pack(pop)
1824#endif
1825
1826#ifdef __MigPackStructs
1827#pragma pack(push, 4)
1828#endif
1829 typedef struct {
1830 mach_msg_header_t Head;
1831 NDR_record_t NDR;
1832 kern_return_t RetCode;
1833 } __Reply__mach_port_assert_attributes_t __attribute__((unused));
1834#ifdef __MigPackStructs
1835#pragma pack(pop)
1836#endif
1837#endif /* !__Reply__mach_port_subsystem__defined */
1838
1839/* union of all replies */
1840
1841#ifndef __ReplyUnion__mach_port_subsystem__defined
1842#define __ReplyUnion__mach_port_subsystem__defined
1843union __ReplyUnion__mach_port_subsystem {
1844 __Reply__mach_port_names_t Reply_mach_port_names;
1845 __Reply__mach_port_type_t Reply_mach_port_type;
1846 __Reply__mach_port_rename_t Reply_mach_port_rename;
1847 __Reply__mach_port_allocate_name_t Reply_mach_port_allocate_name;
1848 __Reply__mach_port_allocate_t Reply_mach_port_allocate;
1849 __Reply__mach_port_destroy_t Reply_mach_port_destroy;
1850 __Reply__mach_port_deallocate_t Reply_mach_port_deallocate;
1851 __Reply__mach_port_get_refs_t Reply_mach_port_get_refs;
1852 __Reply__mach_port_mod_refs_t Reply_mach_port_mod_refs;
1853 __Reply__mach_port_peek_t Reply_mach_port_peek;
1854 __Reply__mach_port_set_mscount_t Reply_mach_port_set_mscount;
1855 __Reply__mach_port_get_set_status_t Reply_mach_port_get_set_status;
1856 __Reply__mach_port_move_member_t Reply_mach_port_move_member;
1857 __Reply__mach_port_request_notification_t Reply_mach_port_request_notification;
1858 __Reply__mach_port_insert_right_t Reply_mach_port_insert_right;
1859 __Reply__mach_port_extract_right_t Reply_mach_port_extract_right;
1860 __Reply__mach_port_set_seqno_t Reply_mach_port_set_seqno;
1861 __Reply__mach_port_get_attributes_t Reply_mach_port_get_attributes;
1862 __Reply__mach_port_set_attributes_t Reply_mach_port_set_attributes;
1863 __Reply__mach_port_allocate_qos_t Reply_mach_port_allocate_qos;
1864 __Reply__mach_port_allocate_full_t Reply_mach_port_allocate_full;
1865 __Reply__task_set_port_space_t Reply_task_set_port_space;
1866 __Reply__mach_port_get_srights_t Reply_mach_port_get_srights;
1867 __Reply__mach_port_space_info_t Reply_mach_port_space_info;
1868 __Reply__mach_port_dnrequest_info_t Reply_mach_port_dnrequest_info;
1869 __Reply__mach_port_kernel_object_t Reply_mach_port_kernel_object;
1870 __Reply__mach_port_insert_member_t Reply_mach_port_insert_member;
1871 __Reply__mach_port_extract_member_t Reply_mach_port_extract_member;
1872 __Reply__mach_port_get_context_t Reply_mach_port_get_context;
1873 __Reply__mach_port_set_context_t Reply_mach_port_set_context;
1874 __Reply__mach_port_kobject_t Reply_mach_port_kobject;
1875 __Reply__mach_port_construct_t Reply_mach_port_construct;
1876 __Reply__mach_port_destruct_t Reply_mach_port_destruct;
1877 __Reply__mach_port_guard_t Reply_mach_port_guard;
1878 __Reply__mach_port_unguard_t Reply_mach_port_unguard;
1879 __Reply__mach_port_space_basic_info_t Reply_mach_port_space_basic_info;
1880 __Reply__mach_port_guard_with_flags_t Reply_mach_port_guard_with_flags;
1881 __Reply__mach_port_swap_guard_t Reply_mach_port_swap_guard;
1882 __Reply__mach_port_kobject_description_t Reply_mach_port_kobject_description;
1883 __Reply__mach_port_is_connection_for_service_t Reply_mach_port_is_connection_for_service;
1884 __Reply__mach_port_get_service_port_info_t Reply_mach_port_get_service_port_info;
1885 __Reply__mach_port_assert_attributes_t Reply_mach_port_assert_attributes;
1886};
1887#endif /* !__RequestUnion__mach_port_subsystem__defined */
1888
1889#ifndef subsystem_to_name_map_mach_port
1890#define subsystem_to_name_map_mach_port \
1891 { "mach_port_names", 3200 },\
1892 { "mach_port_type", 3201 },\
1893 { "mach_port_rename", 3202 },\
1894 { "mach_port_allocate_name", 3203 },\
1895 { "mach_port_allocate", 3204 },\
1896 { "mach_port_destroy", 3205 },\
1897 { "mach_port_deallocate", 3206 },\
1898 { "mach_port_get_refs", 3207 },\
1899 { "mach_port_mod_refs", 3208 },\
1900 { "mach_port_peek", 3209 },\
1901 { "mach_port_set_mscount", 3210 },\
1902 { "mach_port_get_set_status", 3211 },\
1903 { "mach_port_move_member", 3212 },\
1904 { "mach_port_request_notification", 3213 },\
1905 { "mach_port_insert_right", 3214 },\
1906 { "mach_port_extract_right", 3215 },\
1907 { "mach_port_set_seqno", 3216 },\
1908 { "mach_port_get_attributes", 3217 },\
1909 { "mach_port_set_attributes", 3218 },\
1910 { "mach_port_allocate_qos", 3219 },\
1911 { "mach_port_allocate_full", 3220 },\
1912 { "task_set_port_space", 3221 },\
1913 { "mach_port_get_srights", 3222 },\
1914 { "mach_port_space_info", 3223 },\
1915 { "mach_port_dnrequest_info", 3224 },\
1916 { "mach_port_kernel_object", 3225 },\
1917 { "mach_port_insert_member", 3226 },\
1918 { "mach_port_extract_member", 3227 },\
1919 { "mach_port_get_context", 3228 },\
1920 { "mach_port_set_context", 3229 },\
1921 { "mach_port_kobject", 3230 },\
1922 { "mach_port_construct", 3231 },\
1923 { "mach_port_destruct", 3232 },\
1924 { "mach_port_guard", 3233 },\
1925 { "mach_port_unguard", 3234 },\
1926 { "mach_port_space_basic_info", 3235 },\
1927 { "mach_port_guard_with_flags", 3237 },\
1928 { "mach_port_swap_guard", 3238 },\
1929 { "mach_port_kobject_description", 3239 },\
1930 { "mach_port_is_connection_for_service", 3240 },\
1931 { "mach_port_get_service_port_info", 3241 },\
1932 { "mach_port_assert_attributes", 3242 }
1933#endif
1934
1935#ifdef __AfterMigUserHeader
1936__AfterMigUserHeader
1937#endif /* __AfterMigUserHeader */
1938
1939#endif /* _mach_port_user_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/mach_voucher_types.h deleted-246
......@@ -1,246 +0,0 @@
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#include <mach/message.h>
35
36/*
37 * Mach Voucher - an immutable collection of attribute value handles.
38 *
39 * The mach voucher is such that it can be passed between processes
40 * as a Mach port send right (by convention in the mach_msg_header_t’s
41 * msgh_voucher field).
42 *
43 * You may construct a new mach voucher by passing a construction
44 * recipe to host_create_mach_voucher(). The construction recipe supports
45 * generic commands for copying, removing, and redeeming attribute value
46 * handles from previous vouchers, or running attribute-mananger-specific
47 * commands within the recipe.
48 *
49 * Once the set of attribute value handles is constructed and returned,
50 * that set will not change for the life of the voucher (just because the
51 * attribute value handle itself doesn't change, the value the handle refers
52 * to is free to change at will).
53 */
54typedef mach_port_t mach_voucher_t;
55#define MACH_VOUCHER_NULL ((mach_voucher_t) 0)
56
57typedef mach_port_name_t mach_voucher_name_t;
58#define MACH_VOUCHER_NAME_NULL ((mach_voucher_name_t) 0)
59
60typedef mach_voucher_name_t *mach_voucher_name_array_t;
61#define MACH_VOUCHER_NAME_ARRAY_NULL ((mach_voucher_name_array_t) 0)
62
63/*
64 * This type changes appearance between user-space and kernel. It is
65 * a port at user-space and a reference to an ipc_voucher structure in-kernel.
66 */
67typedef mach_voucher_t ipc_voucher_t;
68#define IPC_VOUCHER_NULL ((ipc_voucher_t) 0)
69
70/*
71 * mach_voucher_selector_t - A means of specifying which thread/task value to extract -
72 * the current voucher set at this level, or a voucher representing
73 * the full [layered] effective value for the task/thread.
74 */
75typedef uint32_t mach_voucher_selector_t;
76#define MACH_VOUCHER_SELECTOR_CURRENT ((mach_voucher_selector_t)0)
77#define MACH_VOUCHER_SELECTOR_EFFECTIVE ((mach_voucher_selector_t)1)
78
79
80/*
81 * mach_voucher_attr_key_t - The key used to identify a particular managed resource or
82 * to select the specific resource manager’s data associated
83 * with a given voucher.
84 */
85typedef uint32_t mach_voucher_attr_key_t;
86typedef mach_voucher_attr_key_t *mach_voucher_attr_key_array_t;
87
88#define MACH_VOUCHER_ATTR_KEY_ALL ((mach_voucher_attr_key_t)~0)
89#define MACH_VOUCHER_ATTR_KEY_NONE ((mach_voucher_attr_key_t)0)
90
91/* other well-known-keys will be added here */
92#define MACH_VOUCHER_ATTR_KEY_ATM ((mach_voucher_attr_key_t)1)
93#define MACH_VOUCHER_ATTR_KEY_IMPORTANCE ((mach_voucher_attr_key_t)2)
94#define MACH_VOUCHER_ATTR_KEY_BANK ((mach_voucher_attr_key_t)3)
95#define MACH_VOUCHER_ATTR_KEY_PTHPRIORITY ((mach_voucher_attr_key_t)4)
96
97#define MACH_VOUCHER_ATTR_KEY_USER_DATA ((mach_voucher_attr_key_t)7)
98#define MACH_VOUCHER_ATTR_KEY_BITS MACH_VOUCHER_ATTR_KEY_USER_DATA /* deprecated */
99#define MACH_VOUCHER_ATTR_KEY_TEST ((mach_voucher_attr_key_t)8)
100
101#define MACH_VOUCHER_ATTR_KEY_NUM_WELL_KNOWN MACH_VOUCHER_ATTR_KEY_TEST
102
103/*
104 * mach_voucher_attr_content_t
105 *
106 * Data passed to a resource manager for modifying an attribute
107 * value or returned from the resource manager in response to a
108 * request to externalize the current value for that attribute.
109 */
110typedef uint8_t *mach_voucher_attr_content_t;
111typedef uint32_t mach_voucher_attr_content_size_t;
112
113/*
114 * mach_voucher_attr_command_t - The private verbs implemented by each voucher
115 * attribute manager via mach_voucher_attr_command().
116 */
117typedef uint32_t mach_voucher_attr_command_t;
118
119/*
120 * mach_voucher_attr_recipe_command_t
121 *
122 * The verbs used to create/morph a voucher attribute value.
123 * We define some system-wide commands here - related to creation, and transport of
124 * vouchers and attributes. Additional commands can be defined by, and supported by,
125 * individual attribute resource managers.
126 */
127typedef uint32_t mach_voucher_attr_recipe_command_t;
128typedef mach_voucher_attr_recipe_command_t *mach_voucher_attr_recipe_command_array_t;
129
130#define MACH_VOUCHER_ATTR_NOOP ((mach_voucher_attr_recipe_command_t)0)
131#define MACH_VOUCHER_ATTR_COPY ((mach_voucher_attr_recipe_command_t)1)
132#define MACH_VOUCHER_ATTR_REMOVE ((mach_voucher_attr_recipe_command_t)2)
133#define MACH_VOUCHER_ATTR_SET_VALUE_HANDLE ((mach_voucher_attr_recipe_command_t)3)
134#define MACH_VOUCHER_ATTR_AUTO_REDEEM ((mach_voucher_attr_recipe_command_t)4)
135#define MACH_VOUCHER_ATTR_SEND_PREPROCESS ((mach_voucher_attr_recipe_command_t)5)
136
137/* redeem is on its way out? */
138#define MACH_VOUCHER_ATTR_REDEEM ((mach_voucher_attr_recipe_command_t)10)
139
140/* recipe command(s) for importance attribute manager */
141#define MACH_VOUCHER_ATTR_IMPORTANCE_SELF ((mach_voucher_attr_recipe_command_t)200)
142
143/* recipe command(s) for bit-store attribute manager */
144#define MACH_VOUCHER_ATTR_USER_DATA_STORE ((mach_voucher_attr_recipe_command_t)211)
145#define MACH_VOUCHER_ATTR_BITS_STORE MACH_VOUCHER_ATTR_USER_DATA_STORE /* deprecated */
146
147/* recipe command(s) for test attribute manager */
148#define MACH_VOUCHER_ATTR_TEST_STORE MACH_VOUCHER_ATTR_USER_DATA_STORE
149
150/*
151 * mach_voucher_attr_recipe_t
152 *
153 * An element in a recipe list to create a voucher.
154 */
155#pragma pack(push, 1)
156
157typedef struct mach_voucher_attr_recipe_data {
158 mach_voucher_attr_key_t key;
159 mach_voucher_attr_recipe_command_t command;
160 mach_voucher_name_t previous_voucher;
161 mach_voucher_attr_content_size_t content_size;
162 uint8_t content[];
163} mach_voucher_attr_recipe_data_t;
164typedef mach_voucher_attr_recipe_data_t *mach_voucher_attr_recipe_t;
165typedef mach_msg_type_number_t mach_voucher_attr_recipe_size_t;
166
167/* Make the above palatable to MIG */
168typedef uint8_t *mach_voucher_attr_raw_recipe_t;
169typedef mach_voucher_attr_raw_recipe_t mach_voucher_attr_raw_recipe_array_t;
170typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_size_t;
171typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_array_size_t;
172
173#define MACH_VOUCHER_ATTR_MAX_RAW_RECIPE_ARRAY_SIZE 5120
174#define MACH_VOUCHER_TRAP_STACK_LIMIT 256
175
176#pragma pack(pop)
177
178/*
179 * VOUCHER ATTRIBUTE MANAGER Writer types
180 */
181
182/*
183 * mach_voucher_attr_manager_t
184 *
185 * A handle through which the mach voucher mechanism communicates with the voucher
186 * attribute manager for a given attribute key.
187 */
188typedef mach_port_t mach_voucher_attr_manager_t;
189#define MACH_VOUCHER_ATTR_MANAGER_NULL ((mach_voucher_attr_manager_t) 0)
190
191/*
192 * mach_voucher_attr_control_t
193 *
194 * A handle provided to the voucher attribute manager for a given attribute key
195 * through which it makes inquiries or control operations of the mach voucher mechanism.
196 */
197typedef mach_port_t mach_voucher_attr_control_t;
198#define MACH_VOUCHER_ATTR_CONTROL_NULL ((mach_voucher_attr_control_t) 0)
199
200/*
201 * These types are different in-kernel vs user-space. They are ports in user-space,
202 * pointers to opaque structs in most of the kernel, and pointers to known struct
203 * types in the Mach portion of the kernel.
204 */
205typedef mach_port_t ipc_voucher_attr_manager_t;
206typedef mach_port_t ipc_voucher_attr_control_t;
207#define IPC_VOUCHER_ATTR_MANAGER_NULL ((ipc_voucher_attr_manager_t) 0)
208#define IPC_VOUCHER_ATTR_CONTROL_NULL ((ipc_voucher_attr_control_t) 0)
209
210/*
211 * mach_voucher_attr_value_handle_t
212 *
213 * The private handle that the voucher attribute manager provides to
214 * the mach voucher mechanism to represent a given attr content/value.
215 */
216typedef uint64_t mach_voucher_attr_value_handle_t __kernel_ptr_semantics;
217typedef mach_voucher_attr_value_handle_t *mach_voucher_attr_value_handle_array_t;
218
219typedef mach_msg_type_number_t mach_voucher_attr_value_handle_array_size_t;
220#define MACH_VOUCHER_ATTR_VALUE_MAX_NESTED ((mach_voucher_attr_value_handle_array_size_t)4)
221
222typedef uint32_t mach_voucher_attr_value_reference_t;
223typedef uint32_t mach_voucher_attr_value_flags_t;
224#define MACH_VOUCHER_ATTR_VALUE_FLAGS_NONE ((mach_voucher_attr_value_flags_t)0)
225#define MACH_VOUCHER_ATTR_VALUE_FLAGS_PERSIST ((mach_voucher_attr_value_flags_t)1)
226
227/* USE - TBD */
228typedef uint32_t mach_voucher_attr_control_flags_t;
229#define MACH_VOUCHER_ATTR_CONTROL_FLAGS_NONE ((mach_voucher_attr_control_flags_t)0)
230
231/*
232 * Commands and types for the IPC Importance Attribute Manager
233 *
234 * These are the valid mach_voucher_attr_command() options with the
235 * MACH_VOUCHER_ATTR_KEY_IMPORTANCE key.
236 */
237#define MACH_VOUCHER_IMPORTANCE_ATTR_ADD_EXTERNAL 1 /* Add some number of external refs (not supported) */
238#define MACH_VOUCHER_IMPORTANCE_ATTR_DROP_EXTERNAL 2 /* Drop some number of external refs */
239typedef uint32_t mach_voucher_attr_importance_refs;
240
241/*
242 * Activity id Generation defines
243 */
244#define MACH_ACTIVITY_ID_COUNT_MAX 16
245
246#endif /* _MACH_VOUCHER_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/machine.h deleted-410
......@@ -1,410 +0,0 @@
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#define CPUFAMILY_INTEL_COMETLAKE 0x1cf8a03e
380#define CPUFAMILY_ARM_9 0xe73283ae
381#define CPUFAMILY_ARM_11 0x8ff620d8
382#define CPUFAMILY_ARM_XSCALE 0x53b005f5
383#define CPUFAMILY_ARM_12 0xbd1b0ae9
384#define CPUFAMILY_ARM_13 0x0cc90e64
385#define CPUFAMILY_ARM_14 0x96077ef1
386#define CPUFAMILY_ARM_15 0xa8511bca
387#define CPUFAMILY_ARM_SWIFT 0x1e2d6381
388#define CPUFAMILY_ARM_CYCLONE 0x37a09642
389#define CPUFAMILY_ARM_TYPHOON 0x2c91a47e
390#define CPUFAMILY_ARM_TWISTER 0x92fb37c8
391#define CPUFAMILY_ARM_HURRICANE 0x67ceee93
392#define CPUFAMILY_ARM_MONSOON_MISTRAL 0xe81e7ef6
393#define CPUFAMILY_ARM_VORTEX_TEMPEST 0x07d34b9f
394#define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504d2
395#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3
396#define CPUFAMILY_ARM_BLIZZARD_AVALANCHE 0xda33d83d
397
398#define CPUSUBFAMILY_UNKNOWN 0
399#define CPUSUBFAMILY_ARM_HP 1
400#define CPUSUBFAMILY_ARM_HG 2
401#define CPUSUBFAMILY_ARM_M 3
402#define CPUSUBFAMILY_ARM_HS 4
403#define CPUSUBFAMILY_ARM_HC_HD 5
404
405/* The following synonyms are deprecated: */
406#define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN
407#define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM
408
409
410#endif /* _MACH_MACHINE_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/message.h deleted-911
......@@ -1,911 +0,0 @@
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
299
300typedef struct{
301 uint32_t address;
302 mach_msg_size_t size;
303 boolean_t deallocate: 8;
304 mach_msg_copy_options_t copy: 8;
305 unsigned int pad1: 8;
306 mach_msg_descriptor_type_t type: 8;
307} mach_msg_ool_descriptor32_t;
308
309typedef struct{
310 uint64_t address;
311 boolean_t deallocate: 8;
312 mach_msg_copy_options_t copy: 8;
313 unsigned int pad1: 8;
314 mach_msg_descriptor_type_t type: 8;
315 mach_msg_size_t size;
316} mach_msg_ool_descriptor64_t;
317
318typedef struct{
319 void* address;
320#if !defined(__LP64__)
321 mach_msg_size_t size;
322#endif
323 boolean_t deallocate: 8;
324 mach_msg_copy_options_t copy: 8;
325 unsigned int pad1: 8;
326 mach_msg_descriptor_type_t type: 8;
327#if defined(__LP64__)
328 mach_msg_size_t size;
329#endif
330} mach_msg_ool_descriptor_t;
331
332typedef struct{
333 uint32_t address;
334 mach_msg_size_t count;
335 boolean_t deallocate: 8;
336 mach_msg_copy_options_t copy: 8;
337 mach_msg_type_name_t disposition : 8;
338 mach_msg_descriptor_type_t type : 8;
339} mach_msg_ool_ports_descriptor32_t;
340
341typedef struct{
342 uint64_t address;
343 boolean_t deallocate: 8;
344 mach_msg_copy_options_t copy: 8;
345 mach_msg_type_name_t disposition : 8;
346 mach_msg_descriptor_type_t type : 8;
347 mach_msg_size_t count;
348} mach_msg_ool_ports_descriptor64_t;
349
350typedef struct{
351 void* address;
352#if !defined(__LP64__)
353 mach_msg_size_t count;
354#endif
355 boolean_t deallocate: 8;
356 mach_msg_copy_options_t copy: 8;
357 mach_msg_type_name_t disposition : 8;
358 mach_msg_descriptor_type_t type : 8;
359#if defined(__LP64__)
360 mach_msg_size_t count;
361#endif
362} mach_msg_ool_ports_descriptor_t;
363
364typedef struct{
365 uint32_t context;
366 mach_port_name_t name;
367 mach_msg_guard_flags_t flags : 16;
368 mach_msg_type_name_t disposition : 8;
369 mach_msg_descriptor_type_t type : 8;
370} mach_msg_guarded_port_descriptor32_t;
371
372typedef struct{
373 uint64_t context;
374 mach_msg_guard_flags_t flags : 16;
375 mach_msg_type_name_t disposition : 8;
376 mach_msg_descriptor_type_t type : 8;
377 mach_port_name_t name;
378} mach_msg_guarded_port_descriptor64_t;
379
380typedef struct{
381 mach_port_context_t context;
382#if !defined(__LP64__)
383 mach_port_name_t name;
384#endif
385 mach_msg_guard_flags_t flags : 16;
386 mach_msg_type_name_t disposition : 8;
387 mach_msg_descriptor_type_t type : 8;
388#if defined(__LP64__)
389 mach_port_name_t name;
390#endif /* defined(__LP64__) */
391} mach_msg_guarded_port_descriptor_t;
392
393/*
394 * LP64support - This union definition is not really
395 * appropriate in LP64 mode because not all descriptors
396 * are of the same size in that environment.
397 */
398typedef union{
399 mach_msg_port_descriptor_t port;
400 mach_msg_ool_descriptor_t out_of_line;
401 mach_msg_ool_ports_descriptor_t ool_ports;
402 mach_msg_type_descriptor_t type;
403 mach_msg_guarded_port_descriptor_t guarded_port;
404} mach_msg_descriptor_t;
405
406typedef struct{
407 mach_msg_size_t msgh_descriptor_count;
408} mach_msg_body_t;
409
410#define MACH_MSG_BODY_NULL ((mach_msg_body_t *) 0)
411#define MACH_MSG_DESCRIPTOR_NULL ((mach_msg_descriptor_t *) 0)
412
413typedef struct{
414 mach_msg_bits_t msgh_bits;
415 mach_msg_size_t msgh_size;
416 mach_port_t msgh_remote_port;
417 mach_port_t msgh_local_port;
418 mach_port_name_t msgh_voucher_port;
419 mach_msg_id_t msgh_id;
420} mach_msg_header_t;
421
422#define msgh_reserved msgh_voucher_port
423#define MACH_MSG_NULL ((mach_msg_header_t *) 0)
424
425typedef struct{
426 mach_msg_header_t header;
427 mach_msg_body_t body;
428} mach_msg_base_t;
429
430
431typedef unsigned int mach_msg_trailer_type_t;
432
433#define MACH_MSG_TRAILER_FORMAT_0 0
434
435typedef unsigned int mach_msg_trailer_size_t;
436typedef char *mach_msg_trailer_info_t;
437
438typedef struct{
439 mach_msg_trailer_type_t msgh_trailer_type;
440 mach_msg_trailer_size_t msgh_trailer_size;
441} mach_msg_trailer_t;
442
443/*
444 * The msgh_seqno field carries a sequence number
445 * associated with the received-from port. A port's
446 * sequence number is incremented every time a message
447 * is received from it and included in the received
448 * trailer to help put messages back in sequence if
449 * multiple threads receive and/or process received
450 * messages.
451 */
452typedef struct{
453 mach_msg_trailer_type_t msgh_trailer_type;
454 mach_msg_trailer_size_t msgh_trailer_size;
455 mach_port_seqno_t msgh_seqno;
456} mach_msg_seqno_trailer_t;
457
458typedef struct{
459 unsigned int val[2];
460} security_token_t;
461
462typedef struct{
463 mach_msg_trailer_type_t msgh_trailer_type;
464 mach_msg_trailer_size_t msgh_trailer_size;
465 mach_port_seqno_t msgh_seqno;
466 security_token_t msgh_sender;
467} mach_msg_security_trailer_t;
468
469/*
470 * The audit token is an opaque token which identifies
471 * Mach tasks and senders of Mach messages as subjects
472 * to the BSM audit system. Only the appropriate BSM
473 * library routines should be used to interpret the
474 * contents of the audit token as the representation
475 * of the subject identity within the token may change
476 * over time.
477 */
478typedef struct{
479 unsigned int val[8];
480} audit_token_t;
481
482typedef struct{
483 mach_msg_trailer_type_t msgh_trailer_type;
484 mach_msg_trailer_size_t msgh_trailer_size;
485 mach_port_seqno_t msgh_seqno;
486 security_token_t msgh_sender;
487 audit_token_t msgh_audit;
488} mach_msg_audit_trailer_t;
489
490typedef struct{
491 mach_msg_trailer_type_t msgh_trailer_type;
492 mach_msg_trailer_size_t msgh_trailer_size;
493 mach_port_seqno_t msgh_seqno;
494 security_token_t msgh_sender;
495 audit_token_t msgh_audit;
496 mach_port_context_t msgh_context;
497} mach_msg_context_trailer_t;
498
499
500
501typedef struct{
502 mach_port_name_t sender;
503} msg_labels_t;
504
505typedef int mach_msg_filter_id;
506#define MACH_MSG_FILTER_POLICY_ALLOW (mach_msg_filter_id)0
507
508/*
509 * Trailer type to pass MAC policy label info as a mach message trailer.
510 *
511 */
512
513typedef struct{
514 mach_msg_trailer_type_t msgh_trailer_type;
515 mach_msg_trailer_size_t msgh_trailer_size;
516 mach_port_seqno_t msgh_seqno;
517 security_token_t msgh_sender;
518 audit_token_t msgh_audit;
519 mach_port_context_t msgh_context;
520 mach_msg_filter_id msgh_ad;
521 msg_labels_t msgh_labels;
522} mach_msg_mac_trailer_t;
523
524
525#define MACH_MSG_TRAILER_MINIMUM_SIZE sizeof(mach_msg_trailer_t)
526
527/*
528 * These values can change from release to release - but clearly
529 * code cannot request additional trailer elements one was not
530 * compiled to understand. Therefore, it is safe to use this
531 * constant when the same module specified the receive options.
532 * Otherwise, you run the risk that the options requested by
533 * another module may exceed the local modules notion of
534 * MAX_TRAILER_SIZE.
535 */
536
537typedef mach_msg_mac_trailer_t mach_msg_max_trailer_t;
538#define MAX_TRAILER_SIZE ((mach_msg_size_t)sizeof(mach_msg_max_trailer_t))
539
540/*
541 * Legacy requirements keep us from ever updating these defines (even
542 * when the format_0 trailers gain new option data fields in the future).
543 * Therefore, they shouldn't be used going forward. Instead, the sizes
544 * should be compared against the specific element size requested using
545 * REQUESTED_TRAILER_SIZE.
546 */
547typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t;
548
549/*typedef mach_msg_mac_trailer_t mach_msg_format_0_trailer_t;
550 */
551
552#define MACH_MSG_TRAILER_FORMAT_0_SIZE sizeof(mach_msg_format_0_trailer_t)
553
554#define KERNEL_SECURITY_TOKEN_VALUE { {0, 1} }
555extern const security_token_t KERNEL_SECURITY_TOKEN;
556
557#define KERNEL_AUDIT_TOKEN_VALUE { {0, 0, 0, 0, 0, 0, 0, 0} }
558extern const audit_token_t KERNEL_AUDIT_TOKEN;
559
560typedef integer_t mach_msg_options_t;
561
562typedef struct{
563 mach_msg_header_t header;
564} mach_msg_empty_send_t;
565
566typedef struct{
567 mach_msg_header_t header;
568 mach_msg_trailer_t trailer;
569} mach_msg_empty_rcv_t;
570
571typedef union{
572 mach_msg_empty_send_t send;
573 mach_msg_empty_rcv_t rcv;
574} mach_msg_empty_t;
575
576#pragma pack(pop)
577
578/* utility to round the message size - will become machine dependent */
579#define round_msg(x) (((mach_msg_size_t)(x) + sizeof (natural_t) - 1) & \
580 ~(sizeof (natural_t) - 1))
581
582
583/*
584 * There is no fixed upper bound to the size of Mach messages.
585 */
586#define MACH_MSG_SIZE_MAX ((mach_msg_size_t) ~0)
587
588#if defined(__APPLE_API_PRIVATE)
589/*
590 * But architectural limits of a given implementation, or
591 * temporal conditions may cause unpredictable send failures
592 * for messages larger than MACH_MSG_SIZE_RELIABLE.
593 *
594 * In either case, waiting for memory is [currently] outside
595 * the scope of send timeout values provided to IPC.
596 */
597#define MACH_MSG_SIZE_RELIABLE ((mach_msg_size_t) 256 * 1024)
598#endif
599/*
600 * Compatibility definitions, for code written
601 * when there was a msgh_kind instead of msgh_seqno.
602 */
603#define MACH_MSGH_KIND_NORMAL 0x00000000
604#define MACH_MSGH_KIND_NOTIFICATION 0x00000001
605#define msgh_kind msgh_seqno
606#define mach_msg_kind_t mach_port_seqno_t
607
608typedef natural_t mach_msg_type_size_t;
609typedef natural_t mach_msg_type_number_t;
610
611/*
612 * Values received/carried in messages. Tells the receiver what
613 * sort of port right he now has.
614 *
615 * MACH_MSG_TYPE_PORT_NAME is used to transfer a port name
616 * which should remain uninterpreted by the kernel. (Port rights
617 * are not transferred, just the port name.)
618 */
619
620#define MACH_MSG_TYPE_PORT_NONE 0
621
622#define MACH_MSG_TYPE_PORT_NAME 15
623#define MACH_MSG_TYPE_PORT_RECEIVE MACH_MSG_TYPE_MOVE_RECEIVE
624#define MACH_MSG_TYPE_PORT_SEND MACH_MSG_TYPE_MOVE_SEND
625#define MACH_MSG_TYPE_PORT_SEND_ONCE MACH_MSG_TYPE_MOVE_SEND_ONCE
626
627#define MACH_MSG_TYPE_LAST 22 /* Last assigned */
628
629/*
630 * A dummy value. Mostly used to indicate that the actual value
631 * will be filled in later, dynamically.
632 */
633
634#define MACH_MSG_TYPE_POLYMORPHIC ((mach_msg_type_name_t) -1)
635
636/*
637 * Is a given item a port type?
638 */
639
640#define MACH_MSG_TYPE_PORT_ANY(x) \
641 (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \
642 ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
643
644#define MACH_MSG_TYPE_PORT_ANY_SEND(x) \
645 (((x) >= MACH_MSG_TYPE_MOVE_SEND) && \
646 ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
647
648#define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \
649 (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \
650 ((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE))
651
652typedef integer_t mach_msg_option_t;
653
654#define MACH_MSG_OPTION_NONE 0x00000000
655
656#define MACH_SEND_MSG 0x00000001
657#define MACH_RCV_MSG 0x00000002
658
659#define MACH_RCV_LARGE 0x00000004 /* report large message sizes */
660#define MACH_RCV_LARGE_IDENTITY 0x00000008 /* identify source of large messages */
661
662#define MACH_SEND_TIMEOUT 0x00000010 /* timeout value applies to send */
663#define MACH_SEND_OVERRIDE 0x00000020 /* priority override for send */
664#define MACH_SEND_INTERRUPT 0x00000040 /* don't restart interrupted sends */
665#define MACH_SEND_NOTIFY 0x00000080 /* arm send-possible notify */
666#define MACH_SEND_ALWAYS 0x00010000 /* ignore qlimits - kernel only */
667#define MACH_SEND_FILTER_NONFATAL 0x00010000 /* rejection by message filter should return failure - user only */
668#define MACH_SEND_TRAILER 0x00020000 /* sender-provided trailer */
669#define MACH_SEND_NOIMPORTANCE 0x00040000 /* msg won't carry importance */
670#define MACH_SEND_NODENAP MACH_SEND_NOIMPORTANCE
671#define MACH_SEND_IMPORTANCE 0x00080000 /* msg carries importance - kernel only */
672#define MACH_SEND_SYNC_OVERRIDE 0x00100000 /* msg should do sync IPC override (on legacy kernels) */
673#define MACH_SEND_PROPAGATE_QOS 0x00200000 /* IPC should propagate the caller's QoS */
674#define MACH_SEND_SYNC_USE_THRPRI MACH_SEND_PROPAGATE_QOS /* obsolete name */
675#define MACH_SEND_KERNEL 0x00400000 /* full send from kernel space - kernel only */
676#define MACH_SEND_SYNC_BOOTSTRAP_CHECKIN 0x00800000 /* special reply port should boost thread doing sync bootstrap checkin */
677
678#define MACH_RCV_TIMEOUT 0x00000100 /* timeout value applies to receive */
679#define MACH_RCV_NOTIFY 0x00000000 /* legacy name (value was: 0x00000200) */
680#define MACH_RCV_INTERRUPT 0x00000400 /* don't restart interrupted receive */
681#define MACH_RCV_VOUCHER 0x00000800 /* willing to receive voucher port */
682#define MACH_RCV_OVERWRITE 0x00000000 /* scatter receive (deprecated) */
683#define MACH_RCV_GUARDED_DESC 0x00001000 /* Can receive new guarded descriptor */
684#define MACH_RCV_SYNC_WAIT 0x00004000 /* sync waiter waiting for rcv */
685#define MACH_RCV_SYNC_PEEK 0x00008000 /* sync waiter waiting to peek */
686
687#define MACH_MSG_STRICT_REPLY 0x00000200 /* Enforce specific properties about the reply port, and
688 * the context in which a thread replies to a message.
689 * This flag must be passed on both the SEND and RCV */
690
691
692/*
693 * NOTE: a 0x00------ RCV mask implies to ask for
694 * a MACH_MSG_TRAILER_FORMAT_0 with 0 Elements,
695 * which is equivalent to a mach_msg_trailer_t.
696 *
697 * XXXMAC: unlike the rest of the MACH_RCV_* flags, MACH_RCV_TRAILER_LABELS
698 * needs its own private bit since we only calculate its fields when absolutely
699 * required.
700 */
701#define MACH_RCV_TRAILER_NULL 0
702#define MACH_RCV_TRAILER_SEQNO 1
703#define MACH_RCV_TRAILER_SENDER 2
704#define MACH_RCV_TRAILER_AUDIT 3
705#define MACH_RCV_TRAILER_CTX 4
706#define MACH_RCV_TRAILER_AV 7
707#define MACH_RCV_TRAILER_LABELS 8
708
709#define MACH_RCV_TRAILER_TYPE(x) (((x) & 0xf) << 28)
710#define MACH_RCV_TRAILER_ELEMENTS(x) (((x) & 0xf) << 24)
711#define MACH_RCV_TRAILER_MASK ((0xf << 24))
712
713#define GET_RCV_ELEMENTS(y) (((y) >> 24) & 0xf)
714
715
716/*
717 * XXXMAC: note that in the case of MACH_RCV_TRAILER_LABELS,
718 * we just fall through to mach_msg_max_trailer_t.
719 * This is correct behavior since mach_msg_max_trailer_t is defined as
720 * mac_msg_mac_trailer_t which is used for the LABELS trailer.
721 * It also makes things work properly if MACH_RCV_TRAILER_LABELS is ORed
722 * with one of the other options.
723 */
724
725#define REQUESTED_TRAILER_SIZE_NATIVE(y) \
726 ((mach_msg_trailer_size_t) \
727 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_NULL) ? \
728 sizeof(mach_msg_trailer_t) : \
729 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SEQNO) ? \
730 sizeof(mach_msg_seqno_trailer_t) : \
731 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SENDER) ? \
732 sizeof(mach_msg_security_trailer_t) : \
733 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AUDIT) ? \
734 sizeof(mach_msg_audit_trailer_t) : \
735 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_CTX) ? \
736 sizeof(mach_msg_context_trailer_t) : \
737 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AV) ? \
738 sizeof(mach_msg_mac_trailer_t) : \
739 sizeof(mach_msg_max_trailer_t))))))))
740
741
742#define REQUESTED_TRAILER_SIZE(y) REQUESTED_TRAILER_SIZE_NATIVE(y)
743
744/*
745 * Much code assumes that mach_msg_return_t == kern_return_t.
746 * This definition is useful for descriptive purposes.
747 *
748 * See <mach/error.h> for the format of error codes.
749 * IPC errors are system 4. Send errors are subsystem 0;
750 * receive errors are subsystem 1. The code field is always non-zero.
751 * The high bits of the code field communicate extra information
752 * for some error codes. MACH_MSG_MASK masks off these special bits.
753 */
754
755typedef kern_return_t mach_msg_return_t;
756
757#define MACH_MSG_SUCCESS 0x00000000
758
759
760#define MACH_MSG_MASK 0x00003e00
761/* All special error code bits defined below. */
762#define MACH_MSG_IPC_SPACE 0x00002000
763/* No room in IPC name space for another capability name. */
764#define MACH_MSG_VM_SPACE 0x00001000
765/* No room in VM address space for out-of-line memory. */
766#define MACH_MSG_IPC_KERNEL 0x00000800
767/* Kernel resource shortage handling an IPC capability. */
768#define MACH_MSG_VM_KERNEL 0x00000400
769/* Kernel resource shortage handling out-of-line memory. */
770
771#define MACH_SEND_IN_PROGRESS 0x10000001
772/* Thread is waiting to send. (Internal use only.) */
773#define MACH_SEND_INVALID_DATA 0x10000002
774/* Bogus in-line data. */
775#define MACH_SEND_INVALID_DEST 0x10000003
776/* Bogus destination port. */
777#define MACH_SEND_TIMED_OUT 0x10000004
778/* Message not sent before timeout expired. */
779#define MACH_SEND_INVALID_VOUCHER 0x10000005
780/* Bogus voucher port. */
781#define MACH_SEND_INTERRUPTED 0x10000007
782/* Software interrupt. */
783#define MACH_SEND_MSG_TOO_SMALL 0x10000008
784/* Data doesn't contain a complete message. */
785#define MACH_SEND_INVALID_REPLY 0x10000009
786/* Bogus reply port. */
787#define MACH_SEND_INVALID_RIGHT 0x1000000a
788/* Bogus port rights in the message body. */
789#define MACH_SEND_INVALID_NOTIFY 0x1000000b
790/* Bogus notify port argument. */
791#define MACH_SEND_INVALID_MEMORY 0x1000000c
792/* Invalid out-of-line memory pointer. */
793#define MACH_SEND_NO_BUFFER 0x1000000d
794/* No message buffer is available. */
795#define MACH_SEND_TOO_LARGE 0x1000000e
796/* Send is too large for port */
797#define MACH_SEND_INVALID_TYPE 0x1000000f
798/* Invalid msg-type specification. */
799#define MACH_SEND_INVALID_HEADER 0x10000010
800/* A field in the header had a bad value. */
801#define MACH_SEND_INVALID_TRAILER 0x10000011
802/* The trailer to be sent does not match kernel format. */
803#define MACH_SEND_INVALID_CONTEXT 0x10000012
804/* The sending thread context did not match the context on the dest port */
805#define MACH_SEND_INVALID_RT_OOL_SIZE 0x10000015
806/* compatibility: no longer a returned error */
807#define MACH_SEND_NO_GRANT_DEST 0x10000016
808/* The destination port doesn't accept ports in body */
809#define MACH_SEND_MSG_FILTERED 0x10000017
810/* Message send was rejected by message filter */
811
812#define MACH_RCV_IN_PROGRESS 0x10004001
813/* Thread is waiting for receive. (Internal use only.) */
814#define MACH_RCV_INVALID_NAME 0x10004002
815/* Bogus name for receive port/port-set. */
816#define MACH_RCV_TIMED_OUT 0x10004003
817/* Didn't get a message within the timeout value. */
818#define MACH_RCV_TOO_LARGE 0x10004004
819/* Message buffer is not large enough for inline data. */
820#define MACH_RCV_INTERRUPTED 0x10004005
821/* Software interrupt. */
822#define MACH_RCV_PORT_CHANGED 0x10004006
823/* compatibility: no longer a returned error */
824#define MACH_RCV_INVALID_NOTIFY 0x10004007
825/* Bogus notify port argument. */
826#define MACH_RCV_INVALID_DATA 0x10004008
827/* Bogus message buffer for inline data. */
828#define MACH_RCV_PORT_DIED 0x10004009
829/* Port/set was sent away/died during receive. */
830#define MACH_RCV_IN_SET 0x1000400a
831/* compatibility: no longer a returned error */
832#define MACH_RCV_HEADER_ERROR 0x1000400b
833/* Error receiving message header. See special bits. */
834#define MACH_RCV_BODY_ERROR 0x1000400c
835/* Error receiving message body. See special bits. */
836#define MACH_RCV_INVALID_TYPE 0x1000400d
837/* Invalid msg-type specification in scatter list. */
838#define MACH_RCV_SCATTER_SMALL 0x1000400e
839/* Out-of-line overwrite region is not large enough */
840#define MACH_RCV_INVALID_TRAILER 0x1000400f
841/* trailer type or number of trailer elements not supported */
842#define MACH_RCV_IN_PROGRESS_TIMED 0x10004011
843/* Waiting for receive with timeout. (Internal use only.) */
844#define MACH_RCV_INVALID_REPLY 0x10004012
845/* invalid reply port used in a STRICT_REPLY message */
846
847
848
849__BEGIN_DECLS
850
851/*
852 * Routine: mach_msg_overwrite
853 * Purpose:
854 * Send and/or receive a message. If the message operation
855 * is interrupted, and the user did not request an indication
856 * of that fact, then restart the appropriate parts of the
857 * operation silently (trap version does not restart).
858 *
859 * Distinct send and receive buffers may be specified. If
860 * no separate receive buffer is specified, the msg parameter
861 * will be used for both send and receive operations.
862 *
863 * In addition to a distinct receive buffer, that buffer may
864 * already contain scatter control information to direct the
865 * receiving of the message.
866 */
867__WATCHOS_PROHIBITED __TVOS_PROHIBITED
868extern mach_msg_return_t mach_msg_overwrite(
869 mach_msg_header_t *msg,
870 mach_msg_option_t option,
871 mach_msg_size_t send_size,
872 mach_msg_size_t rcv_size,
873 mach_port_name_t rcv_name,
874 mach_msg_timeout_t timeout,
875 mach_port_name_t notify,
876 mach_msg_header_t *rcv_msg,
877 mach_msg_size_t rcv_limit);
878
879
880/*
881 * Routine: mach_msg
882 * Purpose:
883 * Send and/or receive a message. If the message operation
884 * is interrupted, and the user did not request an indication
885 * of that fact, then restart the appropriate parts of the
886 * operation silently (trap version does not restart).
887 */
888__WATCHOS_PROHIBITED __TVOS_PROHIBITED
889extern mach_msg_return_t mach_msg(
890 mach_msg_header_t *msg,
891 mach_msg_option_t option,
892 mach_msg_size_t send_size,
893 mach_msg_size_t rcv_size,
894 mach_port_name_t rcv_name,
895 mach_msg_timeout_t timeout,
896 mach_port_name_t notify);
897
898/*
899 * Routine: mach_voucher_deallocate
900 * Purpose:
901 * Deallocate a mach voucher created or received in a message. Drops
902 * one (send right) reference to the voucher.
903 */
904__WATCHOS_PROHIBITED __TVOS_PROHIBITED
905extern kern_return_t mach_voucher_deallocate(
906 mach_port_name_t voucher);
907
908
909__END_DECLS
910
911#endif /* _MACH_MESSAGE_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/port.h deleted-477
......@@ -1,477 +0,0 @@
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/* Convenient combinations. */
215
216#define MACH_PORT_TYPE_SEND_RECEIVE \
217 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE)
218#define MACH_PORT_TYPE_SEND_RIGHTS \
219 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE)
220#define MACH_PORT_TYPE_PORT_RIGHTS \
221 (MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE)
222#define MACH_PORT_TYPE_PORT_OR_DEAD \
223 (MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME)
224#define MACH_PORT_TYPE_ALL_RIGHTS \
225 (MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET)
226
227/* Dummy type bits that mach_port_type/mach_port_names can return. */
228
229#define MACH_PORT_TYPE_DNREQUEST 0x80000000
230#define MACH_PORT_TYPE_SPREQUEST 0x40000000
231#define MACH_PORT_TYPE_SPREQUEST_DELAYED 0x20000000
232
233/* User-references for capabilities. */
234
235typedef natural_t mach_port_urefs_t;
236typedef integer_t mach_port_delta_t; /* change in urefs */
237
238/* Attributes of ports. (See mach_port_get_receive_status.) */
239
240typedef natural_t mach_port_seqno_t; /* sequence number */
241typedef natural_t mach_port_mscount_t; /* make-send count */
242typedef natural_t mach_port_msgcount_t; /* number of msgs */
243typedef natural_t mach_port_rights_t; /* number of rights */
244
245/*
246 * Are there outstanding send rights for a given port?
247 */
248#define MACH_PORT_SRIGHTS_NONE 0 /* no srights */
249#define MACH_PORT_SRIGHTS_PRESENT 1 /* srights */
250typedef unsigned int mach_port_srights_t; /* status of send rights */
251
252typedef struct mach_port_status {
253 mach_port_rights_t mps_pset; /* count of containing port sets */
254 mach_port_seqno_t mps_seqno; /* sequence number */
255 mach_port_mscount_t mps_mscount; /* make-send count */
256 mach_port_msgcount_t mps_qlimit; /* queue limit */
257 mach_port_msgcount_t mps_msgcount; /* number in the queue */
258 mach_port_rights_t mps_sorights; /* how many send-once rights */
259 boolean_t mps_srights; /* do send rights exist? */
260 boolean_t mps_pdrequest; /* port-deleted requested? */
261 boolean_t mps_nsrequest; /* no-senders requested? */
262 natural_t mps_flags; /* port flags */
263} mach_port_status_t;
264
265/* System-wide values for setting queue limits on a port */
266#define MACH_PORT_QLIMIT_ZERO (0)
267#define MACH_PORT_QLIMIT_BASIC (5)
268#define MACH_PORT_QLIMIT_SMALL (16)
269#define MACH_PORT_QLIMIT_LARGE (1024)
270#define MACH_PORT_QLIMIT_KERNEL (65534)
271#define MACH_PORT_QLIMIT_MIN MACH_PORT_QLIMIT_ZERO
272#define MACH_PORT_QLIMIT_DEFAULT MACH_PORT_QLIMIT_BASIC
273#define MACH_PORT_QLIMIT_MAX MACH_PORT_QLIMIT_LARGE
274
275typedef struct mach_port_limits {
276 mach_port_msgcount_t mpl_qlimit; /* number of msgs */
277} mach_port_limits_t;
278
279/* Possible values for mps_flags (part of mach_port_status_t) */
280#define MACH_PORT_STATUS_FLAG_TEMPOWNER 0x01
281#define MACH_PORT_STATUS_FLAG_GUARDED 0x02
282#define MACH_PORT_STATUS_FLAG_STRICT_GUARD 0x04
283#define MACH_PORT_STATUS_FLAG_IMP_DONATION 0x08
284#define MACH_PORT_STATUS_FLAG_REVIVE 0x10
285#define MACH_PORT_STATUS_FLAG_TASKPTR 0x20
286#define MACH_PORT_STATUS_FLAG_GUARD_IMMOVABLE_RECEIVE 0x40
287#define MACH_PORT_STATUS_FLAG_NO_GRANT 0x80
288
289typedef struct mach_port_info_ext {
290 mach_port_status_t mpie_status;
291 mach_port_msgcount_t mpie_boost_cnt;
292 uint32_t reserved[6];
293} mach_port_info_ext_t;
294
295typedef struct mach_port_guard_info {
296 uint64_t mpgi_guard; /* guard value */
297} mach_port_guard_info_t;
298
299typedef integer_t *mach_port_info_t; /* varying array of natural_t */
300
301/* Flavors for mach_port_get/set/assert_attributes() */
302typedef int mach_port_flavor_t;
303#define MACH_PORT_LIMITS_INFO 1 /* uses mach_port_limits_t */
304#define MACH_PORT_RECEIVE_STATUS 2 /* uses mach_port_status_t */
305#define MACH_PORT_DNREQUESTS_SIZE 3 /* info is int */
306#define MACH_PORT_TEMPOWNER 4 /* indicates receive right will be reassigned to another task */
307#define MACH_PORT_IMPORTANCE_RECEIVER 5 /* indicates recieve right accepts priority donation */
308#define MACH_PORT_DENAP_RECEIVER 6 /* indicates receive right accepts de-nap donation */
309#define MACH_PORT_INFO_EXT 7 /* uses mach_port_info_ext_t */
310#define MACH_PORT_GUARD_INFO 8 /* asserts if the strict guard value is correct */
311
312#define MACH_PORT_LIMITS_INFO_COUNT ((natural_t) \
313 (sizeof(mach_port_limits_t)/sizeof(natural_t)))
314#define MACH_PORT_RECEIVE_STATUS_COUNT ((natural_t) \
315 (sizeof(mach_port_status_t)/sizeof(natural_t)))
316#define MACH_PORT_DNREQUESTS_SIZE_COUNT 1
317#define MACH_PORT_INFO_EXT_COUNT ((natural_t) \
318 (sizeof(mach_port_info_ext_t)/sizeof(natural_t)))
319#define MACH_PORT_GUARD_INFO_COUNT ((natural_t) \
320 (sizeof(mach_port_guard_info_t)/sizeof(natural_t)))
321
322/*
323 * Structure used to pass information about port allocation requests.
324 * Must be padded to 64-bits total length.
325 */
326typedef struct mach_port_qos {
327 unsigned int name:1; /* name given */
328 unsigned int prealloc:1; /* prealloced message */
329 boolean_t pad1:30;
330 natural_t len;
331} mach_port_qos_t;
332
333/*
334 * Structure used to pass information about the service port
335 */
336#define MACH_SERVICE_PORT_INFO_STRING_NAME_MAX_BUF_LEN 255 /* Maximum length of the port string name buffer */
337
338typedef struct mach_service_port_info {
339 char mspi_string_name[MACH_SERVICE_PORT_INFO_STRING_NAME_MAX_BUF_LEN]; /* Service port's string name */
340 uint8_t mspi_domain_type; /* Service port domain */
341} mach_service_port_info_data_t;
342
343#define MACH_SERVICE_PORT_INFO_COUNT ((char) \
344 (sizeof(mach_service_port_info_data_t)/sizeof(char)))
345
346typedef struct mach_service_port_info * mach_service_port_info_t;
347
348/*
349 * Flags for mach_port_options (used for
350 * invocation of mach_port_construct).
351 * Indicates attributes to be set for the newly
352 * allocated port.
353 */
354#define MPO_CONTEXT_AS_GUARD 0x01 /* Add guard to the port */
355#define MPO_QLIMIT 0x02 /* Set qlimit for the port msg queue */
356#define MPO_TEMPOWNER 0x04 /* Set the tempowner bit of the port */
357#define MPO_IMPORTANCE_RECEIVER 0x08 /* Mark the port as importance receiver */
358#define MPO_INSERT_SEND_RIGHT 0x10 /* Insert a send right for the port */
359#define MPO_STRICT 0x20 /* Apply strict guarding for port */
360#define MPO_DENAP_RECEIVER 0x40 /* Mark the port as App de-nap receiver */
361#define MPO_IMMOVABLE_RECEIVE 0x80 /* Mark the port as immovable; protected by the guard context */
362#define MPO_FILTER_MSG 0x100 /* Allow message filtering */
363#define MPO_TG_BLOCK_TRACKING 0x200 /* Track blocking relationship for thread group during sync IPC */
364#define MPO_SERVICE_PORT 0x400 /* Create a service port with the given name; should be used only by launchd */
365#define MPO_CONNECTION_PORT 0x800 /* Derive new peer connection port from a given service port */
366
367/*
368 * Structure to define optional attributes for a newly
369 * constructed port.
370 */
371typedef struct mach_port_options {
372 uint32_t flags; /* Flags defining attributes for port */
373 mach_port_limits_t mpl; /* Message queue limit for port */
374 union {
375 uint64_t reserved[2]; /* Reserved */
376 mach_port_name_t work_interval_port; /* Work interval port */
377 mach_service_port_info_t service_port_info; /* Service port (MPO_SERVICE_PORT) */
378 mach_port_name_t service_port_name; /* Service port (MPO_CONNECTION_PORT) */
379 };
380}mach_port_options_t;
381
382typedef mach_port_options_t *mach_port_options_ptr_t;
383
384/* Mach Port Guarding definitions */
385
386/*
387 * EXC_GUARD represents a guard violation for both
388 * mach ports and file descriptors. GUARD_TYPE_ is used
389 * to differentiate among them.
390 */
391#define GUARD_TYPE_MACH_PORT 0x1
392
393/* Reasons for exception for a guarded mach port */
394enum mach_port_guard_exception_codes {
395 kGUARD_EXC_DESTROY = 1u << 0,
396 kGUARD_EXC_MOD_REFS = 1u << 1,
397 kGUARD_EXC_SET_CONTEXT = 1u << 2,
398 kGUARD_EXC_UNGUARDED = 1u << 3,
399 kGUARD_EXC_INCORRECT_GUARD = 1u << 4,
400 kGUARD_EXC_IMMOVABLE = 1u << 5,
401 kGUARD_EXC_STRICT_REPLY = 1u << 6,
402 kGUARD_EXC_MSG_FILTERED = 1u << 7,
403 /* start of [optionally] non-fatal guards */
404 kGUARD_EXC_INVALID_RIGHT = 1u << 8,
405 kGUARD_EXC_INVALID_NAME = 1u << 9,
406 kGUARD_EXC_INVALID_VALUE = 1u << 10,
407 kGUARD_EXC_INVALID_ARGUMENT = 1u << 11,
408 kGUARD_EXC_RIGHT_EXISTS = 1u << 12,
409 kGUARD_EXC_KERN_NO_SPACE = 1u << 13,
410 kGUARD_EXC_KERN_FAILURE = 1u << 14,
411 kGUARD_EXC_KERN_RESOURCE = 1u << 15,
412 kGUARD_EXC_SEND_INVALID_REPLY = 1u << 16,
413 kGUARD_EXC_SEND_INVALID_VOUCHER = 1u << 17,
414 kGUARD_EXC_SEND_INVALID_RIGHT = 1u << 18,
415 kGUARD_EXC_RCV_INVALID_NAME = 1u << 19,
416 /* start of always non-fatal guards */
417 kGUARD_EXC_RCV_GUARDED_DESC = 1u << 20, /* for development only */
418 kGUARD_EXC_MOD_REFS_NON_FATAL = 1u << 21,
419 kGUARD_EXC_IMMOVABLE_NON_FATAL = 1u << 22,
420};
421
422#define MAX_FATAL_kGUARD_EXC_CODE (1u << 7)
423
424/*
425 * Mach port guard flags.
426 */
427#define MPG_FLAGS_NONE (0x00ull)
428
429#define MAX_OPTIONAL_kGUARD_EXC_CODE (1u << 19)
430
431/*
432 * These flags are used as bits in the subcode of kGUARD_EXC_STRICT_REPLY exceptions.
433 */
434#define MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_DISP (0x01ull << 56)
435#define MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_PORT (0x02ull << 56)
436#define MPG_FLAGS_STRICT_REPLY_INVALID_VOUCHER (0x04ull << 56)
437#define MPG_FLAGS_STRICT_REPLY_NO_BANK_ATTR (0x08ull << 56)
438#define MPG_FLAGS_STRICT_REPLY_MISMATCHED_PERSONA (0x10ull << 56)
439#define MPG_FLAGS_STRICT_REPLY_MASK (0xffull << 56)
440
441/*
442 * These flags are used as bits in the subcode of kGUARD_EXC_MOD_REFS exceptions.
443 */
444#define MPG_FLAGS_MOD_REFS_PINNED_DEALLOC (0x01ull << 56)
445#define MPG_FLAGS_MOD_REFS_PINNED_DESTROY (0x02ull << 56)
446#define MPG_FLAGS_MOD_REFS_PINNED_COPYIN (0x04ull << 56)
447
448/*
449 * These flags are used as bits in the subcode of kGUARD_EXC_IMMOVABLE exceptions.
450 */
451#define MPG_FLAGS_IMMOVABLE_PINNED (0x01ull << 56)
452
453/*
454 * Flags for mach_port_guard_with_flags. These flags extend
455 * the attributes associated with a guarded port.
456 */
457#define MPG_STRICT 0x01 /* Apply strict guarding for a port */
458#define MPG_IMMOVABLE_RECEIVE 0x02 /* Receive right cannot be moved out of the space */
459
460#if !__DARWIN_UNIX03 && !defined(_NO_PORT_T_FROM_MACH)
461/*
462 * Mach 3.0 renamed everything to have mach_ in front of it.
463 * These types and macros are provided for backward compatibility
464 * but are deprecated.
465 */
466typedef mach_port_t port_t;
467typedef mach_port_name_t port_name_t;
468typedef mach_port_name_t *port_name_array_t;
469
470#define PORT_NULL ((port_t) 0)
471#define PORT_DEAD ((port_t) ~0)
472#define PORT_VALID(name) \
473 ((port_t)(name) != PORT_NULL && (port_t)(name) != PORT_DEAD)
474
475#endif /* !__DARWIN_UNIX03 && !_NO_PORT_T_FROM_MACH */
476
477#endif /* _MACH_PORT_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/processor.h deleted-361
......@@ -1,361 +0,0 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 processor_start */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t processor_start
76(
77 processor_t processor
78);
79
80/* Routine processor_exit */
81#ifdef mig_external
82mig_external
83#else
84extern
85#endif /* mig_external */
86kern_return_t processor_exit
87(
88 processor_t processor
89);
90
91/* Routine processor_info */
92#ifdef mig_external
93mig_external
94#else
95extern
96#endif /* mig_external */
97kern_return_t processor_info
98(
99 processor_t processor,
100 processor_flavor_t flavor,
101 host_t *host,
102 processor_info_t processor_info_out,
103 mach_msg_type_number_t *processor_info_outCnt
104);
105
106/* Routine processor_control */
107#ifdef mig_external
108mig_external
109#else
110extern
111#endif /* mig_external */
112kern_return_t processor_control
113(
114 processor_t processor,
115 processor_info_t processor_cmd,
116 mach_msg_type_number_t processor_cmdCnt
117);
118
119/* Routine processor_assign */
120#ifdef mig_external
121mig_external
122#else
123extern
124#endif /* mig_external */
125kern_return_t processor_assign
126(
127 processor_t processor,
128 processor_set_t new_set,
129 boolean_t wait
130);
131
132/* Routine processor_get_assignment */
133#ifdef mig_external
134mig_external
135#else
136extern
137#endif /* mig_external */
138kern_return_t processor_get_assignment
139(
140 processor_t processor,
141 processor_set_name_t *assigned_set
142);
143
144__END_DECLS
145
146/********************** Caution **************************/
147/* The following data types should be used to calculate */
148/* maximum message sizes only. The actual message may be */
149/* smaller, and the position of the arguments within the */
150/* message layout may vary from what is presented here. */
151/* For example, if any of the arguments are variable- */
152/* sized, and less than the maximum is sent, the data */
153/* will be packed tight in the actual message to reduce */
154/* the presence of holes. */
155/********************** Caution **************************/
156
157/* typedefs for all requests */
158
159#ifndef __Request__processor_subsystem__defined
160#define __Request__processor_subsystem__defined
161
162#ifdef __MigPackStructs
163#pragma pack(push, 4)
164#endif
165 typedef struct {
166 mach_msg_header_t Head;
167 } __Request__processor_start_t __attribute__((unused));
168#ifdef __MigPackStructs
169#pragma pack(pop)
170#endif
171
172#ifdef __MigPackStructs
173#pragma pack(push, 4)
174#endif
175 typedef struct {
176 mach_msg_header_t Head;
177 } __Request__processor_exit_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 processor_flavor_t flavor;
189 mach_msg_type_number_t processor_info_outCnt;
190 } __Request__processor_info_t __attribute__((unused));
191#ifdef __MigPackStructs
192#pragma pack(pop)
193#endif
194
195#ifdef __MigPackStructs
196#pragma pack(push, 4)
197#endif
198 typedef struct {
199 mach_msg_header_t Head;
200 NDR_record_t NDR;
201 mach_msg_type_number_t processor_cmdCnt;
202 integer_t processor_cmd[20];
203 } __Request__processor_control_t __attribute__((unused));
204#ifdef __MigPackStructs
205#pragma pack(pop)
206#endif
207
208#ifdef __MigPackStructs
209#pragma pack(push, 4)
210#endif
211 typedef struct {
212 mach_msg_header_t Head;
213 /* start of the kernel processed data */
214 mach_msg_body_t msgh_body;
215 mach_msg_port_descriptor_t new_set;
216 /* end of the kernel processed data */
217 NDR_record_t NDR;
218 boolean_t wait;
219 } __Request__processor_assign_t __attribute__((unused));
220#ifdef __MigPackStructs
221#pragma pack(pop)
222#endif
223
224#ifdef __MigPackStructs
225#pragma pack(push, 4)
226#endif
227 typedef struct {
228 mach_msg_header_t Head;
229 } __Request__processor_get_assignment_t __attribute__((unused));
230#ifdef __MigPackStructs
231#pragma pack(pop)
232#endif
233#endif /* !__Request__processor_subsystem__defined */
234
235/* union of all requests */
236
237#ifndef __RequestUnion__processor_subsystem__defined
238#define __RequestUnion__processor_subsystem__defined
239union __RequestUnion__processor_subsystem {
240 __Request__processor_start_t Request_processor_start;
241 __Request__processor_exit_t Request_processor_exit;
242 __Request__processor_info_t Request_processor_info;
243 __Request__processor_control_t Request_processor_control;
244 __Request__processor_assign_t Request_processor_assign;
245 __Request__processor_get_assignment_t Request_processor_get_assignment;
246};
247#endif /* !__RequestUnion__processor_subsystem__defined */
248/* typedefs for all replies */
249
250#ifndef __Reply__processor_subsystem__defined
251#define __Reply__processor_subsystem__defined
252
253#ifdef __MigPackStructs
254#pragma pack(push, 4)
255#endif
256 typedef struct {
257 mach_msg_header_t Head;
258 NDR_record_t NDR;
259 kern_return_t RetCode;
260 } __Reply__processor_start_t __attribute__((unused));
261#ifdef __MigPackStructs
262#pragma pack(pop)
263#endif
264
265#ifdef __MigPackStructs
266#pragma pack(push, 4)
267#endif
268 typedef struct {
269 mach_msg_header_t Head;
270 NDR_record_t NDR;
271 kern_return_t RetCode;
272 } __Reply__processor_exit_t __attribute__((unused));
273#ifdef __MigPackStructs
274#pragma pack(pop)
275#endif
276
277#ifdef __MigPackStructs
278#pragma pack(push, 4)
279#endif
280 typedef struct {
281 mach_msg_header_t Head;
282 /* start of the kernel processed data */
283 mach_msg_body_t msgh_body;
284 mach_msg_port_descriptor_t host;
285 /* end of the kernel processed data */
286 NDR_record_t NDR;
287 mach_msg_type_number_t processor_info_outCnt;
288 integer_t processor_info_out[20];
289 } __Reply__processor_info_t __attribute__((unused));
290#ifdef __MigPackStructs
291#pragma pack(pop)
292#endif
293
294#ifdef __MigPackStructs
295#pragma pack(push, 4)
296#endif
297 typedef struct {
298 mach_msg_header_t Head;
299 NDR_record_t NDR;
300 kern_return_t RetCode;
301 } __Reply__processor_control_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 NDR_record_t NDR;
312 kern_return_t RetCode;
313 } __Reply__processor_assign_t __attribute__((unused));
314#ifdef __MigPackStructs
315#pragma pack(pop)
316#endif
317
318#ifdef __MigPackStructs
319#pragma pack(push, 4)
320#endif
321 typedef struct {
322 mach_msg_header_t Head;
323 /* start of the kernel processed data */
324 mach_msg_body_t msgh_body;
325 mach_msg_port_descriptor_t assigned_set;
326 /* end of the kernel processed data */
327 } __Reply__processor_get_assignment_t __attribute__((unused));
328#ifdef __MigPackStructs
329#pragma pack(pop)
330#endif
331#endif /* !__Reply__processor_subsystem__defined */
332
333/* union of all replies */
334
335#ifndef __ReplyUnion__processor_subsystem__defined
336#define __ReplyUnion__processor_subsystem__defined
337union __ReplyUnion__processor_subsystem {
338 __Reply__processor_start_t Reply_processor_start;
339 __Reply__processor_exit_t Reply_processor_exit;
340 __Reply__processor_info_t Reply_processor_info;
341 __Reply__processor_control_t Reply_processor_control;
342 __Reply__processor_assign_t Reply_processor_assign;
343 __Reply__processor_get_assignment_t Reply_processor_get_assignment;
344};
345#endif /* !__RequestUnion__processor_subsystem__defined */
346
347#ifndef subsystem_to_name_map_processor
348#define subsystem_to_name_map_processor \
349 { "processor_start", 3000 },\
350 { "processor_exit", 3001 },\
351 { "processor_info", 3002 },\
352 { "processor_control", 3003 },\
353 { "processor_assign", 3004 },\
354 { "processor_get_assignment", 3005 }
355#endif
356
357#ifdef __AfterMigUserHeader
358__AfterMigUserHeader
359#endif /* __AfterMigUserHeader */
360
361#endif /* _processor_user_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/processor_set.h deleted-586
......@@ -1,586 +0,0 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 processor_set_statistics */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t processor_set_statistics
76(
77 processor_set_name_t pset,
78 processor_set_flavor_t flavor,
79 processor_set_info_t info_out,
80 mach_msg_type_number_t *info_outCnt
81);
82
83/* Routine processor_set_destroy */
84#ifdef mig_external
85mig_external
86#else
87extern
88#endif /* mig_external */
89kern_return_t processor_set_destroy
90(
91 processor_set_t set
92);
93
94/* Routine processor_set_max_priority */
95#ifdef mig_external
96mig_external
97#else
98extern
99#endif /* mig_external */
100kern_return_t processor_set_max_priority
101(
102 processor_set_t processor_set,
103 int max_priority,
104 boolean_t change_threads
105);
106
107/* Routine processor_set_policy_enable */
108#ifdef mig_external
109mig_external
110#else
111extern
112#endif /* mig_external */
113kern_return_t processor_set_policy_enable
114(
115 processor_set_t processor_set,
116 int policy
117);
118
119/* Routine processor_set_policy_disable */
120#ifdef mig_external
121mig_external
122#else
123extern
124#endif /* mig_external */
125kern_return_t processor_set_policy_disable
126(
127 processor_set_t processor_set,
128 int policy,
129 boolean_t change_threads
130);
131
132/* Routine processor_set_tasks */
133#ifdef mig_external
134mig_external
135#else
136extern
137#endif /* mig_external */
138kern_return_t processor_set_tasks
139(
140 processor_set_t processor_set,
141 task_array_t *task_list,
142 mach_msg_type_number_t *task_listCnt
143);
144
145/* Routine processor_set_threads */
146#ifdef mig_external
147mig_external
148#else
149extern
150#endif /* mig_external */
151kern_return_t processor_set_threads
152(
153 processor_set_t processor_set,
154 thread_act_array_t *thread_list,
155 mach_msg_type_number_t *thread_listCnt
156);
157
158/* Routine processor_set_policy_control */
159#ifdef mig_external
160mig_external
161#else
162extern
163#endif /* mig_external */
164kern_return_t processor_set_policy_control
165(
166 processor_set_t pset,
167 processor_set_flavor_t flavor,
168 processor_set_info_t policy_info,
169 mach_msg_type_number_t policy_infoCnt,
170 boolean_t change
171);
172
173/* Routine processor_set_stack_usage */
174#ifdef mig_external
175mig_external
176#else
177extern
178#endif /* mig_external */
179kern_return_t processor_set_stack_usage
180(
181 processor_set_t pset,
182 unsigned *ltotal,
183 vm_size_t *space,
184 vm_size_t *resident,
185 vm_size_t *maxusage,
186 vm_offset_t *maxstack
187);
188
189/* Routine processor_set_info */
190#ifdef mig_external
191mig_external
192#else
193extern
194#endif /* mig_external */
195kern_return_t processor_set_info
196(
197 processor_set_name_t set_name,
198 int flavor,
199 host_t *host,
200 processor_set_info_t info_out,
201 mach_msg_type_number_t *info_outCnt
202);
203
204/* Routine processor_set_tasks_with_flavor */
205#ifdef mig_external
206mig_external
207#else
208extern
209#endif /* mig_external */
210kern_return_t processor_set_tasks_with_flavor
211(
212 processor_set_t processor_set,
213 mach_task_flavor_t flavor,
214 task_array_t *task_list,
215 mach_msg_type_number_t *task_listCnt
216);
217
218__END_DECLS
219
220/********************** Caution **************************/
221/* The following data types should be used to calculate */
222/* maximum message sizes only. The actual message may be */
223/* smaller, and the position of the arguments within the */
224/* message layout may vary from what is presented here. */
225/* For example, if any of the arguments are variable- */
226/* sized, and less than the maximum is sent, the data */
227/* will be packed tight in the actual message to reduce */
228/* the presence of holes. */
229/********************** Caution **************************/
230
231/* typedefs for all requests */
232
233#ifndef __Request__processor_set_subsystem__defined
234#define __Request__processor_set_subsystem__defined
235
236#ifdef __MigPackStructs
237#pragma pack(push, 4)
238#endif
239 typedef struct {
240 mach_msg_header_t Head;
241 NDR_record_t NDR;
242 processor_set_flavor_t flavor;
243 mach_msg_type_number_t info_outCnt;
244 } __Request__processor_set_statistics_t __attribute__((unused));
245#ifdef __MigPackStructs
246#pragma pack(pop)
247#endif
248
249#ifdef __MigPackStructs
250#pragma pack(push, 4)
251#endif
252 typedef struct {
253 mach_msg_header_t Head;
254 } __Request__processor_set_destroy_t __attribute__((unused));
255#ifdef __MigPackStructs
256#pragma pack(pop)
257#endif
258
259#ifdef __MigPackStructs
260#pragma pack(push, 4)
261#endif
262 typedef struct {
263 mach_msg_header_t Head;
264 NDR_record_t NDR;
265 int max_priority;
266 boolean_t change_threads;
267 } __Request__processor_set_max_priority_t __attribute__((unused));
268#ifdef __MigPackStructs
269#pragma pack(pop)
270#endif
271
272#ifdef __MigPackStructs
273#pragma pack(push, 4)
274#endif
275 typedef struct {
276 mach_msg_header_t Head;
277 NDR_record_t NDR;
278 int policy;
279 } __Request__processor_set_policy_enable_t __attribute__((unused));
280#ifdef __MigPackStructs
281#pragma pack(pop)
282#endif
283
284#ifdef __MigPackStructs
285#pragma pack(push, 4)
286#endif
287 typedef struct {
288 mach_msg_header_t Head;
289 NDR_record_t NDR;
290 int policy;
291 boolean_t change_threads;
292 } __Request__processor_set_policy_disable_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 } __Request__processor_set_tasks_t __attribute__((unused));
303#ifdef __MigPackStructs
304#pragma pack(pop)
305#endif
306
307#ifdef __MigPackStructs
308#pragma pack(push, 4)
309#endif
310 typedef struct {
311 mach_msg_header_t Head;
312 } __Request__processor_set_threads_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 NDR_record_t NDR;
323 processor_set_flavor_t flavor;
324 mach_msg_type_number_t policy_infoCnt;
325 integer_t policy_info[5];
326 boolean_t change;
327 } __Request__processor_set_policy_control_t __attribute__((unused));
328#ifdef __MigPackStructs
329#pragma pack(pop)
330#endif
331
332#ifdef __MigPackStructs
333#pragma pack(push, 4)
334#endif
335 typedef struct {
336 mach_msg_header_t Head;
337 } __Request__processor_set_stack_usage_t __attribute__((unused));
338#ifdef __MigPackStructs
339#pragma pack(pop)
340#endif
341
342#ifdef __MigPackStructs
343#pragma pack(push, 4)
344#endif
345 typedef struct {
346 mach_msg_header_t Head;
347 NDR_record_t NDR;
348 int flavor;
349 mach_msg_type_number_t info_outCnt;
350 } __Request__processor_set_info_t __attribute__((unused));
351#ifdef __MigPackStructs
352#pragma pack(pop)
353#endif
354
355#ifdef __MigPackStructs
356#pragma pack(push, 4)
357#endif
358 typedef struct {
359 mach_msg_header_t Head;
360 NDR_record_t NDR;
361 mach_task_flavor_t flavor;
362 } __Request__processor_set_tasks_with_flavor_t __attribute__((unused));
363#ifdef __MigPackStructs
364#pragma pack(pop)
365#endif
366#endif /* !__Request__processor_set_subsystem__defined */
367
368/* union of all requests */
369
370#ifndef __RequestUnion__processor_set_subsystem__defined
371#define __RequestUnion__processor_set_subsystem__defined
372union __RequestUnion__processor_set_subsystem {
373 __Request__processor_set_statistics_t Request_processor_set_statistics;
374 __Request__processor_set_destroy_t Request_processor_set_destroy;
375 __Request__processor_set_max_priority_t Request_processor_set_max_priority;
376 __Request__processor_set_policy_enable_t Request_processor_set_policy_enable;
377 __Request__processor_set_policy_disable_t Request_processor_set_policy_disable;
378 __Request__processor_set_tasks_t Request_processor_set_tasks;
379 __Request__processor_set_threads_t Request_processor_set_threads;
380 __Request__processor_set_policy_control_t Request_processor_set_policy_control;
381 __Request__processor_set_stack_usage_t Request_processor_set_stack_usage;
382 __Request__processor_set_info_t Request_processor_set_info;
383 __Request__processor_set_tasks_with_flavor_t Request_processor_set_tasks_with_flavor;
384};
385#endif /* !__RequestUnion__processor_set_subsystem__defined */
386/* typedefs for all replies */
387
388#ifndef __Reply__processor_set_subsystem__defined
389#define __Reply__processor_set_subsystem__defined
390
391#ifdef __MigPackStructs
392#pragma pack(push, 4)
393#endif
394 typedef struct {
395 mach_msg_header_t Head;
396 NDR_record_t NDR;
397 kern_return_t RetCode;
398 mach_msg_type_number_t info_outCnt;
399 integer_t info_out[5];
400 } __Reply__processor_set_statistics_t __attribute__((unused));
401#ifdef __MigPackStructs
402#pragma pack(pop)
403#endif
404
405#ifdef __MigPackStructs
406#pragma pack(push, 4)
407#endif
408 typedef struct {
409 mach_msg_header_t Head;
410 NDR_record_t NDR;
411 kern_return_t RetCode;
412 } __Reply__processor_set_destroy_t __attribute__((unused));
413#ifdef __MigPackStructs
414#pragma pack(pop)
415#endif
416
417#ifdef __MigPackStructs
418#pragma pack(push, 4)
419#endif
420 typedef struct {
421 mach_msg_header_t Head;
422 NDR_record_t NDR;
423 kern_return_t RetCode;
424 } __Reply__processor_set_max_priority_t __attribute__((unused));
425#ifdef __MigPackStructs
426#pragma pack(pop)
427#endif
428
429#ifdef __MigPackStructs
430#pragma pack(push, 4)
431#endif
432 typedef struct {
433 mach_msg_header_t Head;
434 NDR_record_t NDR;
435 kern_return_t RetCode;
436 } __Reply__processor_set_policy_enable_t __attribute__((unused));
437#ifdef __MigPackStructs
438#pragma pack(pop)
439#endif
440
441#ifdef __MigPackStructs
442#pragma pack(push, 4)
443#endif
444 typedef struct {
445 mach_msg_header_t Head;
446 NDR_record_t NDR;
447 kern_return_t RetCode;
448 } __Reply__processor_set_policy_disable_t __attribute__((unused));
449#ifdef __MigPackStructs
450#pragma pack(pop)
451#endif
452
453#ifdef __MigPackStructs
454#pragma pack(push, 4)
455#endif
456 typedef struct {
457 mach_msg_header_t Head;
458 /* start of the kernel processed data */
459 mach_msg_body_t msgh_body;
460 mach_msg_ool_ports_descriptor_t task_list;
461 /* end of the kernel processed data */
462 NDR_record_t NDR;
463 mach_msg_type_number_t task_listCnt;
464 } __Reply__processor_set_tasks_t __attribute__((unused));
465#ifdef __MigPackStructs
466#pragma pack(pop)
467#endif
468
469#ifdef __MigPackStructs
470#pragma pack(push, 4)
471#endif
472 typedef struct {
473 mach_msg_header_t Head;
474 /* start of the kernel processed data */
475 mach_msg_body_t msgh_body;
476 mach_msg_ool_ports_descriptor_t thread_list;
477 /* end of the kernel processed data */
478 NDR_record_t NDR;
479 mach_msg_type_number_t thread_listCnt;
480 } __Reply__processor_set_threads_t __attribute__((unused));
481#ifdef __MigPackStructs
482#pragma pack(pop)
483#endif
484
485#ifdef __MigPackStructs
486#pragma pack(push, 4)
487#endif
488 typedef struct {
489 mach_msg_header_t Head;
490 NDR_record_t NDR;
491 kern_return_t RetCode;
492 } __Reply__processor_set_policy_control_t __attribute__((unused));
493#ifdef __MigPackStructs
494#pragma pack(pop)
495#endif
496
497#ifdef __MigPackStructs
498#pragma pack(push, 4)
499#endif
500 typedef struct {
501 mach_msg_header_t Head;
502 NDR_record_t NDR;
503 kern_return_t RetCode;
504 unsigned ltotal;
505 vm_size_t space;
506 vm_size_t resident;
507 vm_size_t maxusage;
508 vm_offset_t maxstack;
509 } __Reply__processor_set_stack_usage_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 /* start of the kernel processed data */
520 mach_msg_body_t msgh_body;
521 mach_msg_port_descriptor_t host;
522 /* end of the kernel processed data */
523 NDR_record_t NDR;
524 mach_msg_type_number_t info_outCnt;
525 integer_t info_out[5];
526 } __Reply__processor_set_info_t __attribute__((unused));
527#ifdef __MigPackStructs
528#pragma pack(pop)
529#endif
530
531#ifdef __MigPackStructs
532#pragma pack(push, 4)
533#endif
534 typedef struct {
535 mach_msg_header_t Head;
536 /* start of the kernel processed data */
537 mach_msg_body_t msgh_body;
538 mach_msg_ool_ports_descriptor_t task_list;
539 /* end of the kernel processed data */
540 NDR_record_t NDR;
541 mach_msg_type_number_t task_listCnt;
542 } __Reply__processor_set_tasks_with_flavor_t __attribute__((unused));
543#ifdef __MigPackStructs
544#pragma pack(pop)
545#endif
546#endif /* !__Reply__processor_set_subsystem__defined */
547
548/* union of all replies */
549
550#ifndef __ReplyUnion__processor_set_subsystem__defined
551#define __ReplyUnion__processor_set_subsystem__defined
552union __ReplyUnion__processor_set_subsystem {
553 __Reply__processor_set_statistics_t Reply_processor_set_statistics;
554 __Reply__processor_set_destroy_t Reply_processor_set_destroy;
555 __Reply__processor_set_max_priority_t Reply_processor_set_max_priority;
556 __Reply__processor_set_policy_enable_t Reply_processor_set_policy_enable;
557 __Reply__processor_set_policy_disable_t Reply_processor_set_policy_disable;
558 __Reply__processor_set_tasks_t Reply_processor_set_tasks;
559 __Reply__processor_set_threads_t Reply_processor_set_threads;
560 __Reply__processor_set_policy_control_t Reply_processor_set_policy_control;
561 __Reply__processor_set_stack_usage_t Reply_processor_set_stack_usage;
562 __Reply__processor_set_info_t Reply_processor_set_info;
563 __Reply__processor_set_tasks_with_flavor_t Reply_processor_set_tasks_with_flavor;
564};
565#endif /* !__RequestUnion__processor_set_subsystem__defined */
566
567#ifndef subsystem_to_name_map_processor_set
568#define subsystem_to_name_map_processor_set \
569 { "processor_set_statistics", 4000 },\
570 { "processor_set_destroy", 4001 },\
571 { "processor_set_max_priority", 4002 },\
572 { "processor_set_policy_enable", 4003 },\
573 { "processor_set_policy_disable", 4004 },\
574 { "processor_set_tasks", 4005 },\
575 { "processor_set_threads", 4006 },\
576 { "processor_set_policy_control", 4007 },\
577 { "processor_set_stack_usage", 4008 },\
578 { "processor_set_info", 4009 },\
579 { "processor_set_tasks_with_flavor", 4010 }
580#endif
581
582#ifdef __AfterMigUserHeader
583__AfterMigUserHeader
584#endif /* __AfterMigUserHeader */
585
586#endif /* _processor_set_user_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/thread_act.h deleted-1424
......@@ -1,1424 +0,0 @@
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 31
53#endif /* thread_act_MSG_COUNT */
54
55#include <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 thread_terminate */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75__TVOS_PROHIBITED __WATCHOS_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__TVOS_PROHIBITED __WATCHOS_PROHIBITED
88kern_return_t act_get_state
89(
90 thread_read_t target_act,
91 int flavor,
92 thread_state_t old_state,
93 mach_msg_type_number_t *old_stateCnt
94);
95
96/* Routine act_set_state */
97#ifdef mig_external
98mig_external
99#else
100extern
101#endif /* mig_external */
102__TVOS_PROHIBITED __WATCHOS_PROHIBITED
103kern_return_t act_set_state
104(
105 thread_act_t target_act,
106 int flavor,
107 thread_state_t new_state,
108 mach_msg_type_number_t new_stateCnt
109);
110
111/* Routine thread_get_state */
112#ifdef mig_external
113mig_external
114#else
115extern
116#endif /* mig_external */
117__WATCHOS_PROHIBITED
118kern_return_t thread_get_state
119(
120 thread_read_t target_act,
121 thread_state_flavor_t flavor,
122 thread_state_t old_state,
123 mach_msg_type_number_t *old_stateCnt
124);
125
126/* Routine thread_set_state */
127#ifdef mig_external
128mig_external
129#else
130extern
131#endif /* mig_external */
132__WATCHOS_PROHIBITED
133kern_return_t thread_set_state
134(
135 thread_act_t target_act,
136 thread_state_flavor_t flavor,
137 thread_state_t new_state,
138 mach_msg_type_number_t new_stateCnt
139);
140
141/* Routine thread_suspend */
142#ifdef mig_external
143mig_external
144#else
145extern
146#endif /* mig_external */
147__WATCHOS_PROHIBITED
148kern_return_t thread_suspend
149(
150 thread_read_t target_act
151);
152
153/* Routine thread_resume */
154#ifdef mig_external
155mig_external
156#else
157extern
158#endif /* mig_external */
159__WATCHOS_PROHIBITED
160kern_return_t thread_resume
161(
162 thread_read_t target_act
163);
164
165/* Routine thread_abort */
166#ifdef mig_external
167mig_external
168#else
169extern
170#endif /* mig_external */
171__WATCHOS_PROHIBITED
172kern_return_t thread_abort
173(
174 thread_act_t target_act
175);
176
177/* Routine thread_abort_safely */
178#ifdef mig_external
179mig_external
180#else
181extern
182#endif /* mig_external */
183__WATCHOS_PROHIBITED
184kern_return_t thread_abort_safely
185(
186 thread_act_t target_act
187);
188
189/* Routine thread_depress_abort */
190#ifdef mig_external
191mig_external
192#else
193extern
194#endif /* mig_external */
195__TVOS_PROHIBITED __WATCHOS_PROHIBITED
196kern_return_t thread_depress_abort
197(
198 thread_act_t thread
199);
200
201/* Routine thread_get_special_port */
202#ifdef mig_external
203mig_external
204#else
205extern
206#endif /* mig_external */
207__TVOS_PROHIBITED __WATCHOS_PROHIBITED
208kern_return_t thread_get_special_port
209(
210 thread_inspect_t thr_act,
211 int which_port,
212 mach_port_t *special_port
213);
214
215/* Routine thread_set_special_port */
216#ifdef mig_external
217mig_external
218#else
219extern
220#endif /* mig_external */
221__TVOS_PROHIBITED __WATCHOS_PROHIBITED
222kern_return_t thread_set_special_port
223(
224 thread_act_t thr_act,
225 int which_port,
226 mach_port_t special_port
227);
228
229/* Routine thread_info */
230#ifdef mig_external
231mig_external
232#else
233extern
234#endif /* mig_external */
235kern_return_t thread_info
236(
237 thread_inspect_t target_act,
238 thread_flavor_t flavor,
239 thread_info_t thread_info_out,
240 mach_msg_type_number_t *thread_info_outCnt
241);
242
243/* Routine thread_set_exception_ports */
244#ifdef mig_external
245mig_external
246#else
247extern
248#endif /* mig_external */
249__TVOS_PROHIBITED __WATCHOS_PROHIBITED
250kern_return_t thread_set_exception_ports
251(
252 thread_act_t thread,
253 exception_mask_t exception_mask,
254 mach_port_t new_port,
255 exception_behavior_t behavior,
256 thread_state_flavor_t new_flavor
257);
258
259/* Routine thread_get_exception_ports */
260#ifdef mig_external
261mig_external
262#else
263extern
264#endif /* mig_external */
265__TVOS_PROHIBITED __WATCHOS_PROHIBITED
266kern_return_t thread_get_exception_ports
267(
268 thread_act_t thread,
269 exception_mask_t exception_mask,
270 exception_mask_array_t masks,
271 mach_msg_type_number_t *masksCnt,
272 exception_handler_array_t old_handlers,
273 exception_behavior_array_t old_behaviors,
274 exception_flavor_array_t old_flavors
275);
276
277/* Routine thread_swap_exception_ports */
278#ifdef mig_external
279mig_external
280#else
281extern
282#endif /* mig_external */
283__TVOS_PROHIBITED __WATCHOS_PROHIBITED
284kern_return_t thread_swap_exception_ports
285(
286 thread_act_t thread,
287 exception_mask_t exception_mask,
288 mach_port_t new_port,
289 exception_behavior_t behavior,
290 thread_state_flavor_t new_flavor,
291 exception_mask_array_t masks,
292 mach_msg_type_number_t *masksCnt,
293 exception_handler_array_t old_handlers,
294 exception_behavior_array_t old_behaviors,
295 exception_flavor_array_t old_flavors
296);
297
298/* Routine thread_policy */
299#ifdef mig_external
300mig_external
301#else
302extern
303#endif /* mig_external */
304kern_return_t thread_policy
305(
306 thread_act_t thr_act,
307 policy_t policy,
308 policy_base_t base,
309 mach_msg_type_number_t baseCnt,
310 boolean_t set_limit
311);
312
313/* Routine thread_policy_set */
314#ifdef mig_external
315mig_external
316#else
317extern
318#endif /* mig_external */
319kern_return_t thread_policy_set
320(
321 thread_act_t thread,
322 thread_policy_flavor_t flavor,
323 thread_policy_t policy_info,
324 mach_msg_type_number_t policy_infoCnt
325);
326
327/* Routine thread_policy_get */
328#ifdef mig_external
329mig_external
330#else
331extern
332#endif /* mig_external */
333kern_return_t thread_policy_get
334(
335 thread_inspect_t thread,
336 thread_policy_flavor_t flavor,
337 thread_policy_t policy_info,
338 mach_msg_type_number_t *policy_infoCnt,
339 boolean_t *get_default
340);
341
342/* Routine thread_sample */
343#ifdef mig_external
344mig_external
345#else
346extern
347#endif /* mig_external */
348kern_return_t thread_sample
349(
350 thread_act_t thread,
351 mach_port_t reply
352);
353
354/* Routine etap_trace_thread */
355#ifdef mig_external
356mig_external
357#else
358extern
359#endif /* mig_external */
360kern_return_t etap_trace_thread
361(
362 thread_act_t target_act,
363 boolean_t trace_status
364);
365
366/* Routine thread_assign */
367#ifdef mig_external
368mig_external
369#else
370extern
371#endif /* mig_external */
372kern_return_t thread_assign
373(
374 thread_act_t thread,
375 processor_set_t new_set
376);
377
378/* Routine thread_assign_default */
379#ifdef mig_external
380mig_external
381#else
382extern
383#endif /* mig_external */
384kern_return_t thread_assign_default
385(
386 thread_act_t thread
387);
388
389/* Routine thread_get_assignment */
390#ifdef mig_external
391mig_external
392#else
393extern
394#endif /* mig_external */
395kern_return_t thread_get_assignment
396(
397 thread_inspect_t thread,
398 processor_set_name_t *assigned_set
399);
400
401/* Routine thread_set_policy */
402#ifdef mig_external
403mig_external
404#else
405extern
406#endif /* mig_external */
407kern_return_t thread_set_policy
408(
409 thread_act_t thr_act,
410 processor_set_t pset,
411 policy_t policy,
412 policy_base_t base,
413 mach_msg_type_number_t baseCnt,
414 policy_limit_t limit,
415 mach_msg_type_number_t limitCnt
416);
417
418/* Routine thread_get_mach_voucher */
419#ifdef mig_external
420mig_external
421#else
422extern
423#endif /* mig_external */
424__TVOS_PROHIBITED __WATCHOS_PROHIBITED
425kern_return_t thread_get_mach_voucher
426(
427 thread_read_t thr_act,
428 mach_voucher_selector_t which,
429 ipc_voucher_t *voucher
430);
431
432/* Routine thread_set_mach_voucher */
433#ifdef mig_external
434mig_external
435#else
436extern
437#endif /* mig_external */
438__TVOS_PROHIBITED __WATCHOS_PROHIBITED
439kern_return_t thread_set_mach_voucher
440(
441 thread_act_t thr_act,
442 ipc_voucher_t voucher
443);
444
445/* Routine thread_swap_mach_voucher */
446#ifdef mig_external
447mig_external
448#else
449extern
450#endif /* mig_external */
451__TVOS_PROHIBITED __WATCHOS_PROHIBITED
452kern_return_t thread_swap_mach_voucher
453(
454 thread_act_t thr_act,
455 ipc_voucher_t new_voucher,
456 ipc_voucher_t *old_voucher
457);
458
459/* Routine thread_convert_thread_state */
460#ifdef mig_external
461mig_external
462#else
463extern
464#endif /* mig_external */
465kern_return_t thread_convert_thread_state
466(
467 thread_act_t thread,
468 int direction,
469 thread_state_flavor_t flavor,
470 thread_state_t in_state,
471 mach_msg_type_number_t in_stateCnt,
472 thread_state_t out_state,
473 mach_msg_type_number_t *out_stateCnt
474);
475
476/* Routine thread_get_exception_ports_info */
477#ifdef mig_external
478mig_external
479#else
480extern
481#endif /* mig_external */
482kern_return_t thread_get_exception_ports_info
483(
484 mach_port_t port,
485 exception_mask_t exception_mask,
486 exception_mask_array_t masks,
487 mach_msg_type_number_t *masksCnt,
488 exception_handler_info_array_t old_handlers_info,
489 exception_behavior_array_t old_behaviors,
490 exception_flavor_array_t old_flavors
491);
492
493__END_DECLS
494
495/********************** Caution **************************/
496/* The following data types should be used to calculate */
497/* maximum message sizes only. The actual message may be */
498/* smaller, and the position of the arguments within the */
499/* message layout may vary from what is presented here. */
500/* For example, if any of the arguments are variable- */
501/* sized, and less than the maximum is sent, the data */
502/* will be packed tight in the actual message to reduce */
503/* the presence of holes. */
504/********************** Caution **************************/
505
506/* typedefs for all requests */
507
508#ifndef __Request__thread_act_subsystem__defined
509#define __Request__thread_act_subsystem__defined
510
511#ifdef __MigPackStructs
512#pragma pack(push, 4)
513#endif
514 typedef struct {
515 mach_msg_header_t Head;
516 } __Request__thread_terminate_t __attribute__((unused));
517#ifdef __MigPackStructs
518#pragma pack(pop)
519#endif
520
521#ifdef __MigPackStructs
522#pragma pack(push, 4)
523#endif
524 typedef struct {
525 mach_msg_header_t Head;
526 NDR_record_t NDR;
527 int flavor;
528 mach_msg_type_number_t old_stateCnt;
529 } __Request__act_get_state_t __attribute__((unused));
530#ifdef __MigPackStructs
531#pragma pack(pop)
532#endif
533
534#ifdef __MigPackStructs
535#pragma pack(push, 4)
536#endif
537 typedef struct {
538 mach_msg_header_t Head;
539 NDR_record_t NDR;
540 int flavor;
541 mach_msg_type_number_t new_stateCnt;
542 natural_t new_state[1296];
543 } __Request__act_set_state_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 thread_state_flavor_t flavor;
555 mach_msg_type_number_t old_stateCnt;
556 } __Request__thread_get_state_t __attribute__((unused));
557#ifdef __MigPackStructs
558#pragma pack(pop)
559#endif
560
561#ifdef __MigPackStructs
562#pragma pack(push, 4)
563#endif
564 typedef struct {
565 mach_msg_header_t Head;
566 NDR_record_t NDR;
567 thread_state_flavor_t flavor;
568 mach_msg_type_number_t new_stateCnt;
569 natural_t new_state[1296];
570 } __Request__thread_set_state_t __attribute__((unused));
571#ifdef __MigPackStructs
572#pragma pack(pop)
573#endif
574
575#ifdef __MigPackStructs
576#pragma pack(push, 4)
577#endif
578 typedef struct {
579 mach_msg_header_t Head;
580 } __Request__thread_suspend_t __attribute__((unused));
581#ifdef __MigPackStructs
582#pragma pack(pop)
583#endif
584
585#ifdef __MigPackStructs
586#pragma pack(push, 4)
587#endif
588 typedef struct {
589 mach_msg_header_t Head;
590 } __Request__thread_resume_t __attribute__((unused));
591#ifdef __MigPackStructs
592#pragma pack(pop)
593#endif
594
595#ifdef __MigPackStructs
596#pragma pack(push, 4)
597#endif
598 typedef struct {
599 mach_msg_header_t Head;
600 } __Request__thread_abort_t __attribute__((unused));
601#ifdef __MigPackStructs
602#pragma pack(pop)
603#endif
604
605#ifdef __MigPackStructs
606#pragma pack(push, 4)
607#endif
608 typedef struct {
609 mach_msg_header_t Head;
610 } __Request__thread_abort_safely_t __attribute__((unused));
611#ifdef __MigPackStructs
612#pragma pack(pop)
613#endif
614
615#ifdef __MigPackStructs
616#pragma pack(push, 4)
617#endif
618 typedef struct {
619 mach_msg_header_t Head;
620 } __Request__thread_depress_abort_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 int which_port;
632 } __Request__thread_get_special_port_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 special_port;
645 /* end of the kernel processed data */
646 NDR_record_t NDR;
647 int which_port;
648 } __Request__thread_set_special_port_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 thread_flavor_t flavor;
660 mach_msg_type_number_t thread_info_outCnt;
661 } __Request__thread_info_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 /* start of the kernel processed data */
672 mach_msg_body_t msgh_body;
673 mach_msg_port_descriptor_t new_port;
674 /* end of the kernel processed data */
675 NDR_record_t NDR;
676 exception_mask_t exception_mask;
677 exception_behavior_t behavior;
678 thread_state_flavor_t new_flavor;
679 } __Request__thread_set_exception_ports_t __attribute__((unused));
680#ifdef __MigPackStructs
681#pragma pack(pop)
682#endif
683
684#ifdef __MigPackStructs
685#pragma pack(push, 4)
686#endif
687 typedef struct {
688 mach_msg_header_t Head;
689 NDR_record_t NDR;
690 exception_mask_t exception_mask;
691 } __Request__thread_get_exception_ports_t __attribute__((unused));
692#ifdef __MigPackStructs
693#pragma pack(pop)
694#endif
695
696#ifdef __MigPackStructs
697#pragma pack(push, 4)
698#endif
699 typedef struct {
700 mach_msg_header_t Head;
701 /* start of the kernel processed data */
702 mach_msg_body_t msgh_body;
703 mach_msg_port_descriptor_t new_port;
704 /* end of the kernel processed data */
705 NDR_record_t NDR;
706 exception_mask_t exception_mask;
707 exception_behavior_t behavior;
708 thread_state_flavor_t new_flavor;
709 } __Request__thread_swap_exception_ports_t __attribute__((unused));
710#ifdef __MigPackStructs
711#pragma pack(pop)
712#endif
713
714#ifdef __MigPackStructs
715#pragma pack(push, 4)
716#endif
717 typedef struct {
718 mach_msg_header_t Head;
719 NDR_record_t NDR;
720 policy_t policy;
721 mach_msg_type_number_t baseCnt;
722 integer_t base[5];
723 boolean_t set_limit;
724 } __Request__thread_policy_t __attribute__((unused));
725#ifdef __MigPackStructs
726#pragma pack(pop)
727#endif
728
729#ifdef __MigPackStructs
730#pragma pack(push, 4)
731#endif
732 typedef struct {
733 mach_msg_header_t Head;
734 NDR_record_t NDR;
735 thread_policy_flavor_t flavor;
736 mach_msg_type_number_t policy_infoCnt;
737 integer_t policy_info[16];
738 } __Request__thread_policy_set_t __attribute__((unused));
739#ifdef __MigPackStructs
740#pragma pack(pop)
741#endif
742
743#ifdef __MigPackStructs
744#pragma pack(push, 4)
745#endif
746 typedef struct {
747 mach_msg_header_t Head;
748 NDR_record_t NDR;
749 thread_policy_flavor_t flavor;
750 mach_msg_type_number_t policy_infoCnt;
751 boolean_t get_default;
752 } __Request__thread_policy_get_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 /* start of the kernel processed data */
763 mach_msg_body_t msgh_body;
764 mach_msg_port_descriptor_t reply;
765 /* end of the kernel processed data */
766 } __Request__thread_sample_t __attribute__((unused));
767#ifdef __MigPackStructs
768#pragma pack(pop)
769#endif
770
771#ifdef __MigPackStructs
772#pragma pack(push, 4)
773#endif
774 typedef struct {
775 mach_msg_header_t Head;
776 NDR_record_t NDR;
777 boolean_t trace_status;
778 } __Request__etap_trace_thread_t __attribute__((unused));
779#ifdef __MigPackStructs
780#pragma pack(pop)
781#endif
782
783#ifdef __MigPackStructs
784#pragma pack(push, 4)
785#endif
786 typedef struct {
787 mach_msg_header_t Head;
788 /* start of the kernel processed data */
789 mach_msg_body_t msgh_body;
790 mach_msg_port_descriptor_t new_set;
791 /* end of the kernel processed data */
792 } __Request__thread_assign_t __attribute__((unused));
793#ifdef __MigPackStructs
794#pragma pack(pop)
795#endif
796
797#ifdef __MigPackStructs
798#pragma pack(push, 4)
799#endif
800 typedef struct {
801 mach_msg_header_t Head;
802 } __Request__thread_assign_default_t __attribute__((unused));
803#ifdef __MigPackStructs
804#pragma pack(pop)
805#endif
806
807#ifdef __MigPackStructs
808#pragma pack(push, 4)
809#endif
810 typedef struct {
811 mach_msg_header_t Head;
812 } __Request__thread_get_assignment_t __attribute__((unused));
813#ifdef __MigPackStructs
814#pragma pack(pop)
815#endif
816
817#ifdef __MigPackStructs
818#pragma pack(push, 4)
819#endif
820 typedef struct {
821 mach_msg_header_t Head;
822 /* start of the kernel processed data */
823 mach_msg_body_t msgh_body;
824 mach_msg_port_descriptor_t pset;
825 /* end of the kernel processed data */
826 NDR_record_t NDR;
827 policy_t policy;
828 mach_msg_type_number_t baseCnt;
829 integer_t base[5];
830 mach_msg_type_number_t limitCnt;
831 integer_t limit[1];
832 } __Request__thread_set_policy_t __attribute__((unused));
833#ifdef __MigPackStructs
834#pragma pack(pop)
835#endif
836
837#ifdef __MigPackStructs
838#pragma pack(push, 4)
839#endif
840 typedef struct {
841 mach_msg_header_t Head;
842 NDR_record_t NDR;
843 mach_voucher_selector_t which;
844 } __Request__thread_get_mach_voucher_t __attribute__((unused));
845#ifdef __MigPackStructs
846#pragma pack(pop)
847#endif
848
849#ifdef __MigPackStructs
850#pragma pack(push, 4)
851#endif
852 typedef struct {
853 mach_msg_header_t Head;
854 /* start of the kernel processed data */
855 mach_msg_body_t msgh_body;
856 mach_msg_port_descriptor_t voucher;
857 /* end of the kernel processed data */
858 } __Request__thread_set_mach_voucher_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 /* start of the kernel processed data */
869 mach_msg_body_t msgh_body;
870 mach_msg_port_descriptor_t new_voucher;
871 mach_msg_port_descriptor_t old_voucher;
872 /* end of the kernel processed data */
873 } __Request__thread_swap_mach_voucher_t __attribute__((unused));
874#ifdef __MigPackStructs
875#pragma pack(pop)
876#endif
877
878#ifdef __MigPackStructs
879#pragma pack(push, 4)
880#endif
881 typedef struct {
882 mach_msg_header_t Head;
883 NDR_record_t NDR;
884 int direction;
885 thread_state_flavor_t flavor;
886 mach_msg_type_number_t in_stateCnt;
887 natural_t in_state[1296];
888 mach_msg_type_number_t out_stateCnt;
889 } __Request__thread_convert_thread_state_t __attribute__((unused));
890#ifdef __MigPackStructs
891#pragma pack(pop)
892#endif
893
894#ifdef __MigPackStructs
895#pragma pack(push, 4)
896#endif
897 typedef struct {
898 mach_msg_header_t Head;
899 NDR_record_t NDR;
900 exception_mask_t exception_mask;
901 } __Request__thread_get_exception_ports_info_t __attribute__((unused));
902#ifdef __MigPackStructs
903#pragma pack(pop)
904#endif
905#endif /* !__Request__thread_act_subsystem__defined */
906
907/* union of all requests */
908
909#ifndef __RequestUnion__thread_act_subsystem__defined
910#define __RequestUnion__thread_act_subsystem__defined
911union __RequestUnion__thread_act_subsystem {
912 __Request__thread_terminate_t Request_thread_terminate;
913 __Request__act_get_state_t Request_act_get_state;
914 __Request__act_set_state_t Request_act_set_state;
915 __Request__thread_get_state_t Request_thread_get_state;
916 __Request__thread_set_state_t Request_thread_set_state;
917 __Request__thread_suspend_t Request_thread_suspend;
918 __Request__thread_resume_t Request_thread_resume;
919 __Request__thread_abort_t Request_thread_abort;
920 __Request__thread_abort_safely_t Request_thread_abort_safely;
921 __Request__thread_depress_abort_t Request_thread_depress_abort;
922 __Request__thread_get_special_port_t Request_thread_get_special_port;
923 __Request__thread_set_special_port_t Request_thread_set_special_port;
924 __Request__thread_info_t Request_thread_info;
925 __Request__thread_set_exception_ports_t Request_thread_set_exception_ports;
926 __Request__thread_get_exception_ports_t Request_thread_get_exception_ports;
927 __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports;
928 __Request__thread_policy_t Request_thread_policy;
929 __Request__thread_policy_set_t Request_thread_policy_set;
930 __Request__thread_policy_get_t Request_thread_policy_get;
931 __Request__thread_sample_t Request_thread_sample;
932 __Request__etap_trace_thread_t Request_etap_trace_thread;
933 __Request__thread_assign_t Request_thread_assign;
934 __Request__thread_assign_default_t Request_thread_assign_default;
935 __Request__thread_get_assignment_t Request_thread_get_assignment;
936 __Request__thread_set_policy_t Request_thread_set_policy;
937 __Request__thread_get_mach_voucher_t Request_thread_get_mach_voucher;
938 __Request__thread_set_mach_voucher_t Request_thread_set_mach_voucher;
939 __Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher;
940 __Request__thread_convert_thread_state_t Request_thread_convert_thread_state;
941 __Request__thread_get_exception_ports_info_t Request_thread_get_exception_ports_info;
942};
943#endif /* !__RequestUnion__thread_act_subsystem__defined */
944/* typedefs for all replies */
945
946#ifndef __Reply__thread_act_subsystem__defined
947#define __Reply__thread_act_subsystem__defined
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 kern_return_t RetCode;
956 } __Reply__thread_terminate_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 kern_return_t RetCode;
968 mach_msg_type_number_t old_stateCnt;
969 natural_t old_state[1296];
970 } __Reply__act_get_state_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 NDR_record_t NDR;
981 kern_return_t RetCode;
982 } __Reply__act_set_state_t __attribute__((unused));
983#ifdef __MigPackStructs
984#pragma pack(pop)
985#endif
986
987#ifdef __MigPackStructs
988#pragma pack(push, 4)
989#endif
990 typedef struct {
991 mach_msg_header_t Head;
992 NDR_record_t NDR;
993 kern_return_t RetCode;
994 mach_msg_type_number_t old_stateCnt;
995 natural_t old_state[1296];
996 } __Reply__thread_get_state_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__thread_set_state_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__thread_suspend_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__thread_resume_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 NDR_record_t NDR;
1043 kern_return_t RetCode;
1044 } __Reply__thread_abort_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 kern_return_t RetCode;
1056 } __Reply__thread_abort_safely_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 NDR_record_t NDR;
1067 kern_return_t RetCode;
1068 } __Reply__thread_depress_abort_t __attribute__((unused));
1069#ifdef __MigPackStructs
1070#pragma pack(pop)
1071#endif
1072
1073#ifdef __MigPackStructs
1074#pragma pack(push, 4)
1075#endif
1076 typedef struct {
1077 mach_msg_header_t Head;
1078 /* start of the kernel processed data */
1079 mach_msg_body_t msgh_body;
1080 mach_msg_port_descriptor_t special_port;
1081 /* end of the kernel processed data */
1082 } __Reply__thread_get_special_port_t __attribute__((unused));
1083#ifdef __MigPackStructs
1084#pragma pack(pop)
1085#endif
1086
1087#ifdef __MigPackStructs
1088#pragma pack(push, 4)
1089#endif
1090 typedef struct {
1091 mach_msg_header_t Head;
1092 NDR_record_t NDR;
1093 kern_return_t RetCode;
1094 } __Reply__thread_set_special_port_t __attribute__((unused));
1095#ifdef __MigPackStructs
1096#pragma pack(pop)
1097#endif
1098
1099#ifdef __MigPackStructs
1100#pragma pack(push, 4)
1101#endif
1102 typedef struct {
1103 mach_msg_header_t Head;
1104 NDR_record_t NDR;
1105 kern_return_t RetCode;
1106 mach_msg_type_number_t thread_info_outCnt;
1107 integer_t thread_info_out[32];
1108 } __Reply__thread_info_t __attribute__((unused));
1109#ifdef __MigPackStructs
1110#pragma pack(pop)
1111#endif
1112
1113#ifdef __MigPackStructs
1114#pragma pack(push, 4)
1115#endif
1116 typedef struct {
1117 mach_msg_header_t Head;
1118 NDR_record_t NDR;
1119 kern_return_t RetCode;
1120 } __Reply__thread_set_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_get_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 /* start of the kernel processed data */
1150 mach_msg_body_t msgh_body;
1151 mach_msg_port_descriptor_t old_handlers[32];
1152 /* end of the kernel processed data */
1153 NDR_record_t NDR;
1154 mach_msg_type_number_t masksCnt;
1155 exception_mask_t masks[32];
1156 exception_behavior_t old_behaviors[32];
1157 thread_state_flavor_t old_flavors[32];
1158 } __Reply__thread_swap_exception_ports_t __attribute__((unused));
1159#ifdef __MigPackStructs
1160#pragma pack(pop)
1161#endif
1162
1163#ifdef __MigPackStructs
1164#pragma pack(push, 4)
1165#endif
1166 typedef struct {
1167 mach_msg_header_t Head;
1168 NDR_record_t NDR;
1169 kern_return_t RetCode;
1170 } __Reply__thread_policy_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 kern_return_t RetCode;
1182 } __Reply__thread_policy_set_t __attribute__((unused));
1183#ifdef __MigPackStructs
1184#pragma pack(pop)
1185#endif
1186
1187#ifdef __MigPackStructs
1188#pragma pack(push, 4)
1189#endif
1190 typedef struct {
1191 mach_msg_header_t Head;
1192 NDR_record_t NDR;
1193 kern_return_t RetCode;
1194 mach_msg_type_number_t policy_infoCnt;
1195 integer_t policy_info[16];
1196 boolean_t get_default;
1197 } __Reply__thread_policy_get_t __attribute__((unused));
1198#ifdef __MigPackStructs
1199#pragma pack(pop)
1200#endif
1201
1202#ifdef __MigPackStructs
1203#pragma pack(push, 4)
1204#endif
1205 typedef struct {
1206 mach_msg_header_t Head;
1207 NDR_record_t NDR;
1208 kern_return_t RetCode;
1209 } __Reply__thread_sample_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 NDR_record_t NDR;
1220 kern_return_t RetCode;
1221 } __Reply__etap_trace_thread_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__thread_assign_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__thread_assign_default_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 /* start of the kernel processed data */
1256 mach_msg_body_t msgh_body;
1257 mach_msg_port_descriptor_t assigned_set;
1258 /* end of the kernel processed data */
1259 } __Reply__thread_get_assignment_t __attribute__((unused));
1260#ifdef __MigPackStructs
1261#pragma pack(pop)
1262#endif
1263
1264#ifdef __MigPackStructs
1265#pragma pack(push, 4)
1266#endif
1267 typedef struct {
1268 mach_msg_header_t Head;
1269 NDR_record_t NDR;
1270 kern_return_t RetCode;
1271 } __Reply__thread_set_policy_t __attribute__((unused));
1272#ifdef __MigPackStructs
1273#pragma pack(pop)
1274#endif
1275
1276#ifdef __MigPackStructs
1277#pragma pack(push, 4)
1278#endif
1279 typedef struct {
1280 mach_msg_header_t Head;
1281 /* start of the kernel processed data */
1282 mach_msg_body_t msgh_body;
1283 mach_msg_port_descriptor_t voucher;
1284 /* end of the kernel processed data */
1285 } __Reply__thread_get_mach_voucher_t __attribute__((unused));
1286#ifdef __MigPackStructs
1287#pragma pack(pop)
1288#endif
1289
1290#ifdef __MigPackStructs
1291#pragma pack(push, 4)
1292#endif
1293 typedef struct {
1294 mach_msg_header_t Head;
1295 NDR_record_t NDR;
1296 kern_return_t RetCode;
1297 } __Reply__thread_set_mach_voucher_t __attribute__((unused));
1298#ifdef __MigPackStructs
1299#pragma pack(pop)
1300#endif
1301
1302#ifdef __MigPackStructs
1303#pragma pack(push, 4)
1304#endif
1305 typedef struct {
1306 mach_msg_header_t Head;
1307 /* start of the kernel processed data */
1308 mach_msg_body_t msgh_body;
1309 mach_msg_port_descriptor_t old_voucher;
1310 /* end of the kernel processed data */
1311 } __Reply__thread_swap_mach_voucher_t __attribute__((unused));
1312#ifdef __MigPackStructs
1313#pragma pack(pop)
1314#endif
1315
1316#ifdef __MigPackStructs
1317#pragma pack(push, 4)
1318#endif
1319 typedef struct {
1320 mach_msg_header_t Head;
1321 NDR_record_t NDR;
1322 kern_return_t RetCode;
1323 mach_msg_type_number_t out_stateCnt;
1324 natural_t out_state[1296];
1325 } __Reply__thread_convert_thread_state_t __attribute__((unused));
1326#ifdef __MigPackStructs
1327#pragma pack(pop)
1328#endif
1329
1330#ifdef __MigPackStructs
1331#pragma pack(push, 4)
1332#endif
1333 typedef struct {
1334 mach_msg_header_t Head;
1335 NDR_record_t NDR;
1336 kern_return_t RetCode;
1337 mach_msg_type_number_t masksCnt;
1338 exception_mask_t masks[32];
1339 exception_handler_info_t old_handlers_info[32];
1340 exception_behavior_t old_behaviors[32];
1341 thread_state_flavor_t old_flavors[32];
1342 } __Reply__thread_get_exception_ports_info_t __attribute__((unused));
1343#ifdef __MigPackStructs
1344#pragma pack(pop)
1345#endif
1346#endif /* !__Reply__thread_act_subsystem__defined */
1347
1348/* union of all replies */
1349
1350#ifndef __ReplyUnion__thread_act_subsystem__defined
1351#define __ReplyUnion__thread_act_subsystem__defined
1352union __ReplyUnion__thread_act_subsystem {
1353 __Reply__thread_terminate_t Reply_thread_terminate;
1354 __Reply__act_get_state_t Reply_act_get_state;
1355 __Reply__act_set_state_t Reply_act_set_state;
1356 __Reply__thread_get_state_t Reply_thread_get_state;
1357 __Reply__thread_set_state_t Reply_thread_set_state;
1358 __Reply__thread_suspend_t Reply_thread_suspend;
1359 __Reply__thread_resume_t Reply_thread_resume;
1360 __Reply__thread_abort_t Reply_thread_abort;
1361 __Reply__thread_abort_safely_t Reply_thread_abort_safely;
1362 __Reply__thread_depress_abort_t Reply_thread_depress_abort;
1363 __Reply__thread_get_special_port_t Reply_thread_get_special_port;
1364 __Reply__thread_set_special_port_t Reply_thread_set_special_port;
1365 __Reply__thread_info_t Reply_thread_info;
1366 __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports;
1367 __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports;
1368 __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports;
1369 __Reply__thread_policy_t Reply_thread_policy;
1370 __Reply__thread_policy_set_t Reply_thread_policy_set;
1371 __Reply__thread_policy_get_t Reply_thread_policy_get;
1372 __Reply__thread_sample_t Reply_thread_sample;
1373 __Reply__etap_trace_thread_t Reply_etap_trace_thread;
1374 __Reply__thread_assign_t Reply_thread_assign;
1375 __Reply__thread_assign_default_t Reply_thread_assign_default;
1376 __Reply__thread_get_assignment_t Reply_thread_get_assignment;
1377 __Reply__thread_set_policy_t Reply_thread_set_policy;
1378 __Reply__thread_get_mach_voucher_t Reply_thread_get_mach_voucher;
1379 __Reply__thread_set_mach_voucher_t Reply_thread_set_mach_voucher;
1380 __Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher;
1381 __Reply__thread_convert_thread_state_t Reply_thread_convert_thread_state;
1382 __Reply__thread_get_exception_ports_info_t Reply_thread_get_exception_ports_info;
1383};
1384#endif /* !__RequestUnion__thread_act_subsystem__defined */
1385
1386#ifndef subsystem_to_name_map_thread_act
1387#define subsystem_to_name_map_thread_act \
1388 { "thread_terminate", 3600 },\
1389 { "act_get_state", 3601 },\
1390 { "act_set_state", 3602 },\
1391 { "thread_get_state", 3603 },\
1392 { "thread_set_state", 3604 },\
1393 { "thread_suspend", 3605 },\
1394 { "thread_resume", 3606 },\
1395 { "thread_abort", 3607 },\
1396 { "thread_abort_safely", 3608 },\
1397 { "thread_depress_abort", 3609 },\
1398 { "thread_get_special_port", 3610 },\
1399 { "thread_set_special_port", 3611 },\
1400 { "thread_info", 3612 },\
1401 { "thread_set_exception_ports", 3613 },\
1402 { "thread_get_exception_ports", 3614 },\
1403 { "thread_swap_exception_ports", 3615 },\
1404 { "thread_policy", 3616 },\
1405 { "thread_policy_set", 3617 },\
1406 { "thread_policy_get", 3618 },\
1407 { "thread_sample", 3619 },\
1408 { "etap_trace_thread", 3620 },\
1409 { "thread_assign", 3621 },\
1410 { "thread_assign_default", 3622 },\
1411 { "thread_get_assignment", 3623 },\
1412 { "thread_set_policy", 3624 },\
1413 { "thread_get_mach_voucher", 3625 },\
1414 { "thread_set_mach_voucher", 3626 },\
1415 { "thread_swap_mach_voucher", 3627 },\
1416 { "thread_convert_thread_state", 3628 },\
1417 { "thread_get_exception_ports_info", 3630 }
1418#endif
1419
1420#ifdef __AfterMigUserHeader
1421__AfterMigUserHeader
1422#endif /* __AfterMigUserHeader */
1423
1424#endif /* _thread_act_user_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/thread_policy.h deleted-270
......@@ -1,270 +0,0 @@
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. The thread may be preempted after
135 * the computation time has elapsed.
136 * If (computation < constraint/2) it will be forced to
137 * constraint/2 to avoid unintended preemption and associated
138 * timer interrupts.
139 *
140 * constraint: This is the maximum amount of real time that
141 * may elapse from the start of a separate processing arrival
142 * to the end of computation for logically correct functioning,
143 * specified in absolute time units. Must be (>= computation).
144 * Note that latency = (constraint - computation).
145 *
146 * preemptible: IGNORED (This indicates that the computation may be
147 * interrupted, subject to the constraint specified above.)
148 */
149
150#define THREAD_TIME_CONSTRAINT_POLICY 2
151
152struct thread_time_constraint_policy {
153 uint32_t period;
154 uint32_t computation;
155 uint32_t constraint;
156 boolean_t preemptible;
157};
158
159typedef struct thread_time_constraint_policy \
160 thread_time_constraint_policy_data_t;
161typedef struct thread_time_constraint_policy \
162 *thread_time_constraint_policy_t;
163
164#define THREAD_TIME_CONSTRAINT_POLICY_COUNT ((mach_msg_type_number_t) \
165 (sizeof (thread_time_constraint_policy_data_t) / sizeof (integer_t)))
166
167/*
168 * THREAD_PRECEDENCE_POLICY:
169 *
170 * This may be used to indicate the relative value of the
171 * computation compared to the other threads in the task.
172 *
173 * Parameters:
174 *
175 * importance: The importance is specified as a signed value.
176 */
177
178#define THREAD_PRECEDENCE_POLICY 3
179
180struct thread_precedence_policy {
181 integer_t importance;
182};
183
184typedef struct thread_precedence_policy thread_precedence_policy_data_t;
185typedef struct thread_precedence_policy *thread_precedence_policy_t;
186
187#define THREAD_PRECEDENCE_POLICY_COUNT ((mach_msg_type_number_t) \
188 (sizeof (thread_precedence_policy_data_t) / sizeof (integer_t)))
189
190/*
191 * THREAD_AFFINITY_POLICY:
192 *
193 * This policy is experimental.
194 * This may be used to express affinity relationships
195 * between threads in the task. Threads with the same affinity tag will
196 * be scheduled to share an L2 cache if possible. That is, affinity tags
197 * are a hint to the scheduler for thread placement.
198 *
199 * The namespace of affinity tags is generally local to one task. However,
200 * a child task created after the assignment of affinity tags by its parent
201 * will share that namespace. In particular, a family of forked processes
202 * may be created with a shared affinity namespace.
203 *
204 * Parameters:
205 * tag: The affinity set identifier.
206 */
207
208#define THREAD_AFFINITY_POLICY 4
209
210struct thread_affinity_policy {
211 integer_t affinity_tag;
212};
213
214#define THREAD_AFFINITY_TAG_NULL 0
215
216typedef struct thread_affinity_policy thread_affinity_policy_data_t;
217typedef struct thread_affinity_policy *thread_affinity_policy_t;
218
219#define THREAD_AFFINITY_POLICY_COUNT ((mach_msg_type_number_t) \
220 (sizeof (thread_affinity_policy_data_t) / sizeof (integer_t)))
221
222/*
223 * THREAD_BACKGROUND_POLICY:
224 */
225
226#define THREAD_BACKGROUND_POLICY 5
227
228struct thread_background_policy {
229 integer_t priority;
230};
231
232#define THREAD_BACKGROUND_POLICY_DARWIN_BG 0x1000
233
234typedef struct thread_background_policy thread_background_policy_data_t;
235typedef struct thread_background_policy *thread_background_policy_t;
236
237#define THREAD_BACKGROUND_POLICY_COUNT ((mach_msg_type_number_t) \
238 (sizeof (thread_background_policy_data_t) / sizeof (integer_t)))
239
240
241#define THREAD_LATENCY_QOS_POLICY 7
242typedef integer_t thread_latency_qos_t;
243
244struct thread_latency_qos_policy {
245 thread_latency_qos_t thread_latency_qos_tier;
246};
247
248typedef struct thread_latency_qos_policy thread_latency_qos_policy_data_t;
249typedef struct thread_latency_qos_policy *thread_latency_qos_policy_t;
250
251#define THREAD_LATENCY_QOS_POLICY_COUNT ((mach_msg_type_number_t) \
252 (sizeof (thread_latency_qos_policy_data_t) / sizeof (integer_t)))
253
254#define THREAD_THROUGHPUT_QOS_POLICY 8
255typedef integer_t thread_throughput_qos_t;
256
257struct thread_throughput_qos_policy {
258 thread_throughput_qos_t thread_throughput_qos_tier;
259};
260
261typedef struct thread_throughput_qos_policy thread_throughput_qos_policy_data_t;
262typedef struct thread_throughput_qos_policy *thread_throughput_qos_policy_t;
263
264#define THREAD_THROUGHPUT_QOS_POLICY_COUNT ((mach_msg_type_number_t) \
265 (sizeof (thread_throughput_qos_policy_data_t) / sizeof (integer_t)))
266
267
268
269
270#endif /* _MACH_THREAD_POLICY_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/vm_map.h deleted-1503
......@@ -1,1503 +0,0 @@
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 33
53#endif /* vm_map_MSG_COUNT */
54
55#include <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 vm_region */
71#ifdef mig_external
72mig_external
73#else
74extern
75#endif /* mig_external */
76kern_return_t vm_region
77(
78 vm_map_read_t target_task,
79 vm_address_t *address,
80 vm_size_t *size,
81 vm_region_flavor_t flavor,
82 vm_region_info_t info,
83 mach_msg_type_number_t *infoCnt,
84 mach_port_t *object_name
85);
86
87/* Routine vm_allocate */
88#ifdef mig_external
89mig_external
90#else
91extern
92#endif /* mig_external */
93kern_return_t vm_allocate
94(
95 vm_map_t target_task,
96 vm_address_t *address,
97 vm_size_t size,
98 int flags
99);
100
101/* Routine vm_deallocate */
102#ifdef mig_external
103mig_external
104#else
105extern
106#endif /* mig_external */
107kern_return_t vm_deallocate
108(
109 vm_map_t target_task,
110 vm_address_t address,
111 vm_size_t size
112);
113
114/* Routine vm_protect */
115#ifdef mig_external
116mig_external
117#else
118extern
119#endif /* mig_external */
120kern_return_t vm_protect
121(
122 vm_map_t target_task,
123 vm_address_t address,
124 vm_size_t size,
125 boolean_t set_maximum,
126 vm_prot_t new_protection
127);
128
129/* Routine vm_inherit */
130#ifdef mig_external
131mig_external
132#else
133extern
134#endif /* mig_external */
135kern_return_t vm_inherit
136(
137 vm_map_t target_task,
138 vm_address_t address,
139 vm_size_t size,
140 vm_inherit_t new_inheritance
141);
142
143/* Routine vm_read */
144#ifdef mig_external
145mig_external
146#else
147extern
148#endif /* mig_external */
149kern_return_t vm_read
150(
151 vm_map_read_t target_task,
152 vm_address_t address,
153 vm_size_t size,
154 vm_offset_t *data,
155 mach_msg_type_number_t *dataCnt
156);
157
158/* Routine vm_read_list */
159#ifdef mig_external
160mig_external
161#else
162extern
163#endif /* mig_external */
164kern_return_t vm_read_list
165(
166 vm_map_read_t target_task,
167 vm_read_entry_t data_list,
168 natural_t count
169);
170
171/* Routine vm_write */
172#ifdef mig_external
173mig_external
174#else
175extern
176#endif /* mig_external */
177kern_return_t vm_write
178(
179 vm_map_t target_task,
180 vm_address_t address,
181 vm_offset_t data,
182 mach_msg_type_number_t dataCnt
183);
184
185/* Routine vm_copy */
186#ifdef mig_external
187mig_external
188#else
189extern
190#endif /* mig_external */
191kern_return_t vm_copy
192(
193 vm_map_t target_task,
194 vm_address_t source_address,
195 vm_size_t size,
196 vm_address_t dest_address
197);
198
199/* Routine vm_read_overwrite */
200#ifdef mig_external
201mig_external
202#else
203extern
204#endif /* mig_external */
205kern_return_t vm_read_overwrite
206(
207 vm_map_read_t target_task,
208 vm_address_t address,
209 vm_size_t size,
210 vm_address_t data,
211 vm_size_t *outsize
212);
213
214/* Routine vm_msync */
215#ifdef mig_external
216mig_external
217#else
218extern
219#endif /* mig_external */
220kern_return_t vm_msync
221(
222 vm_map_t target_task,
223 vm_address_t address,
224 vm_size_t size,
225 vm_sync_t sync_flags
226);
227
228/* Routine vm_behavior_set */
229#ifdef mig_external
230mig_external
231#else
232extern
233#endif /* mig_external */
234kern_return_t vm_behavior_set
235(
236 vm_map_t target_task,
237 vm_address_t address,
238 vm_size_t size,
239 vm_behavior_t new_behavior
240);
241
242/* Routine vm_map */
243#ifdef mig_external
244mig_external
245#else
246extern
247#endif /* mig_external */
248kern_return_t vm_map
249(
250 vm_map_t target_task,
251 vm_address_t *address,
252 vm_size_t size,
253 vm_address_t mask,
254 int flags,
255 mem_entry_name_port_t object,
256 vm_offset_t offset,
257 boolean_t copy,
258 vm_prot_t cur_protection,
259 vm_prot_t max_protection,
260 vm_inherit_t inheritance
261);
262
263/* Routine vm_machine_attribute */
264#ifdef mig_external
265mig_external
266#else
267extern
268#endif /* mig_external */
269kern_return_t vm_machine_attribute
270(
271 vm_map_t target_task,
272 vm_address_t address,
273 vm_size_t size,
274 vm_machine_attribute_t attribute,
275 vm_machine_attribute_val_t *value
276);
277
278/* Routine vm_remap */
279#ifdef mig_external
280mig_external
281#else
282extern
283#endif /* mig_external */
284kern_return_t vm_remap
285(
286 vm_map_t target_task,
287 vm_address_t *target_address,
288 vm_size_t size,
289 vm_address_t mask,
290 int flags,
291 vm_map_t src_task,
292 vm_address_t src_address,
293 boolean_t copy,
294 vm_prot_t *cur_protection,
295 vm_prot_t *max_protection,
296 vm_inherit_t inheritance
297);
298
299/* Routine task_wire */
300#ifdef mig_external
301mig_external
302#else
303extern
304#endif /* mig_external */
305__TVOS_PROHIBITED __WATCHOS_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_read_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_read_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_read_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_read_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_read_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_read_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_read_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/* Routine vm_remap_new */
497#ifdef mig_external
498mig_external
499#else
500extern
501#endif /* mig_external */
502kern_return_t vm_remap_new
503(
504 vm_map_t target_task,
505 vm_address_t *target_address,
506 vm_size_t size,
507 vm_address_t mask,
508 int flags,
509 vm_map_read_t src_task,
510 vm_address_t src_address,
511 boolean_t copy,
512 vm_prot_t *cur_protection,
513 vm_prot_t *max_protection,
514 vm_inherit_t inheritance
515);
516
517__END_DECLS
518
519/********************** Caution **************************/
520/* The following data types should be used to calculate */
521/* maximum message sizes only. The actual message may be */
522/* smaller, and the position of the arguments within the */
523/* message layout may vary from what is presented here. */
524/* For example, if any of the arguments are variable- */
525/* sized, and less than the maximum is sent, the data */
526/* will be packed tight in the actual message to reduce */
527/* the presence of holes. */
528/********************** Caution **************************/
529
530/* typedefs for all requests */
531
532#ifndef __Request__vm_map_subsystem__defined
533#define __Request__vm_map_subsystem__defined
534
535#ifdef __MigPackStructs
536#pragma pack(push, 4)
537#endif
538 typedef struct {
539 mach_msg_header_t Head;
540 NDR_record_t NDR;
541 vm_address_t address;
542 vm_region_flavor_t flavor;
543 mach_msg_type_number_t infoCnt;
544 } __Request__vm_region_t __attribute__((unused));
545#ifdef __MigPackStructs
546#pragma pack(pop)
547#endif
548
549#ifdef __MigPackStructs
550#pragma pack(push, 4)
551#endif
552 typedef struct {
553 mach_msg_header_t Head;
554 NDR_record_t NDR;
555 vm_address_t address;
556 vm_size_t size;
557 int flags;
558 } __Request__vm_allocate_t __attribute__((unused));
559#ifdef __MigPackStructs
560#pragma pack(pop)
561#endif
562
563#ifdef __MigPackStructs
564#pragma pack(push, 4)
565#endif
566 typedef struct {
567 mach_msg_header_t Head;
568 NDR_record_t NDR;
569 vm_address_t address;
570 vm_size_t size;
571 } __Request__vm_deallocate_t __attribute__((unused));
572#ifdef __MigPackStructs
573#pragma pack(pop)
574#endif
575
576#ifdef __MigPackStructs
577#pragma pack(push, 4)
578#endif
579 typedef struct {
580 mach_msg_header_t Head;
581 NDR_record_t NDR;
582 vm_address_t address;
583 vm_size_t size;
584 boolean_t set_maximum;
585 vm_prot_t new_protection;
586 } __Request__vm_protect_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 NDR_record_t NDR;
597 vm_address_t address;
598 vm_size_t size;
599 vm_inherit_t new_inheritance;
600 } __Request__vm_inherit_t __attribute__((unused));
601#ifdef __MigPackStructs
602#pragma pack(pop)
603#endif
604
605#ifdef __MigPackStructs
606#pragma pack(push, 4)
607#endif
608 typedef struct {
609 mach_msg_header_t Head;
610 NDR_record_t NDR;
611 vm_address_t address;
612 vm_size_t size;
613 } __Request__vm_read_t __attribute__((unused));
614#ifdef __MigPackStructs
615#pragma pack(pop)
616#endif
617
618#ifdef __MigPackStructs
619#pragma pack(push, 4)
620#endif
621 typedef struct {
622 mach_msg_header_t Head;
623 NDR_record_t NDR;
624 vm_read_entry_t data_list;
625 natural_t count;
626 } __Request__vm_read_list_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_ool_descriptor_t data;
639 /* end of the kernel processed data */
640 NDR_record_t NDR;
641 vm_address_t address;
642 mach_msg_type_number_t dataCnt;
643 } __Request__vm_write_t __attribute__((unused));
644#ifdef __MigPackStructs
645#pragma pack(pop)
646#endif
647
648#ifdef __MigPackStructs
649#pragma pack(push, 4)
650#endif
651 typedef struct {
652 mach_msg_header_t Head;
653 NDR_record_t NDR;
654 vm_address_t source_address;
655 vm_size_t size;
656 vm_address_t dest_address;
657 } __Request__vm_copy_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 NDR_record_t NDR;
668 vm_address_t address;
669 vm_size_t size;
670 vm_address_t data;
671 } __Request__vm_read_overwrite_t __attribute__((unused));
672#ifdef __MigPackStructs
673#pragma pack(pop)
674#endif
675
676#ifdef __MigPackStructs
677#pragma pack(push, 4)
678#endif
679 typedef struct {
680 mach_msg_header_t Head;
681 NDR_record_t NDR;
682 vm_address_t address;
683 vm_size_t size;
684 vm_sync_t sync_flags;
685 } __Request__vm_msync_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 NDR_record_t NDR;
696 vm_address_t address;
697 vm_size_t size;
698 vm_behavior_t new_behavior;
699 } __Request__vm_behavior_set_t __attribute__((unused));
700#ifdef __MigPackStructs
701#pragma pack(pop)
702#endif
703
704#ifdef __MigPackStructs
705#pragma pack(push, 4)
706#endif
707 typedef struct {
708 mach_msg_header_t Head;
709 /* start of the kernel processed data */
710 mach_msg_body_t msgh_body;
711 mach_msg_port_descriptor_t object;
712 /* end of the kernel processed data */
713 NDR_record_t NDR;
714 vm_address_t address;
715 vm_size_t size;
716 vm_address_t mask;
717 int flags;
718 vm_offset_t offset;
719 boolean_t copy;
720 vm_prot_t cur_protection;
721 vm_prot_t max_protection;
722 vm_inherit_t inheritance;
723 } __Request__vm_map_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 vm_address_t address;
735 vm_size_t size;
736 vm_machine_attribute_t attribute;
737 vm_machine_attribute_val_t value;
738 } __Request__vm_machine_attribute_t __attribute__((unused));
739#ifdef __MigPackStructs
740#pragma pack(pop)
741#endif
742
743#ifdef __MigPackStructs
744#pragma pack(push, 4)
745#endif
746 typedef struct {
747 mach_msg_header_t Head;
748 /* start of the kernel processed data */
749 mach_msg_body_t msgh_body;
750 mach_msg_port_descriptor_t src_task;
751 /* end of the kernel processed data */
752 NDR_record_t NDR;
753 vm_address_t target_address;
754 vm_size_t size;
755 vm_address_t mask;
756 int flags;
757 vm_address_t src_address;
758 boolean_t copy;
759 vm_inherit_t inheritance;
760 } __Request__vm_remap_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 must_wire;
772 } __Request__task_wire_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 parent_entry;
785 /* end of the kernel processed data */
786 NDR_record_t NDR;
787 vm_size_t size;
788 vm_offset_t offset;
789 vm_prot_t permission;
790 } __Request__mach_make_memory_entry_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 NDR_record_t NDR;
801 vm_offset_t offset;
802 } __Request__vm_map_page_query_t __attribute__((unused));
803#ifdef __MigPackStructs
804#pragma pack(pop)
805#endif
806
807#ifdef __MigPackStructs
808#pragma pack(push, 4)
809#endif
810 typedef struct {
811 mach_msg_header_t Head;
812 NDR_record_t NDR;
813 vm_address_t address;
814 } __Request__mach_vm_region_info_t __attribute__((unused));
815#ifdef __MigPackStructs
816#pragma pack(pop)
817#endif
818
819#ifdef __MigPackStructs
820#pragma pack(push, 4)
821#endif
822 typedef struct {
823 mach_msg_header_t Head;
824 } __Request__vm_mapped_pages_info_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 vm_address_t address;
836 natural_t nesting_depth;
837 mach_msg_type_number_t infoCnt;
838 } __Request__vm_region_recurse_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 NDR_record_t NDR;
849 vm_address_t address;
850 natural_t nesting_depth;
851 mach_msg_type_number_t infoCnt;
852 } __Request__vm_region_recurse_64_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 NDR_record_t NDR;
863 vm_address_t address;
864 } __Request__mach_vm_region_info_64_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 vm_address_t address;
876 vm_region_flavor_t flavor;
877 mach_msg_type_number_t infoCnt;
878 } __Request__vm_region_64_t __attribute__((unused));
879#ifdef __MigPackStructs
880#pragma pack(pop)
881#endif
882
883#ifdef __MigPackStructs
884#pragma pack(push, 4)
885#endif
886 typedef struct {
887 mach_msg_header_t Head;
888 /* start of the kernel processed data */
889 mach_msg_body_t msgh_body;
890 mach_msg_port_descriptor_t parent_entry;
891 /* end of the kernel processed data */
892 NDR_record_t NDR;
893 memory_object_size_t size;
894 memory_object_offset_t offset;
895 vm_prot_t permission;
896 } __Request__mach_make_memory_entry_64_t __attribute__((unused));
897#ifdef __MigPackStructs
898#pragma pack(pop)
899#endif
900
901#ifdef __MigPackStructs
902#pragma pack(push, 4)
903#endif
904 typedef struct {
905 mach_msg_header_t Head;
906 /* start of the kernel processed data */
907 mach_msg_body_t msgh_body;
908 mach_msg_port_descriptor_t object;
909 /* end of the kernel processed data */
910 NDR_record_t NDR;
911 vm_address_t address;
912 vm_size_t size;
913 vm_address_t mask;
914 int flags;
915 memory_object_offset_t offset;
916 boolean_t copy;
917 vm_prot_t cur_protection;
918 vm_prot_t max_protection;
919 vm_inherit_t inheritance;
920 } __Request__vm_map_64_t __attribute__((unused));
921#ifdef __MigPackStructs
922#pragma pack(pop)
923#endif
924
925#ifdef __MigPackStructs
926#pragma pack(push, 4)
927#endif
928 typedef struct {
929 mach_msg_header_t Head;
930 NDR_record_t NDR;
931 vm_address_t address;
932 vm_purgable_t control;
933 int state;
934 } __Request__vm_purgable_control_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__vm_map_exec_lockdown_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 /* start of the kernel processed data */
955 mach_msg_body_t msgh_body;
956 mach_msg_port_descriptor_t src_task;
957 /* end of the kernel processed data */
958 NDR_record_t NDR;
959 vm_address_t target_address;
960 vm_size_t size;
961 vm_address_t mask;
962 int flags;
963 vm_address_t src_address;
964 boolean_t copy;
965 vm_prot_t cur_protection;
966 vm_prot_t max_protection;
967 vm_inherit_t inheritance;
968 } __Request__vm_remap_new_t __attribute__((unused));
969#ifdef __MigPackStructs
970#pragma pack(pop)
971#endif
972#endif /* !__Request__vm_map_subsystem__defined */
973
974/* union of all requests */
975
976#ifndef __RequestUnion__vm_map_subsystem__defined
977#define __RequestUnion__vm_map_subsystem__defined
978union __RequestUnion__vm_map_subsystem {
979 __Request__vm_region_t Request_vm_region;
980 __Request__vm_allocate_t Request_vm_allocate;
981 __Request__vm_deallocate_t Request_vm_deallocate;
982 __Request__vm_protect_t Request_vm_protect;
983 __Request__vm_inherit_t Request_vm_inherit;
984 __Request__vm_read_t Request_vm_read;
985 __Request__vm_read_list_t Request_vm_read_list;
986 __Request__vm_write_t Request_vm_write;
987 __Request__vm_copy_t Request_vm_copy;
988 __Request__vm_read_overwrite_t Request_vm_read_overwrite;
989 __Request__vm_msync_t Request_vm_msync;
990 __Request__vm_behavior_set_t Request_vm_behavior_set;
991 __Request__vm_map_t Request_vm_map;
992 __Request__vm_machine_attribute_t Request_vm_machine_attribute;
993 __Request__vm_remap_t Request_vm_remap;
994 __Request__task_wire_t Request_task_wire;
995 __Request__mach_make_memory_entry_t Request_mach_make_memory_entry;
996 __Request__vm_map_page_query_t Request_vm_map_page_query;
997 __Request__mach_vm_region_info_t Request_mach_vm_region_info;
998 __Request__vm_mapped_pages_info_t Request_vm_mapped_pages_info;
999 __Request__vm_region_recurse_t Request_vm_region_recurse;
1000 __Request__vm_region_recurse_64_t Request_vm_region_recurse_64;
1001 __Request__mach_vm_region_info_64_t Request_mach_vm_region_info_64;
1002 __Request__vm_region_64_t Request_vm_region_64;
1003 __Request__mach_make_memory_entry_64_t Request_mach_make_memory_entry_64;
1004 __Request__vm_map_64_t Request_vm_map_64;
1005 __Request__vm_purgable_control_t Request_vm_purgable_control;
1006 __Request__vm_map_exec_lockdown_t Request_vm_map_exec_lockdown;
1007 __Request__vm_remap_new_t Request_vm_remap_new;
1008};
1009#endif /* !__RequestUnion__vm_map_subsystem__defined */
1010/* typedefs for all replies */
1011
1012#ifndef __Reply__vm_map_subsystem__defined
1013#define __Reply__vm_map_subsystem__defined
1014
1015#ifdef __MigPackStructs
1016#pragma pack(push, 4)
1017#endif
1018 typedef struct {
1019 mach_msg_header_t Head;
1020 /* start of the kernel processed data */
1021 mach_msg_body_t msgh_body;
1022 mach_msg_port_descriptor_t object_name;
1023 /* end of the kernel processed data */
1024 NDR_record_t NDR;
1025 vm_address_t address;
1026 vm_size_t size;
1027 mach_msg_type_number_t infoCnt;
1028 int info[10];
1029 } __Reply__vm_region_t __attribute__((unused));
1030#ifdef __MigPackStructs
1031#pragma pack(pop)
1032#endif
1033
1034#ifdef __MigPackStructs
1035#pragma pack(push, 4)
1036#endif
1037 typedef struct {
1038 mach_msg_header_t Head;
1039 NDR_record_t NDR;
1040 kern_return_t RetCode;
1041 vm_address_t address;
1042 } __Reply__vm_allocate_t __attribute__((unused));
1043#ifdef __MigPackStructs
1044#pragma pack(pop)
1045#endif
1046
1047#ifdef __MigPackStructs
1048#pragma pack(push, 4)
1049#endif
1050 typedef struct {
1051 mach_msg_header_t Head;
1052 NDR_record_t NDR;
1053 kern_return_t RetCode;
1054 } __Reply__vm_deallocate_t __attribute__((unused));
1055#ifdef __MigPackStructs
1056#pragma pack(pop)
1057#endif
1058
1059#ifdef __MigPackStructs
1060#pragma pack(push, 4)
1061#endif
1062 typedef struct {
1063 mach_msg_header_t Head;
1064 NDR_record_t NDR;
1065 kern_return_t RetCode;
1066 } __Reply__vm_protect_t __attribute__((unused));
1067#ifdef __MigPackStructs
1068#pragma pack(pop)
1069#endif
1070
1071#ifdef __MigPackStructs
1072#pragma pack(push, 4)
1073#endif
1074 typedef struct {
1075 mach_msg_header_t Head;
1076 NDR_record_t NDR;
1077 kern_return_t RetCode;
1078 } __Reply__vm_inherit_t __attribute__((unused));
1079#ifdef __MigPackStructs
1080#pragma pack(pop)
1081#endif
1082
1083#ifdef __MigPackStructs
1084#pragma pack(push, 4)
1085#endif
1086 typedef struct {
1087 mach_msg_header_t Head;
1088 /* start of the kernel processed data */
1089 mach_msg_body_t msgh_body;
1090 mach_msg_ool_descriptor_t data;
1091 /* end of the kernel processed data */
1092 NDR_record_t NDR;
1093 mach_msg_type_number_t dataCnt;
1094 } __Reply__vm_read_t __attribute__((unused));
1095#ifdef __MigPackStructs
1096#pragma pack(pop)
1097#endif
1098
1099#ifdef __MigPackStructs
1100#pragma pack(push, 4)
1101#endif
1102 typedef struct {
1103 mach_msg_header_t Head;
1104 NDR_record_t NDR;
1105 kern_return_t RetCode;
1106 vm_read_entry_t data_list;
1107 } __Reply__vm_read_list_t __attribute__((unused));
1108#ifdef __MigPackStructs
1109#pragma pack(pop)
1110#endif
1111
1112#ifdef __MigPackStructs
1113#pragma pack(push, 4)
1114#endif
1115 typedef struct {
1116 mach_msg_header_t Head;
1117 NDR_record_t NDR;
1118 kern_return_t RetCode;
1119 } __Reply__vm_write_t __attribute__((unused));
1120#ifdef __MigPackStructs
1121#pragma pack(pop)
1122#endif
1123
1124#ifdef __MigPackStructs
1125#pragma pack(push, 4)
1126#endif
1127 typedef struct {
1128 mach_msg_header_t Head;
1129 NDR_record_t NDR;
1130 kern_return_t RetCode;
1131 } __Reply__vm_copy_t __attribute__((unused));
1132#ifdef __MigPackStructs
1133#pragma pack(pop)
1134#endif
1135
1136#ifdef __MigPackStructs
1137#pragma pack(push, 4)
1138#endif
1139 typedef struct {
1140 mach_msg_header_t Head;
1141 NDR_record_t NDR;
1142 kern_return_t RetCode;
1143 vm_size_t outsize;
1144 } __Reply__vm_read_overwrite_t __attribute__((unused));
1145#ifdef __MigPackStructs
1146#pragma pack(pop)
1147#endif
1148
1149#ifdef __MigPackStructs
1150#pragma pack(push, 4)
1151#endif
1152 typedef struct {
1153 mach_msg_header_t Head;
1154 NDR_record_t NDR;
1155 kern_return_t RetCode;
1156 } __Reply__vm_msync_t __attribute__((unused));
1157#ifdef __MigPackStructs
1158#pragma pack(pop)
1159#endif
1160
1161#ifdef __MigPackStructs
1162#pragma pack(push, 4)
1163#endif
1164 typedef struct {
1165 mach_msg_header_t Head;
1166 NDR_record_t NDR;
1167 kern_return_t RetCode;
1168 } __Reply__vm_behavior_set_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 vm_address_t address;
1181 } __Reply__vm_map_t __attribute__((unused));
1182#ifdef __MigPackStructs
1183#pragma pack(pop)
1184#endif
1185
1186#ifdef __MigPackStructs
1187#pragma pack(push, 4)
1188#endif
1189 typedef struct {
1190 mach_msg_header_t Head;
1191 NDR_record_t NDR;
1192 kern_return_t RetCode;
1193 vm_machine_attribute_val_t value;
1194 } __Reply__vm_machine_attribute_t __attribute__((unused));
1195#ifdef __MigPackStructs
1196#pragma pack(pop)
1197#endif
1198
1199#ifdef __MigPackStructs
1200#pragma pack(push, 4)
1201#endif
1202 typedef struct {
1203 mach_msg_header_t Head;
1204 NDR_record_t NDR;
1205 kern_return_t RetCode;
1206 vm_address_t target_address;
1207 vm_prot_t cur_protection;
1208 vm_prot_t max_protection;
1209 } __Reply__vm_remap_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 NDR_record_t NDR;
1220 kern_return_t RetCode;
1221 } __Reply__task_wire_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 /* start of the kernel processed data */
1232 mach_msg_body_t msgh_body;
1233 mach_msg_port_descriptor_t object_handle;
1234 /* end of the kernel processed data */
1235 NDR_record_t NDR;
1236 vm_size_t size;
1237 } __Reply__mach_make_memory_entry_t __attribute__((unused));
1238#ifdef __MigPackStructs
1239#pragma pack(pop)
1240#endif
1241
1242#ifdef __MigPackStructs
1243#pragma pack(push, 4)
1244#endif
1245 typedef struct {
1246 mach_msg_header_t Head;
1247 NDR_record_t NDR;
1248 kern_return_t RetCode;
1249 integer_t disposition;
1250 integer_t ref_count;
1251 } __Reply__vm_map_page_query_t __attribute__((unused));
1252#ifdef __MigPackStructs
1253#pragma pack(pop)
1254#endif
1255
1256#ifdef __MigPackStructs
1257#pragma pack(push, 4)
1258#endif
1259 typedef struct {
1260 mach_msg_header_t Head;
1261 /* start of the kernel processed data */
1262 mach_msg_body_t msgh_body;
1263 mach_msg_ool_descriptor_t objects;
1264 /* end of the kernel processed data */
1265 NDR_record_t NDR;
1266 vm_info_region_t region;
1267 mach_msg_type_number_t objectsCnt;
1268 } __Reply__mach_vm_region_info_t __attribute__((unused));
1269#ifdef __MigPackStructs
1270#pragma pack(pop)
1271#endif
1272
1273#ifdef __MigPackStructs
1274#pragma pack(push, 4)
1275#endif
1276 typedef struct {
1277 mach_msg_header_t Head;
1278 /* start of the kernel processed data */
1279 mach_msg_body_t msgh_body;
1280 mach_msg_ool_descriptor_t pages;
1281 /* end of the kernel processed data */
1282 NDR_record_t NDR;
1283 mach_msg_type_number_t pagesCnt;
1284 } __Reply__vm_mapped_pages_info_t __attribute__((unused));
1285#ifdef __MigPackStructs
1286#pragma pack(pop)
1287#endif
1288
1289#ifdef __MigPackStructs
1290#pragma pack(push, 4)
1291#endif
1292 typedef struct {
1293 mach_msg_header_t Head;
1294 NDR_record_t NDR;
1295 kern_return_t RetCode;
1296 vm_address_t address;
1297 vm_size_t size;
1298 natural_t nesting_depth;
1299 mach_msg_type_number_t infoCnt;
1300 int info[19];
1301 } __Reply__vm_region_recurse_t __attribute__((unused));
1302#ifdef __MigPackStructs
1303#pragma pack(pop)
1304#endif
1305
1306#ifdef __MigPackStructs
1307#pragma pack(push, 4)
1308#endif
1309 typedef struct {
1310 mach_msg_header_t Head;
1311 NDR_record_t NDR;
1312 kern_return_t RetCode;
1313 vm_address_t address;
1314 vm_size_t size;
1315 natural_t nesting_depth;
1316 mach_msg_type_number_t infoCnt;
1317 int info[19];
1318 } __Reply__vm_region_recurse_64_t __attribute__((unused));
1319#ifdef __MigPackStructs
1320#pragma pack(pop)
1321#endif
1322
1323#ifdef __MigPackStructs
1324#pragma pack(push, 4)
1325#endif
1326 typedef struct {
1327 mach_msg_header_t Head;
1328 /* start of the kernel processed data */
1329 mach_msg_body_t msgh_body;
1330 mach_msg_ool_descriptor_t objects;
1331 /* end of the kernel processed data */
1332 NDR_record_t NDR;
1333 vm_info_region_64_t region;
1334 mach_msg_type_number_t objectsCnt;
1335 } __Reply__mach_vm_region_info_64_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 /* start of the kernel processed data */
1346 mach_msg_body_t msgh_body;
1347 mach_msg_port_descriptor_t object_name;
1348 /* end of the kernel processed data */
1349 NDR_record_t NDR;
1350 vm_address_t address;
1351 vm_size_t size;
1352 mach_msg_type_number_t infoCnt;
1353 int info[10];
1354 } __Reply__vm_region_64_t __attribute__((unused));
1355#ifdef __MigPackStructs
1356#pragma pack(pop)
1357#endif
1358
1359#ifdef __MigPackStructs
1360#pragma pack(push, 4)
1361#endif
1362 typedef struct {
1363 mach_msg_header_t Head;
1364 /* start of the kernel processed data */
1365 mach_msg_body_t msgh_body;
1366 mach_msg_port_descriptor_t object_handle;
1367 /* end of the kernel processed data */
1368 NDR_record_t NDR;
1369 memory_object_size_t size;
1370 } __Reply__mach_make_memory_entry_64_t __attribute__((unused));
1371#ifdef __MigPackStructs
1372#pragma pack(pop)
1373#endif
1374
1375#ifdef __MigPackStructs
1376#pragma pack(push, 4)
1377#endif
1378 typedef struct {
1379 mach_msg_header_t Head;
1380 NDR_record_t NDR;
1381 kern_return_t RetCode;
1382 vm_address_t address;
1383 } __Reply__vm_map_64_t __attribute__((unused));
1384#ifdef __MigPackStructs
1385#pragma pack(pop)
1386#endif
1387
1388#ifdef __MigPackStructs
1389#pragma pack(push, 4)
1390#endif
1391 typedef struct {
1392 mach_msg_header_t Head;
1393 NDR_record_t NDR;
1394 kern_return_t RetCode;
1395 int state;
1396 } __Reply__vm_purgable_control_t __attribute__((unused));
1397#ifdef __MigPackStructs
1398#pragma pack(pop)
1399#endif
1400
1401#ifdef __MigPackStructs
1402#pragma pack(push, 4)
1403#endif
1404 typedef struct {
1405 mach_msg_header_t Head;
1406 NDR_record_t NDR;
1407 kern_return_t RetCode;
1408 } __Reply__vm_map_exec_lockdown_t __attribute__((unused));
1409#ifdef __MigPackStructs
1410#pragma pack(pop)
1411#endif
1412
1413#ifdef __MigPackStructs
1414#pragma pack(push, 4)
1415#endif
1416 typedef struct {
1417 mach_msg_header_t Head;
1418 NDR_record_t NDR;
1419 kern_return_t RetCode;
1420 vm_address_t target_address;
1421 vm_prot_t cur_protection;
1422 vm_prot_t max_protection;
1423 } __Reply__vm_remap_new_t __attribute__((unused));
1424#ifdef __MigPackStructs
1425#pragma pack(pop)
1426#endif
1427#endif /* !__Reply__vm_map_subsystem__defined */
1428
1429/* union of all replies */
1430
1431#ifndef __ReplyUnion__vm_map_subsystem__defined
1432#define __ReplyUnion__vm_map_subsystem__defined
1433union __ReplyUnion__vm_map_subsystem {
1434 __Reply__vm_region_t Reply_vm_region;
1435 __Reply__vm_allocate_t Reply_vm_allocate;
1436 __Reply__vm_deallocate_t Reply_vm_deallocate;
1437 __Reply__vm_protect_t Reply_vm_protect;
1438 __Reply__vm_inherit_t Reply_vm_inherit;
1439 __Reply__vm_read_t Reply_vm_read;
1440 __Reply__vm_read_list_t Reply_vm_read_list;
1441 __Reply__vm_write_t Reply_vm_write;
1442 __Reply__vm_copy_t Reply_vm_copy;
1443 __Reply__vm_read_overwrite_t Reply_vm_read_overwrite;
1444 __Reply__vm_msync_t Reply_vm_msync;
1445 __Reply__vm_behavior_set_t Reply_vm_behavior_set;
1446 __Reply__vm_map_t Reply_vm_map;
1447 __Reply__vm_machine_attribute_t Reply_vm_machine_attribute;
1448 __Reply__vm_remap_t Reply_vm_remap;
1449 __Reply__task_wire_t Reply_task_wire;
1450 __Reply__mach_make_memory_entry_t Reply_mach_make_memory_entry;
1451 __Reply__vm_map_page_query_t Reply_vm_map_page_query;
1452 __Reply__mach_vm_region_info_t Reply_mach_vm_region_info;
1453 __Reply__vm_mapped_pages_info_t Reply_vm_mapped_pages_info;
1454 __Reply__vm_region_recurse_t Reply_vm_region_recurse;
1455 __Reply__vm_region_recurse_64_t Reply_vm_region_recurse_64;
1456 __Reply__mach_vm_region_info_64_t Reply_mach_vm_region_info_64;
1457 __Reply__vm_region_64_t Reply_vm_region_64;
1458 __Reply__mach_make_memory_entry_64_t Reply_mach_make_memory_entry_64;
1459 __Reply__vm_map_64_t Reply_vm_map_64;
1460 __Reply__vm_purgable_control_t Reply_vm_purgable_control;
1461 __Reply__vm_map_exec_lockdown_t Reply_vm_map_exec_lockdown;
1462 __Reply__vm_remap_new_t Reply_vm_remap_new;
1463};
1464#endif /* !__RequestUnion__vm_map_subsystem__defined */
1465
1466#ifndef subsystem_to_name_map_vm_map
1467#define subsystem_to_name_map_vm_map \
1468 { "vm_region", 3800 },\
1469 { "vm_allocate", 3801 },\
1470 { "vm_deallocate", 3802 },\
1471 { "vm_protect", 3803 },\
1472 { "vm_inherit", 3804 },\
1473 { "vm_read", 3805 },\
1474 { "vm_read_list", 3806 },\
1475 { "vm_write", 3807 },\
1476 { "vm_copy", 3808 },\
1477 { "vm_read_overwrite", 3809 },\
1478 { "vm_msync", 3810 },\
1479 { "vm_behavior_set", 3811 },\
1480 { "vm_map", 3812 },\
1481 { "vm_machine_attribute", 3813 },\
1482 { "vm_remap", 3814 },\
1483 { "task_wire", 3815 },\
1484 { "mach_make_memory_entry", 3816 },\
1485 { "vm_map_page_query", 3817 },\
1486 { "mach_vm_region_info", 3818 },\
1487 { "vm_mapped_pages_info", 3819 },\
1488 { "vm_region_recurse", 3821 },\
1489 { "vm_region_recurse_64", 3822 },\
1490 { "mach_vm_region_info_64", 3823 },\
1491 { "vm_region_64", 3824 },\
1492 { "mach_make_memory_entry_64", 3825 },\
1493 { "vm_map_64", 3826 },\
1494 { "vm_purgable_control", 3830 },\
1495 { "vm_map_exec_lockdown", 3831 },\
1496 { "vm_remap_new", 3832 }
1497#endif
1498
1499#ifdef __AfterMigUserHeader
1500__AfterMigUserHeader
1501#endif /* __AfterMigUserHeader */
1502
1503#endif /* _vm_map_user_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/vm_prot.h deleted-171
......@@ -1,171 +0,0 @@
1/*
2 * Copyright (c) 2000-2021 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_LEGACY ((vm_prot_t) 0x08)
107#define VM_PROT_NO_CHANGE ((vm_prot_t) 0x01000000)
108
109/*
110 * When a caller finds that he cannot obtain write permission on a
111 * mapped entry, the following flag can be used. The entry will
112 * be made "needs copy" effectively copying the object (using COW),
113 * and write permission will be added to the maximum protections
114 * for the associated entry.
115 */
116
117#define VM_PROT_COPY ((vm_prot_t) 0x10)
118
119
120/*
121 * Another invalid protection value.
122 * Used only by memory_object_data_request upon an object
123 * which has specified a copy_call copy strategy. It is used
124 * when the kernel wants a page belonging to a copy of the
125 * object, and is only asking the object as a result of
126 * following a shadow chain. This solves the race between pages
127 * being pushed up by the memory manager and the kernel
128 * walking down the shadow chain.
129 */
130
131#define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10)
132
133
134/*
135 * Another invalid protection value.
136 * Indicates that the other protection bits are to be applied as a mask
137 * against the actual protection bits of the map entry.
138 */
139#define VM_PROT_IS_MASK ((vm_prot_t) 0x40)
140
141/*
142 * Another invalid protection value to support execute-only protection.
143 * VM_PROT_STRIP_READ is a special marker that tells mprotect to not
144 * set VM_PROT_READ. We have to do it this way because existing code
145 * expects the system to set VM_PROT_READ if VM_PROT_EXECUTE is set.
146 * VM_PROT_EXECUTE_ONLY is just a convenience value to indicate that
147 * the memory should be executable and explicitly not readable. It will
148 * be ignored on platforms that do not support this type of protection.
149 */
150#define VM_PROT_STRIP_READ ((vm_prot_t) 0x80)
151#define VM_PROT_EXECUTE_ONLY (VM_PROT_EXECUTE|VM_PROT_STRIP_READ)
152
153
154#if defined(__x86_64__)
155/*
156 * Another invalid protection value to support specifying different
157 * execute permissions for user- and supervisor- modes. When
158 * MBE is enabled in a VM, VM_PROT_EXECUTE is used to indicate
159 * supervisor-mode execute permission, and VM_PROT_UEXEC specifies
160 * user-mode execute permission. Currently only used by the
161 * x86 Hypervisor kext.
162 */
163#define VM_PROT_UEXEC ((vm_prot_t) 0x8) /* User-mode Execute Permission */
164
165#define VM_PROT_ALLEXEC (VM_PROT_EXECUTE | VM_PROT_UEXEC)
166#else
167#define VM_PROT_ALLEXEC (VM_PROT_EXECUTE)
168#endif /* defined(__x86_64__) */
169
170
171#endif /* _MACH_VM_PROT_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/vm_statistics.h deleted-556
......@@ -1,556 +0,0 @@
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 * VM allocation flags:
236 *
237 * VM_FLAGS_FIXED
238 * (really the absence of VM_FLAGS_ANYWHERE)
239 * Allocate new VM region at the specified virtual address, if possible.
240 *
241 * VM_FLAGS_ANYWHERE
242 * Allocate new VM region anywhere it would fit in the address space.
243 *
244 * VM_FLAGS_PURGABLE
245 * Create a purgable VM object for that new VM region.
246 *
247 * VM_FLAGS_4GB_CHUNK
248 * The new VM region will be chunked up into 4GB sized pieces.
249 *
250 * VM_FLAGS_NO_PMAP_CHECK
251 * (for DEBUG kernel config only, ignored for other configs)
252 * Do not check that there is no stale pmap mapping for the new VM region.
253 * This is useful for kernel memory allocations at bootstrap when building
254 * the initial kernel address space while some memory is already in use.
255 *
256 * VM_FLAGS_OVERWRITE
257 * The new VM region can replace existing VM regions if necessary
258 * (to be used in combination with VM_FLAGS_FIXED).
259 *
260 * VM_FLAGS_NO_CACHE
261 * Pages brought in to this VM region are placed on the speculative
262 * queue instead of the active queue. In other words, they are not
263 * cached so that they will be stolen first if memory runs low.
264 */
265
266#define VM_FLAGS_FIXED 0x0000
267#define VM_FLAGS_ANYWHERE 0x0001
268#define VM_FLAGS_PURGABLE 0x0002
269#define VM_FLAGS_4GB_CHUNK 0x0004
270#define VM_FLAGS_RANDOM_ADDR 0x0008
271#define VM_FLAGS_NO_CACHE 0x0010
272#define VM_FLAGS_RESILIENT_CODESIGN 0x0020
273#define VM_FLAGS_RESILIENT_MEDIA 0x0040
274#define VM_FLAGS_PERMANENT 0x0080
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_PERMANENT | \
299 VM_FLAGS_OVERWRITE | \
300 VM_FLAGS_SUPERPAGE_MASK | \
301 VM_FLAGS_ALIAS_MASK)
302#define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | \
303 VM_FLAGS_RETURN_4K_DATA_ADDR | \
304 VM_FLAGS_RETURN_DATA_ADDR)
305#define VM_FLAGS_USER_REMAP (VM_FLAGS_FIXED | \
306 VM_FLAGS_ANYWHERE | \
307 VM_FLAGS_RANDOM_ADDR | \
308 VM_FLAGS_OVERWRITE| \
309 VM_FLAGS_RETURN_DATA_ADDR | \
310 VM_FLAGS_RESILIENT_CODESIGN | \
311 VM_FLAGS_RESILIENT_MEDIA)
312
313#define VM_FLAGS_SUPERPAGE_SHIFT 16
314#define SUPERPAGE_NONE 0 /* no superpages, if all bits are 0 */
315#define SUPERPAGE_SIZE_ANY 1
316#define VM_FLAGS_SUPERPAGE_NONE (SUPERPAGE_NONE << VM_FLAGS_SUPERPAGE_SHIFT)
317#define VM_FLAGS_SUPERPAGE_SIZE_ANY (SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT)
318#define SUPERPAGE_SIZE_2MB 2
319#define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<<VM_FLAGS_SUPERPAGE_SHIFT)
320
321/*
322 * EXC_GUARD definitions for virtual memory.
323 */
324#define GUARD_TYPE_VIRT_MEMORY 0x5
325
326/* Reasons for exception for virtual memory */
327enum virtual_memory_guard_exception_codes {
328 kGUARD_EXC_DEALLOC_GAP = 1u << 0
329};
330
331
332/* current accounting postmark */
333#define __VM_LEDGER_ACCOUNTING_POSTMARK 2019032600
334
335/* discrete values: */
336#define VM_LEDGER_TAG_NONE 0x00000000
337#define VM_LEDGER_TAG_DEFAULT 0x00000001
338#define VM_LEDGER_TAG_NETWORK 0x00000002
339#define VM_LEDGER_TAG_MEDIA 0x00000003
340#define VM_LEDGER_TAG_GRAPHICS 0x00000004
341#define VM_LEDGER_TAG_NEURAL 0x00000005
342#define VM_LEDGER_TAG_MAX 0x00000005
343/* individual bits: */
344#define VM_LEDGER_FLAG_NO_FOOTPRINT (1 << 0)
345#define VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG (1 << 1)
346#define VM_LEDGER_FLAGS (VM_LEDGER_FLAG_NO_FOOTPRINT | VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG)
347
348
349#define VM_MEMORY_MALLOC 1
350#define VM_MEMORY_MALLOC_SMALL 2
351#define VM_MEMORY_MALLOC_LARGE 3
352#define VM_MEMORY_MALLOC_HUGE 4
353#define VM_MEMORY_SBRK 5// uninteresting -- no one should call
354#define VM_MEMORY_REALLOC 6
355#define VM_MEMORY_MALLOC_TINY 7
356#define VM_MEMORY_MALLOC_LARGE_REUSABLE 8
357#define VM_MEMORY_MALLOC_LARGE_REUSED 9
358
359#define VM_MEMORY_ANALYSIS_TOOL 10
360
361#define VM_MEMORY_MALLOC_NANO 11
362#define VM_MEMORY_MALLOC_MEDIUM 12
363#define VM_MEMORY_MALLOC_PGUARD 13 // Will be removed
364#define VM_MEMORY_MALLOC_PROB_GUARD 13
365
366#define VM_MEMORY_MACH_MSG 20
367#define VM_MEMORY_IOKIT 21
368#define VM_MEMORY_STACK 30
369#define VM_MEMORY_GUARD 31
370#define VM_MEMORY_SHARED_PMAP 32
371/* memory containing a dylib */
372#define VM_MEMORY_DYLIB 33
373#define VM_MEMORY_OBJC_DISPATCHERS 34
374
375/* Was a nested pmap (VM_MEMORY_SHARED_PMAP) which has now been unnested */
376#define VM_MEMORY_UNSHARED_PMAP 35
377
378
379// Placeholders for now -- as we analyze the libraries and find how they
380// use memory, we can make these labels more specific.
381#define VM_MEMORY_APPKIT 40
382#define VM_MEMORY_FOUNDATION 41
383#define VM_MEMORY_COREGRAPHICS 42
384#define VM_MEMORY_CORESERVICES 43
385#define VM_MEMORY_CARBON VM_MEMORY_CORESERVICES
386#define VM_MEMORY_JAVA 44
387#define VM_MEMORY_COREDATA 45
388#define VM_MEMORY_COREDATA_OBJECTIDS 46
389#define VM_MEMORY_ATS 50
390#define VM_MEMORY_LAYERKIT 51
391#define VM_MEMORY_CGIMAGE 52
392#define VM_MEMORY_TCMALLOC 53
393
394/* private raster data (i.e. layers, some images, QGL allocator) */
395#define VM_MEMORY_COREGRAPHICS_DATA 54
396
397/* shared image and font caches */
398#define VM_MEMORY_COREGRAPHICS_SHARED 55
399
400/* Memory used for virtual framebuffers, shadowing buffers, etc... */
401#define VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS 56
402
403/* Window backing stores, custom shadow data, and compressed backing stores */
404#define VM_MEMORY_COREGRAPHICS_BACKINGSTORES 57
405
406/* x-alloc'd memory */
407#define VM_MEMORY_COREGRAPHICS_XALLOC 58
408
409/* catch-all for other uses, such as the read-only shared data page */
410#define VM_MEMORY_COREGRAPHICS_MISC VM_MEMORY_COREGRAPHICS
411
412/* memory allocated by the dynamic loader for itself */
413#define VM_MEMORY_DYLD 60
414/* malloc'd memory created by dyld */
415#define VM_MEMORY_DYLD_MALLOC 61
416
417/* Used for sqlite page cache */
418#define VM_MEMORY_SQLITE 62
419
420/* JavaScriptCore heaps */
421#define VM_MEMORY_JAVASCRIPT_CORE 63
422#define VM_MEMORY_WEBASSEMBLY VM_MEMORY_JAVASCRIPT_CORE
423/* memory allocated for the JIT */
424#define VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR 64
425#define VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE 65
426
427/* memory allocated for GLSL */
428#define VM_MEMORY_GLSL 66
429
430/* memory allocated for OpenCL.framework */
431#define VM_MEMORY_OPENCL 67
432
433/* memory allocated for QuartzCore.framework */
434#define VM_MEMORY_COREIMAGE 68
435
436/* memory allocated for WebCore Purgeable Buffers */
437#define VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS 69
438
439/* ImageIO memory */
440#define VM_MEMORY_IMAGEIO 70
441
442/* CoreProfile memory */
443#define VM_MEMORY_COREPROFILE 71
444
445/* assetsd / MobileSlideShow memory */
446#define VM_MEMORY_ASSETSD 72
447
448/* libsystem_kernel os_once_alloc */
449#define VM_MEMORY_OS_ALLOC_ONCE 73
450
451/* libdispatch internal allocator */
452#define VM_MEMORY_LIBDISPATCH 74
453
454/* Accelerate.framework image backing stores */
455#define VM_MEMORY_ACCELERATE 75
456
457/* CoreUI image block data */
458#define VM_MEMORY_COREUI 76
459
460/* CoreUI image file */
461#define VM_MEMORY_COREUIFILE 77
462
463/* Genealogy buffers */
464#define VM_MEMORY_GENEALOGY 78
465
466/* RawCamera VM allocated memory */
467#define VM_MEMORY_RAWCAMERA 79
468
469/* corpse info for dead process */
470#define VM_MEMORY_CORPSEINFO 80
471
472/* Apple System Logger (ASL) messages */
473#define VM_MEMORY_ASL 81
474
475/* Swift runtime */
476#define VM_MEMORY_SWIFT_RUNTIME 82
477
478/* Swift metadata */
479#define VM_MEMORY_SWIFT_METADATA 83
480
481/* DHMM data */
482#define VM_MEMORY_DHMM 84
483
484
485/* memory allocated by SceneKit.framework */
486#define VM_MEMORY_SCENEKIT 86
487
488/* memory allocated by skywalk networking */
489#define VM_MEMORY_SKYWALK 87
490
491#define VM_MEMORY_IOSURFACE 88
492
493#define VM_MEMORY_LIBNETWORK 89
494
495#define VM_MEMORY_AUDIO 90
496
497#define VM_MEMORY_VIDEOBITSTREAM 91
498
499/* memory allocated by CoreMedia */
500#define VM_MEMORY_CM_XPC 92
501
502#define VM_MEMORY_CM_RPC 93
503
504#define VM_MEMORY_CM_MEMORYPOOL 94
505
506#define VM_MEMORY_CM_READCACHE 95
507
508#define VM_MEMORY_CM_CRABS 96
509
510/* memory allocated for QuickLookThumbnailing */
511#define VM_MEMORY_QUICKLOOK_THUMBNAILS 97
512
513/* memory allocated by Accounts framework */
514#define VM_MEMORY_ACCOUNTS 98
515
516/* memory allocated by Sanitizer runtime libraries */
517#define VM_MEMORY_SANITIZER 99
518
519/* Differentiate memory needed by GPU drivers and frameworks from generic IOKit allocations */
520#define VM_MEMORY_IOACCELERATOR 100
521
522/* memory allocated by CoreMedia for global image registration of frames */
523#define VM_MEMORY_CM_REGWARP 101
524
525/* memory allocated by EmbeddedAcousticRecognition for speech decoder */
526#define VM_MEMORY_EAR_DECODER 102
527
528/* CoreUI cached image data */
529#define VM_MEMORY_COREUI_CACHED_IMAGE_DATA 103
530
531/* ColorSync is using mmap for read-only copies of ICC profile data */
532#define VM_MEMORY_COLORSYNC 104
533
534/* Reserve 230-239 for Rosetta */
535#define VM_MEMORY_ROSETTA 230
536#define VM_MEMORY_ROSETTA_THREAD_CONTEXT 231
537#define VM_MEMORY_ROSETTA_INDIRECT_BRANCH_MAP 232
538#define VM_MEMORY_ROSETTA_RETURN_STACK 233
539#define VM_MEMORY_ROSETTA_EXECUTABLE_HEAP 234
540#define VM_MEMORY_ROSETTA_USER_LDT 235
541#define VM_MEMORY_ROSETTA_ARENA 236
542#define VM_MEMORY_ROSETTA_10 239
543
544/* Reserve 240-255 for application */
545#define VM_MEMORY_APPLICATION_SPECIFIC_1 240
546#define VM_MEMORY_APPLICATION_SPECIFIC_16 255
547
548#define VM_MAKE_TAG(tag) ((tag) << 24)
549
550
551
552#ifdef __cplusplus
553}
554#endif
555
556#endif /* _MACH_VM_STATISTICS_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach/vm_types.h deleted-98
......@@ -1,98 +0,0 @@
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#include <sys/cdefs.h>
40
41typedef vm_offset_t pointer_t __kernel_ptr_semantics;
42typedef vm_offset_t vm_address_t __kernel_ptr_semantics;
43
44/*
45 * We use addr64_t for 64-bit addresses that are used on both
46 * 32 and 64-bit machines. On PPC, they are passed and returned as
47 * two adjacent 32-bit GPRs. We use addr64_t in places where
48 * common code must be useable both on 32 and 64-bit machines.
49 */
50typedef uint64_t addr64_t; /* Basic effective address */
51
52/*
53 * We use reg64_t for addresses that are 32 bits on a 32-bit
54 * machine, and 64 bits on a 64-bit machine, but are always
55 * passed and returned in a single GPR on PPC. This type
56 * cannot be used in generic 32-bit c, since on a 64-bit
57 * machine the upper half of the register will be ignored
58 * by the c compiler in 32-bit mode. In c, we can only use the
59 * type in prototypes of functions that are written in and called
60 * from assembly language. This type is basically a comment.
61 */
62typedef uint32_t reg64_t;
63
64/*
65 * To minimize the use of 64-bit fields, we keep some physical
66 * addresses (that are page aligned) as 32-bit page numbers.
67 * This limits the physical address space to 16TB of RAM.
68 */
69typedef uint32_t ppnum_t; /* Physical page number */
70#define PPNUM_MAX UINT32_MAX
71
72
73
74typedef mach_port_t vm_map_t, vm_map_read_t, vm_map_inspect_t;
75
76
77#define VM_MAP_NULL ((vm_map_t) 0)
78#define VM_MAP_INSPECT_NULL ((vm_map_inspect_t) 0)
79#define VM_MAP_READ_NULL ((vm_map_read_t) 0)
80
81/*
82 * Evolving definitions, likely to change.
83 */
84
85typedef uint64_t vm_object_offset_t;
86typedef uint64_t vm_object_size_t;
87
88
89
90
91typedef mach_port_t upl_t;
92typedef mach_port_t vm_named_entry_t;
93
94
95#define UPL_NULL ((upl_t) 0)
96#define VM_NAMED_ENTRY_NULL ((vm_named_entry_t) 0)
97
98#endif /* _MACH_VM_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/mach_debug/mach_debug_types.h deleted-199
......@@ -1,199 +0,0 @@
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_V2_SIGNATURE 0x63614d2073736f42ULL
74#define MACH_CORE_FILEHEADER_MAXFILES 16
75#define MACH_CORE_FILEHEADER_NAMELEN 16
76
77/* The following are defined for mach_core_fileheader_v2 */
78#define MACH_CORE_FILEHEADER_V2_FLAG_LOG_ENCRYPTED_AEA (1ULL << 0) /* The log is encrypted using AEA */
79#define MACH_CORE_FILEHEADER_V2_FLAG_EXISTING_COREFILE_KEY_FORMAT_NIST_P256 (1ULL << 8) /* The public key is an NIST-P256 ECC key */
80#define MACH_CORE_FILEHEADER_V2_FLAG_NEXT_COREFILE_KEY_FORMAT_NIST_P256 (1ULL << 16) /* The next public key is an NIST-P256 ECC key */
81
82#define MACH_CORE_FILEHEADER_V2_FLAGS_EXISTING_COREFILE_KEY_FORMAT_MASK (0x1ULL << 8) /* A bit-mask for all supported key formats */
83#define MACH_CORE_FILEHEADER_V2_FLAGS_NEXT_COREFILE_KEY_FORMAT_MASK (0x1ULL << 16) /* A bit-mask for all supported next key formats */
84
85#define MACH_CORE_FILEHEADER_V2_FLAGS_NEXT_KEY_FORMAT_TO_KEY_FORMAT(x) (((x) >> 8) & MACH_CORE_FILEHEADER_V2_FLAGS_EXISTING_COREFILE_KEY_FORMAT_MASK)
86
87/* The following are defined for mach_core_details_v2 */
88#define MACH_CORE_DETAILS_V2_FLAG_ENCRYPTED_AEA (1ULL << 0) /* This core is encrypted using AEA */
89#define MACH_CORE_DETAILS_V2_FLAG_COMPRESSED_ZLIB (1ULL << 8) /* This core is compressed using ZLib */
90
91typedef char symtab_name_t[32];
92
93/*
94 ***********************
95 *
96 * Mach corefile layout
97 *
98 ***********************
99 *
100 * uint64_t signature
101 * uint64_t log_offset >---+
102 * uint64_t log_length |
103 * mach_core_details files[MACH_CORE_FILEHEADER_MAXFILES] |
104 * |--> uint64_t gzip_offset >---+ |
105 * | uint64_t gzip_length | |
106 * | char core_name[] | |
107 * |--> uint64_t gzip_offset >---+ | |
108 * | uint64_t gzip_length | | |
109 * | char core_name[] | | |
110 * |--> [...] | | |
111 * [log data. Plain-text] | | <---+
112 * [core #1 data. Zlib compressed] | <---+
113 * [core #2 data. Zlib compressed] <---+
114 * [core #x data...]
115 */
116
117struct mach_core_details {
118 uint64_t gzip_offset;
119 uint64_t gzip_length;
120 char core_name[MACH_CORE_FILEHEADER_NAMELEN];
121};
122
123struct mach_core_fileheader {
124 uint64_t signature; /* MACH_CORE_FILEHEADER_SIGNATURE */
125 uint64_t log_offset;
126 uint64_t log_length;
127 uint64_t num_files;
128 struct mach_core_details files[MACH_CORE_FILEHEADER_MAXFILES];
129};
130
131/*
132 * Mach corefile V2 headers are denoted with MACH_CORE_FILEHEADER_V2_SIGNATURE.
133 * Note that the V2 headers contain a version field that further indicates the version of the
134 * header's contents. For example, if a V2 header's 'version' field indicates version 5, then
135 * the header follows the format of the 'mach_core_fileheader_v5' structure.
136 *
137 * Further note that 'mach_core_details_' structures are not bound to the same versioning scheme
138 * as the header itself. This means that it's perfectly acceptable for a 'mach_core_fileheader_v5' header
139 * to make use of 'mach_core_details_v2'
140 *
141 **************************
142 *
143 * Mach corefile layout V2 (using a version 2 header struct as an example)
144 *
145 **************************
146 *
147 * uint64_t signature
148 * uint32_t version
149 * uint64_t flags
150 * uint64_t pub_key_offset >---+
151 * uint16_t pub_key_length |
152 * uint64_t log_offset >---+ |
153 * uint64_t log_length | |
154 * uint64_t num_files | |
155 * mach_core_details_v2 files[] | |
156 * |--> uint64_t flags | |
157 * | uint64_t offset >---+ | |
158 * | uint64_t length | | |
159 * | char core_name[] | | |
160 * |--> uint64_t flags | | |
161 * | uint64_t offset >---+ | | |
162 * | uint64_t length | | | |
163 * | char core_name[] | | | |
164 * |--> [...] | | | |
165 * [public key data] | | | <---+
166 * [log data. Plain-text or an AEA container] | | <---+
167 * [core #1 data. Zlib compressed. Possibly in an AEA container] | <---+
168 * [core #2 data. Zlib compressed. Possibly in an AEA container] <---+
169 * [core #x data...]
170 */
171
172struct mach_core_details_v2 {
173 uint64_t flags; /* See the MACH_CORE_DETAILS_V2_FLAG_* definitions */
174 uint64_t offset;
175 uint64_t length;
176 char core_name[MACH_CORE_FILEHEADER_NAMELEN];
177};
178
179struct mach_core_fileheader_base {
180 uint64_t signature; /* MACH_CORE_FILEHEADER_V2_SIGNATURE */
181 uint32_t version;
182};
183
184struct mach_core_fileheader_v2 {
185 uint64_t signature; /* MACH_CORE_FILEHEADER_V2_SIGNATURE */
186 uint32_t version; /* 2 */
187 uint64_t flags; /* See the MACH_CORE_FILEHEADER_V2_FLAG_* definitions */
188 uint64_t pub_key_offset; /* Offset of the public key */
189 uint16_t pub_key_length; /* Length of the public key */
190 uint64_t log_offset;
191 uint64_t log_length;
192 uint64_t num_files;
193 struct mach_core_details_v2 files[];
194};
195
196#define KOBJECT_DESCRIPTION_LENGTH 512
197typedef char kobject_description_t[KOBJECT_DESCRIPTION_LENGTH];
198
199#endif /* _MACH_DEBUG_MACH_DEBUG_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/malloc/malloc.h deleted-341
......@@ -1,341 +0,0 @@
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/********* Zone version summary ************/
313// Version 0, but optional:
314// malloc_zone_t::batch_malloc
315// malloc_zone_t::batch_free
316// Version 5:
317// malloc_zone_t::memalign
318// Version 6:
319// malloc_zone_t::free_definite_size
320// Version 7:
321// malloc_introspection_t::enable_discharge_checking
322// malloc_introspection_t::disable_discharge_checking
323// malloc_introspection_t::discharge
324// Version 8:
325// malloc_zone_t::pressure_relief
326// Version 9:
327// malloc_introspection_t::reinit_lock
328// Version 10:
329// malloc_zone_t::claimed_address
330// Version 11:
331// malloc_introspection_t::print_task
332// Version 12:
333// malloc_introspection_t::task_statistics
334
335// These functions are optional and calling them requires two checks:
336// * Check zone version to ensure zone struct is large enough to include the member.
337// * Check that the function pointer is not null.
338
339__END_DECLS
340
341#endif /* _MALLOC_MALLOC_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/netinet6/in6.h deleted-683
......@@ -1,683 +0,0 @@
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#define IPV6CTL_ULA_USETEMPADDR 51
631
632
633/* New entries should be added here from current IPV6CTL_MAXID value. */
634/* to define items, should talk with KAME guys first, for *BSD compatibility */
635#define IPV6CTL_MAXID 51
636
637
638
639
640
641__BEGIN_DECLS
642struct cmsghdr;
643
644extern int inet6_option_space(int);
645extern int inet6_option_init(void *, struct cmsghdr **, int);
646extern int inet6_option_append(struct cmsghdr *, const __uint8_t *, int, int);
647extern __uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int);
648extern int inet6_option_next(const struct cmsghdr *, __uint8_t **);
649extern int inet6_option_find(const struct cmsghdr *, __uint8_t **, int);
650
651extern size_t inet6_rthdr_space(int, int);
652extern struct cmsghdr *inet6_rthdr_init(void *, int);
653extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *,
654 unsigned int);
655extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int);
656#if 0 /* not implemented yet */
657extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *);
658#endif
659extern int inet6_rthdr_segments(const struct cmsghdr *);
660extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int);
661extern int inet6_rthdr_getflags(const struct cmsghdr *, int);
662
663extern int inet6_opt_init(void *, socklen_t);
664extern int inet6_opt_append(void *, socklen_t, int, __uint8_t, socklen_t,
665 __uint8_t, void **);
666extern int inet6_opt_finish(void *, socklen_t, int);
667extern int inet6_opt_set_val(void *, int, void *, socklen_t);
668
669extern int inet6_opt_next(void *, socklen_t, int, __uint8_t *, socklen_t *,
670 void **);
671extern int inet6_opt_find(void *, socklen_t, int, __uint8_t, socklen_t *,
672 void **);
673extern int inet6_opt_get_val(void *, int, void *, socklen_t);
674extern socklen_t inet6_rth_space(int, int);
675extern void *inet6_rth_init(void *, socklen_t, int, int);
676extern int inet6_rth_add(void *, const struct in6_addr *);
677extern int inet6_rth_reverse(const void *, void *);
678extern int inet6_rth_segments(const void *);
679extern struct in6_addr *inet6_rth_getaddr(const void *, int);
680
681__END_DECLS
682#endif /* PLATFORM_DriverKit */
683#endif /* !_NETINET6_IN6_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/objc/NSObjCRuntime.h deleted-33
......@@ -1,33 +0,0 @@
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__ || TARGET_OS_WIN32 || 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
\ No newline at end of file
lib/libc/include/any-macos-any/objc/message.h deleted-319
......@@ -1,319 +0,0 @@
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#endif
\ No newline at end of file
lib/libc/include/any-macos-any/objc/objc-api.h deleted-296
......@@ -1,296 +0,0 @@
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/* OBJC_UNAVAILABLE: unavailable, with a message where supported */
164#if !defined(OBJC_UNAVAILABLE)
165# if __has_extension(attribute_unavailable_with_message)
166# define OBJC_UNAVAILABLE(_msg) __attribute__((unavailable(_msg)))
167# else
168# define OBJC_UNAVAILABLE(_msg) __attribute__((unavailable))
169# endif
170#endif
171
172/* OBJC_DEPRECATED: deprecated, with a message where supported */
173#if !defined(OBJC_DEPRECATED)
174# if __has_extension(attribute_deprecated_with_message)
175# define OBJC_DEPRECATED(_msg) __attribute__((deprecated(_msg)))
176# else
177# define OBJC_DEPRECATED(_msg) __attribute__((deprecated))
178# endif
179#endif
180
181/* OBJC_ARC_UNAVAILABLE: unavailable with -fobjc-arc */
182#if !defined(OBJC_ARC_UNAVAILABLE)
183# if __has_feature(objc_arc)
184# define OBJC_ARC_UNAVAILABLE OBJC_UNAVAILABLE("not available in automatic reference counting mode")
185# else
186# define OBJC_ARC_UNAVAILABLE
187# endif
188#endif
189
190/* OBJC_SWIFT_UNAVAILABLE: unavailable in Swift */
191#if !defined(OBJC_SWIFT_UNAVAILABLE)
192# if __has_feature(attribute_availability_swift)
193# define OBJC_SWIFT_UNAVAILABLE(_msg) __attribute__((availability(swift, unavailable, message=_msg)))
194# else
195# define OBJC_SWIFT_UNAVAILABLE(_msg)
196# endif
197#endif
198
199/* OBJC_ARM64_UNAVAILABLE: unavailable on arm64 (i.e. stret dispatch) */
200#if !defined(OBJC_ARM64_UNAVAILABLE)
201# if defined(__arm64__)
202# define OBJC_ARM64_UNAVAILABLE OBJC_UNAVAILABLE("not available in arm64")
203# else
204# define OBJC_ARM64_UNAVAILABLE
205# endif
206#endif
207
208/* OBJC_GC_UNAVAILABLE: unavailable with -fobjc-gc or -fobjc-gc-only */
209#if !defined(OBJC_GC_UNAVAILABLE)
210# define OBJC_GC_UNAVAILABLE
211#endif
212
213#if !defined(OBJC_EXTERN)
214# if defined(__cplusplus)
215# define OBJC_EXTERN extern "C"
216# else
217# define OBJC_EXTERN extern
218# endif
219#endif
220
221#if !defined(OBJC_VISIBLE)
222# if TARGET_OS_WIN32
223# if defined(BUILDING_OBJC)
224# define OBJC_VISIBLE __declspec(dllexport)
225# else
226# define OBJC_VISIBLE __declspec(dllimport)
227# endif
228# else
229# define OBJC_VISIBLE __attribute__((visibility("default")))
230# endif
231#endif
232
233#if !defined(OBJC_EXPORT)
234# define OBJC_EXPORT OBJC_EXTERN OBJC_VISIBLE
235#endif
236
237#if !defined(OBJC_IMPORT)
238# define OBJC_IMPORT extern
239#endif
240
241#if !defined(OBJC_ROOT_CLASS)
242# if __has_attribute(objc_root_class)
243# define OBJC_ROOT_CLASS __attribute__((objc_root_class))
244# else
245# define OBJC_ROOT_CLASS
246# endif
247#endif
248
249#ifndef __DARWIN_NULL
250#define __DARWIN_NULL NULL
251#endif
252
253#if !defined(OBJC_INLINE)
254# define OBJC_INLINE __inline
255#endif
256
257// Declares an enum type or option bits type as appropriate for each language.
258#if (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum))
259#define OBJC_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
260#if (__cplusplus)
261#define OBJC_OPTIONS(_type, _name) _type _name; enum : _type
262#else
263#define OBJC_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
264#endif
265#else
266#define OBJC_ENUM(_type, _name) _type _name; enum
267#define OBJC_OPTIONS(_type, _name) _type _name; enum
268#endif
269
270#if !defined(OBJC_RETURNS_RETAINED)
271# if __OBJC__ && __has_attribute(ns_returns_retained)
272# define OBJC_RETURNS_RETAINED __attribute__((ns_returns_retained))
273# else
274# define OBJC_RETURNS_RETAINED
275# endif
276#endif
277
278/* OBJC_COLD: very rarely called, e.g. on error path */
279#if !defined(OBJC_COLD)
280# if __OBJC__ && __has_attribute(cold)
281# define OBJC_COLD __attribute__((cold))
282# else
283# define OBJC_COLD
284# endif
285#endif
286
287/* OBJC_NORETURN: does not return normally, but may throw */
288#if !defined(OBJC_NORETURN)
289# if __OBJC__ && __has_attribute(noreturn)
290# define OBJC_NORETURN __attribute__((noreturn))
291# else
292# define OBJC_NORETURN
293# endif
294#endif
295
296#endif
\ No newline at end of file
lib/libc/include/any-macos-any/os/base.h deleted-328
......@@ -1,328 +0,0 @@
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(analyzer_suppress)
155#define OS_ANALYZER_SUPPRESS(RADAR) __attribute__((analyzer_suppress))
156#else
157#define OS_ANALYZER_SUPPRESS(RADAR)
158#endif
159
160#if __has_attribute(enum_extensibility)
161#define __OS_ENUM_ATTR __attribute__((enum_extensibility(open)))
162#define __OS_ENUM_ATTR_CLOSED __attribute__((enum_extensibility(closed)))
163#else
164#define __OS_ENUM_ATTR
165#define __OS_ENUM_ATTR_CLOSED
166#endif // __has_attribute(enum_extensibility)
167
168#if __has_attribute(flag_enum)
169/*!
170 * Compile with -Wflag-enum and -Wassign-enum to enforce at definition and
171 * assignment, respectively, i.e. -Wflag-enum prevents you from creating new
172 * enumeration values from illegal values within the enum definition, and
173 * -Wassign-enum prevents you from assigning illegal values to a variable of the
174 * enum type.
175 */
176#define __OS_OPTIONS_ATTR __attribute__((flag_enum))
177#else
178#define __OS_OPTIONS_ATTR
179#endif // __has_attribute(flag_enum)
180
181#if __has_feature(objc_fixed_enum) || __has_extension(cxx_fixed_enum) || \
182 __has_extension(cxx_strong_enums)
183#define OS_ENUM(_name, _type, ...) \
184 typedef enum : _type { __VA_ARGS__ } _name##_t
185#define OS_CLOSED_ENUM(_name, _type, ...) \
186 typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR_CLOSED _name##_t
187#define OS_OPTIONS(_name, _type, ...) \
188 typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR __OS_OPTIONS_ATTR _name##_t
189#define OS_CLOSED_OPTIONS(_name, _type, ...) \
190 typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR _name##_t
191#else
192/*!
193 * There is unfortunately no good way in plain C to have both fixed-type enums
194 * and enforcement for clang's enum_extensibility extensions. The primary goal
195 * of these macros is to allow you to define an enum and specify its width in a
196 * single statement, and for plain C that is accomplished by defining an
197 * anonymous enum and then separately typedef'ing the requested type name to the
198 * requested underlying integer type. So the type emitted actually has no
199 * relationship at all to the enum, and therefore while the compiler could
200 * enforce enum extensibility if you used the enum type, it cannot do so if you
201 * use the "_t" type resulting from this expression.
202 *
203 * But we still define a named enum type and decorate it appropriately for you,
204 * so if you really want the enum extensibility enforcement, you can use the
205 * enum type yourself, i.e. when compiling with a C compiler:
206 *
207 * OS_CLOSED_ENUM(my_type, uint64_t,
208 * FOO,
209 * BAR,
210 * BAZ,
211 * );
212 *
213 * my_type_t mt = 98; // legal
214 * enum my_type emt = 98; // illegal
215 *
216 * But be aware that the underlying enum type's width is subject only to the C
217 * language's guarantees -- namely that it will be compatible with int, char,
218 * and unsigned char. It is not safe to rely on the size of this type.
219 *
220 * When compiling in ObjC or C++, both of the above assignments are illegal.
221 */
222#define __OS_ENUM_C_FALLBACK(_name, _type, ...) \
223 typedef _type _name##_t; enum _name { __VA_ARGS__ }
224
225#define OS_ENUM(_name, _type, ...) \
226 typedef _type _name##_t; enum { __VA_ARGS__ }
227#define OS_CLOSED_ENUM(_name, _type, ...) \
228 __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \
229 __OS_ENUM_ATTR_CLOSED
230#define OS_OPTIONS(_name, _type, ...) \
231 __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \
232 __OS_ENUM_ATTR __OS_OPTIONS_ATTR
233#define OS_CLOSED_OPTIONS(_name, _type, ...) \
234 __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \
235 __OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR
236#endif // __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums)
237
238#if __has_feature(attribute_availability_swift)
239// equivalent to __SWIFT_UNAVAILABLE from Availability.h
240#define OS_SWIFT_UNAVAILABLE(_msg) \
241 __attribute__((__availability__(swift, unavailable, message=_msg)))
242#else
243#define OS_SWIFT_UNAVAILABLE(_msg)
244#endif
245
246#if __has_attribute(swift_private)
247# define OS_REFINED_FOR_SWIFT __attribute__((__swift_private__))
248#else
249# define OS_REFINED_FOR_SWIFT
250#endif
251
252#if __has_attribute(swift_name)
253# define OS_SWIFT_NAME(_name) __attribute__((__swift_name__(#_name)))
254#else
255# define OS_SWIFT_NAME(_name)
256#endif
257
258#define __OS_STRINGIFY(s) #s
259#define OS_STRINGIFY(s) __OS_STRINGIFY(s)
260#define __OS_CONCAT(x, y) x ## y
261#define OS_CONCAT(x, y) __OS_CONCAT(x, y)
262
263#ifdef __GNUC__
264#define os_prevent_tail_call_optimization() __asm__("")
265#define os_is_compile_time_constant(expr) __builtin_constant_p(expr)
266#define os_compiler_barrier() __asm__ __volatile__("" ::: "memory")
267#else
268#define os_prevent_tail_call_optimization() do { } while (0)
269#define os_is_compile_time_constant(expr) 0
270#define os_compiler_barrier() do { } while (0)
271#endif
272
273#if __has_attribute(not_tail_called)
274#define OS_NOT_TAIL_CALLED __attribute__((__not_tail_called__))
275#else
276#define OS_NOT_TAIL_CALLED
277#endif
278
279
280typedef void (*os_function_t)(void *_Nullable);
281
282#ifdef __BLOCKS__
283/*!
284 * @typedef os_block_t
285 *
286 * @abstract
287 * Generic type for a block taking no arguments and returning no value.
288 *
289 * @discussion
290 * When not building with Objective-C ARC, a block object allocated on or
291 * copied to the heap must be released with a -[release] message or the
292 * Block_release() function.
293 *
294 * The declaration of a block literal allocates storage on the stack.
295 * Therefore, this is an invalid construct:
296 * <code>
297 * os_block_t block;
298 * if (x) {
299 * block = ^{ printf("true\n"); };
300 * } else {
301 * block = ^{ printf("false\n"); };
302 * }
303 * block(); // unsafe!!!
304 * </code>
305 *
306 * What is happening behind the scenes:
307 * <code>
308 * if (x) {
309 * struct Block __tmp_1 = ...; // setup details
310 * block = &__tmp_1;
311 * } else {
312 * struct Block __tmp_2 = ...; // setup details
313 * block = &__tmp_2;
314 * }
315 * </code>
316 *
317 * As the example demonstrates, the address of a stack variable is escaping the
318 * scope in which it is allocated. That is a classic C bug.
319 *
320 * Instead, the block literal must be copied to the heap with the Block_copy()
321 * function or by sending it a -[copy] message.
322 */
323typedef void (^os_block_t)(void);
324#endif
325
326
327
328#endif // __OS_BASE__
\ No newline at end of file
lib/libc/include/any-macos-any/pthread.h deleted-727
......@@ -1,727 +0,0 @@
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, driverkit)
561void pthread_jit_write_protect_np(int enabled);
562
563__API_AVAILABLE(macos(11.0))
564__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
565int pthread_jit_write_protect_supported_np(void);
566
567/*!
568 * @typedef pthread_jit_write_callback_t
569 * The type of a function that can be supplied to {@link
570 * pthread_jit_write_with_callback_np} to write to the MAP_JIT region while it
571 * is writeable.
572 *
573 * @param ctx
574 * A pointer to context that will be passed through to the callback function.
575 *
576 * @result
577 * A result code to be returned to the caller of @{link
578 * pthread_jit_write_with_callback_np}. The system does not interpret/act on
579 * the value of this result.
580 */
581typedef int (*pthread_jit_write_callback_t)(void * _Nullable ctx);
582
583/*!
584 * @define PTHREAD_JIT_WRITE_ALLOW_CALLBACKS_NP
585 * A macro to be used at file scope to list the functions allowed to be passed
586 * to {@link pthread_jit_write_with_callback_np} to write to the MAP_JIT region
587 * while it is writeable. It may be invoked only once per executable/library.
588 *
589 * @param callbacks
590 * The pthread_jit_write_callback_t functions to allow. They should be supplied
591 * as a comma-delimited list.
592 */
593#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__OBJC__) || defined(__cplusplus)
594#define PTHREAD_JIT_WRITE_ALLOW_CALLBACKS_NP(...) \
595 __attribute__((__used__, __section__("__DATA_CONST,__pth_jit_func"))) \
596 static const pthread_jit_write_callback_t __pthread_jit_write_callback_allowlist[] = { \
597 __VA_ARGS__, NULL \
598 }
599#endif /* (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__OBJC__) || defined(__cplusplus) */
600
601/*!
602 * @function pthread_jit_write_with_callback_np
603 *
604 * @abstract
605 * Toggles per-thread write-protection of the MAP_JIT region to writeable,
606 * invokes an allowed callback function to write to it, and toggles protection
607 * back to executable.
608 *
609 * @param callback
610 * The callback function to invoke to write to the MAP_JIT region. It must be
611 * statically allowed using {@link PTHREAD_JIT_WRITE_ALLOW_CALLBACKS_NP}.
612 *
613 * @param ctx
614 * Context to pass through to the invocation of the callback function.
615 *
616 * @result
617 * The result code returned by the callback function.
618 *
619 * @discussion
620 * This function assumes that the MAP_JIT region has executable protection when
621 * called. It is therefore invalid to call it recursively from within a write
622 * callback. The implementation does not detect such invalid recursive calls,
623 * so the client is responsible for preventing them.
624 *
625 * Callbacks _must not_ perform any non-local transfer of control flow (e.g.
626 * throw an exception, longjmp(3)), as doing so would leave the MAP_JIT region
627 * writeable.
628 *
629 * On systems where pthread_jit_write_protect_supported_np(3) is false, this
630 * function calls @callback directly and does nothing else.
631 *
632 * This function only enforces that @callback is allowed if the caller has the
633 * com.apple.security.cs.jit-write-allowlist entitlement. That entitlement also
634 * disallows use of pthread_jit_write_protect_np(3). Adopting the entitlement
635 * is therefore crucial in realizing the security benefits of this interface.
636 *
637 * If the entitlement is not present then this function toggles protection of
638 * the MAP_JIT to writeable, calls @callback and then toggles protection back to
639 * executable, without validating that @callback is an allowed function. This
640 * behavior is intended to permit independent adoption of this interface by
641 * libraries - once all libraries in an application have adopted, the
642 * application should add the entitlement.
643 *
644 * By default, only callbacks in libraries/images present at process start-up
645 * are allowed - callbacks in images loaded dynamically via dlopen(3)/etc. are
646 * not permitted. However, if the additional entitlement
647 * com.apple.security.cs.jit-write-allowlist-freeze-late is _also_ present, any
648 * callbacks in dlopen'd libraries are also added to the set of allowed
649 * callbacks until the {@link pthread_jit_write_freeze_callbacks_np} function is
650 * called.
651 *
652 * The goal of this interface is to allow applications that execute JIT-compiled
653 * code to mitigate against attempts from attackers to escalate to code
654 * execution by getting their own instructions written to the MAP_JIT region.
655 *
656 * Callbacks should assume an attacker can control the input to this function.
657 * They must therefore carefully validate the data that they are passed and do
658 * so using as little attackable state as possible. This means simplifying
659 * control flow and avoiding spills of sensitive registers (e.g. those used for
660 * validation or control flow).
661 *
662 * In the event a callback detects that its input is invalid, it should either
663 * abort in the simplest fashion possible (preferring e.g. __builtin_trap() over
664 * abort(3), the latter being encumbered by various conformance requirements) or
665 * return a result indicating failure.
666 */
667__API_AVAILABLE(macos(11.4))
668__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
669__SWIFT_UNAVAILABLE_MSG("This interface cannot be safely used from Swift")
670int pthread_jit_write_with_callback_np(
671 pthread_jit_write_callback_t _Nonnull callback, void * _Nullable ctx);
672
673/*!
674 * @function pthread_jit_write_freeze_callbacks_np
675 *
676 * @abstract
677 * Freezes the set of allowed pthread JIT write callbacks, preventing any
678 * callbacks in subsequently dlopen'd libraries from being allowed as arguments
679 * to {@link pthread_jit_write_with_callback_np}
680 *
681 * @discussion
682 * If the com.apple.security.cs.jit-write-allowlist-freeze-late entitlement is
683 * present, this function must be called exactly once after all libraries
684 * containing JIT write callbacks have been loaded to prevent any further
685 * runtime modifications to the set of allowed callbacks. Failing to call this
686 * function before calling pthread_jit_write_with_callback_np(3) for the first
687 * time is an error, as is calling it multiple times.
688 *
689 * If the jit-write-allowlist-freeze-late entitlement is not present, calling
690 * this function is an error.
691 *
692 * If an application does not need to dlopen(3) any libraries or frameworks
693 * containing needed JIT write callbacks, it is best to avoid the
694 * jit-write-allowlist-freeze-late entitlement and accompanying need to call
695 * this function, as this allows the runtime to automatically freeze the set of
696 * allowed callbacks early in process initialization.
697 */
698__API_AVAILABLE(macos(12.1))
699__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
700void pthread_jit_write_freeze_callbacks_np(void);
701
702/*!
703 * @function pthread_cpu_number_np
704 *
705 * @param cpu_number_out
706 * The CPU number that the thread was running on at the time of query.
707 * This cpu number is in the interval [0, ncpus) (from sysctlbyname("hw.ncpu"))
708 *
709 * @result
710 * This function returns 0 or the value of errno if an error occurred.
711 *
712 * @note
713 * Optimizations of per-CPU datastructures based on the result of this function
714 * still require synchronization since it is not guaranteed that the thread will
715 * still be on the same CPU by the time the function returns.
716 */
717__API_AVAILABLE(macos(11.0), ios(14.2), tvos(14.2), watchos(7.1))
718int
719pthread_cpu_number_np(size_t *cpu_number_out);
720
721#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE || __cplusplus */
722__END_DECLS
723#if __has_feature(assume_nonnull)
724_Pragma("clang assume_nonnull end")
725#endif
726
727#endif /* _PTHREAD_H */
\ No newline at end of file
lib/libc/include/any-macos-any/simd/base.h deleted-129
......@@ -1,129 +0,0 @@
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_12_0 || \
45 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_15_0 || \
46 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_8_0 || \
47 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_15_0 || \
48 __BRIDGE_OS_VERSION_MIN_REQUIRED >= 60000 || \
49 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_21_0
50# define SIMD_LIBRARY_VERSION 4
51# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13 || \
52 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_11_0 || \
53 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_4_0 || \
54 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_11_0 || \
55 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_19_0
56# define SIMD_LIBRARY_VERSION 3
57# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12 || \
58 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0 || \
59 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_3_0 || \
60 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_10_0
61# define SIMD_LIBRARY_VERSION 2
62# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || \
63 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
64# define SIMD_LIBRARY_VERSION 1
65# else
66# define SIMD_LIBRARY_VERSION 0
67# endif
68# else /* !__has_include(<Availability.h>) */
69# define SIMD_LIBRARY_VERSION 3
70# define __API_AVAILABLE(...) /* Nothing */
71# endif
72
73/* The simd types interoperate with the native simd intrinsic types for each
74 * architecture; the headers that define those types and operations are
75 * automatically included with simd.h */
76# if defined __ARM_NEON__
77# include <arm_neon.h>
78# elif defined __i386__ || defined __x86_64__
79# include <immintrin.h>
80# endif
81
82/* Define a number of function attributes used by the simd functions. */
83# if __has_attribute(__always_inline__)
84# define SIMD_INLINE __attribute__((__always_inline__))
85# else
86# define SIMD_INLINE inline
87# endif
88
89# if __has_attribute(__const__)
90# define SIMD_CONST __attribute__((__const__))
91# else
92# define SIMD_CONST /* nothing */
93# endif
94
95# if __has_attribute(__nodebug__)
96# define SIMD_NODEBUG __attribute__((__nodebug__))
97# else
98# define SIMD_NODEBUG /* nothing */
99# endif
100
101# if __has_attribute(__deprecated__)
102# define SIMD_DEPRECATED(message) __attribute__((__deprecated__(message)))
103# else
104# define SIMD_DEPRECATED(message) /* nothing */
105# endif
106
107#define SIMD_OVERLOAD __attribute__((__overloadable__))
108#define SIMD_CPPFUNC SIMD_INLINE SIMD_CONST SIMD_NODEBUG
109#define SIMD_CFUNC SIMD_CPPFUNC SIMD_OVERLOAD
110#define SIMD_NOINLINE SIMD_CONST SIMD_NODEBUG SIMD_OVERLOAD
111#define SIMD_NONCONST SIMD_INLINE SIMD_NODEBUG SIMD_OVERLOAD
112#define __SIMD_INLINE__ SIMD_CPPFUNC
113#define __SIMD_ATTRIBUTES__ SIMD_CFUNC
114#define __SIMD_OVERLOAD__ SIMD_OVERLOAD
115
116#if defined __cplusplus
117/*! @abstract A boolean scalar. */
118typedef bool simd_bool;
119#else
120/*! @abstract A boolean scalar. */
121typedef _Bool simd_bool;
122#endif
123/*! @abstract A boolean scalar.
124 * @discussion This type is deprecated; In C or Objective-C sources, use
125 * `_Bool` instead. In C++ sources, use `bool`. */
126typedef simd_bool __SIMD_BOOLEAN_TYPE__;
127
128# endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */
129#endif /* defined SIMD_BASE */
\ No newline at end of file
lib/libc/include/any-macos-any/simd/math.h deleted-5783
......@@ -1,5783 +0,0 @@
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 * lgamma(x) simd::lgamma(x)
62 *
63 * fmod(x,y) simd::fmod(x,y)
64 * remainder(x,y) simd::remainder(x,y)
65 *
66 * ceil(x) simd::ceil(x)
67 * floor(x) simd::floor(x)
68 * rint(x) simd::rint(x)
69 * round(x) simd::round(x)
70 * trunc(x) simd::trunc(x)
71 *
72 * fdim(x,y) simd::fdim(x,y)
73 * fmax(x,y) simd::fmax(x,y) When one argument to fmin or fmax is
74 * fmin(x,y) simd::fmin(x,y) constant, use it as the *second* (y)
75 * argument to get better codegen on some
76 * architectures. E.g., write fmin(x,2)
77 * instead of fmin(2,x).
78 * fma(x,y,z) simd::fma(x,y,z) Fast on arm64 and when targeting AVX2
79 * and later; may be quite expensive on
80 * older hardware.
81 * simd_muladd(x,y,z) simd::muladd(x,y,z)
82 *
83 * @copyright 2014-2017 Apple, Inc. All rights reserved.
84 * @unsorted */
85
86#ifndef SIMD_MATH_HEADER
87#define SIMD_MATH_HEADER
88
89#include <simd/base.h>
90#if SIMD_COMPILER_HAS_REQUIRED_FEATURES
91#include <simd/vector_make.h>
92#include <simd/logic.h>
93
94#ifdef __cplusplus
95extern "C" {
96#endif
97/*! @abstract Do not call this function; instead use `acos` in C and
98 * Objective-C, and `simd::acos` in C++. */
99static inline SIMD_CFUNC simd_float2 __tg_acos(simd_float2 x);
100/*! @abstract Do not call this function; instead use `acos` in C and
101 * Objective-C, and `simd::acos` in C++. */
102static inline SIMD_CFUNC simd_float3 __tg_acos(simd_float3 x);
103/*! @abstract Do not call this function; instead use `acos` in C and
104 * Objective-C, and `simd::acos` in C++. */
105static inline SIMD_CFUNC simd_float4 __tg_acos(simd_float4 x);
106/*! @abstract Do not call this function; instead use `acos` in C and
107 * Objective-C, and `simd::acos` in C++. */
108static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x);
109/*! @abstract Do not call this function; instead use `acos` in C and
110 * Objective-C, and `simd::acos` in C++. */
111static inline SIMD_CFUNC simd_float16 __tg_acos(simd_float16 x);
112/*! @abstract Do not call this function; instead use `acos` in C and
113 * Objective-C, and `simd::acos` in C++. */
114static inline SIMD_CFUNC simd_double2 __tg_acos(simd_double2 x);
115/*! @abstract Do not call this function; instead use `acos` in C and
116 * Objective-C, and `simd::acos` in C++. */
117static inline SIMD_CFUNC simd_double3 __tg_acos(simd_double3 x);
118/*! @abstract Do not call this function; instead use `acos` in C and
119 * Objective-C, and `simd::acos` in C++. */
120static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x);
121/*! @abstract Do not call this function; instead use `acos` in C and
122 * Objective-C, and `simd::acos` in C++. */
123static inline SIMD_CFUNC simd_double8 __tg_acos(simd_double8 x);
124
125/*! @abstract Do not call this function; instead use `asin` in C and
126 * Objective-C, and `simd::asin` in C++. */
127static inline SIMD_CFUNC simd_float2 __tg_asin(simd_float2 x);
128/*! @abstract Do not call this function; instead use `asin` in C and
129 * Objective-C, and `simd::asin` in C++. */
130static inline SIMD_CFUNC simd_float3 __tg_asin(simd_float3 x);
131/*! @abstract Do not call this function; instead use `asin` in C and
132 * Objective-C, and `simd::asin` in C++. */
133static inline SIMD_CFUNC simd_float4 __tg_asin(simd_float4 x);
134/*! @abstract Do not call this function; instead use `asin` in C and
135 * Objective-C, and `simd::asin` in C++. */
136static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x);
137/*! @abstract Do not call this function; instead use `asin` in C and
138 * Objective-C, and `simd::asin` in C++. */
139static inline SIMD_CFUNC simd_float16 __tg_asin(simd_float16 x);
140/*! @abstract Do not call this function; instead use `asin` in C and
141 * Objective-C, and `simd::asin` in C++. */
142static inline SIMD_CFUNC simd_double2 __tg_asin(simd_double2 x);
143/*! @abstract Do not call this function; instead use `asin` in C and
144 * Objective-C, and `simd::asin` in C++. */
145static inline SIMD_CFUNC simd_double3 __tg_asin(simd_double3 x);
146/*! @abstract Do not call this function; instead use `asin` in C and
147 * Objective-C, and `simd::asin` in C++. */
148static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x);
149/*! @abstract Do not call this function; instead use `asin` in C and
150 * Objective-C, and `simd::asin` in C++. */
151static inline SIMD_CFUNC simd_double8 __tg_asin(simd_double8 x);
152
153/*! @abstract Do not call this function; instead use `atan` in C and
154 * Objective-C, and `simd::atan` in C++. */
155static inline SIMD_CFUNC simd_float2 __tg_atan(simd_float2 x);
156/*! @abstract Do not call this function; instead use `atan` in C and
157 * Objective-C, and `simd::atan` in C++. */
158static inline SIMD_CFUNC simd_float3 __tg_atan(simd_float3 x);
159/*! @abstract Do not call this function; instead use `atan` in C and
160 * Objective-C, and `simd::atan` in C++. */
161static inline SIMD_CFUNC simd_float4 __tg_atan(simd_float4 x);
162/*! @abstract Do not call this function; instead use `atan` in C and
163 * Objective-C, and `simd::atan` in C++. */
164static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x);
165/*! @abstract Do not call this function; instead use `atan` in C and
166 * Objective-C, and `simd::atan` in C++. */
167static inline SIMD_CFUNC simd_float16 __tg_atan(simd_float16 x);
168/*! @abstract Do not call this function; instead use `atan` in C and
169 * Objective-C, and `simd::atan` in C++. */
170static inline SIMD_CFUNC simd_double2 __tg_atan(simd_double2 x);
171/*! @abstract Do not call this function; instead use `atan` in C and
172 * Objective-C, and `simd::atan` in C++. */
173static inline SIMD_CFUNC simd_double3 __tg_atan(simd_double3 x);
174/*! @abstract Do not call this function; instead use `atan` in C and
175 * Objective-C, and `simd::atan` in C++. */
176static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x);
177/*! @abstract Do not call this function; instead use `atan` in C and
178 * Objective-C, and `simd::atan` in C++. */
179static inline SIMD_CFUNC simd_double8 __tg_atan(simd_double8 x);
180
181/*! @abstract Do not call this function; instead use `cos` in C and
182 * Objective-C, and `simd::cos` in C++. */
183static inline SIMD_CFUNC simd_float2 __tg_cos(simd_float2 x);
184/*! @abstract Do not call this function; instead use `cos` in C and
185 * Objective-C, and `simd::cos` in C++. */
186static inline SIMD_CFUNC simd_float3 __tg_cos(simd_float3 x);
187/*! @abstract Do not call this function; instead use `cos` in C and
188 * Objective-C, and `simd::cos` in C++. */
189static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x);
190/*! @abstract Do not call this function; instead use `cos` in C and
191 * Objective-C, and `simd::cos` in C++. */
192static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x);
193/*! @abstract Do not call this function; instead use `cos` in C and
194 * Objective-C, and `simd::cos` in C++. */
195static inline SIMD_CFUNC simd_float16 __tg_cos(simd_float16 x);
196/*! @abstract Do not call this function; instead use `cos` in C and
197 * Objective-C, and `simd::cos` in C++. */
198static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x);
199/*! @abstract Do not call this function; instead use `cos` in C and
200 * Objective-C, and `simd::cos` in C++. */
201static inline SIMD_CFUNC simd_double3 __tg_cos(simd_double3 x);
202/*! @abstract Do not call this function; instead use `cos` in C and
203 * Objective-C, and `simd::cos` in C++. */
204static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x);
205/*! @abstract Do not call this function; instead use `cos` in C and
206 * Objective-C, and `simd::cos` in C++. */
207static inline SIMD_CFUNC simd_double8 __tg_cos(simd_double8 x);
208
209/*! @abstract Do not call this function; instead use `sin` in C and
210 * Objective-C, and `simd::sin` in C++. */
211static inline SIMD_CFUNC simd_float2 __tg_sin(simd_float2 x);
212/*! @abstract Do not call this function; instead use `sin` in C and
213 * Objective-C, and `simd::sin` in C++. */
214static inline SIMD_CFUNC simd_float3 __tg_sin(simd_float3 x);
215/*! @abstract Do not call this function; instead use `sin` in C and
216 * Objective-C, and `simd::sin` in C++. */
217static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x);
218/*! @abstract Do not call this function; instead use `sin` in C and
219 * Objective-C, and `simd::sin` in C++. */
220static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x);
221/*! @abstract Do not call this function; instead use `sin` in C and
222 * Objective-C, and `simd::sin` in C++. */
223static inline SIMD_CFUNC simd_float16 __tg_sin(simd_float16 x);
224/*! @abstract Do not call this function; instead use `sin` in C and
225 * Objective-C, and `simd::sin` in C++. */
226static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x);
227/*! @abstract Do not call this function; instead use `sin` in C and
228 * Objective-C, and `simd::sin` in C++. */
229static inline SIMD_CFUNC simd_double3 __tg_sin(simd_double3 x);
230/*! @abstract Do not call this function; instead use `sin` in C and
231 * Objective-C, and `simd::sin` in C++. */
232static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x);
233/*! @abstract Do not call this function; instead use `sin` in C and
234 * Objective-C, and `simd::sin` in C++. */
235static inline SIMD_CFUNC simd_double8 __tg_sin(simd_double8 x);
236
237/*! @abstract Do not call this function; instead use `tan` in C and
238 * Objective-C, and `simd::tan` in C++. */
239static inline SIMD_CFUNC simd_float2 __tg_tan(simd_float2 x);
240/*! @abstract Do not call this function; instead use `tan` in C and
241 * Objective-C, and `simd::tan` in C++. */
242static inline SIMD_CFUNC simd_float3 __tg_tan(simd_float3 x);
243/*! @abstract Do not call this function; instead use `tan` in C and
244 * Objective-C, and `simd::tan` in C++. */
245static inline SIMD_CFUNC simd_float4 __tg_tan(simd_float4 x);
246/*! @abstract Do not call this function; instead use `tan` in C and
247 * Objective-C, and `simd::tan` in C++. */
248static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x);
249/*! @abstract Do not call this function; instead use `tan` in C and
250 * Objective-C, and `simd::tan` in C++. */
251static inline SIMD_CFUNC simd_float16 __tg_tan(simd_float16 x);
252/*! @abstract Do not call this function; instead use `tan` in C and
253 * Objective-C, and `simd::tan` in C++. */
254static inline SIMD_CFUNC simd_double2 __tg_tan(simd_double2 x);
255/*! @abstract Do not call this function; instead use `tan` in C and
256 * Objective-C, and `simd::tan` in C++. */
257static inline SIMD_CFUNC simd_double3 __tg_tan(simd_double3 x);
258/*! @abstract Do not call this function; instead use `tan` in C and
259 * Objective-C, and `simd::tan` in C++. */
260static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x);
261/*! @abstract Do not call this function; instead use `tan` in C and
262 * Objective-C, and `simd::tan` in C++. */
263static inline SIMD_CFUNC simd_double8 __tg_tan(simd_double8 x);
264
265#if SIMD_LIBRARY_VERSION >= 1
266/*! @abstract Do not call this function; instead use `cospi` in C and
267 * Objective-C, and `simd::cospi` in C++. */
268static inline SIMD_CFUNC simd_float2 __tg_cospi(simd_float2 x);
269/*! @abstract Do not call this function; instead use `cospi` in C and
270 * Objective-C, and `simd::cospi` in C++. */
271static inline SIMD_CFUNC simd_float3 __tg_cospi(simd_float3 x);
272/*! @abstract Do not call this function; instead use `cospi` in C and
273 * Objective-C, and `simd::cospi` in C++. */
274static inline SIMD_CFUNC simd_float4 __tg_cospi(simd_float4 x);
275/*! @abstract Do not call this function; instead use `cospi` in C and
276 * Objective-C, and `simd::cospi` in C++. */
277static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x);
278/*! @abstract Do not call this function; instead use `cospi` in C and
279 * Objective-C, and `simd::cospi` in C++. */
280static inline SIMD_CFUNC simd_float16 __tg_cospi(simd_float16 x);
281/*! @abstract Do not call this function; instead use `cospi` in C and
282 * Objective-C, and `simd::cospi` in C++. */
283static inline SIMD_CFUNC simd_double2 __tg_cospi(simd_double2 x);
284/*! @abstract Do not call this function; instead use `cospi` in C and
285 * Objective-C, and `simd::cospi` in C++. */
286static inline SIMD_CFUNC simd_double3 __tg_cospi(simd_double3 x);
287/*! @abstract Do not call this function; instead use `cospi` in C and
288 * Objective-C, and `simd::cospi` in C++. */
289static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x);
290/*! @abstract Do not call this function; instead use `cospi` in C and
291 * Objective-C, and `simd::cospi` in C++. */
292static inline SIMD_CFUNC simd_double8 __tg_cospi(simd_double8 x);
293#endif
294
295#if SIMD_LIBRARY_VERSION >= 1
296/*! @abstract Do not call this function; instead use `sinpi` in C and
297 * Objective-C, and `simd::sinpi` in C++. */
298static inline SIMD_CFUNC simd_float2 __tg_sinpi(simd_float2 x);
299/*! @abstract Do not call this function; instead use `sinpi` in C and
300 * Objective-C, and `simd::sinpi` in C++. */
301static inline SIMD_CFUNC simd_float3 __tg_sinpi(simd_float3 x);
302/*! @abstract Do not call this function; instead use `sinpi` in C and
303 * Objective-C, and `simd::sinpi` in C++. */
304static inline SIMD_CFUNC simd_float4 __tg_sinpi(simd_float4 x);
305/*! @abstract Do not call this function; instead use `sinpi` in C and
306 * Objective-C, and `simd::sinpi` in C++. */
307static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x);
308/*! @abstract Do not call this function; instead use `sinpi` in C and
309 * Objective-C, and `simd::sinpi` in C++. */
310static inline SIMD_CFUNC simd_float16 __tg_sinpi(simd_float16 x);
311/*! @abstract Do not call this function; instead use `sinpi` in C and
312 * Objective-C, and `simd::sinpi` in C++. */
313static inline SIMD_CFUNC simd_double2 __tg_sinpi(simd_double2 x);
314/*! @abstract Do not call this function; instead use `sinpi` in C and
315 * Objective-C, and `simd::sinpi` in C++. */
316static inline SIMD_CFUNC simd_double3 __tg_sinpi(simd_double3 x);
317/*! @abstract Do not call this function; instead use `sinpi` in C and
318 * Objective-C, and `simd::sinpi` in C++. */
319static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x);
320/*! @abstract Do not call this function; instead use `sinpi` in C and
321 * Objective-C, and `simd::sinpi` in C++. */
322static inline SIMD_CFUNC simd_double8 __tg_sinpi(simd_double8 x);
323#endif
324
325#if SIMD_LIBRARY_VERSION >= 1
326/*! @abstract Do not call this function; instead use `tanpi` in C and
327 * Objective-C, and `simd::tanpi` in C++. */
328static inline SIMD_CFUNC simd_float2 __tg_tanpi(simd_float2 x);
329/*! @abstract Do not call this function; instead use `tanpi` in C and
330 * Objective-C, and `simd::tanpi` in C++. */
331static inline SIMD_CFUNC simd_float3 __tg_tanpi(simd_float3 x);
332/*! @abstract Do not call this function; instead use `tanpi` in C and
333 * Objective-C, and `simd::tanpi` in C++. */
334static inline SIMD_CFUNC simd_float4 __tg_tanpi(simd_float4 x);
335/*! @abstract Do not call this function; instead use `tanpi` in C and
336 * Objective-C, and `simd::tanpi` in C++. */
337static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x);
338/*! @abstract Do not call this function; instead use `tanpi` in C and
339 * Objective-C, and `simd::tanpi` in C++. */
340static inline SIMD_CFUNC simd_float16 __tg_tanpi(simd_float16 x);
341/*! @abstract Do not call this function; instead use `tanpi` in C and
342 * Objective-C, and `simd::tanpi` in C++. */
343static inline SIMD_CFUNC simd_double2 __tg_tanpi(simd_double2 x);
344/*! @abstract Do not call this function; instead use `tanpi` in C and
345 * Objective-C, and `simd::tanpi` in C++. */
346static inline SIMD_CFUNC simd_double3 __tg_tanpi(simd_double3 x);
347/*! @abstract Do not call this function; instead use `tanpi` in C and
348 * Objective-C, and `simd::tanpi` in C++. */
349static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x);
350/*! @abstract Do not call this function; instead use `tanpi` in C and
351 * Objective-C, and `simd::tanpi` in C++. */
352static inline SIMD_CFUNC simd_double8 __tg_tanpi(simd_double8 x);
353#endif
354
355/*! @abstract Do not call this function; instead use `acosh` in C and
356 * Objective-C, and `simd::acosh` in C++. */
357static inline SIMD_CFUNC simd_float2 __tg_acosh(simd_float2 x);
358/*! @abstract Do not call this function; instead use `acosh` in C and
359 * Objective-C, and `simd::acosh` in C++. */
360static inline SIMD_CFUNC simd_float3 __tg_acosh(simd_float3 x);
361/*! @abstract Do not call this function; instead use `acosh` in C and
362 * Objective-C, and `simd::acosh` in C++. */
363static inline SIMD_CFUNC simd_float4 __tg_acosh(simd_float4 x);
364/*! @abstract Do not call this function; instead use `acosh` in C and
365 * Objective-C, and `simd::acosh` in C++. */
366static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x);
367/*! @abstract Do not call this function; instead use `acosh` in C and
368 * Objective-C, and `simd::acosh` in C++. */
369static inline SIMD_CFUNC simd_float16 __tg_acosh(simd_float16 x);
370/*! @abstract Do not call this function; instead use `acosh` in C and
371 * Objective-C, and `simd::acosh` in C++. */
372static inline SIMD_CFUNC simd_double2 __tg_acosh(simd_double2 x);
373/*! @abstract Do not call this function; instead use `acosh` in C and
374 * Objective-C, and `simd::acosh` in C++. */
375static inline SIMD_CFUNC simd_double3 __tg_acosh(simd_double3 x);
376/*! @abstract Do not call this function; instead use `acosh` in C and
377 * Objective-C, and `simd::acosh` in C++. */
378static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x);
379/*! @abstract Do not call this function; instead use `acosh` in C and
380 * Objective-C, and `simd::acosh` in C++. */
381static inline SIMD_CFUNC simd_double8 __tg_acosh(simd_double8 x);
382
383/*! @abstract Do not call this function; instead use `asinh` in C and
384 * Objective-C, and `simd::asinh` in C++. */
385static inline SIMD_CFUNC simd_float2 __tg_asinh(simd_float2 x);
386/*! @abstract Do not call this function; instead use `asinh` in C and
387 * Objective-C, and `simd::asinh` in C++. */
388static inline SIMD_CFUNC simd_float3 __tg_asinh(simd_float3 x);
389/*! @abstract Do not call this function; instead use `asinh` in C and
390 * Objective-C, and `simd::asinh` in C++. */
391static inline SIMD_CFUNC simd_float4 __tg_asinh(simd_float4 x);
392/*! @abstract Do not call this function; instead use `asinh` in C and
393 * Objective-C, and `simd::asinh` in C++. */
394static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x);
395/*! @abstract Do not call this function; instead use `asinh` in C and
396 * Objective-C, and `simd::asinh` in C++. */
397static inline SIMD_CFUNC simd_float16 __tg_asinh(simd_float16 x);
398/*! @abstract Do not call this function; instead use `asinh` in C and
399 * Objective-C, and `simd::asinh` in C++. */
400static inline SIMD_CFUNC simd_double2 __tg_asinh(simd_double2 x);
401/*! @abstract Do not call this function; instead use `asinh` in C and
402 * Objective-C, and `simd::asinh` in C++. */
403static inline SIMD_CFUNC simd_double3 __tg_asinh(simd_double3 x);
404/*! @abstract Do not call this function; instead use `asinh` in C and
405 * Objective-C, and `simd::asinh` in C++. */
406static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x);
407/*! @abstract Do not call this function; instead use `asinh` in C and
408 * Objective-C, and `simd::asinh` in C++. */
409static inline SIMD_CFUNC simd_double8 __tg_asinh(simd_double8 x);
410
411/*! @abstract Do not call this function; instead use `atanh` in C and
412 * Objective-C, and `simd::atanh` in C++. */
413static inline SIMD_CFUNC simd_float2 __tg_atanh(simd_float2 x);
414/*! @abstract Do not call this function; instead use `atanh` in C and
415 * Objective-C, and `simd::atanh` in C++. */
416static inline SIMD_CFUNC simd_float3 __tg_atanh(simd_float3 x);
417/*! @abstract Do not call this function; instead use `atanh` in C and
418 * Objective-C, and `simd::atanh` in C++. */
419static inline SIMD_CFUNC simd_float4 __tg_atanh(simd_float4 x);
420/*! @abstract Do not call this function; instead use `atanh` in C and
421 * Objective-C, and `simd::atanh` in C++. */
422static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x);
423/*! @abstract Do not call this function; instead use `atanh` in C and
424 * Objective-C, and `simd::atanh` in C++. */
425static inline SIMD_CFUNC simd_float16 __tg_atanh(simd_float16 x);
426/*! @abstract Do not call this function; instead use `atanh` in C and
427 * Objective-C, and `simd::atanh` in C++. */
428static inline SIMD_CFUNC simd_double2 __tg_atanh(simd_double2 x);
429/*! @abstract Do not call this function; instead use `atanh` in C and
430 * Objective-C, and `simd::atanh` in C++. */
431static inline SIMD_CFUNC simd_double3 __tg_atanh(simd_double3 x);
432/*! @abstract Do not call this function; instead use `atanh` in C and
433 * Objective-C, and `simd::atanh` in C++. */
434static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x);
435/*! @abstract Do not call this function; instead use `atanh` in C and
436 * Objective-C, and `simd::atanh` in C++. */
437static inline SIMD_CFUNC simd_double8 __tg_atanh(simd_double8 x);
438
439/*! @abstract Do not call this function; instead use `cosh` in C and
440 * Objective-C, and `simd::cosh` in C++. */
441static inline SIMD_CFUNC simd_float2 __tg_cosh(simd_float2 x);
442/*! @abstract Do not call this function; instead use `cosh` in C and
443 * Objective-C, and `simd::cosh` in C++. */
444static inline SIMD_CFUNC simd_float3 __tg_cosh(simd_float3 x);
445/*! @abstract Do not call this function; instead use `cosh` in C and
446 * Objective-C, and `simd::cosh` in C++. */
447static inline SIMD_CFUNC simd_float4 __tg_cosh(simd_float4 x);
448/*! @abstract Do not call this function; instead use `cosh` in C and
449 * Objective-C, and `simd::cosh` in C++. */
450static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x);
451/*! @abstract Do not call this function; instead use `cosh` in C and
452 * Objective-C, and `simd::cosh` in C++. */
453static inline SIMD_CFUNC simd_float16 __tg_cosh(simd_float16 x);
454/*! @abstract Do not call this function; instead use `cosh` in C and
455 * Objective-C, and `simd::cosh` in C++. */
456static inline SIMD_CFUNC simd_double2 __tg_cosh(simd_double2 x);
457/*! @abstract Do not call this function; instead use `cosh` in C and
458 * Objective-C, and `simd::cosh` in C++. */
459static inline SIMD_CFUNC simd_double3 __tg_cosh(simd_double3 x);
460/*! @abstract Do not call this function; instead use `cosh` in C and
461 * Objective-C, and `simd::cosh` in C++. */
462static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x);
463/*! @abstract Do not call this function; instead use `cosh` in C and
464 * Objective-C, and `simd::cosh` in C++. */
465static inline SIMD_CFUNC simd_double8 __tg_cosh(simd_double8 x);
466
467/*! @abstract Do not call this function; instead use `sinh` in C and
468 * Objective-C, and `simd::sinh` in C++. */
469static inline SIMD_CFUNC simd_float2 __tg_sinh(simd_float2 x);
470/*! @abstract Do not call this function; instead use `sinh` in C and
471 * Objective-C, and `simd::sinh` in C++. */
472static inline SIMD_CFUNC simd_float3 __tg_sinh(simd_float3 x);
473/*! @abstract Do not call this function; instead use `sinh` in C and
474 * Objective-C, and `simd::sinh` in C++. */
475static inline SIMD_CFUNC simd_float4 __tg_sinh(simd_float4 x);
476/*! @abstract Do not call this function; instead use `sinh` in C and
477 * Objective-C, and `simd::sinh` in C++. */
478static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x);
479/*! @abstract Do not call this function; instead use `sinh` in C and
480 * Objective-C, and `simd::sinh` in C++. */
481static inline SIMD_CFUNC simd_float16 __tg_sinh(simd_float16 x);
482/*! @abstract Do not call this function; instead use `sinh` in C and
483 * Objective-C, and `simd::sinh` in C++. */
484static inline SIMD_CFUNC simd_double2 __tg_sinh(simd_double2 x);
485/*! @abstract Do not call this function; instead use `sinh` in C and
486 * Objective-C, and `simd::sinh` in C++. */
487static inline SIMD_CFUNC simd_double3 __tg_sinh(simd_double3 x);
488/*! @abstract Do not call this function; instead use `sinh` in C and
489 * Objective-C, and `simd::sinh` in C++. */
490static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x);
491/*! @abstract Do not call this function; instead use `sinh` in C and
492 * Objective-C, and `simd::sinh` in C++. */
493static inline SIMD_CFUNC simd_double8 __tg_sinh(simd_double8 x);
494
495/*! @abstract Do not call this function; instead use `tanh` in C and
496 * Objective-C, and `simd::tanh` in C++. */
497static inline SIMD_CFUNC simd_float2 __tg_tanh(simd_float2 x);
498/*! @abstract Do not call this function; instead use `tanh` in C and
499 * Objective-C, and `simd::tanh` in C++. */
500static inline SIMD_CFUNC simd_float3 __tg_tanh(simd_float3 x);
501/*! @abstract Do not call this function; instead use `tanh` in C and
502 * Objective-C, and `simd::tanh` in C++. */
503static inline SIMD_CFUNC simd_float4 __tg_tanh(simd_float4 x);
504/*! @abstract Do not call this function; instead use `tanh` in C and
505 * Objective-C, and `simd::tanh` in C++. */
506static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x);
507/*! @abstract Do not call this function; instead use `tanh` in C and
508 * Objective-C, and `simd::tanh` in C++. */
509static inline SIMD_CFUNC simd_float16 __tg_tanh(simd_float16 x);
510/*! @abstract Do not call this function; instead use `tanh` in C and
511 * Objective-C, and `simd::tanh` in C++. */
512static inline SIMD_CFUNC simd_double2 __tg_tanh(simd_double2 x);
513/*! @abstract Do not call this function; instead use `tanh` in C and
514 * Objective-C, and `simd::tanh` in C++. */
515static inline SIMD_CFUNC simd_double3 __tg_tanh(simd_double3 x);
516/*! @abstract Do not call this function; instead use `tanh` in C and
517 * Objective-C, and `simd::tanh` in C++. */
518static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x);
519/*! @abstract Do not call this function; instead use `tanh` in C and
520 * Objective-C, and `simd::tanh` in C++. */
521static inline SIMD_CFUNC simd_double8 __tg_tanh(simd_double8 x);
522
523/*! @abstract Do not call this function; instead use `exp` in C and
524 * Objective-C, and `simd::exp` in C++. */
525static inline SIMD_CFUNC simd_float2 __tg_exp(simd_float2 x);
526/*! @abstract Do not call this function; instead use `exp` in C and
527 * Objective-C, and `simd::exp` in C++. */
528static inline SIMD_CFUNC simd_float3 __tg_exp(simd_float3 x);
529/*! @abstract Do not call this function; instead use `exp` in C and
530 * Objective-C, and `simd::exp` in C++. */
531static inline SIMD_CFUNC simd_float4 __tg_exp(simd_float4 x);
532/*! @abstract Do not call this function; instead use `exp` in C and
533 * Objective-C, and `simd::exp` in C++. */
534static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x);
535/*! @abstract Do not call this function; instead use `exp` in C and
536 * Objective-C, and `simd::exp` in C++. */
537static inline SIMD_CFUNC simd_float16 __tg_exp(simd_float16 x);
538/*! @abstract Do not call this function; instead use `exp` in C and
539 * Objective-C, and `simd::exp` in C++. */
540static inline SIMD_CFUNC simd_double2 __tg_exp(simd_double2 x);
541/*! @abstract Do not call this function; instead use `exp` in C and
542 * Objective-C, and `simd::exp` in C++. */
543static inline SIMD_CFUNC simd_double3 __tg_exp(simd_double3 x);
544/*! @abstract Do not call this function; instead use `exp` in C and
545 * Objective-C, and `simd::exp` in C++. */
546static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x);
547/*! @abstract Do not call this function; instead use `exp` in C and
548 * Objective-C, and `simd::exp` in C++. */
549static inline SIMD_CFUNC simd_double8 __tg_exp(simd_double8 x);
550
551/*! @abstract Do not call this function; instead use `exp2` in C and
552 * Objective-C, and `simd::exp2` in C++. */
553static inline SIMD_CFUNC simd_float2 __tg_exp2(simd_float2 x);
554/*! @abstract Do not call this function; instead use `exp2` in C and
555 * Objective-C, and `simd::exp2` in C++. */
556static inline SIMD_CFUNC simd_float3 __tg_exp2(simd_float3 x);
557/*! @abstract Do not call this function; instead use `exp2` in C and
558 * Objective-C, and `simd::exp2` in C++. */
559static inline SIMD_CFUNC simd_float4 __tg_exp2(simd_float4 x);
560/*! @abstract Do not call this function; instead use `exp2` in C and
561 * Objective-C, and `simd::exp2` in C++. */
562static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x);
563/*! @abstract Do not call this function; instead use `exp2` in C and
564 * Objective-C, and `simd::exp2` in C++. */
565static inline SIMD_CFUNC simd_float16 __tg_exp2(simd_float16 x);
566/*! @abstract Do not call this function; instead use `exp2` in C and
567 * Objective-C, and `simd::exp2` in C++. */
568static inline SIMD_CFUNC simd_double2 __tg_exp2(simd_double2 x);
569/*! @abstract Do not call this function; instead use `exp2` in C and
570 * Objective-C, and `simd::exp2` in C++. */
571static inline SIMD_CFUNC simd_double3 __tg_exp2(simd_double3 x);
572/*! @abstract Do not call this function; instead use `exp2` in C and
573 * Objective-C, and `simd::exp2` in C++. */
574static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x);
575/*! @abstract Do not call this function; instead use `exp2` in C and
576 * Objective-C, and `simd::exp2` in C++. */
577static inline SIMD_CFUNC simd_double8 __tg_exp2(simd_double8 x);
578
579#if SIMD_LIBRARY_VERSION >= 1
580/*! @abstract Do not call this function; instead use `exp10` in C and
581 * Objective-C, and `simd::exp10` in C++. */
582static inline SIMD_CFUNC simd_float2 __tg_exp10(simd_float2 x);
583/*! @abstract Do not call this function; instead use `exp10` in C and
584 * Objective-C, and `simd::exp10` in C++. */
585static inline SIMD_CFUNC simd_float3 __tg_exp10(simd_float3 x);
586/*! @abstract Do not call this function; instead use `exp10` in C and
587 * Objective-C, and `simd::exp10` in C++. */
588static inline SIMD_CFUNC simd_float4 __tg_exp10(simd_float4 x);
589/*! @abstract Do not call this function; instead use `exp10` in C and
590 * Objective-C, and `simd::exp10` in C++. */
591static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x);
592/*! @abstract Do not call this function; instead use `exp10` in C and
593 * Objective-C, and `simd::exp10` in C++. */
594static inline SIMD_CFUNC simd_float16 __tg_exp10(simd_float16 x);
595/*! @abstract Do not call this function; instead use `exp10` in C and
596 * Objective-C, and `simd::exp10` in C++. */
597static inline SIMD_CFUNC simd_double2 __tg_exp10(simd_double2 x);
598/*! @abstract Do not call this function; instead use `exp10` in C and
599 * Objective-C, and `simd::exp10` in C++. */
600static inline SIMD_CFUNC simd_double3 __tg_exp10(simd_double3 x);
601/*! @abstract Do not call this function; instead use `exp10` in C and
602 * Objective-C, and `simd::exp10` in C++. */
603static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x);
604/*! @abstract Do not call this function; instead use `exp10` in C and
605 * Objective-C, and `simd::exp10` in C++. */
606static inline SIMD_CFUNC simd_double8 __tg_exp10(simd_double8 x);
607#endif
608
609/*! @abstract Do not call this function; instead use `expm1` in C and
610 * Objective-C, and `simd::expm1` in C++. */
611static inline SIMD_CFUNC simd_float2 __tg_expm1(simd_float2 x);
612/*! @abstract Do not call this function; instead use `expm1` in C and
613 * Objective-C, and `simd::expm1` in C++. */
614static inline SIMD_CFUNC simd_float3 __tg_expm1(simd_float3 x);
615/*! @abstract Do not call this function; instead use `expm1` in C and
616 * Objective-C, and `simd::expm1` in C++. */
617static inline SIMD_CFUNC simd_float4 __tg_expm1(simd_float4 x);
618/*! @abstract Do not call this function; instead use `expm1` in C and
619 * Objective-C, and `simd::expm1` in C++. */
620static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x);
621/*! @abstract Do not call this function; instead use `expm1` in C and
622 * Objective-C, and `simd::expm1` in C++. */
623static inline SIMD_CFUNC simd_float16 __tg_expm1(simd_float16 x);
624/*! @abstract Do not call this function; instead use `expm1` in C and
625 * Objective-C, and `simd::expm1` in C++. */
626static inline SIMD_CFUNC simd_double2 __tg_expm1(simd_double2 x);
627/*! @abstract Do not call this function; instead use `expm1` in C and
628 * Objective-C, and `simd::expm1` in C++. */
629static inline SIMD_CFUNC simd_double3 __tg_expm1(simd_double3 x);
630/*! @abstract Do not call this function; instead use `expm1` in C and
631 * Objective-C, and `simd::expm1` in C++. */
632static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x);
633/*! @abstract Do not call this function; instead use `expm1` in C and
634 * Objective-C, and `simd::expm1` in C++. */
635static inline SIMD_CFUNC simd_double8 __tg_expm1(simd_double8 x);
636
637/*! @abstract Do not call this function; instead use `log` in C and
638 * Objective-C, and `simd::log` in C++. */
639static inline SIMD_CFUNC simd_float2 __tg_log(simd_float2 x);
640/*! @abstract Do not call this function; instead use `log` in C and
641 * Objective-C, and `simd::log` in C++. */
642static inline SIMD_CFUNC simd_float3 __tg_log(simd_float3 x);
643/*! @abstract Do not call this function; instead use `log` in C and
644 * Objective-C, and `simd::log` in C++. */
645static inline SIMD_CFUNC simd_float4 __tg_log(simd_float4 x);
646/*! @abstract Do not call this function; instead use `log` in C and
647 * Objective-C, and `simd::log` in C++. */
648static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x);
649/*! @abstract Do not call this function; instead use `log` in C and
650 * Objective-C, and `simd::log` in C++. */
651static inline SIMD_CFUNC simd_float16 __tg_log(simd_float16 x);
652/*! @abstract Do not call this function; instead use `log` in C and
653 * Objective-C, and `simd::log` in C++. */
654static inline SIMD_CFUNC simd_double2 __tg_log(simd_double2 x);
655/*! @abstract Do not call this function; instead use `log` in C and
656 * Objective-C, and `simd::log` in C++. */
657static inline SIMD_CFUNC simd_double3 __tg_log(simd_double3 x);
658/*! @abstract Do not call this function; instead use `log` in C and
659 * Objective-C, and `simd::log` in C++. */
660static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x);
661/*! @abstract Do not call this function; instead use `log` in C and
662 * Objective-C, and `simd::log` in C++. */
663static inline SIMD_CFUNC simd_double8 __tg_log(simd_double8 x);
664
665/*! @abstract Do not call this function; instead use `log2` in C and
666 * Objective-C, and `simd::log2` in C++. */
667static inline SIMD_CFUNC simd_float2 __tg_log2(simd_float2 x);
668/*! @abstract Do not call this function; instead use `log2` in C and
669 * Objective-C, and `simd::log2` in C++. */
670static inline SIMD_CFUNC simd_float3 __tg_log2(simd_float3 x);
671/*! @abstract Do not call this function; instead use `log2` in C and
672 * Objective-C, and `simd::log2` in C++. */
673static inline SIMD_CFUNC simd_float4 __tg_log2(simd_float4 x);
674/*! @abstract Do not call this function; instead use `log2` in C and
675 * Objective-C, and `simd::log2` in C++. */
676static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x);
677/*! @abstract Do not call this function; instead use `log2` in C and
678 * Objective-C, and `simd::log2` in C++. */
679static inline SIMD_CFUNC simd_float16 __tg_log2(simd_float16 x);
680/*! @abstract Do not call this function; instead use `log2` in C and
681 * Objective-C, and `simd::log2` in C++. */
682static inline SIMD_CFUNC simd_double2 __tg_log2(simd_double2 x);
683/*! @abstract Do not call this function; instead use `log2` in C and
684 * Objective-C, and `simd::log2` in C++. */
685static inline SIMD_CFUNC simd_double3 __tg_log2(simd_double3 x);
686/*! @abstract Do not call this function; instead use `log2` in C and
687 * Objective-C, and `simd::log2` in C++. */
688static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x);
689/*! @abstract Do not call this function; instead use `log2` in C and
690 * Objective-C, and `simd::log2` in C++. */
691static inline SIMD_CFUNC simd_double8 __tg_log2(simd_double8 x);
692
693/*! @abstract Do not call this function; instead use `log10` in C and
694 * Objective-C, and `simd::log10` in C++. */
695static inline SIMD_CFUNC simd_float2 __tg_log10(simd_float2 x);
696/*! @abstract Do not call this function; instead use `log10` in C and
697 * Objective-C, and `simd::log10` in C++. */
698static inline SIMD_CFUNC simd_float3 __tg_log10(simd_float3 x);
699/*! @abstract Do not call this function; instead use `log10` in C and
700 * Objective-C, and `simd::log10` in C++. */
701static inline SIMD_CFUNC simd_float4 __tg_log10(simd_float4 x);
702/*! @abstract Do not call this function; instead use `log10` in C and
703 * Objective-C, and `simd::log10` in C++. */
704static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x);
705/*! @abstract Do not call this function; instead use `log10` in C and
706 * Objective-C, and `simd::log10` in C++. */
707static inline SIMD_CFUNC simd_float16 __tg_log10(simd_float16 x);
708/*! @abstract Do not call this function; instead use `log10` in C and
709 * Objective-C, and `simd::log10` in C++. */
710static inline SIMD_CFUNC simd_double2 __tg_log10(simd_double2 x);
711/*! @abstract Do not call this function; instead use `log10` in C and
712 * Objective-C, and `simd::log10` in C++. */
713static inline SIMD_CFUNC simd_double3 __tg_log10(simd_double3 x);
714/*! @abstract Do not call this function; instead use `log10` in C and
715 * Objective-C, and `simd::log10` in C++. */
716static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x);
717/*! @abstract Do not call this function; instead use `log10` in C and
718 * Objective-C, and `simd::log10` in C++. */
719static inline SIMD_CFUNC simd_double8 __tg_log10(simd_double8 x);
720
721/*! @abstract Do not call this function; instead use `log1p` in C and
722 * Objective-C, and `simd::log1p` in C++. */
723static inline SIMD_CFUNC simd_float2 __tg_log1p(simd_float2 x);
724/*! @abstract Do not call this function; instead use `log1p` in C and
725 * Objective-C, and `simd::log1p` in C++. */
726static inline SIMD_CFUNC simd_float3 __tg_log1p(simd_float3 x);
727/*! @abstract Do not call this function; instead use `log1p` in C and
728 * Objective-C, and `simd::log1p` in C++. */
729static inline SIMD_CFUNC simd_float4 __tg_log1p(simd_float4 x);
730/*! @abstract Do not call this function; instead use `log1p` in C and
731 * Objective-C, and `simd::log1p` in C++. */
732static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x);
733/*! @abstract Do not call this function; instead use `log1p` in C and
734 * Objective-C, and `simd::log1p` in C++. */
735static inline SIMD_CFUNC simd_float16 __tg_log1p(simd_float16 x);
736/*! @abstract Do not call this function; instead use `log1p` in C and
737 * Objective-C, and `simd::log1p` in C++. */
738static inline SIMD_CFUNC simd_double2 __tg_log1p(simd_double2 x);
739/*! @abstract Do not call this function; instead use `log1p` in C and
740 * Objective-C, and `simd::log1p` in C++. */
741static inline SIMD_CFUNC simd_double3 __tg_log1p(simd_double3 x);
742/*! @abstract Do not call this function; instead use `log1p` in C and
743 * Objective-C, and `simd::log1p` in C++. */
744static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x);
745/*! @abstract Do not call this function; instead use `log1p` in C and
746 * Objective-C, and `simd::log1p` in C++. */
747static inline SIMD_CFUNC simd_double8 __tg_log1p(simd_double8 x);
748
749/*! @abstract Do not call this function; instead use `fabs` in C and
750 * Objective-C, and `simd::fabs` in C++. */
751static inline SIMD_CFUNC simd_float2 __tg_fabs(simd_float2 x);
752/*! @abstract Do not call this function; instead use `fabs` in C and
753 * Objective-C, and `simd::fabs` in C++. */
754static inline SIMD_CFUNC simd_float3 __tg_fabs(simd_float3 x);
755/*! @abstract Do not call this function; instead use `fabs` in C and
756 * Objective-C, and `simd::fabs` in C++. */
757static inline SIMD_CFUNC simd_float4 __tg_fabs(simd_float4 x);
758/*! @abstract Do not call this function; instead use `fabs` in C and
759 * Objective-C, and `simd::fabs` in C++. */
760static inline SIMD_CFUNC simd_float8 __tg_fabs(simd_float8 x);
761/*! @abstract Do not call this function; instead use `fabs` in C and
762 * Objective-C, and `simd::fabs` in C++. */
763static inline SIMD_CFUNC simd_float16 __tg_fabs(simd_float16 x);
764/*! @abstract Do not call this function; instead use `fabs` in C and
765 * Objective-C, and `simd::fabs` in C++. */
766static inline SIMD_CFUNC simd_double2 __tg_fabs(simd_double2 x);
767/*! @abstract Do not call this function; instead use `fabs` in C and
768 * Objective-C, and `simd::fabs` in C++. */
769static inline SIMD_CFUNC simd_double3 __tg_fabs(simd_double3 x);
770/*! @abstract Do not call this function; instead use `fabs` in C and
771 * Objective-C, and `simd::fabs` in C++. */
772static inline SIMD_CFUNC simd_double4 __tg_fabs(simd_double4 x);
773/*! @abstract Do not call this function; instead use `fabs` in C and
774 * Objective-C, and `simd::fabs` in C++. */
775static inline SIMD_CFUNC simd_double8 __tg_fabs(simd_double8 x);
776
777/*! @abstract Do not call this function; instead use `cbrt` in C and
778 * Objective-C, and `simd::cbrt` in C++. */
779static inline SIMD_CFUNC simd_float2 __tg_cbrt(simd_float2 x);
780/*! @abstract Do not call this function; instead use `cbrt` in C and
781 * Objective-C, and `simd::cbrt` in C++. */
782static inline SIMD_CFUNC simd_float3 __tg_cbrt(simd_float3 x);
783/*! @abstract Do not call this function; instead use `cbrt` in C and
784 * Objective-C, and `simd::cbrt` in C++. */
785static inline SIMD_CFUNC simd_float4 __tg_cbrt(simd_float4 x);
786/*! @abstract Do not call this function; instead use `cbrt` in C and
787 * Objective-C, and `simd::cbrt` in C++. */
788static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x);
789/*! @abstract Do not call this function; instead use `cbrt` in C and
790 * Objective-C, and `simd::cbrt` in C++. */
791static inline SIMD_CFUNC simd_float16 __tg_cbrt(simd_float16 x);
792/*! @abstract Do not call this function; instead use `cbrt` in C and
793 * Objective-C, and `simd::cbrt` in C++. */
794static inline SIMD_CFUNC simd_double2 __tg_cbrt(simd_double2 x);
795/*! @abstract Do not call this function; instead use `cbrt` in C and
796 * Objective-C, and `simd::cbrt` in C++. */
797static inline SIMD_CFUNC simd_double3 __tg_cbrt(simd_double3 x);
798/*! @abstract Do not call this function; instead use `cbrt` in C and
799 * Objective-C, and `simd::cbrt` in C++. */
800static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x);
801/*! @abstract Do not call this function; instead use `cbrt` in C and
802 * Objective-C, and `simd::cbrt` in C++. */
803static inline SIMD_CFUNC simd_double8 __tg_cbrt(simd_double8 x);
804
805/*! @abstract Do not call this function; instead use `sqrt` in C and
806 * Objective-C, and `simd::sqrt` in C++. */
807static inline SIMD_CFUNC simd_float2 __tg_sqrt(simd_float2 x);
808/*! @abstract Do not call this function; instead use `sqrt` in C and
809 * Objective-C, and `simd::sqrt` in C++. */
810static inline SIMD_CFUNC simd_float3 __tg_sqrt(simd_float3 x);
811/*! @abstract Do not call this function; instead use `sqrt` in C and
812 * Objective-C, and `simd::sqrt` in C++. */
813static inline SIMD_CFUNC simd_float4 __tg_sqrt(simd_float4 x);
814/*! @abstract Do not call this function; instead use `sqrt` in C and
815 * Objective-C, and `simd::sqrt` in C++. */
816static inline SIMD_CFUNC simd_float8 __tg_sqrt(simd_float8 x);
817/*! @abstract Do not call this function; instead use `sqrt` in C and
818 * Objective-C, and `simd::sqrt` in C++. */
819static inline SIMD_CFUNC simd_float16 __tg_sqrt(simd_float16 x);
820/*! @abstract Do not call this function; instead use `sqrt` in C and
821 * Objective-C, and `simd::sqrt` in C++. */
822static inline SIMD_CFUNC simd_double2 __tg_sqrt(simd_double2 x);
823/*! @abstract Do not call this function; instead use `sqrt` in C and
824 * Objective-C, and `simd::sqrt` in C++. */
825static inline SIMD_CFUNC simd_double3 __tg_sqrt(simd_double3 x);
826/*! @abstract Do not call this function; instead use `sqrt` in C and
827 * Objective-C, and `simd::sqrt` in C++. */
828static inline SIMD_CFUNC simd_double4 __tg_sqrt(simd_double4 x);
829/*! @abstract Do not call this function; instead use `sqrt` in C and
830 * Objective-C, and `simd::sqrt` in C++. */
831static inline SIMD_CFUNC simd_double8 __tg_sqrt(simd_double8 x);
832
833/*! @abstract Do not call this function; instead use `erf` in C and
834 * Objective-C, and `simd::erf` in C++. */
835static inline SIMD_CFUNC simd_float2 __tg_erf(simd_float2 x);
836/*! @abstract Do not call this function; instead use `erf` in C and
837 * Objective-C, and `simd::erf` in C++. */
838static inline SIMD_CFUNC simd_float3 __tg_erf(simd_float3 x);
839/*! @abstract Do not call this function; instead use `erf` in C and
840 * Objective-C, and `simd::erf` in C++. */
841static inline SIMD_CFUNC simd_float4 __tg_erf(simd_float4 x);
842/*! @abstract Do not call this function; instead use `erf` in C and
843 * Objective-C, and `simd::erf` in C++. */
844static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x);
845/*! @abstract Do not call this function; instead use `erf` in C and
846 * Objective-C, and `simd::erf` in C++. */
847static inline SIMD_CFUNC simd_float16 __tg_erf(simd_float16 x);
848/*! @abstract Do not call this function; instead use `erf` in C and
849 * Objective-C, and `simd::erf` in C++. */
850static inline SIMD_CFUNC simd_double2 __tg_erf(simd_double2 x);
851/*! @abstract Do not call this function; instead use `erf` in C and
852 * Objective-C, and `simd::erf` in C++. */
853static inline SIMD_CFUNC simd_double3 __tg_erf(simd_double3 x);
854/*! @abstract Do not call this function; instead use `erf` in C and
855 * Objective-C, and `simd::erf` in C++. */
856static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x);
857/*! @abstract Do not call this function; instead use `erf` in C and
858 * Objective-C, and `simd::erf` in C++. */
859static inline SIMD_CFUNC simd_double8 __tg_erf(simd_double8 x);
860
861/*! @abstract Do not call this function; instead use `erfc` in C and
862 * Objective-C, and `simd::erfc` in C++. */
863static inline SIMD_CFUNC simd_float2 __tg_erfc(simd_float2 x);
864/*! @abstract Do not call this function; instead use `erfc` in C and
865 * Objective-C, and `simd::erfc` in C++. */
866static inline SIMD_CFUNC simd_float3 __tg_erfc(simd_float3 x);
867/*! @abstract Do not call this function; instead use `erfc` in C and
868 * Objective-C, and `simd::erfc` in C++. */
869static inline SIMD_CFUNC simd_float4 __tg_erfc(simd_float4 x);
870/*! @abstract Do not call this function; instead use `erfc` in C and
871 * Objective-C, and `simd::erfc` in C++. */
872static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x);
873/*! @abstract Do not call this function; instead use `erfc` in C and
874 * Objective-C, and `simd::erfc` in C++. */
875static inline SIMD_CFUNC simd_float16 __tg_erfc(simd_float16 x);
876/*! @abstract Do not call this function; instead use `erfc` in C and
877 * Objective-C, and `simd::erfc` in C++. */
878static inline SIMD_CFUNC simd_double2 __tg_erfc(simd_double2 x);
879/*! @abstract Do not call this function; instead use `erfc` in C and
880 * Objective-C, and `simd::erfc` in C++. */
881static inline SIMD_CFUNC simd_double3 __tg_erfc(simd_double3 x);
882/*! @abstract Do not call this function; instead use `erfc` in C and
883 * Objective-C, and `simd::erfc` in C++. */
884static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x);
885/*! @abstract Do not call this function; instead use `erfc` in C and
886 * Objective-C, and `simd::erfc` in C++. */
887static inline SIMD_CFUNC simd_double8 __tg_erfc(simd_double8 x);
888
889/*! @abstract Do not call this function; instead use `tgamma` in C and
890 * Objective-C, and `simd::tgamma` in C++. */
891static inline SIMD_CFUNC simd_float2 __tg_tgamma(simd_float2 x);
892/*! @abstract Do not call this function; instead use `tgamma` in C and
893 * Objective-C, and `simd::tgamma` in C++. */
894static inline SIMD_CFUNC simd_float3 __tg_tgamma(simd_float3 x);
895/*! @abstract Do not call this function; instead use `tgamma` in C and
896 * Objective-C, and `simd::tgamma` in C++. */
897static inline SIMD_CFUNC simd_float4 __tg_tgamma(simd_float4 x);
898/*! @abstract Do not call this function; instead use `tgamma` in C and
899 * Objective-C, and `simd::tgamma` in C++. */
900static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x);
901/*! @abstract Do not call this function; instead use `tgamma` in C and
902 * Objective-C, and `simd::tgamma` in C++. */
903static inline SIMD_CFUNC simd_float16 __tg_tgamma(simd_float16 x);
904/*! @abstract Do not call this function; instead use `tgamma` in C and
905 * Objective-C, and `simd::tgamma` in C++. */
906static inline SIMD_CFUNC simd_double2 __tg_tgamma(simd_double2 x);
907/*! @abstract Do not call this function; instead use `tgamma` in C and
908 * Objective-C, and `simd::tgamma` in C++. */
909static inline SIMD_CFUNC simd_double3 __tg_tgamma(simd_double3 x);
910/*! @abstract Do not call this function; instead use `tgamma` in C and
911 * Objective-C, and `simd::tgamma` in C++. */
912static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x);
913/*! @abstract Do not call this function; instead use `tgamma` in C and
914 * Objective-C, and `simd::tgamma` in C++. */
915static inline SIMD_CFUNC simd_double8 __tg_tgamma(simd_double8 x);
916
917/*! @abstract Do not call this function; instead use `lgamma` in C and
918 * Objective-C, and `simd::lgamma` in C++. */
919static inline SIMD_CFUNC simd_float2 __tg_lgamma(simd_float2 x);
920/*! @abstract Do not call this function; instead use `lgamma` in C and
921 * Objective-C, and `simd::lgamma` in C++. */
922static inline SIMD_CFUNC simd_float3 __tg_lgamma(simd_float3 x);
923/*! @abstract Do not call this function; instead use `lgamma` in C and
924 * Objective-C, and `simd::lgamma` in C++. */
925static inline SIMD_CFUNC simd_float4 __tg_lgamma(simd_float4 x);
926/*! @abstract Do not call this function; instead use `lgamma` in C and
927 * Objective-C, and `simd::lgamma` in C++. */
928static inline SIMD_CFUNC simd_float8 __tg_lgamma(simd_float8 x);
929/*! @abstract Do not call this function; instead use `lgamma` in C and
930 * Objective-C, and `simd::lgamma` in C++. */
931static inline SIMD_CFUNC simd_float16 __tg_lgamma(simd_float16 x);
932/*! @abstract Do not call this function; instead use `lgamma` in C and
933 * Objective-C, and `simd::lgamma` in C++. */
934static inline SIMD_CFUNC simd_double2 __tg_lgamma(simd_double2 x);
935/*! @abstract Do not call this function; instead use `lgamma` in C and
936 * Objective-C, and `simd::lgamma` in C++. */
937static inline SIMD_CFUNC simd_double3 __tg_lgamma(simd_double3 x);
938/*! @abstract Do not call this function; instead use `lgamma` in C and
939 * Objective-C, and `simd::lgamma` in C++. */
940static inline SIMD_CFUNC simd_double4 __tg_lgamma(simd_double4 x);
941/*! @abstract Do not call this function; instead use `lgamma` in C and
942 * Objective-C, and `simd::lgamma` in C++. */
943static inline SIMD_CFUNC simd_double8 __tg_lgamma(simd_double8 x);
944
945/*! @abstract Do not call this function; instead use `ceil` in C and
946 * Objective-C, and `simd::ceil` in C++. */
947static inline SIMD_CFUNC simd_float2 __tg_ceil(simd_float2 x);
948/*! @abstract Do not call this function; instead use `ceil` in C and
949 * Objective-C, and `simd::ceil` in C++. */
950static inline SIMD_CFUNC simd_float3 __tg_ceil(simd_float3 x);
951/*! @abstract Do not call this function; instead use `ceil` in C and
952 * Objective-C, and `simd::ceil` in C++. */
953static inline SIMD_CFUNC simd_float4 __tg_ceil(simd_float4 x);
954/*! @abstract Do not call this function; instead use `ceil` in C and
955 * Objective-C, and `simd::ceil` in C++. */
956static inline SIMD_CFUNC simd_float8 __tg_ceil(simd_float8 x);
957/*! @abstract Do not call this function; instead use `ceil` in C and
958 * Objective-C, and `simd::ceil` in C++. */
959static inline SIMD_CFUNC simd_float16 __tg_ceil(simd_float16 x);
960/*! @abstract Do not call this function; instead use `ceil` in C and
961 * Objective-C, and `simd::ceil` in C++. */
962static inline SIMD_CFUNC simd_double2 __tg_ceil(simd_double2 x);
963/*! @abstract Do not call this function; instead use `ceil` in C and
964 * Objective-C, and `simd::ceil` in C++. */
965static inline SIMD_CFUNC simd_double3 __tg_ceil(simd_double3 x);
966/*! @abstract Do not call this function; instead use `ceil` in C and
967 * Objective-C, and `simd::ceil` in C++. */
968static inline SIMD_CFUNC simd_double4 __tg_ceil(simd_double4 x);
969/*! @abstract Do not call this function; instead use `ceil` in C and
970 * Objective-C, and `simd::ceil` in C++. */
971static inline SIMD_CFUNC simd_double8 __tg_ceil(simd_double8 x);
972
973/*! @abstract Do not call this function; instead use `floor` in C and
974 * Objective-C, and `simd::floor` in C++. */
975static inline SIMD_CFUNC simd_float2 __tg_floor(simd_float2 x);
976/*! @abstract Do not call this function; instead use `floor` in C and
977 * Objective-C, and `simd::floor` in C++. */
978static inline SIMD_CFUNC simd_float3 __tg_floor(simd_float3 x);
979/*! @abstract Do not call this function; instead use `floor` in C and
980 * Objective-C, and `simd::floor` in C++. */
981static inline SIMD_CFUNC simd_float4 __tg_floor(simd_float4 x);
982/*! @abstract Do not call this function; instead use `floor` in C and
983 * Objective-C, and `simd::floor` in C++. */
984static inline SIMD_CFUNC simd_float8 __tg_floor(simd_float8 x);
985/*! @abstract Do not call this function; instead use `floor` in C and
986 * Objective-C, and `simd::floor` in C++. */
987static inline SIMD_CFUNC simd_float16 __tg_floor(simd_float16 x);
988/*! @abstract Do not call this function; instead use `floor` in C and
989 * Objective-C, and `simd::floor` in C++. */
990static inline SIMD_CFUNC simd_double2 __tg_floor(simd_double2 x);
991/*! @abstract Do not call this function; instead use `floor` in C and
992 * Objective-C, and `simd::floor` in C++. */
993static inline SIMD_CFUNC simd_double3 __tg_floor(simd_double3 x);
994/*! @abstract Do not call this function; instead use `floor` in C and
995 * Objective-C, and `simd::floor` in C++. */
996static inline SIMD_CFUNC simd_double4 __tg_floor(simd_double4 x);
997/*! @abstract Do not call this function; instead use `floor` in C and
998 * Objective-C, and `simd::floor` in C++. */
999static inline SIMD_CFUNC simd_double8 __tg_floor(simd_double8 x);
1000
1001/*! @abstract Do not call this function; instead use `rint` in C and
1002 * Objective-C, and `simd::rint` in C++. */
1003static inline SIMD_CFUNC simd_float2 __tg_rint(simd_float2 x);
1004/*! @abstract Do not call this function; instead use `rint` in C and
1005 * Objective-C, and `simd::rint` in C++. */
1006static inline SIMD_CFUNC simd_float3 __tg_rint(simd_float3 x);
1007/*! @abstract Do not call this function; instead use `rint` in C and
1008 * Objective-C, and `simd::rint` in C++. */
1009static inline SIMD_CFUNC simd_float4 __tg_rint(simd_float4 x);
1010/*! @abstract Do not call this function; instead use `rint` in C and
1011 * Objective-C, and `simd::rint` in C++. */
1012static inline SIMD_CFUNC simd_float8 __tg_rint(simd_float8 x);
1013/*! @abstract Do not call this function; instead use `rint` in C and
1014 * Objective-C, and `simd::rint` in C++. */
1015static inline SIMD_CFUNC simd_float16 __tg_rint(simd_float16 x);
1016/*! @abstract Do not call this function; instead use `rint` in C and
1017 * Objective-C, and `simd::rint` in C++. */
1018static inline SIMD_CFUNC simd_double2 __tg_rint(simd_double2 x);
1019/*! @abstract Do not call this function; instead use `rint` in C and
1020 * Objective-C, and `simd::rint` in C++. */
1021static inline SIMD_CFUNC simd_double3 __tg_rint(simd_double3 x);
1022/*! @abstract Do not call this function; instead use `rint` in C and
1023 * Objective-C, and `simd::rint` in C++. */
1024static inline SIMD_CFUNC simd_double4 __tg_rint(simd_double4 x);
1025/*! @abstract Do not call this function; instead use `rint` in C and
1026 * Objective-C, and `simd::rint` in C++. */
1027static inline SIMD_CFUNC simd_double8 __tg_rint(simd_double8 x);
1028
1029/*! @abstract Do not call this function; instead use `round` in C and
1030 * Objective-C, and `simd::round` in C++. */
1031static inline SIMD_CFUNC simd_float2 __tg_round(simd_float2 x);
1032/*! @abstract Do not call this function; instead use `round` in C and
1033 * Objective-C, and `simd::round` in C++. */
1034static inline SIMD_CFUNC simd_float3 __tg_round(simd_float3 x);
1035/*! @abstract Do not call this function; instead use `round` in C and
1036 * Objective-C, and `simd::round` in C++. */
1037static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x);
1038/*! @abstract Do not call this function; instead use `round` in C and
1039 * Objective-C, and `simd::round` in C++. */
1040static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x);
1041/*! @abstract Do not call this function; instead use `round` in C and
1042 * Objective-C, and `simd::round` in C++. */
1043static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x);
1044/*! @abstract Do not call this function; instead use `round` in C and
1045 * Objective-C, and `simd::round` in C++. */
1046static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x);
1047/*! @abstract Do not call this function; instead use `round` in C and
1048 * Objective-C, and `simd::round` in C++. */
1049static inline SIMD_CFUNC simd_double3 __tg_round(simd_double3 x);
1050/*! @abstract Do not call this function; instead use `round` in C and
1051 * Objective-C, and `simd::round` in C++. */
1052static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x);
1053/*! @abstract Do not call this function; instead use `round` in C and
1054 * Objective-C, and `simd::round` in C++. */
1055static inline SIMD_CFUNC simd_double8 __tg_round(simd_double8 x);
1056
1057/*! @abstract Do not call this function; instead use `trunc` in C and
1058 * Objective-C, and `simd::trunc` in C++. */
1059static inline SIMD_CFUNC simd_float2 __tg_trunc(simd_float2 x);
1060/*! @abstract Do not call this function; instead use `trunc` in C and
1061 * Objective-C, and `simd::trunc` in C++. */
1062static inline SIMD_CFUNC simd_float3 __tg_trunc(simd_float3 x);
1063/*! @abstract Do not call this function; instead use `trunc` in C and
1064 * Objective-C, and `simd::trunc` in C++. */
1065static inline SIMD_CFUNC simd_float4 __tg_trunc(simd_float4 x);
1066/*! @abstract Do not call this function; instead use `trunc` in C and
1067 * Objective-C, and `simd::trunc` in C++. */
1068static inline SIMD_CFUNC simd_float8 __tg_trunc(simd_float8 x);
1069/*! @abstract Do not call this function; instead use `trunc` in C and
1070 * Objective-C, and `simd::trunc` in C++. */
1071static inline SIMD_CFUNC simd_float16 __tg_trunc(simd_float16 x);
1072/*! @abstract Do not call this function; instead use `trunc` in C and
1073 * Objective-C, and `simd::trunc` in C++. */
1074static inline SIMD_CFUNC simd_double2 __tg_trunc(simd_double2 x);
1075/*! @abstract Do not call this function; instead use `trunc` in C and
1076 * Objective-C, and `simd::trunc` in C++. */
1077static inline SIMD_CFUNC simd_double3 __tg_trunc(simd_double3 x);
1078/*! @abstract Do not call this function; instead use `trunc` in C and
1079 * Objective-C, and `simd::trunc` in C++. */
1080static inline SIMD_CFUNC simd_double4 __tg_trunc(simd_double4 x);
1081/*! @abstract Do not call this function; instead use `trunc` in C and
1082 * Objective-C, and `simd::trunc` in C++. */
1083static inline SIMD_CFUNC simd_double8 __tg_trunc(simd_double8 x);
1084
1085/*! @abstract Do not call this function; instead use `isfinite` in C and
1086 * Objective-C, and `simd::isfinite` in C++. */
1087static inline SIMD_CFUNC simd_int2 __tg_isfinite(simd_float2 x);
1088/*! @abstract Do not call this function; instead use `isfinite` in C and
1089 * Objective-C, and `simd::isfinite` in C++. */
1090static inline SIMD_CFUNC simd_int3 __tg_isfinite(simd_float3 x);
1091/*! @abstract Do not call this function; instead use `isfinite` in C and
1092 * Objective-C, and `simd::isfinite` in C++. */
1093static inline SIMD_CFUNC simd_int4 __tg_isfinite(simd_float4 x);
1094/*! @abstract Do not call this function; instead use `isfinite` in C and
1095 * Objective-C, and `simd::isfinite` in C++. */
1096static inline SIMD_CFUNC simd_int8 __tg_isfinite(simd_float8 x);
1097/*! @abstract Do not call this function; instead use `isfinite` in C and
1098 * Objective-C, and `simd::isfinite` in C++. */
1099static inline SIMD_CFUNC simd_int16 __tg_isfinite(simd_float16 x);
1100/*! @abstract Do not call this function; instead use `isfinite` in C and
1101 * Objective-C, and `simd::isfinite` in C++. */
1102static inline SIMD_CFUNC simd_long2 __tg_isfinite(simd_double2 x);
1103/*! @abstract Do not call this function; instead use `isfinite` in C and
1104 * Objective-C, and `simd::isfinite` in C++. */
1105static inline SIMD_CFUNC simd_long3 __tg_isfinite(simd_double3 x);
1106/*! @abstract Do not call this function; instead use `isfinite` in C and
1107 * Objective-C, and `simd::isfinite` in C++. */
1108static inline SIMD_CFUNC simd_long4 __tg_isfinite(simd_double4 x);
1109/*! @abstract Do not call this function; instead use `isfinite` in C and
1110 * Objective-C, and `simd::isfinite` in C++. */
1111static inline SIMD_CFUNC simd_long8 __tg_isfinite(simd_double8 x);
1112
1113/*! @abstract Do not call this function; instead use `isinf` in C and
1114 * Objective-C, and `simd::isinf` in C++. */
1115static inline SIMD_CFUNC simd_int2 __tg_isinf(simd_float2 x);
1116/*! @abstract Do not call this function; instead use `isinf` in C and
1117 * Objective-C, and `simd::isinf` in C++. */
1118static inline SIMD_CFUNC simd_int3 __tg_isinf(simd_float3 x);
1119/*! @abstract Do not call this function; instead use `isinf` in C and
1120 * Objective-C, and `simd::isinf` in C++. */
1121static inline SIMD_CFUNC simd_int4 __tg_isinf(simd_float4 x);
1122/*! @abstract Do not call this function; instead use `isinf` in C and
1123 * Objective-C, and `simd::isinf` in C++. */
1124static inline SIMD_CFUNC simd_int8 __tg_isinf(simd_float8 x);
1125/*! @abstract Do not call this function; instead use `isinf` in C and
1126 * Objective-C, and `simd::isinf` in C++. */
1127static inline SIMD_CFUNC simd_int16 __tg_isinf(simd_float16 x);
1128/*! @abstract Do not call this function; instead use `isinf` in C and
1129 * Objective-C, and `simd::isinf` in C++. */
1130static inline SIMD_CFUNC simd_long2 __tg_isinf(simd_double2 x);
1131/*! @abstract Do not call this function; instead use `isinf` in C and
1132 * Objective-C, and `simd::isinf` in C++. */
1133static inline SIMD_CFUNC simd_long3 __tg_isinf(simd_double3 x);
1134/*! @abstract Do not call this function; instead use `isinf` in C and
1135 * Objective-C, and `simd::isinf` in C++. */
1136static inline SIMD_CFUNC simd_long4 __tg_isinf(simd_double4 x);
1137/*! @abstract Do not call this function; instead use `isinf` in C and
1138 * Objective-C, and `simd::isinf` in C++. */
1139static inline SIMD_CFUNC simd_long8 __tg_isinf(simd_double8 x);
1140
1141/*! @abstract Do not call this function; instead use `isnan` in C and
1142 * Objective-C, and `simd::isnan` in C++. */
1143static inline SIMD_CFUNC simd_int2 __tg_isnan(simd_float2 x);
1144/*! @abstract Do not call this function; instead use `isnan` in C and
1145 * Objective-C, and `simd::isnan` in C++. */
1146static inline SIMD_CFUNC simd_int3 __tg_isnan(simd_float3 x);
1147/*! @abstract Do not call this function; instead use `isnan` in C and
1148 * Objective-C, and `simd::isnan` in C++. */
1149static inline SIMD_CFUNC simd_int4 __tg_isnan(simd_float4 x);
1150/*! @abstract Do not call this function; instead use `isnan` in C and
1151 * Objective-C, and `simd::isnan` in C++. */
1152static inline SIMD_CFUNC simd_int8 __tg_isnan(simd_float8 x);
1153/*! @abstract Do not call this function; instead use `isnan` in C and
1154 * Objective-C, and `simd::isnan` in C++. */
1155static inline SIMD_CFUNC simd_int16 __tg_isnan(simd_float16 x);
1156/*! @abstract Do not call this function; instead use `isnan` in C and
1157 * Objective-C, and `simd::isnan` in C++. */
1158static inline SIMD_CFUNC simd_long2 __tg_isnan(simd_double2 x);
1159/*! @abstract Do not call this function; instead use `isnan` in C and
1160 * Objective-C, and `simd::isnan` in C++. */
1161static inline SIMD_CFUNC simd_long3 __tg_isnan(simd_double3 x);
1162/*! @abstract Do not call this function; instead use `isnan` in C and
1163 * Objective-C, and `simd::isnan` in C++. */
1164static inline SIMD_CFUNC simd_long4 __tg_isnan(simd_double4 x);
1165/*! @abstract Do not call this function; instead use `isnan` in C and
1166 * Objective-C, and `simd::isnan` in C++. */
1167static inline SIMD_CFUNC simd_long8 __tg_isnan(simd_double8 x);
1168
1169/*! @abstract Do not call this function; instead use `isnormal` in C and
1170 * Objective-C, and `simd::isnormal` in C++. */
1171static inline SIMD_CFUNC simd_int2 __tg_isnormal(simd_float2 x);
1172/*! @abstract Do not call this function; instead use `isnormal` in C and
1173 * Objective-C, and `simd::isnormal` in C++. */
1174static inline SIMD_CFUNC simd_int3 __tg_isnormal(simd_float3 x);
1175/*! @abstract Do not call this function; instead use `isnormal` in C and
1176 * Objective-C, and `simd::isnormal` in C++. */
1177static inline SIMD_CFUNC simd_int4 __tg_isnormal(simd_float4 x);
1178/*! @abstract Do not call this function; instead use `isnormal` in C and
1179 * Objective-C, and `simd::isnormal` in C++. */
1180static inline SIMD_CFUNC simd_int8 __tg_isnormal(simd_float8 x);
1181/*! @abstract Do not call this function; instead use `isnormal` in C and
1182 * Objective-C, and `simd::isnormal` in C++. */
1183static inline SIMD_CFUNC simd_int16 __tg_isnormal(simd_float16 x);
1184/*! @abstract Do not call this function; instead use `isnormal` in C and
1185 * Objective-C, and `simd::isnormal` in C++. */
1186static inline SIMD_CFUNC simd_long2 __tg_isnormal(simd_double2 x);
1187/*! @abstract Do not call this function; instead use `isnormal` in C and
1188 * Objective-C, and `simd::isnormal` in C++. */
1189static inline SIMD_CFUNC simd_long3 __tg_isnormal(simd_double3 x);
1190/*! @abstract Do not call this function; instead use `isnormal` in C and
1191 * Objective-C, and `simd::isnormal` in C++. */
1192static inline SIMD_CFUNC simd_long4 __tg_isnormal(simd_double4 x);
1193/*! @abstract Do not call this function; instead use `isnormal` in C and
1194 * Objective-C, and `simd::isnormal` in C++. */
1195static inline SIMD_CFUNC simd_long8 __tg_isnormal(simd_double8 x);
1196
1197
1198/*! @abstract Do not call this function; instead use `atan2` in C and
1199 * Objective-C, and `simd::atan2` in C++. */
1200static inline SIMD_CFUNC simd_float2 __tg_atan2(simd_float2 y, simd_float2 x);
1201/*! @abstract Do not call this function; instead use `atan2` in C and
1202 * Objective-C, and `simd::atan2` in C++. */
1203static inline SIMD_CFUNC simd_float3 __tg_atan2(simd_float3 y, simd_float3 x);
1204/*! @abstract Do not call this function; instead use `atan2` in C and
1205 * Objective-C, and `simd::atan2` in C++. */
1206static inline SIMD_CFUNC simd_float4 __tg_atan2(simd_float4 y, simd_float4 x);
1207/*! @abstract Do not call this function; instead use `atan2` in C and
1208 * Objective-C, and `simd::atan2` in C++. */
1209static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x);
1210/*! @abstract Do not call this function; instead use `atan2` in C and
1211 * Objective-C, and `simd::atan2` in C++. */
1212static inline SIMD_CFUNC simd_float16 __tg_atan2(simd_float16 y, simd_float16 x);
1213/*! @abstract Do not call this function; instead use `atan2` in C and
1214 * Objective-C, and `simd::atan2` in C++. */
1215static inline SIMD_CFUNC simd_double2 __tg_atan2(simd_double2 y, simd_double2 x);
1216/*! @abstract Do not call this function; instead use `atan2` in C and
1217 * Objective-C, and `simd::atan2` in C++. */
1218static inline SIMD_CFUNC simd_double3 __tg_atan2(simd_double3 y, simd_double3 x);
1219/*! @abstract Do not call this function; instead use `atan2` in C and
1220 * Objective-C, and `simd::atan2` in C++. */
1221static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x);
1222/*! @abstract Do not call this function; instead use `atan2` in C and
1223 * Objective-C, and `simd::atan2` in C++. */
1224static inline SIMD_CFUNC simd_double8 __tg_atan2(simd_double8 y, simd_double8 x);
1225
1226/*! @abstract Do not call this function; instead use `hypot` in C and
1227 * Objective-C, and `simd::hypot` in C++. */
1228static inline SIMD_CFUNC simd_float2 __tg_hypot(simd_float2 x, simd_float2 y);
1229/*! @abstract Do not call this function; instead use `hypot` in C and
1230 * Objective-C, and `simd::hypot` in C++. */
1231static inline SIMD_CFUNC simd_float3 __tg_hypot(simd_float3 x, simd_float3 y);
1232/*! @abstract Do not call this function; instead use `hypot` in C and
1233 * Objective-C, and `simd::hypot` in C++. */
1234static inline SIMD_CFUNC simd_float4 __tg_hypot(simd_float4 x, simd_float4 y);
1235/*! @abstract Do not call this function; instead use `hypot` in C and
1236 * Objective-C, and `simd::hypot` in C++. */
1237static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y);
1238/*! @abstract Do not call this function; instead use `hypot` in C and
1239 * Objective-C, and `simd::hypot` in C++. */
1240static inline SIMD_CFUNC simd_float16 __tg_hypot(simd_float16 x, simd_float16 y);
1241/*! @abstract Do not call this function; instead use `hypot` in C and
1242 * Objective-C, and `simd::hypot` in C++. */
1243static inline SIMD_CFUNC simd_double2 __tg_hypot(simd_double2 x, simd_double2 y);
1244/*! @abstract Do not call this function; instead use `hypot` in C and
1245 * Objective-C, and `simd::hypot` in C++. */
1246static inline SIMD_CFUNC simd_double3 __tg_hypot(simd_double3 x, simd_double3 y);
1247/*! @abstract Do not call this function; instead use `hypot` in C and
1248 * Objective-C, and `simd::hypot` in C++. */
1249static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y);
1250/*! @abstract Do not call this function; instead use `hypot` in C and
1251 * Objective-C, and `simd::hypot` in C++. */
1252static inline SIMD_CFUNC simd_double8 __tg_hypot(simd_double8 x, simd_double8 y);
1253
1254/*! @abstract Do not call this function; instead use `pow` in C and
1255 * Objective-C, and `simd::pow` in C++. */
1256static inline SIMD_CFUNC simd_float2 __tg_pow(simd_float2 x, simd_float2 y);
1257/*! @abstract Do not call this function; instead use `pow` in C and
1258 * Objective-C, and `simd::pow` in C++. */
1259static inline SIMD_CFUNC simd_float3 __tg_pow(simd_float3 x, simd_float3 y);
1260/*! @abstract Do not call this function; instead use `pow` in C and
1261 * Objective-C, and `simd::pow` in C++. */
1262static inline SIMD_CFUNC simd_float4 __tg_pow(simd_float4 x, simd_float4 y);
1263/*! @abstract Do not call this function; instead use `pow` in C and
1264 * Objective-C, and `simd::pow` in C++. */
1265static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y);
1266/*! @abstract Do not call this function; instead use `pow` in C and
1267 * Objective-C, and `simd::pow` in C++. */
1268static inline SIMD_CFUNC simd_float16 __tg_pow(simd_float16 x, simd_float16 y);
1269/*! @abstract Do not call this function; instead use `pow` in C and
1270 * Objective-C, and `simd::pow` in C++. */
1271static inline SIMD_CFUNC simd_double2 __tg_pow(simd_double2 x, simd_double2 y);
1272/*! @abstract Do not call this function; instead use `pow` in C and
1273 * Objective-C, and `simd::pow` in C++. */
1274static inline SIMD_CFUNC simd_double3 __tg_pow(simd_double3 x, simd_double3 y);
1275/*! @abstract Do not call this function; instead use `pow` in C and
1276 * Objective-C, and `simd::pow` in C++. */
1277static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y);
1278/*! @abstract Do not call this function; instead use `pow` in C and
1279 * Objective-C, and `simd::pow` in C++. */
1280static inline SIMD_CFUNC simd_double8 __tg_pow(simd_double8 x, simd_double8 y);
1281
1282/*! @abstract Do not call this function; instead use `fmod` in C and
1283 * Objective-C, and `simd::fmod` in C++. */
1284static inline SIMD_CFUNC simd_float2 __tg_fmod(simd_float2 x, simd_float2 y);
1285/*! @abstract Do not call this function; instead use `fmod` in C and
1286 * Objective-C, and `simd::fmod` in C++. */
1287static inline SIMD_CFUNC simd_float3 __tg_fmod(simd_float3 x, simd_float3 y);
1288/*! @abstract Do not call this function; instead use `fmod` in C and
1289 * Objective-C, and `simd::fmod` in C++. */
1290static inline SIMD_CFUNC simd_float4 __tg_fmod(simd_float4 x, simd_float4 y);
1291/*! @abstract Do not call this function; instead use `fmod` in C and
1292 * Objective-C, and `simd::fmod` in C++. */
1293static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y);
1294/*! @abstract Do not call this function; instead use `fmod` in C and
1295 * Objective-C, and `simd::fmod` in C++. */
1296static inline SIMD_CFUNC simd_float16 __tg_fmod(simd_float16 x, simd_float16 y);
1297/*! @abstract Do not call this function; instead use `fmod` in C and
1298 * Objective-C, and `simd::fmod` in C++. */
1299static inline SIMD_CFUNC simd_double2 __tg_fmod(simd_double2 x, simd_double2 y);
1300/*! @abstract Do not call this function; instead use `fmod` in C and
1301 * Objective-C, and `simd::fmod` in C++. */
1302static inline SIMD_CFUNC simd_double3 __tg_fmod(simd_double3 x, simd_double3 y);
1303/*! @abstract Do not call this function; instead use `fmod` in C and
1304 * Objective-C, and `simd::fmod` in C++. */
1305static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y);
1306/*! @abstract Do not call this function; instead use `fmod` in C and
1307 * Objective-C, and `simd::fmod` in C++. */
1308static inline SIMD_CFUNC simd_double8 __tg_fmod(simd_double8 x, simd_double8 y);
1309
1310/*! @abstract Do not call this function; instead use `remainder` in C and
1311 * Objective-C, and `simd::remainder` in C++. */
1312static inline SIMD_CFUNC simd_float2 __tg_remainder(simd_float2 x, simd_float2 y);
1313/*! @abstract Do not call this function; instead use `remainder` in C and
1314 * Objective-C, and `simd::remainder` in C++. */
1315static inline SIMD_CFUNC simd_float3 __tg_remainder(simd_float3 x, simd_float3 y);
1316/*! @abstract Do not call this function; instead use `remainder` in C and
1317 * Objective-C, and `simd::remainder` in C++. */
1318static inline SIMD_CFUNC simd_float4 __tg_remainder(simd_float4 x, simd_float4 y);
1319/*! @abstract Do not call this function; instead use `remainder` in C and
1320 * Objective-C, and `simd::remainder` in C++. */
1321static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y);
1322/*! @abstract Do not call this function; instead use `remainder` in C and
1323 * Objective-C, and `simd::remainder` in C++. */
1324static inline SIMD_CFUNC simd_float16 __tg_remainder(simd_float16 x, simd_float16 y);
1325/*! @abstract Do not call this function; instead use `remainder` in C and
1326 * Objective-C, and `simd::remainder` in C++. */
1327static inline SIMD_CFUNC simd_double2 __tg_remainder(simd_double2 x, simd_double2 y);
1328/*! @abstract Do not call this function; instead use `remainder` in C and
1329 * Objective-C, and `simd::remainder` in C++. */
1330static inline SIMD_CFUNC simd_double3 __tg_remainder(simd_double3 x, simd_double3 y);
1331/*! @abstract Do not call this function; instead use `remainder` in C and
1332 * Objective-C, and `simd::remainder` in C++. */
1333static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double4 y);
1334/*! @abstract Do not call this function; instead use `remainder` in C and
1335 * Objective-C, and `simd::remainder` in C++. */
1336static inline SIMD_CFUNC simd_double8 __tg_remainder(simd_double8 x, simd_double8 y);
1337
1338/*! @abstract Do not call this function; instead use `copysign` in C and
1339 * Objective-C, and `simd::copysign` in C++. */
1340static inline SIMD_CFUNC simd_float2 __tg_copysign(simd_float2 x, simd_float2 y);
1341/*! @abstract Do not call this function; instead use `copysign` in C and
1342 * Objective-C, and `simd::copysign` in C++. */
1343static inline SIMD_CFUNC simd_float3 __tg_copysign(simd_float3 x, simd_float3 y);
1344/*! @abstract Do not call this function; instead use `copysign` in C and
1345 * Objective-C, and `simd::copysign` in C++. */
1346static inline SIMD_CFUNC simd_float4 __tg_copysign(simd_float4 x, simd_float4 y);
1347/*! @abstract Do not call this function; instead use `copysign` in C and
1348 * Objective-C, and `simd::copysign` in C++. */
1349static inline SIMD_CFUNC simd_float8 __tg_copysign(simd_float8 x, simd_float8 y);
1350/*! @abstract Do not call this function; instead use `copysign` in C and
1351 * Objective-C, and `simd::copysign` in C++. */
1352static inline SIMD_CFUNC simd_float16 __tg_copysign(simd_float16 x, simd_float16 y);
1353/*! @abstract Do not call this function; instead use `copysign` in C and
1354 * Objective-C, and `simd::copysign` in C++. */
1355static inline SIMD_CFUNC simd_double2 __tg_copysign(simd_double2 x, simd_double2 y);
1356/*! @abstract Do not call this function; instead use `copysign` in C and
1357 * Objective-C, and `simd::copysign` in C++. */
1358static inline SIMD_CFUNC simd_double3 __tg_copysign(simd_double3 x, simd_double3 y);
1359/*! @abstract Do not call this function; instead use `copysign` in C and
1360 * Objective-C, and `simd::copysign` in C++. */
1361static inline SIMD_CFUNC simd_double4 __tg_copysign(simd_double4 x, simd_double4 y);
1362/*! @abstract Do not call this function; instead use `copysign` in C and
1363 * Objective-C, and `simd::copysign` in C++. */
1364static inline SIMD_CFUNC simd_double8 __tg_copysign(simd_double8 x, simd_double8 y);
1365
1366/*! @abstract Do not call this function; instead use `nextafter` in C and
1367 * Objective-C, and `simd::nextafter` in C++. */
1368static inline SIMD_CFUNC simd_float2 __tg_nextafter(simd_float2 x, simd_float2 y);
1369/*! @abstract Do not call this function; instead use `nextafter` in C and
1370 * Objective-C, and `simd::nextafter` in C++. */
1371static inline SIMD_CFUNC simd_float3 __tg_nextafter(simd_float3 x, simd_float3 y);
1372/*! @abstract Do not call this function; instead use `nextafter` in C and
1373 * Objective-C, and `simd::nextafter` in C++. */
1374static inline SIMD_CFUNC simd_float4 __tg_nextafter(simd_float4 x, simd_float4 y);
1375/*! @abstract Do not call this function; instead use `nextafter` in C and
1376 * Objective-C, and `simd::nextafter` in C++. */
1377static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y);
1378/*! @abstract Do not call this function; instead use `nextafter` in C and
1379 * Objective-C, and `simd::nextafter` in C++. */
1380static inline SIMD_CFUNC simd_float16 __tg_nextafter(simd_float16 x, simd_float16 y);
1381/*! @abstract Do not call this function; instead use `nextafter` in C and
1382 * Objective-C, and `simd::nextafter` in C++. */
1383static inline SIMD_CFUNC simd_double2 __tg_nextafter(simd_double2 x, simd_double2 y);
1384/*! @abstract Do not call this function; instead use `nextafter` in C and
1385 * Objective-C, and `simd::nextafter` in C++. */
1386static inline SIMD_CFUNC simd_double3 __tg_nextafter(simd_double3 x, simd_double3 y);
1387/*! @abstract Do not call this function; instead use `nextafter` in C and
1388 * Objective-C, and `simd::nextafter` in C++. */
1389static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double4 y);
1390/*! @abstract Do not call this function; instead use `nextafter` in C and
1391 * Objective-C, and `simd::nextafter` in C++. */
1392static inline SIMD_CFUNC simd_double8 __tg_nextafter(simd_double8 x, simd_double8 y);
1393
1394/*! @abstract Do not call this function; instead use `fdim` in C and
1395 * Objective-C, and `simd::fdim` in C++. */
1396static inline SIMD_CFUNC simd_float2 __tg_fdim(simd_float2 x, simd_float2 y);
1397/*! @abstract Do not call this function; instead use `fdim` in C and
1398 * Objective-C, and `simd::fdim` in C++. */
1399static inline SIMD_CFUNC simd_float3 __tg_fdim(simd_float3 x, simd_float3 y);
1400/*! @abstract Do not call this function; instead use `fdim` in C and
1401 * Objective-C, and `simd::fdim` in C++. */
1402static inline SIMD_CFUNC simd_float4 __tg_fdim(simd_float4 x, simd_float4 y);
1403/*! @abstract Do not call this function; instead use `fdim` in C and
1404 * Objective-C, and `simd::fdim` in C++. */
1405static inline SIMD_CFUNC simd_float8 __tg_fdim(simd_float8 x, simd_float8 y);
1406/*! @abstract Do not call this function; instead use `fdim` in C and
1407 * Objective-C, and `simd::fdim` in C++. */
1408static inline SIMD_CFUNC simd_float16 __tg_fdim(simd_float16 x, simd_float16 y);
1409/*! @abstract Do not call this function; instead use `fdim` in C and
1410 * Objective-C, and `simd::fdim` in C++. */
1411static inline SIMD_CFUNC simd_double2 __tg_fdim(simd_double2 x, simd_double2 y);
1412/*! @abstract Do not call this function; instead use `fdim` in C and
1413 * Objective-C, and `simd::fdim` in C++. */
1414static inline SIMD_CFUNC simd_double3 __tg_fdim(simd_double3 x, simd_double3 y);
1415/*! @abstract Do not call this function; instead use `fdim` in C and
1416 * Objective-C, and `simd::fdim` in C++. */
1417static inline SIMD_CFUNC simd_double4 __tg_fdim(simd_double4 x, simd_double4 y);
1418/*! @abstract Do not call this function; instead use `fdim` in C and
1419 * Objective-C, and `simd::fdim` in C++. */
1420static inline SIMD_CFUNC simd_double8 __tg_fdim(simd_double8 x, simd_double8 y);
1421
1422/*! @abstract Do not call this function; instead use `fmax` in C and
1423 * Objective-C, and `simd::fmax` in C++. */
1424static inline SIMD_CFUNC simd_float2 __tg_fmax(simd_float2 x, simd_float2 y);
1425/*! @abstract Do not call this function; instead use `fmax` in C and
1426 * Objective-C, and `simd::fmax` in C++. */
1427static inline SIMD_CFUNC simd_float3 __tg_fmax(simd_float3 x, simd_float3 y);
1428/*! @abstract Do not call this function; instead use `fmax` in C and
1429 * Objective-C, and `simd::fmax` in C++. */
1430static inline SIMD_CFUNC simd_float4 __tg_fmax(simd_float4 x, simd_float4 y);
1431/*! @abstract Do not call this function; instead use `fmax` in C and
1432 * Objective-C, and `simd::fmax` in C++. */
1433static inline SIMD_CFUNC simd_float8 __tg_fmax(simd_float8 x, simd_float8 y);
1434/*! @abstract Do not call this function; instead use `fmax` in C and
1435 * Objective-C, and `simd::fmax` in C++. */
1436static inline SIMD_CFUNC simd_float16 __tg_fmax(simd_float16 x, simd_float16 y);
1437/*! @abstract Do not call this function; instead use `fmax` in C and
1438 * Objective-C, and `simd::fmax` in C++. */
1439static inline SIMD_CFUNC simd_double2 __tg_fmax(simd_double2 x, simd_double2 y);
1440/*! @abstract Do not call this function; instead use `fmax` in C and
1441 * Objective-C, and `simd::fmax` in C++. */
1442static inline SIMD_CFUNC simd_double3 __tg_fmax(simd_double3 x, simd_double3 y);
1443/*! @abstract Do not call this function; instead use `fmax` in C and
1444 * Objective-C, and `simd::fmax` in C++. */
1445static inline SIMD_CFUNC simd_double4 __tg_fmax(simd_double4 x, simd_double4 y);
1446/*! @abstract Do not call this function; instead use `fmax` in C and
1447 * Objective-C, and `simd::fmax` in C++. */
1448static inline SIMD_CFUNC simd_double8 __tg_fmax(simd_double8 x, simd_double8 y);
1449
1450/*! @abstract Do not call this function; instead use `fmin` in C and
1451 * Objective-C, and `simd::fmin` in C++. */
1452static inline SIMD_CFUNC simd_float2 __tg_fmin(simd_float2 x, simd_float2 y);
1453/*! @abstract Do not call this function; instead use `fmin` in C and
1454 * Objective-C, and `simd::fmin` in C++. */
1455static inline SIMD_CFUNC simd_float3 __tg_fmin(simd_float3 x, simd_float3 y);
1456/*! @abstract Do not call this function; instead use `fmin` in C and
1457 * Objective-C, and `simd::fmin` in C++. */
1458static inline SIMD_CFUNC simd_float4 __tg_fmin(simd_float4 x, simd_float4 y);
1459/*! @abstract Do not call this function; instead use `fmin` in C and
1460 * Objective-C, and `simd::fmin` in C++. */
1461static inline SIMD_CFUNC simd_float8 __tg_fmin(simd_float8 x, simd_float8 y);
1462/*! @abstract Do not call this function; instead use `fmin` in C and
1463 * Objective-C, and `simd::fmin` in C++. */
1464static inline SIMD_CFUNC simd_float16 __tg_fmin(simd_float16 x, simd_float16 y);
1465/*! @abstract Do not call this function; instead use `fmin` in C and
1466 * Objective-C, and `simd::fmin` in C++. */
1467static inline SIMD_CFUNC simd_double2 __tg_fmin(simd_double2 x, simd_double2 y);
1468/*! @abstract Do not call this function; instead use `fmin` in C and
1469 * Objective-C, and `simd::fmin` in C++. */
1470static inline SIMD_CFUNC simd_double3 __tg_fmin(simd_double3 x, simd_double3 y);
1471/*! @abstract Do not call this function; instead use `fmin` in C and
1472 * Objective-C, and `simd::fmin` in C++. */
1473static inline SIMD_CFUNC simd_double4 __tg_fmin(simd_double4 x, simd_double4 y);
1474/*! @abstract Do not call this function; instead use `fmin` in C and
1475 * Objective-C, and `simd::fmin` in C++. */
1476static inline SIMD_CFUNC simd_double8 __tg_fmin(simd_double8 x, simd_double8 y);
1477
1478
1479/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1480 * and `simd::fma` in C++. */
1481static inline SIMD_CFUNC simd_float2 __tg_fma(simd_float2 x, simd_float2 y, simd_float2 z);
1482/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1483 * and `simd::fma` in C++. */
1484static inline SIMD_CFUNC simd_float3 __tg_fma(simd_float3 x, simd_float3 y, simd_float3 z);
1485/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1486 * and `simd::fma` in C++. */
1487static inline SIMD_CFUNC simd_float4 __tg_fma(simd_float4 x, simd_float4 y, simd_float4 z);
1488/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1489 * and `simd::fma` in C++. */
1490static inline SIMD_CFUNC simd_float8 __tg_fma(simd_float8 x, simd_float8 y, simd_float8 z);
1491/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1492 * and `simd::fma` in C++. */
1493static inline SIMD_CFUNC simd_float16 __tg_fma(simd_float16 x, simd_float16 y, simd_float16 z);
1494/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1495 * and `simd::fma` in C++. */
1496static inline SIMD_CFUNC simd_double2 __tg_fma(simd_double2 x, simd_double2 y, simd_double2 z);
1497/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1498 * and `simd::fma` in C++. */
1499static inline SIMD_CFUNC simd_double3 __tg_fma(simd_double3 x, simd_double3 y, simd_double3 z);
1500/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1501 * and `simd::fma` in C++. */
1502static inline SIMD_CFUNC simd_double4 __tg_fma(simd_double4 x, simd_double4 y, simd_double4 z);
1503/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1504 * and `simd::fma` in C++. */
1505static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, simd_double8 z);
1506
1507/*! @abstract Computes accum + x*y by the most efficient means available;
1508 * either a fused multiply add or separate multiply and add instructions. */
1509static inline SIMD_CFUNC float simd_muladd(float x, float y, float z);
1510/*! @abstract Computes accum + x*y by the most efficient means available;
1511 * either a fused multiply add or separate multiply and add instructions. */
1512static inline SIMD_CFUNC simd_float2 simd_muladd(simd_float2 x, simd_float2 y, simd_float2 z);
1513/*! @abstract Computes accum + x*y by the most efficient means available;
1514 * either a fused multiply add or separate multiply and add instructions. */
1515static inline SIMD_CFUNC simd_float3 simd_muladd(simd_float3 x, simd_float3 y, simd_float3 z);
1516/*! @abstract Computes accum + x*y by the most efficient means available;
1517 * either a fused multiply add or separate multiply and add instructions. */
1518static inline SIMD_CFUNC simd_float4 simd_muladd(simd_float4 x, simd_float4 y, simd_float4 z);
1519/*! @abstract Computes accum + x*y by the most efficient means available;
1520 * either a fused multiply add or separate multiply and add instructions. */
1521static inline SIMD_CFUNC simd_float8 simd_muladd(simd_float8 x, simd_float8 y, simd_float8 z);
1522/*! @abstract Computes accum + x*y by the most efficient means available;
1523 * either a fused multiply add or separate multiply and add instructions. */
1524static inline SIMD_CFUNC simd_float16 simd_muladd(simd_float16 x, simd_float16 y, simd_float16 z);
1525/*! @abstract Computes accum + x*y by the most efficient means available;
1526 * either a fused multiply add or separate multiply and add instructions. */
1527static inline SIMD_CFUNC double simd_muladd(double x, double y, double z);
1528/*! @abstract Computes accum + x*y by the most efficient means available;
1529 * either a fused multiply add or separate multiply and add instructions. */
1530static inline SIMD_CFUNC simd_double2 simd_muladd(simd_double2 x, simd_double2 y, simd_double2 z);
1531/*! @abstract Computes accum + x*y by the most efficient means available;
1532 * either a fused multiply add or separate multiply and add instructions. */
1533static inline SIMD_CFUNC simd_double3 simd_muladd(simd_double3 x, simd_double3 y, simd_double3 z);
1534/*! @abstract Computes accum + x*y by the most efficient means available;
1535 * either a fused multiply add or separate multiply and add instructions. */
1536static inline SIMD_CFUNC simd_double4 simd_muladd(simd_double4 x, simd_double4 y, simd_double4 z);
1537/*! @abstract Computes accum + x*y by the most efficient means available;
1538 * either a fused multiply add or separate multiply and add instructions. */
1539static inline SIMD_CFUNC simd_double8 simd_muladd(simd_double8 x, simd_double8 y, simd_double8 z);
1540
1541#ifdef __cplusplus
1542} /* extern "C" */
1543
1544#include <cmath>
1545/*! @abstract Do not call this function directly; use simd::acos instead. */
1546static SIMD_CPPFUNC float __tg_acos(float x) { return ::acos(x); }
1547/*! @abstract Do not call this function directly; use simd::acos instead. */
1548static SIMD_CPPFUNC double __tg_acos(double x) { return ::acos(x); }
1549/*! @abstract Do not call this function directly; use simd::asin instead. */
1550static SIMD_CPPFUNC float __tg_asin(float x) { return ::asin(x); }
1551/*! @abstract Do not call this function directly; use simd::asin instead. */
1552static SIMD_CPPFUNC double __tg_asin(double x) { return ::asin(x); }
1553/*! @abstract Do not call this function directly; use simd::atan instead. */
1554static SIMD_CPPFUNC float __tg_atan(float x) { return ::atan(x); }
1555/*! @abstract Do not call this function directly; use simd::atan instead. */
1556static SIMD_CPPFUNC double __tg_atan(double x) { return ::atan(x); }
1557/*! @abstract Do not call this function directly; use simd::cos instead. */
1558static SIMD_CPPFUNC float __tg_cos(float x) { return ::cos(x); }
1559/*! @abstract Do not call this function directly; use simd::cos instead. */
1560static SIMD_CPPFUNC double __tg_cos(double x) { return ::cos(x); }
1561/*! @abstract Do not call this function directly; use simd::sin instead. */
1562static SIMD_CPPFUNC float __tg_sin(float x) { return ::sin(x); }
1563/*! @abstract Do not call this function directly; use simd::sin instead. */
1564static SIMD_CPPFUNC double __tg_sin(double x) { return ::sin(x); }
1565/*! @abstract Do not call this function directly; use simd::tan instead. */
1566static SIMD_CPPFUNC float __tg_tan(float x) { return ::tan(x); }
1567/*! @abstract Do not call this function directly; use simd::tan instead. */
1568static SIMD_CPPFUNC double __tg_tan(double x) { return ::tan(x); }
1569/*! @abstract Do not call this function directly; use simd::cospi instead. */
1570static SIMD_CPPFUNC float __tg_cospi(float x) { return ::__cospi(x); }
1571/*! @abstract Do not call this function directly; use simd::cospi instead. */
1572static SIMD_CPPFUNC double __tg_cospi(double x) { return ::__cospi(x); }
1573/*! @abstract Do not call this function directly; use simd::sinpi instead. */
1574static SIMD_CPPFUNC float __tg_sinpi(float x) { return ::__sinpi(x); }
1575/*! @abstract Do not call this function directly; use simd::sinpi instead. */
1576static SIMD_CPPFUNC double __tg_sinpi(double x) { return ::__sinpi(x); }
1577/*! @abstract Do not call this function directly; use simd::tanpi instead. */
1578static SIMD_CPPFUNC float __tg_tanpi(float x) { return ::__tanpi(x); }
1579/*! @abstract Do not call this function directly; use simd::tanpi instead. */
1580static SIMD_CPPFUNC double __tg_tanpi(double x) { return ::__tanpi(x); }
1581/*! @abstract Do not call this function directly; use simd::acosh instead. */
1582static SIMD_CPPFUNC float __tg_acosh(float x) { return ::acosh(x); }
1583/*! @abstract Do not call this function directly; use simd::acosh instead. */
1584static SIMD_CPPFUNC double __tg_acosh(double x) { return ::acosh(x); }
1585/*! @abstract Do not call this function directly; use simd::asinh instead. */
1586static SIMD_CPPFUNC float __tg_asinh(float x) { return ::asinh(x); }
1587/*! @abstract Do not call this function directly; use simd::asinh instead. */
1588static SIMD_CPPFUNC double __tg_asinh(double x) { return ::asinh(x); }
1589/*! @abstract Do not call this function directly; use simd::atanh instead. */
1590static SIMD_CPPFUNC float __tg_atanh(float x) { return ::atanh(x); }
1591/*! @abstract Do not call this function directly; use simd::atanh instead. */
1592static SIMD_CPPFUNC double __tg_atanh(double x) { return ::atanh(x); }
1593/*! @abstract Do not call this function directly; use simd::cosh instead. */
1594static SIMD_CPPFUNC float __tg_cosh(float x) { return ::cosh(x); }
1595/*! @abstract Do not call this function directly; use simd::cosh instead. */
1596static SIMD_CPPFUNC double __tg_cosh(double x) { return ::cosh(x); }
1597/*! @abstract Do not call this function directly; use simd::sinh instead. */
1598static SIMD_CPPFUNC float __tg_sinh(float x) { return ::sinh(x); }
1599/*! @abstract Do not call this function directly; use simd::sinh instead. */
1600static SIMD_CPPFUNC double __tg_sinh(double x) { return ::sinh(x); }
1601/*! @abstract Do not call this function directly; use simd::tanh instead. */
1602static SIMD_CPPFUNC float __tg_tanh(float x) { return ::tanh(x); }
1603/*! @abstract Do not call this function directly; use simd::tanh instead. */
1604static SIMD_CPPFUNC double __tg_tanh(double x) { return ::tanh(x); }
1605/*! @abstract Do not call this function directly; use simd::exp instead. */
1606static SIMD_CPPFUNC float __tg_exp(float x) { return ::exp(x); }
1607/*! @abstract Do not call this function directly; use simd::exp instead. */
1608static SIMD_CPPFUNC double __tg_exp(double x) { return ::exp(x); }
1609/*! @abstract Do not call this function directly; use simd::exp2 instead. */
1610static SIMD_CPPFUNC float __tg_exp2(float x) { return ::exp2(x); }
1611/*! @abstract Do not call this function directly; use simd::exp2 instead. */
1612static SIMD_CPPFUNC double __tg_exp2(double x) { return ::exp2(x); }
1613/*! @abstract Do not call this function directly; use simd::exp10 instead. */
1614static SIMD_CPPFUNC float __tg_exp10(float x) { return ::__exp10(x); }
1615/*! @abstract Do not call this function directly; use simd::exp10 instead. */
1616static SIMD_CPPFUNC double __tg_exp10(double x) { return ::__exp10(x); }
1617/*! @abstract Do not call this function directly; use simd::expm1 instead. */
1618static SIMD_CPPFUNC float __tg_expm1(float x) { return ::expm1(x); }
1619/*! @abstract Do not call this function directly; use simd::expm1 instead. */
1620static SIMD_CPPFUNC double __tg_expm1(double x) { return ::expm1(x); }
1621/*! @abstract Do not call this function directly; use simd::log instead. */
1622static SIMD_CPPFUNC float __tg_log(float x) { return ::log(x); }
1623/*! @abstract Do not call this function directly; use simd::log instead. */
1624static SIMD_CPPFUNC double __tg_log(double x) { return ::log(x); }
1625/*! @abstract Do not call this function directly; use simd::log2 instead. */
1626static SIMD_CPPFUNC float __tg_log2(float x) { return ::log2(x); }
1627/*! @abstract Do not call this function directly; use simd::log2 instead. */
1628static SIMD_CPPFUNC double __tg_log2(double x) { return ::log2(x); }
1629/*! @abstract Do not call this function directly; use simd::log10 instead. */
1630static SIMD_CPPFUNC float __tg_log10(float x) { return ::log10(x); }
1631/*! @abstract Do not call this function directly; use simd::log10 instead. */
1632static SIMD_CPPFUNC double __tg_log10(double x) { return ::log10(x); }
1633/*! @abstract Do not call this function directly; use simd::log1p instead. */
1634static SIMD_CPPFUNC float __tg_log1p(float x) { return ::log1p(x); }
1635/*! @abstract Do not call this function directly; use simd::log1p instead. */
1636static SIMD_CPPFUNC double __tg_log1p(double x) { return ::log1p(x); }
1637/*! @abstract Do not call this function directly; use simd::fabs instead. */
1638static SIMD_CPPFUNC float __tg_fabs(float x) { return ::fabs(x); }
1639/*! @abstract Do not call this function directly; use simd::fabs instead. */
1640static SIMD_CPPFUNC double __tg_fabs(double x) { return ::fabs(x); }
1641/*! @abstract Do not call this function directly; use simd::cbrt instead. */
1642static SIMD_CPPFUNC float __tg_cbrt(float x) { return ::cbrt(x); }
1643/*! @abstract Do not call this function directly; use simd::cbrt instead. */
1644static SIMD_CPPFUNC double __tg_cbrt(double x) { return ::cbrt(x); }
1645/*! @abstract Do not call this function directly; use simd::sqrt instead. */
1646static SIMD_CPPFUNC float __tg_sqrt(float x) { return ::sqrt(x); }
1647/*! @abstract Do not call this function directly; use simd::sqrt instead. */
1648static SIMD_CPPFUNC double __tg_sqrt(double x) { return ::sqrt(x); }
1649/*! @abstract Do not call this function directly; use simd::erf instead. */
1650static SIMD_CPPFUNC float __tg_erf(float x) { return ::erf(x); }
1651/*! @abstract Do not call this function directly; use simd::erf instead. */
1652static SIMD_CPPFUNC double __tg_erf(double x) { return ::erf(x); }
1653/*! @abstract Do not call this function directly; use simd::erfc instead. */
1654static SIMD_CPPFUNC float __tg_erfc(float x) { return ::erfc(x); }
1655/*! @abstract Do not call this function directly; use simd::erfc instead. */
1656static SIMD_CPPFUNC double __tg_erfc(double x) { return ::erfc(x); }
1657/*! @abstract Do not call this function directly; use simd::tgamma instead. */
1658static SIMD_CPPFUNC float __tg_tgamma(float x) { return ::tgamma(x); }
1659/*! @abstract Do not call this function directly; use simd::tgamma instead. */
1660static SIMD_CPPFUNC double __tg_tgamma(double x) { return ::tgamma(x); }
1661/*! @abstract Do not call this function directly; use simd::lgamma instead. */
1662static SIMD_CPPFUNC float __tg_lgamma(float x) { return ::lgamma(x); }
1663/*! @abstract Do not call this function directly; use simd::lgamma instead. */
1664static SIMD_CPPFUNC double __tg_lgamma(double x) { return ::lgamma(x); }
1665/*! @abstract Do not call this function directly; use simd::ceil instead. */
1666static SIMD_CPPFUNC float __tg_ceil(float x) { return ::ceil(x); }
1667/*! @abstract Do not call this function directly; use simd::ceil instead. */
1668static SIMD_CPPFUNC double __tg_ceil(double x) { return ::ceil(x); }
1669/*! @abstract Do not call this function directly; use simd::floor instead. */
1670static SIMD_CPPFUNC float __tg_floor(float x) { return ::floor(x); }
1671/*! @abstract Do not call this function directly; use simd::floor instead. */
1672static SIMD_CPPFUNC double __tg_floor(double x) { return ::floor(x); }
1673/*! @abstract Do not call this function directly; use simd::rint instead. */
1674static SIMD_CPPFUNC float __tg_rint(float x) { return ::rint(x); }
1675/*! @abstract Do not call this function directly; use simd::rint instead. */
1676static SIMD_CPPFUNC double __tg_rint(double x) { return ::rint(x); }
1677/*! @abstract Do not call this function directly; use simd::round instead. */
1678static SIMD_CPPFUNC float __tg_round(float x) { return ::round(x); }
1679/*! @abstract Do not call this function directly; use simd::round instead. */
1680static SIMD_CPPFUNC double __tg_round(double x) { return ::round(x); }
1681/*! @abstract Do not call this function directly; use simd::trunc instead. */
1682static SIMD_CPPFUNC float __tg_trunc(float x) { return ::trunc(x); }
1683/*! @abstract Do not call this function directly; use simd::trunc instead. */
1684static SIMD_CPPFUNC double __tg_trunc(double x) { return ::trunc(x); }
1685/*! @abstract Do not call this function directly; use simd::isfinite
1686 * instead. */
1687static SIMD_CPPFUNC float __tg_isfinite(float x) { return ::isfinite(x); }
1688/*! @abstract Do not call this function directly; use simd::isfinite
1689 * instead. */
1690static SIMD_CPPFUNC double __tg_isfinite(double x) { return ::isfinite(x); }
1691/*! @abstract Do not call this function directly; use simd::isinf instead. */
1692static SIMD_CPPFUNC float __tg_isinf(float x) { return ::isinf(x); }
1693/*! @abstract Do not call this function directly; use simd::isinf instead. */
1694static SIMD_CPPFUNC double __tg_isinf(double x) { return ::isinf(x); }
1695/*! @abstract Do not call this function directly; use simd::isnan instead. */
1696static SIMD_CPPFUNC float __tg_isnan(float x) { return ::isnan(x); }
1697/*! @abstract Do not call this function directly; use simd::isnan instead. */
1698static SIMD_CPPFUNC double __tg_isnan(double x) { return ::isnan(x); }
1699/*! @abstract Do not call this function directly; use simd::isnormal
1700 * instead. */
1701static SIMD_CPPFUNC float __tg_isnormal(float x) { return ::isnormal(x); }
1702/*! @abstract Do not call this function directly; use simd::isnormal
1703 * instead. */
1704static SIMD_CPPFUNC double __tg_isnormal(double x) { return ::isnormal(x); }
1705/*! @abstract Do not call this function directly; use simd::atan2 instead. */
1706static SIMD_CPPFUNC float __tg_atan2(float x, float y) { return ::atan2(x, y); }
1707/*! @abstract Do not call this function directly; use simd::atan2 instead. */
1708static SIMD_CPPFUNC double __tg_atan2(double x, double y) { return ::atan2(x, y); }
1709/*! @abstract Do not call this function directly; use simd::hypot instead. */
1710static SIMD_CPPFUNC float __tg_hypot(float x, float y) { return ::hypot(x, y); }
1711/*! @abstract Do not call this function directly; use simd::hypot instead. */
1712static SIMD_CPPFUNC double __tg_hypot(double x, double y) { return ::hypot(x, y); }
1713/*! @abstract Do not call this function directly; use simd::pow instead. */
1714static SIMD_CPPFUNC float __tg_pow(float x, float y) { return ::pow(x, y); }
1715/*! @abstract Do not call this function directly; use simd::pow instead. */
1716static SIMD_CPPFUNC double __tg_pow(double x, double y) { return ::pow(x, y); }
1717/*! @abstract Do not call this function directly; use simd::fmod instead. */
1718static SIMD_CPPFUNC float __tg_fmod(float x, float y) { return ::fmod(x, y); }
1719/*! @abstract Do not call this function directly; use simd::fmod instead. */
1720static SIMD_CPPFUNC double __tg_fmod(double x, double y) { return ::fmod(x, y); }
1721/*! @abstract Do not call this function directly; use simd::remainder
1722 * instead. */
1723static SIMD_CPPFUNC float __tg_remainder(float x, float y) { return ::remainder(x, y); }
1724/*! @abstract Do not call this function directly; use simd::remainder
1725 * instead. */
1726static SIMD_CPPFUNC double __tg_remainder(double x, double y) { return ::remainder(x, y); }
1727/*! @abstract Do not call this function directly; use simd::copysign
1728 * instead. */
1729static SIMD_CPPFUNC float __tg_copysign(float x, float y) { return ::copysign(x, y); }
1730/*! @abstract Do not call this function directly; use simd::copysign
1731 * instead. */
1732static SIMD_CPPFUNC double __tg_copysign(double x, double y) { return ::copysign(x, y); }
1733/*! @abstract Do not call this function directly; use simd::nextafter
1734 * instead. */
1735static SIMD_CPPFUNC float __tg_nextafter(float x, float y) { return ::nextafter(x, y); }
1736/*! @abstract Do not call this function directly; use simd::nextafter
1737 * instead. */
1738static SIMD_CPPFUNC double __tg_nextafter(double x, double y) { return ::nextafter(x, y); }
1739/*! @abstract Do not call this function directly; use simd::fdim instead. */
1740static SIMD_CPPFUNC float __tg_fdim(float x, float y) { return ::fdim(x, y); }
1741/*! @abstract Do not call this function directly; use simd::fdim instead. */
1742static SIMD_CPPFUNC double __tg_fdim(double x, double y) { return ::fdim(x, y); }
1743/*! @abstract Do not call this function directly; use simd::fmax instead. */
1744static SIMD_CPPFUNC float __tg_fmax(float x, float y) { return ::fmax(x, y); }
1745/*! @abstract Do not call this function directly; use simd::fmax instead. */
1746static SIMD_CPPFUNC double __tg_fmax(double x, double y) { return ::fmax(x, y); }
1747/*! @abstract Do not call this function directly; use simd::fmin instead. */
1748static SIMD_CPPFUNC float __tg_fmin(float x, float y) { return ::fmin(x, y); }
1749/*! @abstract Do not call this function directly; use simd::fmin instead. */
1750static SIMD_CPPFUNC double __tg_fmin(double x, double y) { return ::fmin(x, y); }
1751/*! @abstract Do not call this function directly; use simd::fma instead. */
1752static SIMD_CPPFUNC float __tg_fma(float x, float y, float z) { return ::fma(x, y, z); }
1753/*! @abstract Do not call this function directly; use simd::fma instead. */
1754static SIMD_CPPFUNC double __tg_fma(double x, double y, double z) { return ::fma(x, y, z); }
1755
1756namespace simd {
1757/*! @abstract Generalizes the <cmath> function acos to operate on vectors of
1758 * floats and doubles. */
1759 template <typename fptypeN>
1760 static SIMD_CPPFUNC fptypeN acos(fptypeN x) { return ::__tg_acos(x); }
1761
1762/*! @abstract Generalizes the <cmath> function asin to operate on vectors of
1763 * floats and doubles. */
1764 template <typename fptypeN>
1765 static SIMD_CPPFUNC fptypeN asin(fptypeN x) { return ::__tg_asin(x); }
1766
1767/*! @abstract Generalizes the <cmath> function atan to operate on vectors of
1768 * floats and doubles. */
1769 template <typename fptypeN>
1770 static SIMD_CPPFUNC fptypeN atan(fptypeN x) { return ::__tg_atan(x); }
1771
1772/*! @abstract Generalizes the <cmath> function cos to operate on vectors of
1773 * floats and doubles. */
1774 template <typename fptypeN>
1775 static SIMD_CPPFUNC fptypeN cos(fptypeN x) { return ::__tg_cos(x); }
1776
1777/*! @abstract Generalizes the <cmath> function sin to operate on vectors of
1778 * floats and doubles. */
1779 template <typename fptypeN>
1780 static SIMD_CPPFUNC fptypeN sin(fptypeN x) { return ::__tg_sin(x); }
1781
1782/*! @abstract Generalizes the <cmath> function tan to operate on vectors of
1783 * floats and doubles. */
1784 template <typename fptypeN>
1785 static SIMD_CPPFUNC fptypeN tan(fptypeN x) { return ::__tg_tan(x); }
1786
1787#if SIMD_LIBRARY_VERSION >= 1
1788/*! @abstract Generalizes the <cmath> function cospi to operate on vectors
1789 * of floats and doubles. */
1790 template <typename fptypeN>
1791 static SIMD_CPPFUNC fptypeN cospi(fptypeN x) { return ::__tg_cospi(x); }
1792#endif
1793
1794#if SIMD_LIBRARY_VERSION >= 1
1795/*! @abstract Generalizes the <cmath> function sinpi to operate on vectors
1796 * of floats and doubles. */
1797 template <typename fptypeN>
1798 static SIMD_CPPFUNC fptypeN sinpi(fptypeN x) { return ::__tg_sinpi(x); }
1799#endif
1800
1801#if SIMD_LIBRARY_VERSION >= 1
1802/*! @abstract Generalizes the <cmath> function tanpi to operate on vectors
1803 * of floats and doubles. */
1804 template <typename fptypeN>
1805 static SIMD_CPPFUNC fptypeN tanpi(fptypeN x) { return ::__tg_tanpi(x); }
1806#endif
1807
1808/*! @abstract Generalizes the <cmath> function acosh to operate on vectors
1809 * of floats and doubles. */
1810 template <typename fptypeN>
1811 static SIMD_CPPFUNC fptypeN acosh(fptypeN x) { return ::__tg_acosh(x); }
1812
1813/*! @abstract Generalizes the <cmath> function asinh to operate on vectors
1814 * of floats and doubles. */
1815 template <typename fptypeN>
1816 static SIMD_CPPFUNC fptypeN asinh(fptypeN x) { return ::__tg_asinh(x); }
1817
1818/*! @abstract Generalizes the <cmath> function atanh to operate on vectors
1819 * of floats and doubles. */
1820 template <typename fptypeN>
1821 static SIMD_CPPFUNC fptypeN atanh(fptypeN x) { return ::__tg_atanh(x); }
1822
1823/*! @abstract Generalizes the <cmath> function cosh to operate on vectors of
1824 * floats and doubles. */
1825 template <typename fptypeN>
1826 static SIMD_CPPFUNC fptypeN cosh(fptypeN x) { return ::__tg_cosh(x); }
1827
1828/*! @abstract Generalizes the <cmath> function sinh to operate on vectors of
1829 * floats and doubles. */
1830 template <typename fptypeN>
1831 static SIMD_CPPFUNC fptypeN sinh(fptypeN x) { return ::__tg_sinh(x); }
1832
1833/*! @abstract Generalizes the <cmath> function tanh to operate on vectors of
1834 * floats and doubles. */
1835 template <typename fptypeN>
1836 static SIMD_CPPFUNC fptypeN tanh(fptypeN x) { return ::__tg_tanh(x); }
1837
1838/*! @abstract Generalizes the <cmath> function exp to operate on vectors of
1839 * floats and doubles. */
1840 template <typename fptypeN>
1841 static SIMD_CPPFUNC fptypeN exp(fptypeN x) { return ::__tg_exp(x); }
1842
1843/*! @abstract Generalizes the <cmath> function exp2 to operate on vectors of
1844 * floats and doubles. */
1845 template <typename fptypeN>
1846 static SIMD_CPPFUNC fptypeN exp2(fptypeN x) { return ::__tg_exp2(x); }
1847
1848#if SIMD_LIBRARY_VERSION >= 1
1849/*! @abstract Generalizes the <cmath> function exp10 to operate on vectors
1850 * of floats and doubles. */
1851 template <typename fptypeN>
1852 static SIMD_CPPFUNC fptypeN exp10(fptypeN x) { return ::__tg_exp10(x); }
1853#endif
1854
1855/*! @abstract Generalizes the <cmath> function expm1 to operate on vectors
1856 * of floats and doubles. */
1857 template <typename fptypeN>
1858 static SIMD_CPPFUNC fptypeN expm1(fptypeN x) { return ::__tg_expm1(x); }
1859
1860/*! @abstract Generalizes the <cmath> function log to operate on vectors of
1861 * floats and doubles. */
1862 template <typename fptypeN>
1863 static SIMD_CPPFUNC fptypeN log(fptypeN x) { return ::__tg_log(x); }
1864
1865/*! @abstract Generalizes the <cmath> function log2 to operate on vectors of
1866 * floats and doubles. */
1867 template <typename fptypeN>
1868 static SIMD_CPPFUNC fptypeN log2(fptypeN x) { return ::__tg_log2(x); }
1869
1870/*! @abstract Generalizes the <cmath> function log10 to operate on vectors
1871 * of floats and doubles. */
1872 template <typename fptypeN>
1873 static SIMD_CPPFUNC fptypeN log10(fptypeN x) { return ::__tg_log10(x); }
1874
1875/*! @abstract Generalizes the <cmath> function log1p to operate on vectors
1876 * of floats and doubles. */
1877 template <typename fptypeN>
1878 static SIMD_CPPFUNC fptypeN log1p(fptypeN x) { return ::__tg_log1p(x); }
1879
1880/*! @abstract Generalizes the <cmath> function fabs to operate on vectors of
1881 * floats and doubles. */
1882 template <typename fptypeN>
1883 static SIMD_CPPFUNC fptypeN fabs(fptypeN x) { return ::__tg_fabs(x); }
1884
1885/*! @abstract Generalizes the <cmath> function cbrt to operate on vectors of
1886 * floats and doubles. */
1887 template <typename fptypeN>
1888 static SIMD_CPPFUNC fptypeN cbrt(fptypeN x) { return ::__tg_cbrt(x); }
1889
1890/*! @abstract Generalizes the <cmath> function sqrt to operate on vectors of
1891 * floats and doubles. */
1892 template <typename fptypeN>
1893 static SIMD_CPPFUNC fptypeN sqrt(fptypeN x) { return ::__tg_sqrt(x); }
1894
1895/*! @abstract Generalizes the <cmath> function erf to operate on vectors of
1896 * floats and doubles. */
1897 template <typename fptypeN>
1898 static SIMD_CPPFUNC fptypeN erf(fptypeN x) { return ::__tg_erf(x); }
1899
1900/*! @abstract Generalizes the <cmath> function erfc to operate on vectors of
1901 * floats and doubles. */
1902 template <typename fptypeN>
1903 static SIMD_CPPFUNC fptypeN erfc(fptypeN x) { return ::__tg_erfc(x); }
1904
1905/*! @abstract Generalizes the <cmath> function tgamma to operate on vectors
1906 * of floats and doubles. */
1907 template <typename fptypeN>
1908 static SIMD_CPPFUNC fptypeN tgamma(fptypeN x) { return ::__tg_tgamma(x); }
1909
1910/*! @abstract Generalizes the <cmath> function lgamma to operate on vectors
1911 * of floats and doubles. */
1912 template <typename fptypeN>
1913 static SIMD_CPPFUNC fptypeN lgamma(fptypeN x) { return ::__tg_lgamma(x); }
1914
1915/*! @abstract Generalizes the <cmath> function ceil to operate on vectors of
1916 * floats and doubles. */
1917 template <typename fptypeN>
1918 static SIMD_CPPFUNC fptypeN ceil(fptypeN x) { return ::__tg_ceil(x); }
1919
1920/*! @abstract Generalizes the <cmath> function floor to operate on vectors
1921 * of floats and doubles. */
1922 template <typename fptypeN>
1923 static SIMD_CPPFUNC fptypeN floor(fptypeN x) { return ::__tg_floor(x); }
1924
1925/*! @abstract Generalizes the <cmath> function rint to operate on vectors of
1926 * floats and doubles. */
1927 template <typename fptypeN>
1928 static SIMD_CPPFUNC fptypeN rint(fptypeN x) { return ::__tg_rint(x); }
1929
1930/*! @abstract Generalizes the <cmath> function round to operate on vectors
1931 * of floats and doubles. */
1932 template <typename fptypeN>
1933 static SIMD_CPPFUNC fptypeN round(fptypeN x) { return ::__tg_round(x); }
1934
1935/*! @abstract Generalizes the <cmath> function trunc to operate on vectors
1936 * of floats and doubles. */
1937 template <typename fptypeN>
1938 static SIMD_CPPFUNC fptypeN trunc(fptypeN x) { return ::__tg_trunc(x); }
1939
1940/*! @abstract Generalizes the <cmath> function isfinite to operate on
1941 * vectors of floats and doubles. */
1942 template <typename fptypeN>
1943 static SIMD_CPPFUNC
1944 typename std::enable_if<std::is_floating_point<typename traits<fptypeN>::scalar_t>::value, typename traits<fptypeN>::mask_t>::type
1945 isfinite(fptypeN x) { return ::__tg_isfinite(x); }
1946
1947/*! @abstract Generalizes the <cmath> function isinf to operate on vectors
1948 * of floats and doubles. */
1949 template <typename fptypeN>
1950 static SIMD_CPPFUNC
1951 typename std::enable_if<std::is_floating_point<typename traits<fptypeN>::scalar_t>::value, typename traits<fptypeN>::mask_t>::type
1952 isinf(fptypeN x) { return ::__tg_isinf(x); }
1953
1954/*! @abstract Generalizes the <cmath> function isnan to operate on vectors
1955 * of floats and doubles. */
1956 template <typename fptypeN>
1957 static SIMD_CPPFUNC
1958 typename std::enable_if<std::is_floating_point<typename traits<fptypeN>::scalar_t>::value, typename traits<fptypeN>::mask_t>::type
1959 isnan(fptypeN x) { return ::__tg_isnan(x); }
1960
1961/*! @abstract Generalizes the <cmath> function isnormal to operate on
1962 * vectors of floats and doubles. */
1963 template <typename fptypeN>
1964 static SIMD_CPPFUNC
1965 typename std::enable_if<std::is_floating_point<typename traits<fptypeN>::scalar_t>::value, typename traits<fptypeN>::mask_t>::type
1966 isnormal(fptypeN x) { return ::__tg_isnormal(x); }
1967
1968/*! @abstract Generalizes the <cmath> function atan2 to operate on vectors
1969 * of floats and doubles. */
1970 template <typename fptypeN>
1971 static SIMD_CPPFUNC fptypeN atan2(fptypeN y, fptypeN x) { return ::__tg_atan2(y, x); }
1972
1973/*! @abstract Generalizes the <cmath> function hypot to operate on vectors
1974 * of floats and doubles. */
1975 template <typename fptypeN>
1976 static SIMD_CPPFUNC fptypeN hypot(fptypeN x, fptypeN y) { return ::__tg_hypot(x, y); }
1977
1978/*! @abstract Generalizes the <cmath> function pow to operate on vectors of
1979 * floats and doubles. */
1980 template <typename fptypeN>
1981 static SIMD_CPPFUNC fptypeN pow(fptypeN x, fptypeN y) { return ::__tg_pow(x, y); }
1982
1983/*! @abstract Generalizes the <cmath> function fmod to operate on vectors of
1984 * floats and doubles. */
1985 template <typename fptypeN>
1986 static SIMD_CPPFUNC fptypeN fmod(fptypeN x, fptypeN y) { return ::__tg_fmod(x, y); }
1987
1988/*! @abstract Generalizes the <cmath> function remainder to operate on
1989 * vectors of floats and doubles. */
1990 template <typename fptypeN>
1991 static SIMD_CPPFUNC fptypeN remainder(fptypeN x, fptypeN y) { return ::__tg_remainder(x, y); }
1992
1993/*! @abstract Generalizes the <cmath> function copysign to operate on
1994 * vectors of floats and doubles. */
1995 template <typename fptypeN>
1996 static SIMD_CPPFUNC fptypeN copysign(fptypeN x, fptypeN y) { return ::__tg_copysign(x, y); }
1997
1998/*! @abstract Generalizes the <cmath> function nextafter to operate on
1999 * vectors of floats and doubles. */
2000 template <typename fptypeN>
2001 static SIMD_CPPFUNC fptypeN nextafter(fptypeN x, fptypeN y) { return ::__tg_nextafter(x, y); }
2002
2003/*! @abstract Generalizes the <cmath> function fdim to operate on vectors of
2004 * floats and doubles. */
2005 template <typename fptypeN>
2006 static SIMD_CPPFUNC fptypeN fdim(fptypeN x, fptypeN y) { return ::__tg_fdim(x, y); }
2007
2008/*! @abstract Generalizes the <cmath> function fmax to operate on vectors of
2009 * floats and doubles. */
2010 template <typename fptypeN>
2011 static SIMD_CPPFUNC fptypeN fmax(fptypeN x, fptypeN y) { return ::__tg_fmax(x, y); }
2012
2013/*! @abstract Generalizes the <cmath> function fmin to operate on vectors of
2014 * floats and doubles. */
2015 template <typename fptypeN>
2016 static SIMD_CPPFUNC fptypeN fmin(fptypeN x, fptypeN y) { return ::__tg_fmin(x, y); }
2017
2018/*! @abstract Generalizes the <cmath> function fma to operate on vectors of
2019 * floats and doubles. */
2020 template <typename fptypeN>
2021 static SIMD_CPPFUNC fptypeN fma(fptypeN x, fptypeN y, fptypeN z) { return ::__tg_fma(x, y, z); }
2022
2023/*! @abstract Computes x*y + z by the most efficient means available; either
2024 * a fused multiply add or separate multiply and add. */
2025 template <typename fptypeN>
2026 static SIMD_CPPFUNC fptypeN muladd(fptypeN x, fptypeN y, fptypeN z) { return ::simd_muladd(x, y, z); }
2027};
2028
2029extern "C" {
2030#else
2031#include <tgmath.h>
2032/* C and Objective-C, we need some infrastructure to piggyback on tgmath.h */
2033static SIMD_OVERLOAD simd_float2 __tg_promote(simd_float2);
2034static SIMD_OVERLOAD simd_float3 __tg_promote(simd_float3);
2035static SIMD_OVERLOAD simd_float4 __tg_promote(simd_float4);
2036static SIMD_OVERLOAD simd_float8 __tg_promote(simd_float8);
2037static SIMD_OVERLOAD simd_float16 __tg_promote(simd_float16);
2038static SIMD_OVERLOAD simd_double2 __tg_promote(simd_double2);
2039static SIMD_OVERLOAD simd_double3 __tg_promote(simd_double3);
2040static SIMD_OVERLOAD simd_double4 __tg_promote(simd_double4);
2041static SIMD_OVERLOAD simd_double8 __tg_promote(simd_double8);
2042
2043/* Apple extensions to <math.h>, added in macOS 10.9 and iOS 7.0 */
2044#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9 || \
2045 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0 || \
2046 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_19_0
2047static inline SIMD_CFUNC float __tg_cospi(float x) { return __cospif(x); }
2048static inline SIMD_CFUNC double __tg_cospi(double x) { return __cospi(x); }
2049#undef cospi
2050/*! @abstract `cospi(x)` computes `cos(pi * x)` without intermediate rounding.
2051 *
2052 * @discussion Both faster and more accurate than multiplying by `pi` and then
2053 * calling `cos`. Defined for `float` and `double` as well as vectors of
2054 * floats and doubles as provided by `<simd/simd.h>`. */
2055#define cospi(__x) __tg_cospi(__tg_promote1((__x))(__x))
2056
2057static inline SIMD_CFUNC float __tg_sinpi(float x) { return __sinpif(x); }
2058static inline SIMD_CFUNC double __tg_sinpi(double x) { return __sinpi(x); }
2059#undef sinpi
2060/*! @abstract `sinpi(x)` computes `sin(pi * x)` without intermediate rounding.
2061 *
2062 * @discussion Both faster and more accurate than multiplying by `pi` and then
2063 * calling `sin`. Defined for `float` and `double` as well as vectors
2064 * of floats and doubles as provided by `<simd/simd.h>`. */
2065#define sinpi(__x) __tg_sinpi(__tg_promote1((__x))(__x))
2066
2067static inline SIMD_CFUNC float __tg_tanpi(float x) { return __tanpif(x); }
2068static inline SIMD_CFUNC double __tg_tanpi(double x) { return __tanpi(x); }
2069#undef tanpi
2070/*! @abstract `tanpi(x)` computes `tan(pi * x)` without intermediate rounding.
2071 *
2072 * @discussion Both faster and more accurate than multiplying by `pi` and then
2073 * calling `tan`. Defined for `float` and `double` as well as vectors of
2074 * floats and doubles as provided by `<simd/simd.h>`. */
2075#define tanpi(__x) __tg_tanpi(__tg_promote1((__x))(__x))
2076
2077static inline SIMD_CFUNC float __tg_exp10(float x) { return __exp10f(x); }
2078static inline SIMD_CFUNC double __tg_exp10(double x) { return __exp10(x); }
2079#undef exp10
2080/*! @abstract `exp10(x)` computes `10**x` more efficiently and accurately
2081 * than `pow(10, x)`.
2082 *
2083 * @discussion Defined for `float` and `double` as well as vectors of floats
2084 * and doubles as provided by `<simd/simd.h>`. */
2085#define exp10(__x) __tg_exp10(__tg_promote1((__x))(__x))
2086#endif
2087
2088#if (defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__)
2089static inline SIMD_CFUNC int __tg_isfinite(float x) { return __inline_isfinitef(x); }
2090static inline SIMD_CFUNC int __tg_isfinite(double x) { return __inline_isfinited(x); }
2091static inline SIMD_CFUNC int __tg_isfinite(long double x) { return __inline_isfinitel(x); }
2092#undef isfinite
2093/*! @abstract `__tg_isfinite(x)` determines if x is a finite value.
2094 *
2095 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2096 * and doubles as provided by `<simd/simd.h>`. */
2097#define isfinite(__x) __tg_isfinite(__tg_promote1((__x))(__x))
2098
2099static inline SIMD_CFUNC int __tg_isinf(float x) { return __inline_isinff(x); }
2100static inline SIMD_CFUNC int __tg_isinf(double x) { return __inline_isinfd(x); }
2101static inline SIMD_CFUNC int __tg_isinf(long double x) { return __inline_isinfl(x); }
2102#undef isinf
2103/*! @abstract `__tg_isinf(x)` determines if x is positive or negative infinity.
2104 *
2105 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2106 * and doubles as provided by `<simd/simd.h>`. */
2107#define isinf(__x) __tg_isinf(__tg_promote1((__x))(__x))
2108
2109static inline SIMD_CFUNC int __tg_isnan(float x) { return __inline_isnanf(x); }
2110static inline SIMD_CFUNC int __tg_isnan(double x) { return __inline_isnand(x); }
2111static inline SIMD_CFUNC int __tg_isnan(long double x) { return __inline_isnanl(x); }
2112#undef isnan
2113/*! @abstract `__tg_isnan(x)` determines if x is a not-a-number (NaN) value.
2114 *
2115 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2116 * and doubles as provided by `<simd/simd.h>`. */
2117#define isnan(__x) __tg_isnan(__tg_promote1((__x))(__x))
2118
2119static inline SIMD_CFUNC int __tg_isnormal(float x) { return __inline_isnormalf(x); }
2120static inline SIMD_CFUNC int __tg_isnormal(double x) { return __inline_isnormald(x); }
2121static inline SIMD_CFUNC int __tg_isnormal(long double x) { return __inline_isnormall(x); }
2122#undef isnormal
2123/*! @abstract `__tg_isnormal(x)` determines if x is a normal value.
2124 *
2125 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2126 * and doubles as provided by `<simd/simd.h>`. */
2127#define isnormal(__x) __tg_isnormal(__tg_promote1((__x))(__x))
2128
2129#else /* defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__ */
2130
2131static inline SIMD_CFUNC int __tg_isfinite(float x) { return __isfinitef(x); }
2132static inline SIMD_CFUNC int __tg_isfinite(double x) { return __isfinited(x); }
2133static inline SIMD_CFUNC int __tg_isfinite(long double x) { return __isfinitel(x); }
2134#undef isfinite
2135/*! @abstract `__tg_isfinite(x)` determines if x is a finite value.
2136 *
2137 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2138 * and doubles as provided by `<simd/simd.h>`. */
2139#define isfinite(__x) __tg_isfinite(__tg_promote1((__x))(__x))
2140
2141static inline SIMD_CFUNC int __tg_isinf(float x) { return __isinff(x); }
2142static inline SIMD_CFUNC int __tg_isinf(double x) { return __isinfd(x); }
2143static inline SIMD_CFUNC int __tg_isinf(long double x) { return __isinfl(x); }
2144#undef isinf
2145/*! @abstract `__tg_isinf(x)` determines if x is positive or negative infinity.
2146 *
2147 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2148 * and doubles as provided by `<simd/simd.h>`. */
2149#define isinf(__x) __tg_isinf(__tg_promote1((__x))(__x))
2150
2151static inline SIMD_CFUNC int __tg_isnan(float x) { return __isnanf(x); }
2152static inline SIMD_CFUNC int __tg_isnan(double x) { return __isnand(x); }
2153static inline SIMD_CFUNC int __tg_isnan(long double x) { return __isnanl(x); }
2154#undef isnan
2155/*! @abstract `__tg_isnan(x)` determines if x is a not-a-number (NaN) value.
2156 *
2157 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2158 * and doubles as provided by `<simd/simd.h>`. */
2159#define isnan(__x) __tg_isnan(__tg_promote1((__x))(__x))
2160
2161static inline SIMD_CFUNC int __tg_isnormal(float x) { return __isnormalf(x); }
2162static inline SIMD_CFUNC int __tg_isnormal(double x) { return __isnormald(x); }
2163static inline SIMD_CFUNC int __tg_isnormal(long double x) { return __isnormall(x); }
2164#undef isnormal
2165/*! @abstract `__tg_isnormal(x)` determines if x is a normal value.
2166 *
2167 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2168 * and doubles as provided by `<simd/simd.h>`. */
2169#define isnormal(__x) __tg_isnormal(__tg_promote1((__x))(__x))
2170#endif /* defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__ */
2171#endif /* !__cplusplus */
2172
2173#pragma mark - fabs implementation
2174static inline SIMD_CFUNC simd_float2 __tg_fabs(simd_float2 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2175static inline SIMD_CFUNC simd_float3 __tg_fabs(simd_float3 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2176static inline SIMD_CFUNC simd_float4 __tg_fabs(simd_float4 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2177static inline SIMD_CFUNC simd_float8 __tg_fabs(simd_float8 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2178static inline SIMD_CFUNC simd_float16 __tg_fabs(simd_float16 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2179static inline SIMD_CFUNC simd_double2 __tg_fabs(simd_double2 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
2180static inline SIMD_CFUNC simd_double3 __tg_fabs(simd_double3 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
2181static inline SIMD_CFUNC simd_double4 __tg_fabs(simd_double4 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
2182static inline SIMD_CFUNC simd_double8 __tg_fabs(simd_double8 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
2183
2184#pragma mark - isfinite implementation
2185static inline SIMD_CFUNC simd_int2 __tg_isfinite(simd_float2 x) { return x == x && __tg_fabs(x) != (simd_float2)INFINITY; }
2186static inline SIMD_CFUNC simd_int3 __tg_isfinite(simd_float3 x) { return x == x && __tg_fabs(x) != (simd_float3)INFINITY; }
2187static inline SIMD_CFUNC simd_int4 __tg_isfinite(simd_float4 x) { return x == x && __tg_fabs(x) != (simd_float4)INFINITY; }
2188static inline SIMD_CFUNC simd_int8 __tg_isfinite(simd_float8 x) { return x == x && __tg_fabs(x) != (simd_float8)INFINITY; }
2189static inline SIMD_CFUNC simd_int16 __tg_isfinite(simd_float16 x) { return x == x && __tg_fabs(x) != (simd_float16)INFINITY; }
2190static inline SIMD_CFUNC simd_long2 __tg_isfinite(simd_double2 x) { return x == x && __tg_fabs(x) != (simd_double2)INFINITY; }
2191static inline SIMD_CFUNC simd_long3 __tg_isfinite(simd_double3 x) { return x == x && __tg_fabs(x) != (simd_double3)INFINITY; }
2192static inline SIMD_CFUNC simd_long4 __tg_isfinite(simd_double4 x) { return x == x && __tg_fabs(x) != (simd_double4)INFINITY; }
2193static inline SIMD_CFUNC simd_long8 __tg_isfinite(simd_double8 x) { return x == x && __tg_fabs(x) != (simd_double8)INFINITY; }
2194
2195#pragma mark - isinf implementation
2196static inline SIMD_CFUNC simd_int2 __tg_isinf(simd_float2 x) { return __tg_fabs(x) == (simd_float2)INFINITY; }
2197static inline SIMD_CFUNC simd_int3 __tg_isinf(simd_float3 x) { return __tg_fabs(x) == (simd_float3)INFINITY; }
2198static inline SIMD_CFUNC simd_int4 __tg_isinf(simd_float4 x) { return __tg_fabs(x) == (simd_float4)INFINITY; }
2199static inline SIMD_CFUNC simd_int8 __tg_isinf(simd_float8 x) { return __tg_fabs(x) == (simd_float8)INFINITY; }
2200static inline SIMD_CFUNC simd_int16 __tg_isinf(simd_float16 x) { return __tg_fabs(x) == (simd_float16)INFINITY; }
2201static inline SIMD_CFUNC simd_long2 __tg_isinf(simd_double2 x) { return __tg_fabs(x) == (simd_double2)INFINITY; }
2202static inline SIMD_CFUNC simd_long3 __tg_isinf(simd_double3 x) { return __tg_fabs(x) == (simd_double3)INFINITY; }
2203static inline SIMD_CFUNC simd_long4 __tg_isinf(simd_double4 x) { return __tg_fabs(x) == (simd_double4)INFINITY; }
2204static inline SIMD_CFUNC simd_long8 __tg_isinf(simd_double8 x) { return __tg_fabs(x) == (simd_double8)INFINITY; }
2205
2206#pragma mark - isnan implementation
2207static inline SIMD_CFUNC simd_int2 __tg_isnan(simd_float2 x) { return x != x; }
2208static inline SIMD_CFUNC simd_int3 __tg_isnan(simd_float3 x) { return x != x; }
2209static inline SIMD_CFUNC simd_int4 __tg_isnan(simd_float4 x) { return x != x; }
2210static inline SIMD_CFUNC simd_int8 __tg_isnan(simd_float8 x) { return x != x; }
2211static inline SIMD_CFUNC simd_int16 __tg_isnan(simd_float16 x) { return x != x; }
2212static inline SIMD_CFUNC simd_long2 __tg_isnan(simd_double2 x) { return x != x; }
2213static inline SIMD_CFUNC simd_long3 __tg_isnan(simd_double3 x) { return x != x; }
2214static inline SIMD_CFUNC simd_long4 __tg_isnan(simd_double4 x) { return x != x; }
2215static inline SIMD_CFUNC simd_long8 __tg_isnan(simd_double8 x) { return x != x; }
2216
2217#pragma mark - isnormal implementation
2218static inline SIMD_CFUNC simd_int2 __tg_isnormal(simd_float2 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float2)__FLT_MIN__; }
2219static inline SIMD_CFUNC simd_int3 __tg_isnormal(simd_float3 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float3)__FLT_MIN__; }
2220static inline SIMD_CFUNC simd_int4 __tg_isnormal(simd_float4 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float4)__FLT_MIN__; }
2221static inline SIMD_CFUNC simd_int8 __tg_isnormal(simd_float8 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float8)__FLT_MIN__; }
2222static inline SIMD_CFUNC simd_int16 __tg_isnormal(simd_float16 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float16)__FLT_MIN__; }
2223static inline SIMD_CFUNC simd_long2 __tg_isnormal(simd_double2 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_double2)__DBL_MIN__; }
2224static inline SIMD_CFUNC simd_long3 __tg_isnormal(simd_double3 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_double3)__DBL_MIN__; }
2225static inline SIMD_CFUNC simd_long4 __tg_isnormal(simd_double4 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_double4)__DBL_MIN__; }
2226static inline SIMD_CFUNC simd_long8 __tg_isnormal(simd_double8 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_double8)__DBL_MIN__; }
2227
2228#pragma mark - fmin, fmax implementation
2229static SIMD_CFUNC simd_float2 __tg_fmin(simd_float2 x, simd_float2 y) {
2230#if defined __SSE2__
2231 return simd_make_float2(__tg_fmin(simd_make_float4_undef(x), simd_make_float4_undef(y)));
2232#elif defined __arm64__
2233 return vminnm_f32(x, y);
2234#elif defined __arm__ && __FINITE_MATH_ONLY__
2235 return vmin_f32(x, y);
2236#else
2237 return simd_bitselect(y, x, (x <= y) | (y != y));
2238#endif
2239}
2240
2241static SIMD_CFUNC simd_float3 __tg_fmin(simd_float3 x, simd_float3 y) {
2242 return simd_make_float3(__tg_fmin(simd_make_float4_undef(x), simd_make_float4_undef(y)));
2243}
2244
2245static SIMD_CFUNC simd_float4 __tg_fmin(simd_float4 x, simd_float4 y) {
2246#if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__
2247 return _mm_range_ps(x, y, 4);
2248#elif defined __SSE2__ && __FINITE_MATH_ONLY__
2249 return _mm_min_ps(x, y);
2250#elif defined __SSE2__
2251 return simd_bitselect(_mm_min_ps(x, y), x, y != y);
2252#elif defined __arm64__
2253 return vminnmq_f32(x, y);
2254#elif defined __arm__ && __FINITE_MATH_ONLY__
2255 return vminq_f32(x, y);
2256#else
2257 return simd_bitselect(y, x, (x <= y) | (y != y));
2258#endif
2259}
2260
2261static SIMD_CFUNC simd_float8 __tg_fmin(simd_float8 x, simd_float8 y) {
2262#if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__
2263 return _mm256_range_ps(x, y, 4);
2264#elif defined __AVX__ && __FINITE_MATH_ONLY__
2265 return _mm256_min_ps(x, y);
2266#elif defined __AVX__
2267 return simd_bitselect(_mm256_min_ps(x, y), x, y != y);
2268#else
2269 return simd_make_float8(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi));
2270#endif
2271}
2272
2273static SIMD_CFUNC simd_float16 __tg_fmin(simd_float16 x, simd_float16 y) {
2274#if defined __x86_64__ && defined __AVX512DQ__ && !__FINITE_MATH_ONLY__
2275 return _mm512_range_ps(x, y, 4);
2276#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__
2277 return _mm512_min_ps(x, y);
2278#elif defined __x86_64__ && defined __AVX512F__
2279 return simd_bitselect(_mm512_min_ps(x, y), x, y != y);
2280#else
2281 return simd_make_float16(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi));
2282#endif
2283}
2284
2285static SIMD_CFUNC simd_double2 __tg_fmin(simd_double2 x, simd_double2 y) {
2286#if defined __AVX512DQ__ && defined __AVX512VL__
2287 return _mm_range_pd(x, y, 4);
2288#elif defined __SSE2__ && __FINITE_MATH_ONLY__
2289 return _mm_min_pd(x, y);
2290#elif defined __SSE2__
2291 return simd_bitselect(_mm_min_pd(x, y), x, y != y);
2292#elif defined __arm64__
2293 return vminnmq_f64(x, y);
2294#else
2295 return simd_bitselect(y, x, (x <= y) | (y != y));
2296#endif
2297}
2298
2299static SIMD_CFUNC simd_double3 __tg_fmin(simd_double3 x, simd_double3 y) {
2300 return simd_make_double3(__tg_fmin(simd_make_double4_undef(x), simd_make_double4_undef(y)));
2301}
2302
2303static SIMD_CFUNC simd_double4 __tg_fmin(simd_double4 x, simd_double4 y) {
2304#if defined __AVX512DQ__ && defined __AVX512VL__
2305 return _mm256_range_pd(x, y, 4);
2306#elif defined __AVX__ && __FINITE_MATH_ONLY__
2307 return _mm256_min_pd(x, y);
2308#elif defined __AVX__
2309 return simd_bitselect(_mm256_min_pd(x, y), x, y != y);
2310#else
2311 return simd_make_double4(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi));
2312#endif
2313}
2314
2315static SIMD_CFUNC simd_double8 __tg_fmin(simd_double8 x, simd_double8 y) {
2316#if defined __x86_64__ && defined __AVX512DQ__
2317 return _mm512_range_pd(x, y, 4);
2318#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__
2319 return _mm512_min_pd(x, y);
2320#elif defined __x86_64__ && defined __AVX512F__
2321 return simd_bitselect(_mm512_min_pd(x, y), x, y != y);
2322#else
2323 return simd_make_double8(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi));
2324#endif
2325}
2326
2327static SIMD_CFUNC simd_float2 __tg_fmax(simd_float2 x, simd_float2 y) {
2328#if defined __SSE2__
2329 return simd_make_float2(__tg_fmax(simd_make_float4_undef(x), simd_make_float4_undef(y)));
2330#elif defined __arm64__
2331 return vmaxnm_f32(x, y);
2332#elif defined __arm__ && __FINITE_MATH_ONLY__
2333 return vmax_f32(x, y);
2334#else
2335 return simd_bitselect(y, x, (x >= y) | (y != y));
2336#endif
2337}
2338
2339static SIMD_CFUNC simd_float3 __tg_fmax(simd_float3 x, simd_float3 y) {
2340 return simd_make_float3(__tg_fmax(simd_make_float4_undef(x), simd_make_float4_undef(y)));
2341}
2342
2343static SIMD_CFUNC simd_float4 __tg_fmax(simd_float4 x, simd_float4 y) {
2344#if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__
2345 return _mm_range_ps(x, y, 5);
2346#elif defined __SSE2__ && __FINITE_MATH_ONLY__
2347 return _mm_max_ps(x, y);
2348#elif defined __SSE2__
2349 return simd_bitselect(_mm_max_ps(x, y), x, y != y);
2350#elif defined __arm64__
2351 return vmaxnmq_f32(x, y);
2352#elif defined __arm__ && __FINITE_MATH_ONLY__
2353 return vmaxq_f32(x, y);
2354#else
2355 return simd_bitselect(y, x, (x >= y) | (y != y));
2356#endif
2357}
2358
2359static SIMD_CFUNC simd_float8 __tg_fmax(simd_float8 x, simd_float8 y) {
2360#if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__
2361 return _mm256_range_ps(x, y, 5);
2362#elif defined __AVX__ && __FINITE_MATH_ONLY__
2363 return _mm256_max_ps(x, y);
2364#elif defined __AVX__
2365 return simd_bitselect(_mm256_max_ps(x, y), x, y != y);
2366#else
2367 return simd_make_float8(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi));
2368#endif
2369}
2370
2371static SIMD_CFUNC simd_float16 __tg_fmax(simd_float16 x, simd_float16 y) {
2372#if defined __x86_64__ && defined __AVX512DQ__ && !__FINITE_MATH_ONLY__
2373 return _mm512_range_ps(x, y, 5);
2374#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__
2375 return _mm512_max_ps(x, y);
2376#elif defined __x86_64__ && defined __AVX512F__
2377 return simd_bitselect(_mm512_max_ps(x, y), x, y != y);
2378#else
2379 return simd_make_float16(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi));
2380#endif
2381}
2382
2383static SIMD_CFUNC simd_double2 __tg_fmax(simd_double2 x, simd_double2 y) {
2384#if defined __AVX512DQ__ && defined __AVX512VL__
2385 return _mm_range_pd(x, y, 5);
2386#elif defined __SSE2__ && __FINITE_MATH_ONLY__
2387 return _mm_max_pd(x, y);
2388#elif defined __SSE2__
2389 return simd_bitselect(_mm_max_pd(x, y), x, y != y);
2390#elif defined __arm64__
2391 return vmaxnmq_f64(x, y);
2392#else
2393 return simd_bitselect(y, x, (x >= y) | (y != y));
2394#endif
2395}
2396
2397static SIMD_CFUNC simd_double3 __tg_fmax(simd_double3 x, simd_double3 y) {
2398 return simd_make_double3(__tg_fmax(simd_make_double4_undef(x), simd_make_double4_undef(y)));
2399}
2400
2401static SIMD_CFUNC simd_double4 __tg_fmax(simd_double4 x, simd_double4 y) {
2402#if defined __AVX512DQ__ && defined __AVX512VL__
2403 return _mm256_range_pd(x, y, 5);
2404#elif defined __AVX__ && __FINITE_MATH_ONLY__
2405 return _mm256_max_pd(x, y);
2406#elif defined __AVX__
2407 return simd_bitselect(_mm256_max_pd(x, y), x, y != y);
2408#else
2409 return simd_make_double4(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi));
2410#endif
2411}
2412
2413static SIMD_CFUNC simd_double8 __tg_fmax(simd_double8 x, simd_double8 y) {
2414#if defined __x86_64__ && defined __AVX512DQ__
2415 return _mm512_range_pd(x, y, 5);
2416#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__
2417 return _mm512_max_pd(x, y);
2418#elif defined __x86_64__ && defined __AVX512F__
2419 return simd_bitselect(_mm512_max_pd(x, y), x, y != y);
2420#else
2421 return simd_make_double8(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi));
2422#endif
2423}
2424
2425#pragma mark - copysign implementation
2426static inline SIMD_CFUNC simd_float2 __tg_copysign(simd_float2 x, simd_float2 y) { return simd_bitselect(y, x, 0x7fffffff); }
2427static inline SIMD_CFUNC simd_float3 __tg_copysign(simd_float3 x, simd_float3 y) { return simd_bitselect(y, x, 0x7fffffff); }
2428static inline SIMD_CFUNC simd_float4 __tg_copysign(simd_float4 x, simd_float4 y) { return simd_bitselect(y, x, 0x7fffffff); }
2429static inline SIMD_CFUNC simd_float8 __tg_copysign(simd_float8 x, simd_float8 y) { return simd_bitselect(y, x, 0x7fffffff); }
2430static inline SIMD_CFUNC simd_float16 __tg_copysign(simd_float16 x, simd_float16 y) { return simd_bitselect(y, x, 0x7fffffff); }
2431static inline SIMD_CFUNC simd_double2 __tg_copysign(simd_double2 x, simd_double2 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); }
2432static inline SIMD_CFUNC simd_double3 __tg_copysign(simd_double3 x, simd_double3 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); }
2433static inline SIMD_CFUNC simd_double4 __tg_copysign(simd_double4 x, simd_double4 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); }
2434static inline SIMD_CFUNC simd_double8 __tg_copysign(simd_double8 x, simd_double8 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); }
2435
2436#pragma mark - sqrt implementation
2437static SIMD_CFUNC simd_float2 __tg_sqrt(simd_float2 x) {
2438#if defined __SSE2__
2439 return simd_make_float2(__tg_sqrt(simd_make_float4_undef(x)));
2440#elif defined __arm64__
2441 return vsqrt_f32(x);
2442#else
2443 return simd_make_float2(sqrt(x.x), sqrt(x.y));
2444#endif
2445}
2446
2447static SIMD_CFUNC simd_float3 __tg_sqrt(simd_float3 x) {
2448 return simd_make_float3(__tg_sqrt(simd_make_float4_undef(x)));
2449}
2450
2451static SIMD_CFUNC simd_float4 __tg_sqrt(simd_float4 x) {
2452#if defined __SSE2__
2453 return _mm_sqrt_ps(x);
2454#elif defined __arm64__
2455 return vsqrtq_f32(x);
2456#else
2457 return simd_make_float4(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2458#endif
2459}
2460
2461static SIMD_CFUNC simd_float8 __tg_sqrt(simd_float8 x) {
2462#if defined __AVX__
2463 return _mm256_sqrt_ps(x);
2464#else
2465 return simd_make_float8(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2466#endif
2467}
2468
2469static SIMD_CFUNC simd_float16 __tg_sqrt(simd_float16 x) {
2470#if defined __x86_64__ && defined __AVX512F__
2471 return _mm512_sqrt_ps(x);
2472#else
2473 return simd_make_float16(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2474#endif
2475}
2476
2477static SIMD_CFUNC simd_double2 __tg_sqrt(simd_double2 x) {
2478#if defined __SSE2__
2479 return _mm_sqrt_pd(x);
2480#elif defined __arm64__
2481 return vsqrtq_f64(x);
2482#else
2483 return simd_make_double2(sqrt(x.x), sqrt(x.y));
2484#endif
2485}
2486
2487static SIMD_CFUNC simd_double3 __tg_sqrt(simd_double3 x) {
2488 return simd_make_double3(__tg_sqrt(simd_make_double4_undef(x)));
2489}
2490
2491static SIMD_CFUNC simd_double4 __tg_sqrt(simd_double4 x) {
2492#if defined __AVX__
2493 return _mm256_sqrt_pd(x);
2494#else
2495 return simd_make_double4(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2496#endif
2497}
2498
2499static SIMD_CFUNC simd_double8 __tg_sqrt(simd_double8 x) {
2500#if defined __x86_64__ && defined __AVX512F__
2501 return _mm512_sqrt_pd(x);
2502#else
2503 return simd_make_double8(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2504#endif
2505}
2506
2507#pragma mark - ceil, floor, rint, trunc implementation
2508static SIMD_CFUNC simd_float2 __tg_ceil(simd_float2 x) {
2509#if defined __arm64__
2510 return vrndp_f32(x);
2511#else
2512 return simd_make_float2(__tg_ceil(simd_make_float4_undef(x)));
2513#endif
2514}
2515
2516static SIMD_CFUNC simd_float3 __tg_ceil(simd_float3 x) {
2517 return simd_make_float3(__tg_ceil(simd_make_float4_undef(x)));
2518}
2519
2520#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2521extern simd_float4 _simd_ceil_f4(simd_float4 x);
2522#endif
2523
2524static SIMD_CFUNC simd_float4 __tg_ceil(simd_float4 x) {
2525#if defined __SSE4_1__
2526 return _mm_round_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2527#elif defined __arm64__
2528 return vrndpq_f32(x);
2529#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2530 return _simd_ceil_f4(x);
2531#else
2532 simd_float4 truncated = __tg_trunc(x);
2533 simd_float4 adjust = simd_bitselect((simd_float4)0, 1, truncated < x);
2534 return __tg_copysign(truncated + adjust, x);
2535#endif
2536}
2537
2538static SIMD_CFUNC simd_float8 __tg_ceil(simd_float8 x) {
2539#if defined __AVX__
2540 return _mm256_round_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2541#else
2542 return simd_make_float8(__tg_ceil(x.lo), __tg_ceil(x.hi));
2543#endif
2544}
2545
2546static SIMD_CFUNC simd_float16 __tg_ceil(simd_float16 x) {
2547#if defined __x86_64__ && defined __AVX512F__
2548 return _mm512_roundscale_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2549#else
2550 return simd_make_float16(__tg_ceil(x.lo), __tg_ceil(x.hi));
2551#endif
2552}
2553
2554#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2555extern simd_double2 _simd_ceil_d2(simd_double2 x);
2556#endif
2557
2558static SIMD_CFUNC simd_double2 __tg_ceil(simd_double2 x) {
2559#if defined __SSE4_1__
2560 return _mm_round_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2561#elif defined __arm64__
2562 return vrndpq_f64(x);
2563#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2564 return _simd_ceil_d2(x);
2565#else
2566 simd_double2 truncated = __tg_trunc(x);
2567 simd_double2 adjust = simd_bitselect((simd_double2)0, 1, truncated < x);
2568 return __tg_copysign(truncated + adjust, x);
2569#endif
2570}
2571
2572static SIMD_CFUNC simd_double3 __tg_ceil(simd_double3 x) {
2573 return simd_make_double3(__tg_ceil(simd_make_double4_undef(x)));
2574}
2575
2576static SIMD_CFUNC simd_double4 __tg_ceil(simd_double4 x) {
2577#if defined __AVX__
2578 return _mm256_round_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2579#else
2580 return simd_make_double4(__tg_ceil(x.lo), __tg_ceil(x.hi));
2581#endif
2582}
2583
2584static SIMD_CFUNC simd_double8 __tg_ceil(simd_double8 x) {
2585#if defined __x86_64__ && defined __AVX512F__
2586 return _mm512_roundscale_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2587#else
2588 return simd_make_double8(__tg_ceil(x.lo), __tg_ceil(x.hi));
2589#endif
2590}
2591
2592static SIMD_CFUNC simd_float2 __tg_floor(simd_float2 x) {
2593#if defined __arm64__
2594 return vrndm_f32(x);
2595#else
2596 return simd_make_float2(__tg_floor(simd_make_float4_undef(x)));
2597#endif
2598}
2599
2600static SIMD_CFUNC simd_float3 __tg_floor(simd_float3 x) {
2601 return simd_make_float3(__tg_floor(simd_make_float4_undef(x)));
2602}
2603
2604#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2605extern simd_float4 _simd_floor_f4(simd_float4 x);
2606#endif
2607
2608static SIMD_CFUNC simd_float4 __tg_floor(simd_float4 x) {
2609#if defined __SSE4_1__
2610 return _mm_round_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2611#elif defined __arm64__
2612 return vrndmq_f32(x);
2613#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2614 return _simd_floor_f4(x);
2615#else
2616 simd_float4 truncated = __tg_trunc(x);
2617 simd_float4 adjust = simd_bitselect((simd_float4)0, 1, truncated > x);
2618 return truncated - adjust;
2619#endif
2620}
2621
2622static SIMD_CFUNC simd_float8 __tg_floor(simd_float8 x) {
2623#if defined __AVX__
2624 return _mm256_round_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2625#else
2626 return simd_make_float8(__tg_floor(x.lo), __tg_floor(x.hi));
2627#endif
2628}
2629
2630static SIMD_CFUNC simd_float16 __tg_floor(simd_float16 x) {
2631#if defined __x86_64__ && defined __AVX512F__
2632 return _mm512_roundscale_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2633#else
2634 return simd_make_float16(__tg_floor(x.lo), __tg_floor(x.hi));
2635#endif
2636}
2637
2638#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2639extern simd_double2 _simd_floor_d2(simd_double2 x);
2640#endif
2641
2642static SIMD_CFUNC simd_double2 __tg_floor(simd_double2 x) {
2643#if defined __SSE4_1__
2644 return _mm_round_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2645#elif defined __arm64__
2646 return vrndmq_f64(x);
2647#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2648 return _simd_floor_d2(x);
2649#else
2650 simd_double2 truncated = __tg_trunc(x);
2651 simd_double2 adjust = simd_bitselect((simd_double2)0, 1, truncated > x);
2652 return truncated - adjust;
2653#endif
2654}
2655
2656static SIMD_CFUNC simd_double3 __tg_floor(simd_double3 x) {
2657 return simd_make_double3(__tg_floor(simd_make_double4_undef(x)));
2658}
2659
2660static SIMD_CFUNC simd_double4 __tg_floor(simd_double4 x) {
2661#if defined __AVX__
2662 return _mm256_round_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2663#else
2664 return simd_make_double4(__tg_floor(x.lo), __tg_floor(x.hi));
2665#endif
2666}
2667
2668static SIMD_CFUNC simd_double8 __tg_floor(simd_double8 x) {
2669#if defined __x86_64__ && defined __AVX512F__
2670 return _mm512_roundscale_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2671#else
2672 return simd_make_double8(__tg_floor(x.lo), __tg_floor(x.hi));
2673#endif
2674}
2675
2676static SIMD_CFUNC simd_float2 __tg_rint(simd_float2 x) {
2677#if defined __arm64__
2678 return vrndx_f32(x);
2679#else
2680 return simd_make_float2(__tg_rint(simd_make_float4_undef(x)));
2681#endif
2682}
2683
2684static SIMD_CFUNC simd_float3 __tg_rint(simd_float3 x) {
2685 return simd_make_float3(__tg_rint(simd_make_float4_undef(x)));
2686}
2687
2688#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2689extern simd_float4 _simd_rint_f4(simd_float4 x);
2690#endif
2691
2692static SIMD_CFUNC simd_float4 __tg_rint(simd_float4 x) {
2693#if defined __SSE4_1__
2694 return _mm_round_ps(x, _MM_FROUND_RINT);
2695#elif defined __arm64__
2696 return vrndxq_f32(x);
2697#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2698 return _simd_rint_f4(x);
2699#else
2700 simd_float4 magic = __tg_copysign(0x1.0p23, x);
2701 simd_int4 x_is_small = __tg_fabs(x) < 0x1.0p23;
2702 return simd_bitselect(x, (x + magic) - magic, x_is_small & 0x7fffffff);
2703#endif
2704}
2705
2706static SIMD_CFUNC simd_float8 __tg_rint(simd_float8 x) {
2707#if defined __AVX__
2708 return _mm256_round_ps(x, _MM_FROUND_RINT);
2709#else
2710 return simd_make_float8(__tg_rint(x.lo), __tg_rint(x.hi));
2711#endif
2712}
2713
2714static SIMD_CFUNC simd_float16 __tg_rint(simd_float16 x) {
2715#if defined __x86_64__ && defined __AVX512F__
2716 return _mm512_roundscale_ps(x, _MM_FROUND_RINT);
2717#else
2718 return simd_make_float16(__tg_rint(x.lo), __tg_rint(x.hi));
2719#endif
2720}
2721
2722#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2723extern simd_double2 _simd_rint_d2(simd_double2 x);
2724#endif
2725
2726static SIMD_CFUNC simd_double2 __tg_rint(simd_double2 x) {
2727#if defined __SSE4_1__
2728 return _mm_round_pd(x, _MM_FROUND_RINT);
2729#elif defined __arm64__
2730 return vrndxq_f64(x);
2731#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2732 return _simd_rint_d2(x);
2733#else
2734 simd_double2 magic = __tg_copysign(0x1.0p52, x);
2735 simd_long2 x_is_small = __tg_fabs(x) < 0x1.0p52;
2736 return simd_bitselect(x, (x + magic) - magic, x_is_small & 0x7fffffffffffffff);
2737#endif
2738}
2739
2740static SIMD_CFUNC simd_double3 __tg_rint(simd_double3 x) {
2741 return simd_make_double3(__tg_rint(simd_make_double4_undef(x)));
2742}
2743
2744static SIMD_CFUNC simd_double4 __tg_rint(simd_double4 x) {
2745#if defined __AVX__
2746 return _mm256_round_pd(x, _MM_FROUND_RINT);
2747#else
2748 return simd_make_double4(__tg_rint(x.lo), __tg_rint(x.hi));
2749#endif
2750}
2751
2752static SIMD_CFUNC simd_double8 __tg_rint(simd_double8 x) {
2753#if defined __x86_64__ && defined __AVX512F__
2754 return _mm512_roundscale_pd(x, _MM_FROUND_RINT);
2755#else
2756 return simd_make_double8(__tg_rint(x.lo), __tg_rint(x.hi));
2757#endif
2758}
2759
2760static SIMD_CFUNC simd_float2 __tg_trunc(simd_float2 x) {
2761#if defined __arm64__
2762 return vrnd_f32(x);
2763#else
2764 return simd_make_float2(__tg_trunc(simd_make_float4_undef(x)));
2765#endif
2766}
2767
2768static SIMD_CFUNC simd_float3 __tg_trunc(simd_float3 x) {
2769 return simd_make_float3(__tg_trunc(simd_make_float4_undef(x)));
2770}
2771
2772#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2773extern simd_float4 _simd_trunc_f4(simd_float4 x);
2774#endif
2775
2776static SIMD_CFUNC simd_float4 __tg_trunc(simd_float4 x) {
2777#if defined __SSE4_1__
2778 return _mm_round_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2779#elif defined __arm64__
2780 return vrndq_f32(x);
2781#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2782 return _simd_trunc_f4(x);
2783#else
2784 simd_float4 binade = simd_bitselect(0, x, 0x7f800000);
2785 simd_int4 mask = (simd_int4)__tg_fmin(-2*binade + 1, -0);
2786 simd_float4 result = simd_bitselect(0, x, mask);
2787 return simd_bitselect(x, result, binade < 0x1.0p23);
2788#endif
2789}
2790
2791static SIMD_CFUNC simd_float8 __tg_trunc(simd_float8 x) {
2792#if defined __AVX__
2793 return _mm256_round_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2794#else
2795 return simd_make_float8(__tg_trunc(x.lo), __tg_trunc(x.hi));
2796#endif
2797}
2798
2799static SIMD_CFUNC simd_float16 __tg_trunc(simd_float16 x) {
2800#if defined __x86_64__ && defined __AVX512F__
2801 return _mm512_roundscale_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2802#else
2803 return simd_make_float16(__tg_trunc(x.lo), __tg_trunc(x.hi));
2804#endif
2805}
2806
2807#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2808extern simd_double2 _simd_trunc_d2(simd_double2 x);
2809#endif
2810
2811static SIMD_CFUNC simd_double2 __tg_trunc(simd_double2 x) {
2812#if defined __SSE4_1__
2813 return _mm_round_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2814#elif defined __arm64__
2815 return vrndq_f64(x);
2816#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2817 return _simd_trunc_d2(x);
2818#else
2819 simd_double2 binade = simd_bitselect(0, x, 0x7ff0000000000000);
2820 simd_long2 mask = (simd_long2)__tg_fmin(-2*binade + 1, -0);
2821 simd_double2 result = simd_bitselect(0, x, mask);
2822 return simd_bitselect(x, result, binade < 0x1.0p52);
2823#endif
2824}
2825
2826static SIMD_CFUNC simd_double3 __tg_trunc(simd_double3 x) {
2827 return simd_make_double3(__tg_trunc(simd_make_double4_undef(x)));
2828}
2829
2830static SIMD_CFUNC simd_double4 __tg_trunc(simd_double4 x) {
2831#if defined __AVX__
2832 return _mm256_round_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2833#else
2834 return simd_make_double4(__tg_trunc(x.lo), __tg_trunc(x.hi));
2835#endif
2836}
2837
2838static SIMD_CFUNC simd_double8 __tg_trunc(simd_double8 x) {
2839#if defined __x86_64__ && defined __AVX512F__
2840 return _mm512_roundscale_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2841#else
2842 return simd_make_double8(__tg_trunc(x.lo), __tg_trunc(x.hi));
2843#endif
2844}
2845
2846#pragma mark - sine, cosine implementation
2847static inline SIMD_CFUNC simd_float2 __tg_sin(simd_float2 x) {
2848 return simd_make_float2(__tg_sin(simd_make_float4(x)));
2849}
2850
2851static inline SIMD_CFUNC simd_float3 __tg_sin(simd_float3 x) {
2852 return simd_make_float3(__tg_sin(simd_make_float4(x)));
2853}
2854
2855#if SIMD_LIBRARY_VERSION >= 3
2856extern simd_float4 _simd_sin_f4(simd_float4 x);
2857static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) {
2858 return _simd_sin_f4(x);
2859}
2860#elif SIMD_LIBRARY_VERSION == 1
2861extern simd_float4 __sin_f4(simd_float4 x);
2862static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) {
2863 return __sin_f4(x);
2864}
2865#else
2866static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) {
2867 return simd_make_float4(sin(x.x), sin(x.y), sin(x.z), sin(x.w));
2868}
2869#endif
2870
2871#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
2872extern simd_float8 _simd_sin_f8(simd_float8 x);
2873static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x) {
2874 return _simd_sin_f8(x);
2875}
2876#else
2877static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x) {
2878 return simd_make_float8(__tg_sin(x.lo), __tg_sin(x.hi));
2879}
2880#endif
2881
2882#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
2883extern simd_float16 _simd_sin_f16(simd_float16 x);
2884static inline SIMD_CFUNC simd_float16 __tg_sin(simd_float16 x) {
2885 return _simd_sin_f16(x);
2886}
2887#else
2888static inline SIMD_CFUNC simd_float16 __tg_sin(simd_float16 x) {
2889 return simd_make_float16(__tg_sin(x.lo), __tg_sin(x.hi));
2890}
2891#endif
2892
2893#if SIMD_LIBRARY_VERSION >= 3
2894extern simd_double2 _simd_sin_d2(simd_double2 x);
2895static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x) {
2896 return _simd_sin_d2(x);
2897}
2898#elif SIMD_LIBRARY_VERSION == 1
2899extern simd_double2 __sin_d2(simd_double2 x);
2900static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x) {
2901 return __sin_d2(x);
2902}
2903#else
2904static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x) {
2905 return simd_make_double2(sin(x.x), sin(x.y));
2906}
2907#endif
2908
2909static inline SIMD_CFUNC simd_double3 __tg_sin(simd_double3 x) {
2910 return simd_make_double3(__tg_sin(simd_make_double4(x)));
2911}
2912
2913#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
2914extern simd_double4 _simd_sin_d4(simd_double4 x);
2915static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x) {
2916 return _simd_sin_d4(x);
2917}
2918#else
2919static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x) {
2920 return simd_make_double4(__tg_sin(x.lo), __tg_sin(x.hi));
2921}
2922#endif
2923
2924#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
2925extern simd_double8 _simd_sin_d8(simd_double8 x);
2926static inline SIMD_CFUNC simd_double8 __tg_sin(simd_double8 x) {
2927 return _simd_sin_d8(x);
2928}
2929#else
2930static inline SIMD_CFUNC simd_double8 __tg_sin(simd_double8 x) {
2931 return simd_make_double8(__tg_sin(x.lo), __tg_sin(x.hi));
2932}
2933#endif
2934
2935static inline SIMD_CFUNC simd_float2 __tg_cos(simd_float2 x) {
2936 return simd_make_float2(__tg_cos(simd_make_float4(x)));
2937}
2938
2939static inline SIMD_CFUNC simd_float3 __tg_cos(simd_float3 x) {
2940 return simd_make_float3(__tg_cos(simd_make_float4(x)));
2941}
2942
2943#if SIMD_LIBRARY_VERSION >= 3
2944extern simd_float4 _simd_cos_f4(simd_float4 x);
2945static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) {
2946 return _simd_cos_f4(x);
2947}
2948#elif SIMD_LIBRARY_VERSION == 1
2949extern simd_float4 __cos_f4(simd_float4 x);
2950static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) {
2951 return __cos_f4(x);
2952}
2953#else
2954static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) {
2955 return simd_make_float4(cos(x.x), cos(x.y), cos(x.z), cos(x.w));
2956}
2957#endif
2958
2959#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
2960extern simd_float8 _simd_cos_f8(simd_float8 x);
2961static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x) {
2962 return _simd_cos_f8(x);
2963}
2964#else
2965static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x) {
2966 return simd_make_float8(__tg_cos(x.lo), __tg_cos(x.hi));
2967}
2968#endif
2969
2970#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
2971extern simd_float16 _simd_cos_f16(simd_float16 x);
2972static inline SIMD_CFUNC simd_float16 __tg_cos(simd_float16 x) {
2973 return _simd_cos_f16(x);
2974}
2975#else
2976static inline SIMD_CFUNC simd_float16 __tg_cos(simd_float16 x) {
2977 return simd_make_float16(__tg_cos(x.lo), __tg_cos(x.hi));
2978}
2979#endif
2980
2981#if SIMD_LIBRARY_VERSION >= 3
2982extern simd_double2 _simd_cos_d2(simd_double2 x);
2983static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x) {
2984 return _simd_cos_d2(x);
2985}
2986#elif SIMD_LIBRARY_VERSION == 1
2987extern simd_double2 __cos_d2(simd_double2 x);
2988static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x) {
2989 return __cos_d2(x);
2990}
2991#else
2992static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x) {
2993 return simd_make_double2(cos(x.x), cos(x.y));
2994}
2995#endif
2996
2997static inline SIMD_CFUNC simd_double3 __tg_cos(simd_double3 x) {
2998 return simd_make_double3(__tg_cos(simd_make_double4(x)));
2999}
3000
3001#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3002extern simd_double4 _simd_cos_d4(simd_double4 x);
3003static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x) {
3004 return _simd_cos_d4(x);
3005}
3006#else
3007static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x) {
3008 return simd_make_double4(__tg_cos(x.lo), __tg_cos(x.hi));
3009}
3010#endif
3011
3012#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3013extern simd_double8 _simd_cos_d8(simd_double8 x);
3014static inline SIMD_CFUNC simd_double8 __tg_cos(simd_double8 x) {
3015 return _simd_cos_d8(x);
3016}
3017#else
3018static inline SIMD_CFUNC simd_double8 __tg_cos(simd_double8 x) {
3019 return simd_make_double8(__tg_cos(x.lo), __tg_cos(x.hi));
3020}
3021#endif
3022
3023
3024#pragma mark - acos implementation
3025static inline SIMD_CFUNC simd_float2 __tg_acos(simd_float2 x) {
3026 return simd_make_float2(__tg_acos(simd_make_float4(x)));
3027}
3028
3029static inline SIMD_CFUNC simd_float3 __tg_acos(simd_float3 x) {
3030 return simd_make_float3(__tg_acos(simd_make_float4(x)));
3031}
3032
3033#if SIMD_LIBRARY_VERSION >= 3
3034extern simd_float4 _simd_acos_f4(simd_float4 x);
3035static inline SIMD_CFUNC simd_float4 __tg_acos(simd_float4 x) {
3036 return _simd_acos_f4(x);
3037}
3038#else
3039static inline SIMD_CFUNC simd_float4 __tg_acos(simd_float4 x) {
3040 return simd_make_float4(acos(x.x), acos(x.y), acos(x.z), acos(x.w));
3041}
3042#endif
3043
3044#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3045extern simd_float8 _simd_acos_f8(simd_float8 x);
3046static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x) {
3047 return _simd_acos_f8(x);
3048}
3049#else
3050static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x) {
3051 return simd_make_float8(__tg_acos(x.lo), __tg_acos(x.hi));
3052}
3053#endif
3054
3055#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3056extern simd_float16 _simd_acos_f16(simd_float16 x);
3057static inline SIMD_CFUNC simd_float16 __tg_acos(simd_float16 x) {
3058 return _simd_acos_f16(x);
3059}
3060#else
3061static inline SIMD_CFUNC simd_float16 __tg_acos(simd_float16 x) {
3062 return simd_make_float16(__tg_acos(x.lo), __tg_acos(x.hi));
3063}
3064#endif
3065
3066#if SIMD_LIBRARY_VERSION >= 3
3067extern simd_double2 _simd_acos_d2(simd_double2 x);
3068static inline SIMD_CFUNC simd_double2 __tg_acos(simd_double2 x) {
3069 return _simd_acos_d2(x);
3070}
3071#else
3072static inline SIMD_CFUNC simd_double2 __tg_acos(simd_double2 x) {
3073 return simd_make_double2(acos(x.x), acos(x.y));
3074}
3075#endif
3076
3077static inline SIMD_CFUNC simd_double3 __tg_acos(simd_double3 x) {
3078 return simd_make_double3(__tg_acos(simd_make_double4(x)));
3079}
3080
3081#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3082extern simd_double4 _simd_acos_d4(simd_double4 x);
3083static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x) {
3084 return _simd_acos_d4(x);
3085}
3086#else
3087static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x) {
3088 return simd_make_double4(__tg_acos(x.lo), __tg_acos(x.hi));
3089}
3090#endif
3091
3092#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3093extern simd_double8 _simd_acos_d8(simd_double8 x);
3094static inline SIMD_CFUNC simd_double8 __tg_acos(simd_double8 x) {
3095 return _simd_acos_d8(x);
3096}
3097#else
3098static inline SIMD_CFUNC simd_double8 __tg_acos(simd_double8 x) {
3099 return simd_make_double8(__tg_acos(x.lo), __tg_acos(x.hi));
3100}
3101#endif
3102
3103#pragma mark - asin implementation
3104static inline SIMD_CFUNC simd_float2 __tg_asin(simd_float2 x) {
3105 return simd_make_float2(__tg_asin(simd_make_float4(x)));
3106}
3107
3108static inline SIMD_CFUNC simd_float3 __tg_asin(simd_float3 x) {
3109 return simd_make_float3(__tg_asin(simd_make_float4(x)));
3110}
3111
3112#if SIMD_LIBRARY_VERSION >= 3
3113extern simd_float4 _simd_asin_f4(simd_float4 x);
3114static inline SIMD_CFUNC simd_float4 __tg_asin(simd_float4 x) {
3115 return _simd_asin_f4(x);
3116}
3117#else
3118static inline SIMD_CFUNC simd_float4 __tg_asin(simd_float4 x) {
3119 return simd_make_float4(asin(x.x), asin(x.y), asin(x.z), asin(x.w));
3120}
3121#endif
3122
3123#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3124extern simd_float8 _simd_asin_f8(simd_float8 x);
3125static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x) {
3126 return _simd_asin_f8(x);
3127}
3128#else
3129static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x) {
3130 return simd_make_float8(__tg_asin(x.lo), __tg_asin(x.hi));
3131}
3132#endif
3133
3134#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3135extern simd_float16 _simd_asin_f16(simd_float16 x);
3136static inline SIMD_CFUNC simd_float16 __tg_asin(simd_float16 x) {
3137 return _simd_asin_f16(x);
3138}
3139#else
3140static inline SIMD_CFUNC simd_float16 __tg_asin(simd_float16 x) {
3141 return simd_make_float16(__tg_asin(x.lo), __tg_asin(x.hi));
3142}
3143#endif
3144
3145#if SIMD_LIBRARY_VERSION >= 3
3146extern simd_double2 _simd_asin_d2(simd_double2 x);
3147static inline SIMD_CFUNC simd_double2 __tg_asin(simd_double2 x) {
3148 return _simd_asin_d2(x);
3149}
3150#else
3151static inline SIMD_CFUNC simd_double2 __tg_asin(simd_double2 x) {
3152 return simd_make_double2(asin(x.x), asin(x.y));
3153}
3154#endif
3155
3156static inline SIMD_CFUNC simd_double3 __tg_asin(simd_double3 x) {
3157 return simd_make_double3(__tg_asin(simd_make_double4(x)));
3158}
3159
3160#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3161extern simd_double4 _simd_asin_d4(simd_double4 x);
3162static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x) {
3163 return _simd_asin_d4(x);
3164}
3165#else
3166static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x) {
3167 return simd_make_double4(__tg_asin(x.lo), __tg_asin(x.hi));
3168}
3169#endif
3170
3171#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3172extern simd_double8 _simd_asin_d8(simd_double8 x);
3173static inline SIMD_CFUNC simd_double8 __tg_asin(simd_double8 x) {
3174 return _simd_asin_d8(x);
3175}
3176#else
3177static inline SIMD_CFUNC simd_double8 __tg_asin(simd_double8 x) {
3178 return simd_make_double8(__tg_asin(x.lo), __tg_asin(x.hi));
3179}
3180#endif
3181
3182#pragma mark - atan implementation
3183static inline SIMD_CFUNC simd_float2 __tg_atan(simd_float2 x) {
3184 return simd_make_float2(__tg_atan(simd_make_float4(x)));
3185}
3186
3187static inline SIMD_CFUNC simd_float3 __tg_atan(simd_float3 x) {
3188 return simd_make_float3(__tg_atan(simd_make_float4(x)));
3189}
3190
3191#if SIMD_LIBRARY_VERSION >= 3
3192extern simd_float4 _simd_atan_f4(simd_float4 x);
3193static inline SIMD_CFUNC simd_float4 __tg_atan(simd_float4 x) {
3194 return _simd_atan_f4(x);
3195}
3196#else
3197static inline SIMD_CFUNC simd_float4 __tg_atan(simd_float4 x) {
3198 return simd_make_float4(atan(x.x), atan(x.y), atan(x.z), atan(x.w));
3199}
3200#endif
3201
3202#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3203extern simd_float8 _simd_atan_f8(simd_float8 x);
3204static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x) {
3205 return _simd_atan_f8(x);
3206}
3207#else
3208static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x) {
3209 return simd_make_float8(__tg_atan(x.lo), __tg_atan(x.hi));
3210}
3211#endif
3212
3213#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3214extern simd_float16 _simd_atan_f16(simd_float16 x);
3215static inline SIMD_CFUNC simd_float16 __tg_atan(simd_float16 x) {
3216 return _simd_atan_f16(x);
3217}
3218#else
3219static inline SIMD_CFUNC simd_float16 __tg_atan(simd_float16 x) {
3220 return simd_make_float16(__tg_atan(x.lo), __tg_atan(x.hi));
3221}
3222#endif
3223
3224#if SIMD_LIBRARY_VERSION >= 3
3225extern simd_double2 _simd_atan_d2(simd_double2 x);
3226static inline SIMD_CFUNC simd_double2 __tg_atan(simd_double2 x) {
3227 return _simd_atan_d2(x);
3228}
3229#else
3230static inline SIMD_CFUNC simd_double2 __tg_atan(simd_double2 x) {
3231 return simd_make_double2(atan(x.x), atan(x.y));
3232}
3233#endif
3234
3235static inline SIMD_CFUNC simd_double3 __tg_atan(simd_double3 x) {
3236 return simd_make_double3(__tg_atan(simd_make_double4(x)));
3237}
3238
3239#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3240extern simd_double4 _simd_atan_d4(simd_double4 x);
3241static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x) {
3242 return _simd_atan_d4(x);
3243}
3244#else
3245static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x) {
3246 return simd_make_double4(__tg_atan(x.lo), __tg_atan(x.hi));
3247}
3248#endif
3249
3250#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3251extern simd_double8 _simd_atan_d8(simd_double8 x);
3252static inline SIMD_CFUNC simd_double8 __tg_atan(simd_double8 x) {
3253 return _simd_atan_d8(x);
3254}
3255#else
3256static inline SIMD_CFUNC simd_double8 __tg_atan(simd_double8 x) {
3257 return simd_make_double8(__tg_atan(x.lo), __tg_atan(x.hi));
3258}
3259#endif
3260
3261#pragma mark - tan implementation
3262static inline SIMD_CFUNC simd_float2 __tg_tan(simd_float2 x) {
3263 return simd_make_float2(__tg_tan(simd_make_float4(x)));
3264}
3265
3266static inline SIMD_CFUNC simd_float3 __tg_tan(simd_float3 x) {
3267 return simd_make_float3(__tg_tan(simd_make_float4(x)));
3268}
3269
3270#if SIMD_LIBRARY_VERSION >= 3
3271extern simd_float4 _simd_tan_f4(simd_float4 x);
3272static inline SIMD_CFUNC simd_float4 __tg_tan(simd_float4 x) {
3273 return _simd_tan_f4(x);
3274}
3275#else
3276static inline SIMD_CFUNC simd_float4 __tg_tan(simd_float4 x) {
3277 return simd_make_float4(tan(x.x), tan(x.y), tan(x.z), tan(x.w));
3278}
3279#endif
3280
3281#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3282extern simd_float8 _simd_tan_f8(simd_float8 x);
3283static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x) {
3284 return _simd_tan_f8(x);
3285}
3286#else
3287static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x) {
3288 return simd_make_float8(__tg_tan(x.lo), __tg_tan(x.hi));
3289}
3290#endif
3291
3292#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3293extern simd_float16 _simd_tan_f16(simd_float16 x);
3294static inline SIMD_CFUNC simd_float16 __tg_tan(simd_float16 x) {
3295 return _simd_tan_f16(x);
3296}
3297#else
3298static inline SIMD_CFUNC simd_float16 __tg_tan(simd_float16 x) {
3299 return simd_make_float16(__tg_tan(x.lo), __tg_tan(x.hi));
3300}
3301#endif
3302
3303#if SIMD_LIBRARY_VERSION >= 3
3304extern simd_double2 _simd_tan_d2(simd_double2 x);
3305static inline SIMD_CFUNC simd_double2 __tg_tan(simd_double2 x) {
3306 return _simd_tan_d2(x);
3307}
3308#else
3309static inline SIMD_CFUNC simd_double2 __tg_tan(simd_double2 x) {
3310 return simd_make_double2(tan(x.x), tan(x.y));
3311}
3312#endif
3313
3314static inline SIMD_CFUNC simd_double3 __tg_tan(simd_double3 x) {
3315 return simd_make_double3(__tg_tan(simd_make_double4(x)));
3316}
3317
3318#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3319extern simd_double4 _simd_tan_d4(simd_double4 x);
3320static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x) {
3321 return _simd_tan_d4(x);
3322}
3323#else
3324static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x) {
3325 return simd_make_double4(__tg_tan(x.lo), __tg_tan(x.hi));
3326}
3327#endif
3328
3329#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3330extern simd_double8 _simd_tan_d8(simd_double8 x);
3331static inline SIMD_CFUNC simd_double8 __tg_tan(simd_double8 x) {
3332 return _simd_tan_d8(x);
3333}
3334#else
3335static inline SIMD_CFUNC simd_double8 __tg_tan(simd_double8 x) {
3336 return simd_make_double8(__tg_tan(x.lo), __tg_tan(x.hi));
3337}
3338#endif
3339
3340#pragma mark - cospi implementation
3341#if SIMD_LIBRARY_VERSION >= 1
3342static inline SIMD_CFUNC simd_float2 __tg_cospi(simd_float2 x) {
3343 return simd_make_float2(__tg_cospi(simd_make_float4(x)));
3344}
3345
3346static inline SIMD_CFUNC simd_float3 __tg_cospi(simd_float3 x) {
3347 return simd_make_float3(__tg_cospi(simd_make_float4(x)));
3348}
3349
3350#if SIMD_LIBRARY_VERSION >= 3
3351extern simd_float4 _simd_cospi_f4(simd_float4 x);
3352static inline SIMD_CFUNC simd_float4 __tg_cospi(simd_float4 x) {
3353 return _simd_cospi_f4(x);
3354}
3355#else
3356static inline SIMD_CFUNC simd_float4 __tg_cospi(simd_float4 x) {
3357 return simd_make_float4(__cospi(x.x), __cospi(x.y), __cospi(x.z), __cospi(x.w));
3358}
3359#endif
3360
3361#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3362extern simd_float8 _simd_cospi_f8(simd_float8 x);
3363static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x) {
3364 return _simd_cospi_f8(x);
3365}
3366#else
3367static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x) {
3368 return simd_make_float8(__tg_cospi(x.lo), __tg_cospi(x.hi));
3369}
3370#endif
3371
3372#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3373extern simd_float16 _simd_cospi_f16(simd_float16 x);
3374static inline SIMD_CFUNC simd_float16 __tg_cospi(simd_float16 x) {
3375 return _simd_cospi_f16(x);
3376}
3377#else
3378static inline SIMD_CFUNC simd_float16 __tg_cospi(simd_float16 x) {
3379 return simd_make_float16(__tg_cospi(x.lo), __tg_cospi(x.hi));
3380}
3381#endif
3382
3383#if SIMD_LIBRARY_VERSION >= 3
3384extern simd_double2 _simd_cospi_d2(simd_double2 x);
3385static inline SIMD_CFUNC simd_double2 __tg_cospi(simd_double2 x) {
3386 return _simd_cospi_d2(x);
3387}
3388#else
3389static inline SIMD_CFUNC simd_double2 __tg_cospi(simd_double2 x) {
3390 return simd_make_double2(__cospi(x.x), __cospi(x.y));
3391}
3392#endif
3393
3394static inline SIMD_CFUNC simd_double3 __tg_cospi(simd_double3 x) {
3395 return simd_make_double3(__tg_cospi(simd_make_double4(x)));
3396}
3397
3398#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3399extern simd_double4 _simd_cospi_d4(simd_double4 x);
3400static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x) {
3401 return _simd_cospi_d4(x);
3402}
3403#else
3404static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x) {
3405 return simd_make_double4(__tg_cospi(x.lo), __tg_cospi(x.hi));
3406}
3407#endif
3408
3409#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3410extern simd_double8 _simd_cospi_d8(simd_double8 x);
3411static inline SIMD_CFUNC simd_double8 __tg_cospi(simd_double8 x) {
3412 return _simd_cospi_d8(x);
3413}
3414#else
3415static inline SIMD_CFUNC simd_double8 __tg_cospi(simd_double8 x) {
3416 return simd_make_double8(__tg_cospi(x.lo), __tg_cospi(x.hi));
3417}
3418#endif
3419
3420#endif /* SIMD_LIBRARY_VERSION */
3421#pragma mark - sinpi implementation
3422#if SIMD_LIBRARY_VERSION >= 1
3423static inline SIMD_CFUNC simd_float2 __tg_sinpi(simd_float2 x) {
3424 return simd_make_float2(__tg_sinpi(simd_make_float4(x)));
3425}
3426
3427static inline SIMD_CFUNC simd_float3 __tg_sinpi(simd_float3 x) {
3428 return simd_make_float3(__tg_sinpi(simd_make_float4(x)));
3429}
3430
3431#if SIMD_LIBRARY_VERSION >= 3
3432extern simd_float4 _simd_sinpi_f4(simd_float4 x);
3433static inline SIMD_CFUNC simd_float4 __tg_sinpi(simd_float4 x) {
3434 return _simd_sinpi_f4(x);
3435}
3436#else
3437static inline SIMD_CFUNC simd_float4 __tg_sinpi(simd_float4 x) {
3438 return simd_make_float4(__sinpi(x.x), __sinpi(x.y), __sinpi(x.z), __sinpi(x.w));
3439}
3440#endif
3441
3442#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3443extern simd_float8 _simd_sinpi_f8(simd_float8 x);
3444static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x) {
3445 return _simd_sinpi_f8(x);
3446}
3447#else
3448static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x) {
3449 return simd_make_float8(__tg_sinpi(x.lo), __tg_sinpi(x.hi));
3450}
3451#endif
3452
3453#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3454extern simd_float16 _simd_sinpi_f16(simd_float16 x);
3455static inline SIMD_CFUNC simd_float16 __tg_sinpi(simd_float16 x) {
3456 return _simd_sinpi_f16(x);
3457}
3458#else
3459static inline SIMD_CFUNC simd_float16 __tg_sinpi(simd_float16 x) {
3460 return simd_make_float16(__tg_sinpi(x.lo), __tg_sinpi(x.hi));
3461}
3462#endif
3463
3464#if SIMD_LIBRARY_VERSION >= 3
3465extern simd_double2 _simd_sinpi_d2(simd_double2 x);
3466static inline SIMD_CFUNC simd_double2 __tg_sinpi(simd_double2 x) {
3467 return _simd_sinpi_d2(x);
3468}
3469#else
3470static inline SIMD_CFUNC simd_double2 __tg_sinpi(simd_double2 x) {
3471 return simd_make_double2(__sinpi(x.x), __sinpi(x.y));
3472}
3473#endif
3474
3475static inline SIMD_CFUNC simd_double3 __tg_sinpi(simd_double3 x) {
3476 return simd_make_double3(__tg_sinpi(simd_make_double4(x)));
3477}
3478
3479#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3480extern simd_double4 _simd_sinpi_d4(simd_double4 x);
3481static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x) {
3482 return _simd_sinpi_d4(x);
3483}
3484#else
3485static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x) {
3486 return simd_make_double4(__tg_sinpi(x.lo), __tg_sinpi(x.hi));
3487}
3488#endif
3489
3490#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3491extern simd_double8 _simd_sinpi_d8(simd_double8 x);
3492static inline SIMD_CFUNC simd_double8 __tg_sinpi(simd_double8 x) {
3493 return _simd_sinpi_d8(x);
3494}
3495#else
3496static inline SIMD_CFUNC simd_double8 __tg_sinpi(simd_double8 x) {
3497 return simd_make_double8(__tg_sinpi(x.lo), __tg_sinpi(x.hi));
3498}
3499#endif
3500
3501#endif /* SIMD_LIBRARY_VERSION */
3502#pragma mark - tanpi implementation
3503#if SIMD_LIBRARY_VERSION >= 1
3504static inline SIMD_CFUNC simd_float2 __tg_tanpi(simd_float2 x) {
3505 return simd_make_float2(__tg_tanpi(simd_make_float4(x)));
3506}
3507
3508static inline SIMD_CFUNC simd_float3 __tg_tanpi(simd_float3 x) {
3509 return simd_make_float3(__tg_tanpi(simd_make_float4(x)));
3510}
3511
3512#if SIMD_LIBRARY_VERSION >= 3
3513extern simd_float4 _simd_tanpi_f4(simd_float4 x);
3514static inline SIMD_CFUNC simd_float4 __tg_tanpi(simd_float4 x) {
3515 return _simd_tanpi_f4(x);
3516}
3517#else
3518static inline SIMD_CFUNC simd_float4 __tg_tanpi(simd_float4 x) {
3519 return simd_make_float4(__tanpi(x.x), __tanpi(x.y), __tanpi(x.z), __tanpi(x.w));
3520}
3521#endif
3522
3523#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3524extern simd_float8 _simd_tanpi_f8(simd_float8 x);
3525static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x) {
3526 return _simd_tanpi_f8(x);
3527}
3528#else
3529static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x) {
3530 return simd_make_float8(__tg_tanpi(x.lo), __tg_tanpi(x.hi));
3531}
3532#endif
3533
3534#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3535extern simd_float16 _simd_tanpi_f16(simd_float16 x);
3536static inline SIMD_CFUNC simd_float16 __tg_tanpi(simd_float16 x) {
3537 return _simd_tanpi_f16(x);
3538}
3539#else
3540static inline SIMD_CFUNC simd_float16 __tg_tanpi(simd_float16 x) {
3541 return simd_make_float16(__tg_tanpi(x.lo), __tg_tanpi(x.hi));
3542}
3543#endif
3544
3545#if SIMD_LIBRARY_VERSION >= 3
3546extern simd_double2 _simd_tanpi_d2(simd_double2 x);
3547static inline SIMD_CFUNC simd_double2 __tg_tanpi(simd_double2 x) {
3548 return _simd_tanpi_d2(x);
3549}
3550#else
3551static inline SIMD_CFUNC simd_double2 __tg_tanpi(simd_double2 x) {
3552 return simd_make_double2(__tanpi(x.x), __tanpi(x.y));
3553}
3554#endif
3555
3556static inline SIMD_CFUNC simd_double3 __tg_tanpi(simd_double3 x) {
3557 return simd_make_double3(__tg_tanpi(simd_make_double4(x)));
3558}
3559
3560#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3561extern simd_double4 _simd_tanpi_d4(simd_double4 x);
3562static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x) {
3563 return _simd_tanpi_d4(x);
3564}
3565#else
3566static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x) {
3567 return simd_make_double4(__tg_tanpi(x.lo), __tg_tanpi(x.hi));
3568}
3569#endif
3570
3571#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3572extern simd_double8 _simd_tanpi_d8(simd_double8 x);
3573static inline SIMD_CFUNC simd_double8 __tg_tanpi(simd_double8 x) {
3574 return _simd_tanpi_d8(x);
3575}
3576#else
3577static inline SIMD_CFUNC simd_double8 __tg_tanpi(simd_double8 x) {
3578 return simd_make_double8(__tg_tanpi(x.lo), __tg_tanpi(x.hi));
3579}
3580#endif
3581
3582#endif /* SIMD_LIBRARY_VERSION */
3583#pragma mark - acosh implementation
3584static inline SIMD_CFUNC simd_float2 __tg_acosh(simd_float2 x) {
3585 return simd_make_float2(__tg_acosh(simd_make_float4(x)));
3586}
3587
3588static inline SIMD_CFUNC simd_float3 __tg_acosh(simd_float3 x) {
3589 return simd_make_float3(__tg_acosh(simd_make_float4(x)));
3590}
3591
3592#if SIMD_LIBRARY_VERSION >= 3
3593extern simd_float4 _simd_acosh_f4(simd_float4 x);
3594static inline SIMD_CFUNC simd_float4 __tg_acosh(simd_float4 x) {
3595 return _simd_acosh_f4(x);
3596}
3597#else
3598static inline SIMD_CFUNC simd_float4 __tg_acosh(simd_float4 x) {
3599 return simd_make_float4(acosh(x.x), acosh(x.y), acosh(x.z), acosh(x.w));
3600}
3601#endif
3602
3603#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3604extern simd_float8 _simd_acosh_f8(simd_float8 x);
3605static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x) {
3606 return _simd_acosh_f8(x);
3607}
3608#else
3609static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x) {
3610 return simd_make_float8(__tg_acosh(x.lo), __tg_acosh(x.hi));
3611}
3612#endif
3613
3614#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3615extern simd_float16 _simd_acosh_f16(simd_float16 x);
3616static inline SIMD_CFUNC simd_float16 __tg_acosh(simd_float16 x) {
3617 return _simd_acosh_f16(x);
3618}
3619#else
3620static inline SIMD_CFUNC simd_float16 __tg_acosh(simd_float16 x) {
3621 return simd_make_float16(__tg_acosh(x.lo), __tg_acosh(x.hi));
3622}
3623#endif
3624
3625#if SIMD_LIBRARY_VERSION >= 3
3626extern simd_double2 _simd_acosh_d2(simd_double2 x);
3627static inline SIMD_CFUNC simd_double2 __tg_acosh(simd_double2 x) {
3628 return _simd_acosh_d2(x);
3629}
3630#else
3631static inline SIMD_CFUNC simd_double2 __tg_acosh(simd_double2 x) {
3632 return simd_make_double2(acosh(x.x), acosh(x.y));
3633}
3634#endif
3635
3636static inline SIMD_CFUNC simd_double3 __tg_acosh(simd_double3 x) {
3637 return simd_make_double3(__tg_acosh(simd_make_double4(x)));
3638}
3639
3640#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3641extern simd_double4 _simd_acosh_d4(simd_double4 x);
3642static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x) {
3643 return _simd_acosh_d4(x);
3644}
3645#else
3646static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x) {
3647 return simd_make_double4(__tg_acosh(x.lo), __tg_acosh(x.hi));
3648}
3649#endif
3650
3651#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3652extern simd_double8 _simd_acosh_d8(simd_double8 x);
3653static inline SIMD_CFUNC simd_double8 __tg_acosh(simd_double8 x) {
3654 return _simd_acosh_d8(x);
3655}
3656#else
3657static inline SIMD_CFUNC simd_double8 __tg_acosh(simd_double8 x) {
3658 return simd_make_double8(__tg_acosh(x.lo), __tg_acosh(x.hi));
3659}
3660#endif
3661
3662#pragma mark - asinh implementation
3663static inline SIMD_CFUNC simd_float2 __tg_asinh(simd_float2 x) {
3664 return simd_make_float2(__tg_asinh(simd_make_float4(x)));
3665}
3666
3667static inline SIMD_CFUNC simd_float3 __tg_asinh(simd_float3 x) {
3668 return simd_make_float3(__tg_asinh(simd_make_float4(x)));
3669}
3670
3671#if SIMD_LIBRARY_VERSION >= 3
3672extern simd_float4 _simd_asinh_f4(simd_float4 x);
3673static inline SIMD_CFUNC simd_float4 __tg_asinh(simd_float4 x) {
3674 return _simd_asinh_f4(x);
3675}
3676#else
3677static inline SIMD_CFUNC simd_float4 __tg_asinh(simd_float4 x) {
3678 return simd_make_float4(asinh(x.x), asinh(x.y), asinh(x.z), asinh(x.w));
3679}
3680#endif
3681
3682#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3683extern simd_float8 _simd_asinh_f8(simd_float8 x);
3684static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x) {
3685 return _simd_asinh_f8(x);
3686}
3687#else
3688static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x) {
3689 return simd_make_float8(__tg_asinh(x.lo), __tg_asinh(x.hi));
3690}
3691#endif
3692
3693#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3694extern simd_float16 _simd_asinh_f16(simd_float16 x);
3695static inline SIMD_CFUNC simd_float16 __tg_asinh(simd_float16 x) {
3696 return _simd_asinh_f16(x);
3697}
3698#else
3699static inline SIMD_CFUNC simd_float16 __tg_asinh(simd_float16 x) {
3700 return simd_make_float16(__tg_asinh(x.lo), __tg_asinh(x.hi));
3701}
3702#endif
3703
3704#if SIMD_LIBRARY_VERSION >= 3
3705extern simd_double2 _simd_asinh_d2(simd_double2 x);
3706static inline SIMD_CFUNC simd_double2 __tg_asinh(simd_double2 x) {
3707 return _simd_asinh_d2(x);
3708}
3709#else
3710static inline SIMD_CFUNC simd_double2 __tg_asinh(simd_double2 x) {
3711 return simd_make_double2(asinh(x.x), asinh(x.y));
3712}
3713#endif
3714
3715static inline SIMD_CFUNC simd_double3 __tg_asinh(simd_double3 x) {
3716 return simd_make_double3(__tg_asinh(simd_make_double4(x)));
3717}
3718
3719#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3720extern simd_double4 _simd_asinh_d4(simd_double4 x);
3721static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x) {
3722 return _simd_asinh_d4(x);
3723}
3724#else
3725static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x) {
3726 return simd_make_double4(__tg_asinh(x.lo), __tg_asinh(x.hi));
3727}
3728#endif
3729
3730#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3731extern simd_double8 _simd_asinh_d8(simd_double8 x);
3732static inline SIMD_CFUNC simd_double8 __tg_asinh(simd_double8 x) {
3733 return _simd_asinh_d8(x);
3734}
3735#else
3736static inline SIMD_CFUNC simd_double8 __tg_asinh(simd_double8 x) {
3737 return simd_make_double8(__tg_asinh(x.lo), __tg_asinh(x.hi));
3738}
3739#endif
3740
3741#pragma mark - atanh implementation
3742static inline SIMD_CFUNC simd_float2 __tg_atanh(simd_float2 x) {
3743 return simd_make_float2(__tg_atanh(simd_make_float4(x)));
3744}
3745
3746static inline SIMD_CFUNC simd_float3 __tg_atanh(simd_float3 x) {
3747 return simd_make_float3(__tg_atanh(simd_make_float4(x)));
3748}
3749
3750#if SIMD_LIBRARY_VERSION >= 3
3751extern simd_float4 _simd_atanh_f4(simd_float4 x);
3752static inline SIMD_CFUNC simd_float4 __tg_atanh(simd_float4 x) {
3753 return _simd_atanh_f4(x);
3754}
3755#else
3756static inline SIMD_CFUNC simd_float4 __tg_atanh(simd_float4 x) {
3757 return simd_make_float4(atanh(x.x), atanh(x.y), atanh(x.z), atanh(x.w));
3758}
3759#endif
3760
3761#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3762extern simd_float8 _simd_atanh_f8(simd_float8 x);
3763static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x) {
3764 return _simd_atanh_f8(x);
3765}
3766#else
3767static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x) {
3768 return simd_make_float8(__tg_atanh(x.lo), __tg_atanh(x.hi));
3769}
3770#endif
3771
3772#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3773extern simd_float16 _simd_atanh_f16(simd_float16 x);
3774static inline SIMD_CFUNC simd_float16 __tg_atanh(simd_float16 x) {
3775 return _simd_atanh_f16(x);
3776}
3777#else
3778static inline SIMD_CFUNC simd_float16 __tg_atanh(simd_float16 x) {
3779 return simd_make_float16(__tg_atanh(x.lo), __tg_atanh(x.hi));
3780}
3781#endif
3782
3783#if SIMD_LIBRARY_VERSION >= 3
3784extern simd_double2 _simd_atanh_d2(simd_double2 x);
3785static inline SIMD_CFUNC simd_double2 __tg_atanh(simd_double2 x) {
3786 return _simd_atanh_d2(x);
3787}
3788#else
3789static inline SIMD_CFUNC simd_double2 __tg_atanh(simd_double2 x) {
3790 return simd_make_double2(atanh(x.x), atanh(x.y));
3791}
3792#endif
3793
3794static inline SIMD_CFUNC simd_double3 __tg_atanh(simd_double3 x) {
3795 return simd_make_double3(__tg_atanh(simd_make_double4(x)));
3796}
3797
3798#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3799extern simd_double4 _simd_atanh_d4(simd_double4 x);
3800static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x) {
3801 return _simd_atanh_d4(x);
3802}
3803#else
3804static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x) {
3805 return simd_make_double4(__tg_atanh(x.lo), __tg_atanh(x.hi));
3806}
3807#endif
3808
3809#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3810extern simd_double8 _simd_atanh_d8(simd_double8 x);
3811static inline SIMD_CFUNC simd_double8 __tg_atanh(simd_double8 x) {
3812 return _simd_atanh_d8(x);
3813}
3814#else
3815static inline SIMD_CFUNC simd_double8 __tg_atanh(simd_double8 x) {
3816 return simd_make_double8(__tg_atanh(x.lo), __tg_atanh(x.hi));
3817}
3818#endif
3819
3820#pragma mark - cosh implementation
3821static inline SIMD_CFUNC simd_float2 __tg_cosh(simd_float2 x) {
3822 return simd_make_float2(__tg_cosh(simd_make_float4(x)));
3823}
3824
3825static inline SIMD_CFUNC simd_float3 __tg_cosh(simd_float3 x) {
3826 return simd_make_float3(__tg_cosh(simd_make_float4(x)));
3827}
3828
3829#if SIMD_LIBRARY_VERSION >= 3
3830extern simd_float4 _simd_cosh_f4(simd_float4 x);
3831static inline SIMD_CFUNC simd_float4 __tg_cosh(simd_float4 x) {
3832 return _simd_cosh_f4(x);
3833}
3834#else
3835static inline SIMD_CFUNC simd_float4 __tg_cosh(simd_float4 x) {
3836 return simd_make_float4(cosh(x.x), cosh(x.y), cosh(x.z), cosh(x.w));
3837}
3838#endif
3839
3840#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3841extern simd_float8 _simd_cosh_f8(simd_float8 x);
3842static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x) {
3843 return _simd_cosh_f8(x);
3844}
3845#else
3846static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x) {
3847 return simd_make_float8(__tg_cosh(x.lo), __tg_cosh(x.hi));
3848}
3849#endif
3850
3851#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3852extern simd_float16 _simd_cosh_f16(simd_float16 x);
3853static inline SIMD_CFUNC simd_float16 __tg_cosh(simd_float16 x) {
3854 return _simd_cosh_f16(x);
3855}
3856#else
3857static inline SIMD_CFUNC simd_float16 __tg_cosh(simd_float16 x) {
3858 return simd_make_float16(__tg_cosh(x.lo), __tg_cosh(x.hi));
3859}
3860#endif
3861
3862#if SIMD_LIBRARY_VERSION >= 3
3863extern simd_double2 _simd_cosh_d2(simd_double2 x);
3864static inline SIMD_CFUNC simd_double2 __tg_cosh(simd_double2 x) {
3865 return _simd_cosh_d2(x);
3866}
3867#else
3868static inline SIMD_CFUNC simd_double2 __tg_cosh(simd_double2 x) {
3869 return simd_make_double2(cosh(x.x), cosh(x.y));
3870}
3871#endif
3872
3873static inline SIMD_CFUNC simd_double3 __tg_cosh(simd_double3 x) {
3874 return simd_make_double3(__tg_cosh(simd_make_double4(x)));
3875}
3876
3877#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3878extern simd_double4 _simd_cosh_d4(simd_double4 x);
3879static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x) {
3880 return _simd_cosh_d4(x);
3881}
3882#else
3883static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x) {
3884 return simd_make_double4(__tg_cosh(x.lo), __tg_cosh(x.hi));
3885}
3886#endif
3887
3888#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3889extern simd_double8 _simd_cosh_d8(simd_double8 x);
3890static inline SIMD_CFUNC simd_double8 __tg_cosh(simd_double8 x) {
3891 return _simd_cosh_d8(x);
3892}
3893#else
3894static inline SIMD_CFUNC simd_double8 __tg_cosh(simd_double8 x) {
3895 return simd_make_double8(__tg_cosh(x.lo), __tg_cosh(x.hi));
3896}
3897#endif
3898
3899#pragma mark - sinh implementation
3900static inline SIMD_CFUNC simd_float2 __tg_sinh(simd_float2 x) {
3901 return simd_make_float2(__tg_sinh(simd_make_float4(x)));
3902}
3903
3904static inline SIMD_CFUNC simd_float3 __tg_sinh(simd_float3 x) {
3905 return simd_make_float3(__tg_sinh(simd_make_float4(x)));
3906}
3907
3908#if SIMD_LIBRARY_VERSION >= 3
3909extern simd_float4 _simd_sinh_f4(simd_float4 x);
3910static inline SIMD_CFUNC simd_float4 __tg_sinh(simd_float4 x) {
3911 return _simd_sinh_f4(x);
3912}
3913#else
3914static inline SIMD_CFUNC simd_float4 __tg_sinh(simd_float4 x) {
3915 return simd_make_float4(sinh(x.x), sinh(x.y), sinh(x.z), sinh(x.w));
3916}
3917#endif
3918
3919#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3920extern simd_float8 _simd_sinh_f8(simd_float8 x);
3921static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x) {
3922 return _simd_sinh_f8(x);
3923}
3924#else
3925static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x) {
3926 return simd_make_float8(__tg_sinh(x.lo), __tg_sinh(x.hi));
3927}
3928#endif
3929
3930#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3931extern simd_float16 _simd_sinh_f16(simd_float16 x);
3932static inline SIMD_CFUNC simd_float16 __tg_sinh(simd_float16 x) {
3933 return _simd_sinh_f16(x);
3934}
3935#else
3936static inline SIMD_CFUNC simd_float16 __tg_sinh(simd_float16 x) {
3937 return simd_make_float16(__tg_sinh(x.lo), __tg_sinh(x.hi));
3938}
3939#endif
3940
3941#if SIMD_LIBRARY_VERSION >= 3
3942extern simd_double2 _simd_sinh_d2(simd_double2 x);
3943static inline SIMD_CFUNC simd_double2 __tg_sinh(simd_double2 x) {
3944 return _simd_sinh_d2(x);
3945}
3946#else
3947static inline SIMD_CFUNC simd_double2 __tg_sinh(simd_double2 x) {
3948 return simd_make_double2(sinh(x.x), sinh(x.y));
3949}
3950#endif
3951
3952static inline SIMD_CFUNC simd_double3 __tg_sinh(simd_double3 x) {
3953 return simd_make_double3(__tg_sinh(simd_make_double4(x)));
3954}
3955
3956#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3957extern simd_double4 _simd_sinh_d4(simd_double4 x);
3958static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x) {
3959 return _simd_sinh_d4(x);
3960}
3961#else
3962static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x) {
3963 return simd_make_double4(__tg_sinh(x.lo), __tg_sinh(x.hi));
3964}
3965#endif
3966
3967#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3968extern simd_double8 _simd_sinh_d8(simd_double8 x);
3969static inline SIMD_CFUNC simd_double8 __tg_sinh(simd_double8 x) {
3970 return _simd_sinh_d8(x);
3971}
3972#else
3973static inline SIMD_CFUNC simd_double8 __tg_sinh(simd_double8 x) {
3974 return simd_make_double8(__tg_sinh(x.lo), __tg_sinh(x.hi));
3975}
3976#endif
3977
3978#pragma mark - tanh implementation
3979static inline SIMD_CFUNC simd_float2 __tg_tanh(simd_float2 x) {
3980 return simd_make_float2(__tg_tanh(simd_make_float4(x)));
3981}
3982
3983static inline SIMD_CFUNC simd_float3 __tg_tanh(simd_float3 x) {
3984 return simd_make_float3(__tg_tanh(simd_make_float4(x)));
3985}
3986
3987#if SIMD_LIBRARY_VERSION >= 3
3988extern simd_float4 _simd_tanh_f4(simd_float4 x);
3989static inline SIMD_CFUNC simd_float4 __tg_tanh(simd_float4 x) {
3990 return _simd_tanh_f4(x);
3991}
3992#else
3993static inline SIMD_CFUNC simd_float4 __tg_tanh(simd_float4 x) {
3994 return simd_make_float4(tanh(x.x), tanh(x.y), tanh(x.z), tanh(x.w));
3995}
3996#endif
3997
3998#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3999extern simd_float8 _simd_tanh_f8(simd_float8 x);
4000static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x) {
4001 return _simd_tanh_f8(x);
4002}
4003#else
4004static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x) {
4005 return simd_make_float8(__tg_tanh(x.lo), __tg_tanh(x.hi));
4006}
4007#endif
4008
4009#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4010extern simd_float16 _simd_tanh_f16(simd_float16 x);
4011static inline SIMD_CFUNC simd_float16 __tg_tanh(simd_float16 x) {
4012 return _simd_tanh_f16(x);
4013}
4014#else
4015static inline SIMD_CFUNC simd_float16 __tg_tanh(simd_float16 x) {
4016 return simd_make_float16(__tg_tanh(x.lo), __tg_tanh(x.hi));
4017}
4018#endif
4019
4020#if SIMD_LIBRARY_VERSION >= 3
4021extern simd_double2 _simd_tanh_d2(simd_double2 x);
4022static inline SIMD_CFUNC simd_double2 __tg_tanh(simd_double2 x) {
4023 return _simd_tanh_d2(x);
4024}
4025#else
4026static inline SIMD_CFUNC simd_double2 __tg_tanh(simd_double2 x) {
4027 return simd_make_double2(tanh(x.x), tanh(x.y));
4028}
4029#endif
4030
4031static inline SIMD_CFUNC simd_double3 __tg_tanh(simd_double3 x) {
4032 return simd_make_double3(__tg_tanh(simd_make_double4(x)));
4033}
4034
4035#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4036extern simd_double4 _simd_tanh_d4(simd_double4 x);
4037static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x) {
4038 return _simd_tanh_d4(x);
4039}
4040#else
4041static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x) {
4042 return simd_make_double4(__tg_tanh(x.lo), __tg_tanh(x.hi));
4043}
4044#endif
4045
4046#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4047extern simd_double8 _simd_tanh_d8(simd_double8 x);
4048static inline SIMD_CFUNC simd_double8 __tg_tanh(simd_double8 x) {
4049 return _simd_tanh_d8(x);
4050}
4051#else
4052static inline SIMD_CFUNC simd_double8 __tg_tanh(simd_double8 x) {
4053 return simd_make_double8(__tg_tanh(x.lo), __tg_tanh(x.hi));
4054}
4055#endif
4056
4057#pragma mark - exp implementation
4058static inline SIMD_CFUNC simd_float2 __tg_exp(simd_float2 x) {
4059 return simd_make_float2(__tg_exp(simd_make_float4(x)));
4060}
4061
4062static inline SIMD_CFUNC simd_float3 __tg_exp(simd_float3 x) {
4063 return simd_make_float3(__tg_exp(simd_make_float4(x)));
4064}
4065
4066#if SIMD_LIBRARY_VERSION >= 3
4067extern simd_float4 _simd_exp_f4(simd_float4 x);
4068static inline SIMD_CFUNC simd_float4 __tg_exp(simd_float4 x) {
4069 return _simd_exp_f4(x);
4070}
4071#else
4072static inline SIMD_CFUNC simd_float4 __tg_exp(simd_float4 x) {
4073 return simd_make_float4(exp(x.x), exp(x.y), exp(x.z), exp(x.w));
4074}
4075#endif
4076
4077#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4078extern simd_float8 _simd_exp_f8(simd_float8 x);
4079static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x) {
4080 return _simd_exp_f8(x);
4081}
4082#else
4083static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x) {
4084 return simd_make_float8(__tg_exp(x.lo), __tg_exp(x.hi));
4085}
4086#endif
4087
4088#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4089extern simd_float16 _simd_exp_f16(simd_float16 x);
4090static inline SIMD_CFUNC simd_float16 __tg_exp(simd_float16 x) {
4091 return _simd_exp_f16(x);
4092}
4093#else
4094static inline SIMD_CFUNC simd_float16 __tg_exp(simd_float16 x) {
4095 return simd_make_float16(__tg_exp(x.lo), __tg_exp(x.hi));
4096}
4097#endif
4098
4099#if SIMD_LIBRARY_VERSION >= 3
4100extern simd_double2 _simd_exp_d2(simd_double2 x);
4101static inline SIMD_CFUNC simd_double2 __tg_exp(simd_double2 x) {
4102 return _simd_exp_d2(x);
4103}
4104#else
4105static inline SIMD_CFUNC simd_double2 __tg_exp(simd_double2 x) {
4106 return simd_make_double2(exp(x.x), exp(x.y));
4107}
4108#endif
4109
4110static inline SIMD_CFUNC simd_double3 __tg_exp(simd_double3 x) {
4111 return simd_make_double3(__tg_exp(simd_make_double4(x)));
4112}
4113
4114#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4115extern simd_double4 _simd_exp_d4(simd_double4 x);
4116static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x) {
4117 return _simd_exp_d4(x);
4118}
4119#else
4120static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x) {
4121 return simd_make_double4(__tg_exp(x.lo), __tg_exp(x.hi));
4122}
4123#endif
4124
4125#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4126extern simd_double8 _simd_exp_d8(simd_double8 x);
4127static inline SIMD_CFUNC simd_double8 __tg_exp(simd_double8 x) {
4128 return _simd_exp_d8(x);
4129}
4130#else
4131static inline SIMD_CFUNC simd_double8 __tg_exp(simd_double8 x) {
4132 return simd_make_double8(__tg_exp(x.lo), __tg_exp(x.hi));
4133}
4134#endif
4135
4136#pragma mark - exp2 implementation
4137static inline SIMD_CFUNC simd_float2 __tg_exp2(simd_float2 x) {
4138 return simd_make_float2(__tg_exp2(simd_make_float4(x)));
4139}
4140
4141static inline SIMD_CFUNC simd_float3 __tg_exp2(simd_float3 x) {
4142 return simd_make_float3(__tg_exp2(simd_make_float4(x)));
4143}
4144
4145#if SIMD_LIBRARY_VERSION >= 3
4146extern simd_float4 _simd_exp2_f4(simd_float4 x);
4147static inline SIMD_CFUNC simd_float4 __tg_exp2(simd_float4 x) {
4148 return _simd_exp2_f4(x);
4149}
4150#else
4151static inline SIMD_CFUNC simd_float4 __tg_exp2(simd_float4 x) {
4152 return simd_make_float4(exp2(x.x), exp2(x.y), exp2(x.z), exp2(x.w));
4153}
4154#endif
4155
4156#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4157extern simd_float8 _simd_exp2_f8(simd_float8 x);
4158static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x) {
4159 return _simd_exp2_f8(x);
4160}
4161#else
4162static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x) {
4163 return simd_make_float8(__tg_exp2(x.lo), __tg_exp2(x.hi));
4164}
4165#endif
4166
4167#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4168extern simd_float16 _simd_exp2_f16(simd_float16 x);
4169static inline SIMD_CFUNC simd_float16 __tg_exp2(simd_float16 x) {
4170 return _simd_exp2_f16(x);
4171}
4172#else
4173static inline SIMD_CFUNC simd_float16 __tg_exp2(simd_float16 x) {
4174 return simd_make_float16(__tg_exp2(x.lo), __tg_exp2(x.hi));
4175}
4176#endif
4177
4178#if SIMD_LIBRARY_VERSION >= 3
4179extern simd_double2 _simd_exp2_d2(simd_double2 x);
4180static inline SIMD_CFUNC simd_double2 __tg_exp2(simd_double2 x) {
4181 return _simd_exp2_d2(x);
4182}
4183#else
4184static inline SIMD_CFUNC simd_double2 __tg_exp2(simd_double2 x) {
4185 return simd_make_double2(exp2(x.x), exp2(x.y));
4186}
4187#endif
4188
4189static inline SIMD_CFUNC simd_double3 __tg_exp2(simd_double3 x) {
4190 return simd_make_double3(__tg_exp2(simd_make_double4(x)));
4191}
4192
4193#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4194extern simd_double4 _simd_exp2_d4(simd_double4 x);
4195static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x) {
4196 return _simd_exp2_d4(x);
4197}
4198#else
4199static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x) {
4200 return simd_make_double4(__tg_exp2(x.lo), __tg_exp2(x.hi));
4201}
4202#endif
4203
4204#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4205extern simd_double8 _simd_exp2_d8(simd_double8 x);
4206static inline SIMD_CFUNC simd_double8 __tg_exp2(simd_double8 x) {
4207 return _simd_exp2_d8(x);
4208}
4209#else
4210static inline SIMD_CFUNC simd_double8 __tg_exp2(simd_double8 x) {
4211 return simd_make_double8(__tg_exp2(x.lo), __tg_exp2(x.hi));
4212}
4213#endif
4214
4215#pragma mark - exp10 implementation
4216#if SIMD_LIBRARY_VERSION >= 1
4217static inline SIMD_CFUNC simd_float2 __tg_exp10(simd_float2 x) {
4218 return simd_make_float2(__tg_exp10(simd_make_float4(x)));
4219}
4220
4221static inline SIMD_CFUNC simd_float3 __tg_exp10(simd_float3 x) {
4222 return simd_make_float3(__tg_exp10(simd_make_float4(x)));
4223}
4224
4225#if SIMD_LIBRARY_VERSION >= 3
4226extern simd_float4 _simd_exp10_f4(simd_float4 x);
4227static inline SIMD_CFUNC simd_float4 __tg_exp10(simd_float4 x) {
4228 return _simd_exp10_f4(x);
4229}
4230#else
4231static inline SIMD_CFUNC simd_float4 __tg_exp10(simd_float4 x) {
4232 return simd_make_float4(__exp10(x.x), __exp10(x.y), __exp10(x.z), __exp10(x.w));
4233}
4234#endif
4235
4236#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4237extern simd_float8 _simd_exp10_f8(simd_float8 x);
4238static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x) {
4239 return _simd_exp10_f8(x);
4240}
4241#else
4242static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x) {
4243 return simd_make_float8(__tg_exp10(x.lo), __tg_exp10(x.hi));
4244}
4245#endif
4246
4247#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4248extern simd_float16 _simd_exp10_f16(simd_float16 x);
4249static inline SIMD_CFUNC simd_float16 __tg_exp10(simd_float16 x) {
4250 return _simd_exp10_f16(x);
4251}
4252#else
4253static inline SIMD_CFUNC simd_float16 __tg_exp10(simd_float16 x) {
4254 return simd_make_float16(__tg_exp10(x.lo), __tg_exp10(x.hi));
4255}
4256#endif
4257
4258#if SIMD_LIBRARY_VERSION >= 3
4259extern simd_double2 _simd_exp10_d2(simd_double2 x);
4260static inline SIMD_CFUNC simd_double2 __tg_exp10(simd_double2 x) {
4261 return _simd_exp10_d2(x);
4262}
4263#else
4264static inline SIMD_CFUNC simd_double2 __tg_exp10(simd_double2 x) {
4265 return simd_make_double2(__exp10(x.x), __exp10(x.y));
4266}
4267#endif
4268
4269static inline SIMD_CFUNC simd_double3 __tg_exp10(simd_double3 x) {
4270 return simd_make_double3(__tg_exp10(simd_make_double4(x)));
4271}
4272
4273#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4274extern simd_double4 _simd_exp10_d4(simd_double4 x);
4275static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x) {
4276 return _simd_exp10_d4(x);
4277}
4278#else
4279static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x) {
4280 return simd_make_double4(__tg_exp10(x.lo), __tg_exp10(x.hi));
4281}
4282#endif
4283
4284#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4285extern simd_double8 _simd_exp10_d8(simd_double8 x);
4286static inline SIMD_CFUNC simd_double8 __tg_exp10(simd_double8 x) {
4287 return _simd_exp10_d8(x);
4288}
4289#else
4290static inline SIMD_CFUNC simd_double8 __tg_exp10(simd_double8 x) {
4291 return simd_make_double8(__tg_exp10(x.lo), __tg_exp10(x.hi));
4292}
4293#endif
4294
4295#endif /* SIMD_LIBRARY_VERSION */
4296#pragma mark - expm1 implementation
4297static inline SIMD_CFUNC simd_float2 __tg_expm1(simd_float2 x) {
4298 return simd_make_float2(__tg_expm1(simd_make_float4(x)));
4299}
4300
4301static inline SIMD_CFUNC simd_float3 __tg_expm1(simd_float3 x) {
4302 return simd_make_float3(__tg_expm1(simd_make_float4(x)));
4303}
4304
4305#if SIMD_LIBRARY_VERSION >= 3
4306extern simd_float4 _simd_expm1_f4(simd_float4 x);
4307static inline SIMD_CFUNC simd_float4 __tg_expm1(simd_float4 x) {
4308 return _simd_expm1_f4(x);
4309}
4310#else
4311static inline SIMD_CFUNC simd_float4 __tg_expm1(simd_float4 x) {
4312 return simd_make_float4(expm1(x.x), expm1(x.y), expm1(x.z), expm1(x.w));
4313}
4314#endif
4315
4316#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4317extern simd_float8 _simd_expm1_f8(simd_float8 x);
4318static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x) {
4319 return _simd_expm1_f8(x);
4320}
4321#else
4322static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x) {
4323 return simd_make_float8(__tg_expm1(x.lo), __tg_expm1(x.hi));
4324}
4325#endif
4326
4327#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4328extern simd_float16 _simd_expm1_f16(simd_float16 x);
4329static inline SIMD_CFUNC simd_float16 __tg_expm1(simd_float16 x) {
4330 return _simd_expm1_f16(x);
4331}
4332#else
4333static inline SIMD_CFUNC simd_float16 __tg_expm1(simd_float16 x) {
4334 return simd_make_float16(__tg_expm1(x.lo), __tg_expm1(x.hi));
4335}
4336#endif
4337
4338#if SIMD_LIBRARY_VERSION >= 3
4339extern simd_double2 _simd_expm1_d2(simd_double2 x);
4340static inline SIMD_CFUNC simd_double2 __tg_expm1(simd_double2 x) {
4341 return _simd_expm1_d2(x);
4342}
4343#else
4344static inline SIMD_CFUNC simd_double2 __tg_expm1(simd_double2 x) {
4345 return simd_make_double2(expm1(x.x), expm1(x.y));
4346}
4347#endif
4348
4349static inline SIMD_CFUNC simd_double3 __tg_expm1(simd_double3 x) {
4350 return simd_make_double3(__tg_expm1(simd_make_double4(x)));
4351}
4352
4353#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4354extern simd_double4 _simd_expm1_d4(simd_double4 x);
4355static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x) {
4356 return _simd_expm1_d4(x);
4357}
4358#else
4359static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x) {
4360 return simd_make_double4(__tg_expm1(x.lo), __tg_expm1(x.hi));
4361}
4362#endif
4363
4364#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4365extern simd_double8 _simd_expm1_d8(simd_double8 x);
4366static inline SIMD_CFUNC simd_double8 __tg_expm1(simd_double8 x) {
4367 return _simd_expm1_d8(x);
4368}
4369#else
4370static inline SIMD_CFUNC simd_double8 __tg_expm1(simd_double8 x) {
4371 return simd_make_double8(__tg_expm1(x.lo), __tg_expm1(x.hi));
4372}
4373#endif
4374
4375#pragma mark - log implementation
4376static inline SIMD_CFUNC simd_float2 __tg_log(simd_float2 x) {
4377 return simd_make_float2(__tg_log(simd_make_float4(x)));
4378}
4379
4380static inline SIMD_CFUNC simd_float3 __tg_log(simd_float3 x) {
4381 return simd_make_float3(__tg_log(simd_make_float4(x)));
4382}
4383
4384#if SIMD_LIBRARY_VERSION >= 3
4385extern simd_float4 _simd_log_f4(simd_float4 x);
4386static inline SIMD_CFUNC simd_float4 __tg_log(simd_float4 x) {
4387 return _simd_log_f4(x);
4388}
4389#else
4390static inline SIMD_CFUNC simd_float4 __tg_log(simd_float4 x) {
4391 return simd_make_float4(log(x.x), log(x.y), log(x.z), log(x.w));
4392}
4393#endif
4394
4395#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4396extern simd_float8 _simd_log_f8(simd_float8 x);
4397static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x) {
4398 return _simd_log_f8(x);
4399}
4400#else
4401static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x) {
4402 return simd_make_float8(__tg_log(x.lo), __tg_log(x.hi));
4403}
4404#endif
4405
4406#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4407extern simd_float16 _simd_log_f16(simd_float16 x);
4408static inline SIMD_CFUNC simd_float16 __tg_log(simd_float16 x) {
4409 return _simd_log_f16(x);
4410}
4411#else
4412static inline SIMD_CFUNC simd_float16 __tg_log(simd_float16 x) {
4413 return simd_make_float16(__tg_log(x.lo), __tg_log(x.hi));
4414}
4415#endif
4416
4417#if SIMD_LIBRARY_VERSION >= 3
4418extern simd_double2 _simd_log_d2(simd_double2 x);
4419static inline SIMD_CFUNC simd_double2 __tg_log(simd_double2 x) {
4420 return _simd_log_d2(x);
4421}
4422#else
4423static inline SIMD_CFUNC simd_double2 __tg_log(simd_double2 x) {
4424 return simd_make_double2(log(x.x), log(x.y));
4425}
4426#endif
4427
4428static inline SIMD_CFUNC simd_double3 __tg_log(simd_double3 x) {
4429 return simd_make_double3(__tg_log(simd_make_double4(x)));
4430}
4431
4432#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4433extern simd_double4 _simd_log_d4(simd_double4 x);
4434static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x) {
4435 return _simd_log_d4(x);
4436}
4437#else
4438static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x) {
4439 return simd_make_double4(__tg_log(x.lo), __tg_log(x.hi));
4440}
4441#endif
4442
4443#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4444extern simd_double8 _simd_log_d8(simd_double8 x);
4445static inline SIMD_CFUNC simd_double8 __tg_log(simd_double8 x) {
4446 return _simd_log_d8(x);
4447}
4448#else
4449static inline SIMD_CFUNC simd_double8 __tg_log(simd_double8 x) {
4450 return simd_make_double8(__tg_log(x.lo), __tg_log(x.hi));
4451}
4452#endif
4453
4454#pragma mark - log2 implementation
4455static inline SIMD_CFUNC simd_float2 __tg_log2(simd_float2 x) {
4456 return simd_make_float2(__tg_log2(simd_make_float4(x)));
4457}
4458
4459static inline SIMD_CFUNC simd_float3 __tg_log2(simd_float3 x) {
4460 return simd_make_float3(__tg_log2(simd_make_float4(x)));
4461}
4462
4463#if SIMD_LIBRARY_VERSION >= 3
4464extern simd_float4 _simd_log2_f4(simd_float4 x);
4465static inline SIMD_CFUNC simd_float4 __tg_log2(simd_float4 x) {
4466 return _simd_log2_f4(x);
4467}
4468#else
4469static inline SIMD_CFUNC simd_float4 __tg_log2(simd_float4 x) {
4470 return simd_make_float4(log2(x.x), log2(x.y), log2(x.z), log2(x.w));
4471}
4472#endif
4473
4474#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4475extern simd_float8 _simd_log2_f8(simd_float8 x);
4476static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x) {
4477 return _simd_log2_f8(x);
4478}
4479#else
4480static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x) {
4481 return simd_make_float8(__tg_log2(x.lo), __tg_log2(x.hi));
4482}
4483#endif
4484
4485#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4486extern simd_float16 _simd_log2_f16(simd_float16 x);
4487static inline SIMD_CFUNC simd_float16 __tg_log2(simd_float16 x) {
4488 return _simd_log2_f16(x);
4489}
4490#else
4491static inline SIMD_CFUNC simd_float16 __tg_log2(simd_float16 x) {
4492 return simd_make_float16(__tg_log2(x.lo), __tg_log2(x.hi));
4493}
4494#endif
4495
4496#if SIMD_LIBRARY_VERSION >= 3
4497extern simd_double2 _simd_log2_d2(simd_double2 x);
4498static inline SIMD_CFUNC simd_double2 __tg_log2(simd_double2 x) {
4499 return _simd_log2_d2(x);
4500}
4501#else
4502static inline SIMD_CFUNC simd_double2 __tg_log2(simd_double2 x) {
4503 return simd_make_double2(log2(x.x), log2(x.y));
4504}
4505#endif
4506
4507static inline SIMD_CFUNC simd_double3 __tg_log2(simd_double3 x) {
4508 return simd_make_double3(__tg_log2(simd_make_double4(x)));
4509}
4510
4511#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4512extern simd_double4 _simd_log2_d4(simd_double4 x);
4513static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x) {
4514 return _simd_log2_d4(x);
4515}
4516#else
4517static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x) {
4518 return simd_make_double4(__tg_log2(x.lo), __tg_log2(x.hi));
4519}
4520#endif
4521
4522#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4523extern simd_double8 _simd_log2_d8(simd_double8 x);
4524static inline SIMD_CFUNC simd_double8 __tg_log2(simd_double8 x) {
4525 return _simd_log2_d8(x);
4526}
4527#else
4528static inline SIMD_CFUNC simd_double8 __tg_log2(simd_double8 x) {
4529 return simd_make_double8(__tg_log2(x.lo), __tg_log2(x.hi));
4530}
4531#endif
4532
4533#pragma mark - log10 implementation
4534static inline SIMD_CFUNC simd_float2 __tg_log10(simd_float2 x) {
4535 return simd_make_float2(__tg_log10(simd_make_float4(x)));
4536}
4537
4538static inline SIMD_CFUNC simd_float3 __tg_log10(simd_float3 x) {
4539 return simd_make_float3(__tg_log10(simd_make_float4(x)));
4540}
4541
4542#if SIMD_LIBRARY_VERSION >= 3
4543extern simd_float4 _simd_log10_f4(simd_float4 x);
4544static inline SIMD_CFUNC simd_float4 __tg_log10(simd_float4 x) {
4545 return _simd_log10_f4(x);
4546}
4547#else
4548static inline SIMD_CFUNC simd_float4 __tg_log10(simd_float4 x) {
4549 return simd_make_float4(log10(x.x), log10(x.y), log10(x.z), log10(x.w));
4550}
4551#endif
4552
4553#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4554extern simd_float8 _simd_log10_f8(simd_float8 x);
4555static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x) {
4556 return _simd_log10_f8(x);
4557}
4558#else
4559static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x) {
4560 return simd_make_float8(__tg_log10(x.lo), __tg_log10(x.hi));
4561}
4562#endif
4563
4564#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4565extern simd_float16 _simd_log10_f16(simd_float16 x);
4566static inline SIMD_CFUNC simd_float16 __tg_log10(simd_float16 x) {
4567 return _simd_log10_f16(x);
4568}
4569#else
4570static inline SIMD_CFUNC simd_float16 __tg_log10(simd_float16 x) {
4571 return simd_make_float16(__tg_log10(x.lo), __tg_log10(x.hi));
4572}
4573#endif
4574
4575#if SIMD_LIBRARY_VERSION >= 3
4576extern simd_double2 _simd_log10_d2(simd_double2 x);
4577static inline SIMD_CFUNC simd_double2 __tg_log10(simd_double2 x) {
4578 return _simd_log10_d2(x);
4579}
4580#else
4581static inline SIMD_CFUNC simd_double2 __tg_log10(simd_double2 x) {
4582 return simd_make_double2(log10(x.x), log10(x.y));
4583}
4584#endif
4585
4586static inline SIMD_CFUNC simd_double3 __tg_log10(simd_double3 x) {
4587 return simd_make_double3(__tg_log10(simd_make_double4(x)));
4588}
4589
4590#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4591extern simd_double4 _simd_log10_d4(simd_double4 x);
4592static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x) {
4593 return _simd_log10_d4(x);
4594}
4595#else
4596static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x) {
4597 return simd_make_double4(__tg_log10(x.lo), __tg_log10(x.hi));
4598}
4599#endif
4600
4601#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4602extern simd_double8 _simd_log10_d8(simd_double8 x);
4603static inline SIMD_CFUNC simd_double8 __tg_log10(simd_double8 x) {
4604 return _simd_log10_d8(x);
4605}
4606#else
4607static inline SIMD_CFUNC simd_double8 __tg_log10(simd_double8 x) {
4608 return simd_make_double8(__tg_log10(x.lo), __tg_log10(x.hi));
4609}
4610#endif
4611
4612#pragma mark - log1p implementation
4613static inline SIMD_CFUNC simd_float2 __tg_log1p(simd_float2 x) {
4614 return simd_make_float2(__tg_log1p(simd_make_float4(x)));
4615}
4616
4617static inline SIMD_CFUNC simd_float3 __tg_log1p(simd_float3 x) {
4618 return simd_make_float3(__tg_log1p(simd_make_float4(x)));
4619}
4620
4621#if SIMD_LIBRARY_VERSION >= 3
4622extern simd_float4 _simd_log1p_f4(simd_float4 x);
4623static inline SIMD_CFUNC simd_float4 __tg_log1p(simd_float4 x) {
4624 return _simd_log1p_f4(x);
4625}
4626#else
4627static inline SIMD_CFUNC simd_float4 __tg_log1p(simd_float4 x) {
4628 return simd_make_float4(log1p(x.x), log1p(x.y), log1p(x.z), log1p(x.w));
4629}
4630#endif
4631
4632#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4633extern simd_float8 _simd_log1p_f8(simd_float8 x);
4634static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x) {
4635 return _simd_log1p_f8(x);
4636}
4637#else
4638static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x) {
4639 return simd_make_float8(__tg_log1p(x.lo), __tg_log1p(x.hi));
4640}
4641#endif
4642
4643#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4644extern simd_float16 _simd_log1p_f16(simd_float16 x);
4645static inline SIMD_CFUNC simd_float16 __tg_log1p(simd_float16 x) {
4646 return _simd_log1p_f16(x);
4647}
4648#else
4649static inline SIMD_CFUNC simd_float16 __tg_log1p(simd_float16 x) {
4650 return simd_make_float16(__tg_log1p(x.lo), __tg_log1p(x.hi));
4651}
4652#endif
4653
4654#if SIMD_LIBRARY_VERSION >= 3
4655extern simd_double2 _simd_log1p_d2(simd_double2 x);
4656static inline SIMD_CFUNC simd_double2 __tg_log1p(simd_double2 x) {
4657 return _simd_log1p_d2(x);
4658}
4659#else
4660static inline SIMD_CFUNC simd_double2 __tg_log1p(simd_double2 x) {
4661 return simd_make_double2(log1p(x.x), log1p(x.y));
4662}
4663#endif
4664
4665static inline SIMD_CFUNC simd_double3 __tg_log1p(simd_double3 x) {
4666 return simd_make_double3(__tg_log1p(simd_make_double4(x)));
4667}
4668
4669#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4670extern simd_double4 _simd_log1p_d4(simd_double4 x);
4671static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x) {
4672 return _simd_log1p_d4(x);
4673}
4674#else
4675static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x) {
4676 return simd_make_double4(__tg_log1p(x.lo), __tg_log1p(x.hi));
4677}
4678#endif
4679
4680#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4681extern simd_double8 _simd_log1p_d8(simd_double8 x);
4682static inline SIMD_CFUNC simd_double8 __tg_log1p(simd_double8 x) {
4683 return _simd_log1p_d8(x);
4684}
4685#else
4686static inline SIMD_CFUNC simd_double8 __tg_log1p(simd_double8 x) {
4687 return simd_make_double8(__tg_log1p(x.lo), __tg_log1p(x.hi));
4688}
4689#endif
4690
4691#pragma mark - cbrt implementation
4692static inline SIMD_CFUNC simd_float2 __tg_cbrt(simd_float2 x) {
4693 return simd_make_float2(__tg_cbrt(simd_make_float4(x)));
4694}
4695
4696static inline SIMD_CFUNC simd_float3 __tg_cbrt(simd_float3 x) {
4697 return simd_make_float3(__tg_cbrt(simd_make_float4(x)));
4698}
4699
4700#if SIMD_LIBRARY_VERSION >= 3
4701extern simd_float4 _simd_cbrt_f4(simd_float4 x);
4702static inline SIMD_CFUNC simd_float4 __tg_cbrt(simd_float4 x) {
4703 return _simd_cbrt_f4(x);
4704}
4705#else
4706static inline SIMD_CFUNC simd_float4 __tg_cbrt(simd_float4 x) {
4707 return simd_make_float4(cbrt(x.x), cbrt(x.y), cbrt(x.z), cbrt(x.w));
4708}
4709#endif
4710
4711#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4712extern simd_float8 _simd_cbrt_f8(simd_float8 x);
4713static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x) {
4714 return _simd_cbrt_f8(x);
4715}
4716#else
4717static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x) {
4718 return simd_make_float8(__tg_cbrt(x.lo), __tg_cbrt(x.hi));
4719}
4720#endif
4721
4722#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4723extern simd_float16 _simd_cbrt_f16(simd_float16 x);
4724static inline SIMD_CFUNC simd_float16 __tg_cbrt(simd_float16 x) {
4725 return _simd_cbrt_f16(x);
4726}
4727#else
4728static inline SIMD_CFUNC simd_float16 __tg_cbrt(simd_float16 x) {
4729 return simd_make_float16(__tg_cbrt(x.lo), __tg_cbrt(x.hi));
4730}
4731#endif
4732
4733#if SIMD_LIBRARY_VERSION >= 3
4734extern simd_double2 _simd_cbrt_d2(simd_double2 x);
4735static inline SIMD_CFUNC simd_double2 __tg_cbrt(simd_double2 x) {
4736 return _simd_cbrt_d2(x);
4737}
4738#else
4739static inline SIMD_CFUNC simd_double2 __tg_cbrt(simd_double2 x) {
4740 return simd_make_double2(cbrt(x.x), cbrt(x.y));
4741}
4742#endif
4743
4744static inline SIMD_CFUNC simd_double3 __tg_cbrt(simd_double3 x) {
4745 return simd_make_double3(__tg_cbrt(simd_make_double4(x)));
4746}
4747
4748#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4749extern simd_double4 _simd_cbrt_d4(simd_double4 x);
4750static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x) {
4751 return _simd_cbrt_d4(x);
4752}
4753#else
4754static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x) {
4755 return simd_make_double4(__tg_cbrt(x.lo), __tg_cbrt(x.hi));
4756}
4757#endif
4758
4759#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4760extern simd_double8 _simd_cbrt_d8(simd_double8 x);
4761static inline SIMD_CFUNC simd_double8 __tg_cbrt(simd_double8 x) {
4762 return _simd_cbrt_d8(x);
4763}
4764#else
4765static inline SIMD_CFUNC simd_double8 __tg_cbrt(simd_double8 x) {
4766 return simd_make_double8(__tg_cbrt(x.lo), __tg_cbrt(x.hi));
4767}
4768#endif
4769
4770#pragma mark - erf implementation
4771static inline SIMD_CFUNC simd_float2 __tg_erf(simd_float2 x) {
4772 return simd_make_float2(__tg_erf(simd_make_float4(x)));
4773}
4774
4775static inline SIMD_CFUNC simd_float3 __tg_erf(simd_float3 x) {
4776 return simd_make_float3(__tg_erf(simd_make_float4(x)));
4777}
4778
4779#if SIMD_LIBRARY_VERSION >= 3
4780extern simd_float4 _simd_erf_f4(simd_float4 x);
4781static inline SIMD_CFUNC simd_float4 __tg_erf(simd_float4 x) {
4782 return _simd_erf_f4(x);
4783}
4784#else
4785static inline SIMD_CFUNC simd_float4 __tg_erf(simd_float4 x) {
4786 return simd_make_float4(erf(x.x), erf(x.y), erf(x.z), erf(x.w));
4787}
4788#endif
4789
4790#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4791extern simd_float8 _simd_erf_f8(simd_float8 x);
4792static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x) {
4793 return _simd_erf_f8(x);
4794}
4795#else
4796static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x) {
4797 return simd_make_float8(__tg_erf(x.lo), __tg_erf(x.hi));
4798}
4799#endif
4800
4801#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4802extern simd_float16 _simd_erf_f16(simd_float16 x);
4803static inline SIMD_CFUNC simd_float16 __tg_erf(simd_float16 x) {
4804 return _simd_erf_f16(x);
4805}
4806#else
4807static inline SIMD_CFUNC simd_float16 __tg_erf(simd_float16 x) {
4808 return simd_make_float16(__tg_erf(x.lo), __tg_erf(x.hi));
4809}
4810#endif
4811
4812#if SIMD_LIBRARY_VERSION >= 3
4813extern simd_double2 _simd_erf_d2(simd_double2 x);
4814static inline SIMD_CFUNC simd_double2 __tg_erf(simd_double2 x) {
4815 return _simd_erf_d2(x);
4816}
4817#else
4818static inline SIMD_CFUNC simd_double2 __tg_erf(simd_double2 x) {
4819 return simd_make_double2(erf(x.x), erf(x.y));
4820}
4821#endif
4822
4823static inline SIMD_CFUNC simd_double3 __tg_erf(simd_double3 x) {
4824 return simd_make_double3(__tg_erf(simd_make_double4(x)));
4825}
4826
4827#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4828extern simd_double4 _simd_erf_d4(simd_double4 x);
4829static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x) {
4830 return _simd_erf_d4(x);
4831}
4832#else
4833static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x) {
4834 return simd_make_double4(__tg_erf(x.lo), __tg_erf(x.hi));
4835}
4836#endif
4837
4838#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4839extern simd_double8 _simd_erf_d8(simd_double8 x);
4840static inline SIMD_CFUNC simd_double8 __tg_erf(simd_double8 x) {
4841 return _simd_erf_d8(x);
4842}
4843#else
4844static inline SIMD_CFUNC simd_double8 __tg_erf(simd_double8 x) {
4845 return simd_make_double8(__tg_erf(x.lo), __tg_erf(x.hi));
4846}
4847#endif
4848
4849#pragma mark - erfc implementation
4850static inline SIMD_CFUNC simd_float2 __tg_erfc(simd_float2 x) {
4851 return simd_make_float2(__tg_erfc(simd_make_float4(x)));
4852}
4853
4854static inline SIMD_CFUNC simd_float3 __tg_erfc(simd_float3 x) {
4855 return simd_make_float3(__tg_erfc(simd_make_float4(x)));
4856}
4857
4858#if SIMD_LIBRARY_VERSION >= 3
4859extern simd_float4 _simd_erfc_f4(simd_float4 x);
4860static inline SIMD_CFUNC simd_float4 __tg_erfc(simd_float4 x) {
4861 return _simd_erfc_f4(x);
4862}
4863#else
4864static inline SIMD_CFUNC simd_float4 __tg_erfc(simd_float4 x) {
4865 return simd_make_float4(erfc(x.x), erfc(x.y), erfc(x.z), erfc(x.w));
4866}
4867#endif
4868
4869#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4870extern simd_float8 _simd_erfc_f8(simd_float8 x);
4871static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x) {
4872 return _simd_erfc_f8(x);
4873}
4874#else
4875static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x) {
4876 return simd_make_float8(__tg_erfc(x.lo), __tg_erfc(x.hi));
4877}
4878#endif
4879
4880#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4881extern simd_float16 _simd_erfc_f16(simd_float16 x);
4882static inline SIMD_CFUNC simd_float16 __tg_erfc(simd_float16 x) {
4883 return _simd_erfc_f16(x);
4884}
4885#else
4886static inline SIMD_CFUNC simd_float16 __tg_erfc(simd_float16 x) {
4887 return simd_make_float16(__tg_erfc(x.lo), __tg_erfc(x.hi));
4888}
4889#endif
4890
4891#if SIMD_LIBRARY_VERSION >= 3
4892extern simd_double2 _simd_erfc_d2(simd_double2 x);
4893static inline SIMD_CFUNC simd_double2 __tg_erfc(simd_double2 x) {
4894 return _simd_erfc_d2(x);
4895}
4896#else
4897static inline SIMD_CFUNC simd_double2 __tg_erfc(simd_double2 x) {
4898 return simd_make_double2(erfc(x.x), erfc(x.y));
4899}
4900#endif
4901
4902static inline SIMD_CFUNC simd_double3 __tg_erfc(simd_double3 x) {
4903 return simd_make_double3(__tg_erfc(simd_make_double4(x)));
4904}
4905
4906#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4907extern simd_double4 _simd_erfc_d4(simd_double4 x);
4908static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x) {
4909 return _simd_erfc_d4(x);
4910}
4911#else
4912static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x) {
4913 return simd_make_double4(__tg_erfc(x.lo), __tg_erfc(x.hi));
4914}
4915#endif
4916
4917#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4918extern simd_double8 _simd_erfc_d8(simd_double8 x);
4919static inline SIMD_CFUNC simd_double8 __tg_erfc(simd_double8 x) {
4920 return _simd_erfc_d8(x);
4921}
4922#else
4923static inline SIMD_CFUNC simd_double8 __tg_erfc(simd_double8 x) {
4924 return simd_make_double8(__tg_erfc(x.lo), __tg_erfc(x.hi));
4925}
4926#endif
4927
4928#pragma mark - tgamma implementation
4929static inline SIMD_CFUNC simd_float2 __tg_tgamma(simd_float2 x) {
4930 return simd_make_float2(__tg_tgamma(simd_make_float4(x)));
4931}
4932
4933static inline SIMD_CFUNC simd_float3 __tg_tgamma(simd_float3 x) {
4934 return simd_make_float3(__tg_tgamma(simd_make_float4(x)));
4935}
4936
4937#if SIMD_LIBRARY_VERSION >= 3
4938extern simd_float4 _simd_tgamma_f4(simd_float4 x);
4939static inline SIMD_CFUNC simd_float4 __tg_tgamma(simd_float4 x) {
4940 return _simd_tgamma_f4(x);
4941}
4942#else
4943static inline SIMD_CFUNC simd_float4 __tg_tgamma(simd_float4 x) {
4944 return simd_make_float4(tgamma(x.x), tgamma(x.y), tgamma(x.z), tgamma(x.w));
4945}
4946#endif
4947
4948#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4949extern simd_float8 _simd_tgamma_f8(simd_float8 x);
4950static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x) {
4951 return _simd_tgamma_f8(x);
4952}
4953#else
4954static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x) {
4955 return simd_make_float8(__tg_tgamma(x.lo), __tg_tgamma(x.hi));
4956}
4957#endif
4958
4959#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4960extern simd_float16 _simd_tgamma_f16(simd_float16 x);
4961static inline SIMD_CFUNC simd_float16 __tg_tgamma(simd_float16 x) {
4962 return _simd_tgamma_f16(x);
4963}
4964#else
4965static inline SIMD_CFUNC simd_float16 __tg_tgamma(simd_float16 x) {
4966 return simd_make_float16(__tg_tgamma(x.lo), __tg_tgamma(x.hi));
4967}
4968#endif
4969
4970#if SIMD_LIBRARY_VERSION >= 3
4971extern simd_double2 _simd_tgamma_d2(simd_double2 x);
4972static inline SIMD_CFUNC simd_double2 __tg_tgamma(simd_double2 x) {
4973 return _simd_tgamma_d2(x);
4974}
4975#else
4976static inline SIMD_CFUNC simd_double2 __tg_tgamma(simd_double2 x) {
4977 return simd_make_double2(tgamma(x.x), tgamma(x.y));
4978}
4979#endif
4980
4981static inline SIMD_CFUNC simd_double3 __tg_tgamma(simd_double3 x) {
4982 return simd_make_double3(__tg_tgamma(simd_make_double4(x)));
4983}
4984
4985#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4986extern simd_double4 _simd_tgamma_d4(simd_double4 x);
4987static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x) {
4988 return _simd_tgamma_d4(x);
4989}
4990#else
4991static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x) {
4992 return simd_make_double4(__tg_tgamma(x.lo), __tg_tgamma(x.hi));
4993}
4994#endif
4995
4996#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4997extern simd_double8 _simd_tgamma_d8(simd_double8 x);
4998static inline SIMD_CFUNC simd_double8 __tg_tgamma(simd_double8 x) {
4999 return _simd_tgamma_d8(x);
5000}
5001#else
5002static inline SIMD_CFUNC simd_double8 __tg_tgamma(simd_double8 x) {
5003 return simd_make_double8(__tg_tgamma(x.lo), __tg_tgamma(x.hi));
5004}
5005#endif
5006
5007#pragma mark - round implementation
5008static inline SIMD_CFUNC simd_float2 __tg_round(simd_float2 x) {
5009 return simd_make_float2(__tg_round(simd_make_float4(x)));
5010}
5011
5012static inline SIMD_CFUNC simd_float3 __tg_round(simd_float3 x) {
5013 return simd_make_float3(__tg_round(simd_make_float4(x)));
5014}
5015
5016#if SIMD_LIBRARY_VERSION >= 3
5017extern simd_float4 _simd_round_f4(simd_float4 x);
5018static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x) {
5019#if defined __arm64__
5020 return vrndaq_f32(x);
5021#else
5022 return _simd_round_f4(x);
5023#endif
5024}
5025#else
5026static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x) {
5027 return simd_make_float4(round(x.x), round(x.y), round(x.z), round(x.w));
5028}
5029#endif
5030
5031#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5032extern simd_float8 _simd_round_f8(simd_float8 x);
5033static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x) {
5034 return _simd_round_f8(x);
5035}
5036#else
5037static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x) {
5038 return simd_make_float8(__tg_round(x.lo), __tg_round(x.hi));
5039}
5040#endif
5041
5042#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5043extern simd_float16 _simd_round_f16(simd_float16 x);
5044static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x) {
5045 return _simd_round_f16(x);
5046}
5047#else
5048static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x) {
5049 return simd_make_float16(__tg_round(x.lo), __tg_round(x.hi));
5050}
5051#endif
5052
5053#if SIMD_LIBRARY_VERSION >= 3
5054extern simd_double2 _simd_round_d2(simd_double2 x);
5055static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x) {
5056#if defined __arm64__
5057 return vrndaq_f64(x);
5058#else
5059 return _simd_round_d2(x);
5060#endif
5061}
5062#else
5063static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x) {
5064 return simd_make_double2(round(x.x), round(x.y));
5065}
5066#endif
5067
5068static inline SIMD_CFUNC simd_double3 __tg_round(simd_double3 x) {
5069 return simd_make_double3(__tg_round(simd_make_double4(x)));
5070}
5071
5072#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5073extern simd_double4 _simd_round_d4(simd_double4 x);
5074static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x) {
5075 return _simd_round_d4(x);
5076}
5077#else
5078static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x) {
5079 return simd_make_double4(__tg_round(x.lo), __tg_round(x.hi));
5080}
5081#endif
5082
5083#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5084extern simd_double8 _simd_round_d8(simd_double8 x);
5085static inline SIMD_CFUNC simd_double8 __tg_round(simd_double8 x) {
5086 return _simd_round_d8(x);
5087}
5088#else
5089static inline SIMD_CFUNC simd_double8 __tg_round(simd_double8 x) {
5090 return simd_make_double8(__tg_round(x.lo), __tg_round(x.hi));
5091}
5092#endif
5093
5094#pragma mark - atan2 implementation
5095static inline SIMD_CFUNC simd_float2 __tg_atan2(simd_float2 y, simd_float2 x) {
5096 return simd_make_float2(__tg_atan2(simd_make_float4(y), simd_make_float4(x)));
5097}
5098
5099static inline SIMD_CFUNC simd_float3 __tg_atan2(simd_float3 y, simd_float3 x) {
5100 return simd_make_float3(__tg_atan2(simd_make_float4(y), simd_make_float4(x)));
5101}
5102
5103#if SIMD_LIBRARY_VERSION >= 3
5104extern simd_float4 _simd_atan2_f4(simd_float4 y, simd_float4 x);
5105static inline SIMD_CFUNC simd_float4 __tg_atan2(simd_float4 y, simd_float4 x) {
5106 return _simd_atan2_f4(y, x);
5107}
5108#else
5109static inline SIMD_CFUNC simd_float4 __tg_atan2(simd_float4 y, simd_float4 x) {
5110 return simd_make_float4(atan2(y.x, x.x), atan2(y.y, x.y), atan2(y.z, x.z), atan2(y.w, x.w));
5111}
5112#endif
5113
5114#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5115extern simd_float8 _simd_atan2_f8(simd_float8 y, simd_float8 x);
5116static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x) {
5117 return _simd_atan2_f8(y, x);
5118}
5119#else
5120static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x) {
5121 return simd_make_float8(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi));
5122}
5123#endif
5124
5125#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5126extern simd_float16 _simd_atan2_f16(simd_float16 y, simd_float16 x);
5127static inline SIMD_CFUNC simd_float16 __tg_atan2(simd_float16 y, simd_float16 x) {
5128 return _simd_atan2_f16(y, x);
5129}
5130#else
5131static inline SIMD_CFUNC simd_float16 __tg_atan2(simd_float16 y, simd_float16 x) {
5132 return simd_make_float16(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi));
5133}
5134#endif
5135
5136#if SIMD_LIBRARY_VERSION >= 3
5137extern simd_double2 _simd_atan2_d2(simd_double2 y, simd_double2 x);
5138static inline SIMD_CFUNC simd_double2 __tg_atan2(simd_double2 y, simd_double2 x) {
5139 return _simd_atan2_d2(y, x);
5140}
5141#else
5142static inline SIMD_CFUNC simd_double2 __tg_atan2(simd_double2 y, simd_double2 x) {
5143 return simd_make_double2(atan2(y.x, x.x), atan2(y.y, x.y));
5144}
5145#endif
5146
5147static inline SIMD_CFUNC simd_double3 __tg_atan2(simd_double3 y, simd_double3 x) {
5148 return simd_make_double3(__tg_atan2(simd_make_double4(y), simd_make_double4(x)));
5149}
5150
5151#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5152extern simd_double4 _simd_atan2_d4(simd_double4 y, simd_double4 x);
5153static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x) {
5154 return _simd_atan2_d4(y, x);
5155}
5156#else
5157static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x) {
5158 return simd_make_double4(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi));
5159}
5160#endif
5161
5162#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5163extern simd_double8 _simd_atan2_d8(simd_double8 y, simd_double8 x);
5164static inline SIMD_CFUNC simd_double8 __tg_atan2(simd_double8 y, simd_double8 x) {
5165 return _simd_atan2_d8(y, x);
5166}
5167#else
5168static inline SIMD_CFUNC simd_double8 __tg_atan2(simd_double8 y, simd_double8 x) {
5169 return simd_make_double8(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi));
5170}
5171#endif
5172
5173#pragma mark - hypot implementation
5174static inline SIMD_CFUNC simd_float2 __tg_hypot(simd_float2 x, simd_float2 y) {
5175 return simd_make_float2(__tg_hypot(simd_make_float4(x), simd_make_float4(y)));
5176}
5177
5178static inline SIMD_CFUNC simd_float3 __tg_hypot(simd_float3 x, simd_float3 y) {
5179 return simd_make_float3(__tg_hypot(simd_make_float4(x), simd_make_float4(y)));
5180}
5181
5182#if SIMD_LIBRARY_VERSION >= 3
5183extern simd_float4 _simd_hypot_f4(simd_float4 x, simd_float4 y);
5184static inline SIMD_CFUNC simd_float4 __tg_hypot(simd_float4 x, simd_float4 y) {
5185 return _simd_hypot_f4(x, y);
5186}
5187#else
5188static inline SIMD_CFUNC simd_float4 __tg_hypot(simd_float4 x, simd_float4 y) {
5189 return simd_make_float4(hypot(x.x, y.x), hypot(x.y, y.y), hypot(x.z, y.z), hypot(x.w, y.w));
5190}
5191#endif
5192
5193#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5194extern simd_float8 _simd_hypot_f8(simd_float8 x, simd_float8 y);
5195static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y) {
5196 return _simd_hypot_f8(x, y);
5197}
5198#else
5199static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y) {
5200 return simd_make_float8(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi));
5201}
5202#endif
5203
5204#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5205extern simd_float16 _simd_hypot_f16(simd_float16 x, simd_float16 y);
5206static inline SIMD_CFUNC simd_float16 __tg_hypot(simd_float16 x, simd_float16 y) {
5207 return _simd_hypot_f16(x, y);
5208}
5209#else
5210static inline SIMD_CFUNC simd_float16 __tg_hypot(simd_float16 x, simd_float16 y) {
5211 return simd_make_float16(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi));
5212}
5213#endif
5214
5215#if SIMD_LIBRARY_VERSION >= 3
5216extern simd_double2 _simd_hypot_d2(simd_double2 x, simd_double2 y);
5217static inline SIMD_CFUNC simd_double2 __tg_hypot(simd_double2 x, simd_double2 y) {
5218 return _simd_hypot_d2(x, y);
5219}
5220#else
5221static inline SIMD_CFUNC simd_double2 __tg_hypot(simd_double2 x, simd_double2 y) {
5222 return simd_make_double2(hypot(x.x, y.x), hypot(x.y, y.y));
5223}
5224#endif
5225
5226static inline SIMD_CFUNC simd_double3 __tg_hypot(simd_double3 x, simd_double3 y) {
5227 return simd_make_double3(__tg_hypot(simd_make_double4(x), simd_make_double4(y)));
5228}
5229
5230#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5231extern simd_double4 _simd_hypot_d4(simd_double4 x, simd_double4 y);
5232static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y) {
5233 return _simd_hypot_d4(x, y);
5234}
5235#else
5236static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y) {
5237 return simd_make_double4(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi));
5238}
5239#endif
5240
5241#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5242extern simd_double8 _simd_hypot_d8(simd_double8 x, simd_double8 y);
5243static inline SIMD_CFUNC simd_double8 __tg_hypot(simd_double8 x, simd_double8 y) {
5244 return _simd_hypot_d8(x, y);
5245}
5246#else
5247static inline SIMD_CFUNC simd_double8 __tg_hypot(simd_double8 x, simd_double8 y) {
5248 return simd_make_double8(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi));
5249}
5250#endif
5251
5252#pragma mark - pow implementation
5253static inline SIMD_CFUNC simd_float2 __tg_pow(simd_float2 x, simd_float2 y) {
5254 return simd_make_float2(__tg_pow(simd_make_float4(x), simd_make_float4(y)));
5255}
5256
5257static inline SIMD_CFUNC simd_float3 __tg_pow(simd_float3 x, simd_float3 y) {
5258 return simd_make_float3(__tg_pow(simd_make_float4(x), simd_make_float4(y)));
5259}
5260
5261#if SIMD_LIBRARY_VERSION >= 3
5262extern simd_float4 _simd_pow_f4(simd_float4 x, simd_float4 y);
5263static inline SIMD_CFUNC simd_float4 __tg_pow(simd_float4 x, simd_float4 y) {
5264 return _simd_pow_f4(x, y);
5265}
5266#else
5267static inline SIMD_CFUNC simd_float4 __tg_pow(simd_float4 x, simd_float4 y) {
5268 return simd_make_float4(pow(x.x, y.x), pow(x.y, y.y), pow(x.z, y.z), pow(x.w, y.w));
5269}
5270#endif
5271
5272#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5273extern simd_float8 _simd_pow_f8(simd_float8 x, simd_float8 y);
5274static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y) {
5275 return _simd_pow_f8(x, y);
5276}
5277#else
5278static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y) {
5279 return simd_make_float8(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi));
5280}
5281#endif
5282
5283#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5284extern simd_float16 _simd_pow_f16(simd_float16 x, simd_float16 y);
5285static inline SIMD_CFUNC simd_float16 __tg_pow(simd_float16 x, simd_float16 y) {
5286 return _simd_pow_f16(x, y);
5287}
5288#else
5289static inline SIMD_CFUNC simd_float16 __tg_pow(simd_float16 x, simd_float16 y) {
5290 return simd_make_float16(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi));
5291}
5292#endif
5293
5294#if SIMD_LIBRARY_VERSION >= 3
5295extern simd_double2 _simd_pow_d2(simd_double2 x, simd_double2 y);
5296static inline SIMD_CFUNC simd_double2 __tg_pow(simd_double2 x, simd_double2 y) {
5297 return _simd_pow_d2(x, y);
5298}
5299#else
5300static inline SIMD_CFUNC simd_double2 __tg_pow(simd_double2 x, simd_double2 y) {
5301 return simd_make_double2(pow(x.x, y.x), pow(x.y, y.y));
5302}
5303#endif
5304
5305static inline SIMD_CFUNC simd_double3 __tg_pow(simd_double3 x, simd_double3 y) {
5306 return simd_make_double3(__tg_pow(simd_make_double4(x), simd_make_double4(y)));
5307}
5308
5309#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5310extern simd_double4 _simd_pow_d4(simd_double4 x, simd_double4 y);
5311static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y) {
5312 return _simd_pow_d4(x, y);
5313}
5314#else
5315static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y) {
5316 return simd_make_double4(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi));
5317}
5318#endif
5319
5320#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5321extern simd_double8 _simd_pow_d8(simd_double8 x, simd_double8 y);
5322static inline SIMD_CFUNC simd_double8 __tg_pow(simd_double8 x, simd_double8 y) {
5323 return _simd_pow_d8(x, y);
5324}
5325#else
5326static inline SIMD_CFUNC simd_double8 __tg_pow(simd_double8 x, simd_double8 y) {
5327 return simd_make_double8(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi));
5328}
5329#endif
5330
5331#pragma mark - fmod implementation
5332static inline SIMD_CFUNC simd_float2 __tg_fmod(simd_float2 x, simd_float2 y) {
5333 return simd_make_float2(__tg_fmod(simd_make_float4(x), simd_make_float4(y)));
5334}
5335
5336static inline SIMD_CFUNC simd_float3 __tg_fmod(simd_float3 x, simd_float3 y) {
5337 return simd_make_float3(__tg_fmod(simd_make_float4(x), simd_make_float4(y)));
5338}
5339
5340#if SIMD_LIBRARY_VERSION >= 3
5341extern simd_float4 _simd_fmod_f4(simd_float4 x, simd_float4 y);
5342static inline SIMD_CFUNC simd_float4 __tg_fmod(simd_float4 x, simd_float4 y) {
5343 return _simd_fmod_f4(x, y);
5344}
5345#else
5346static inline SIMD_CFUNC simd_float4 __tg_fmod(simd_float4 x, simd_float4 y) {
5347 return simd_make_float4(fmod(x.x, y.x), fmod(x.y, y.y), fmod(x.z, y.z), fmod(x.w, y.w));
5348}
5349#endif
5350
5351#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5352extern simd_float8 _simd_fmod_f8(simd_float8 x, simd_float8 y);
5353static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y) {
5354 return _simd_fmod_f8(x, y);
5355}
5356#else
5357static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y) {
5358 return simd_make_float8(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi));
5359}
5360#endif
5361
5362#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5363extern simd_float16 _simd_fmod_f16(simd_float16 x, simd_float16 y);
5364static inline SIMD_CFUNC simd_float16 __tg_fmod(simd_float16 x, simd_float16 y) {
5365 return _simd_fmod_f16(x, y);
5366}
5367#else
5368static inline SIMD_CFUNC simd_float16 __tg_fmod(simd_float16 x, simd_float16 y) {
5369 return simd_make_float16(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi));
5370}
5371#endif
5372
5373#if SIMD_LIBRARY_VERSION >= 3
5374extern simd_double2 _simd_fmod_d2(simd_double2 x, simd_double2 y);
5375static inline SIMD_CFUNC simd_double2 __tg_fmod(simd_double2 x, simd_double2 y) {
5376 return _simd_fmod_d2(x, y);
5377}
5378#else
5379static inline SIMD_CFUNC simd_double2 __tg_fmod(simd_double2 x, simd_double2 y) {
5380 return simd_make_double2(fmod(x.x, y.x), fmod(x.y, y.y));
5381}
5382#endif
5383
5384static inline SIMD_CFUNC simd_double3 __tg_fmod(simd_double3 x, simd_double3 y) {
5385 return simd_make_double3(__tg_fmod(simd_make_double4(x), simd_make_double4(y)));
5386}
5387
5388#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5389extern simd_double4 _simd_fmod_d4(simd_double4 x, simd_double4 y);
5390static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y) {
5391 return _simd_fmod_d4(x, y);
5392}
5393#else
5394static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y) {
5395 return simd_make_double4(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi));
5396}
5397#endif
5398
5399#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5400extern simd_double8 _simd_fmod_d8(simd_double8 x, simd_double8 y);
5401static inline SIMD_CFUNC simd_double8 __tg_fmod(simd_double8 x, simd_double8 y) {
5402 return _simd_fmod_d8(x, y);
5403}
5404#else
5405static inline SIMD_CFUNC simd_double8 __tg_fmod(simd_double8 x, simd_double8 y) {
5406 return simd_make_double8(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi));
5407}
5408#endif
5409
5410#pragma mark - remainder implementation
5411static inline SIMD_CFUNC simd_float2 __tg_remainder(simd_float2 x, simd_float2 y) {
5412 return simd_make_float2(__tg_remainder(simd_make_float4(x), simd_make_float4(y)));
5413}
5414
5415static inline SIMD_CFUNC simd_float3 __tg_remainder(simd_float3 x, simd_float3 y) {
5416 return simd_make_float3(__tg_remainder(simd_make_float4(x), simd_make_float4(y)));
5417}
5418
5419#if SIMD_LIBRARY_VERSION >= 3
5420extern simd_float4 _simd_remainder_f4(simd_float4 x, simd_float4 y);
5421static inline SIMD_CFUNC simd_float4 __tg_remainder(simd_float4 x, simd_float4 y) {
5422 return _simd_remainder_f4(x, y);
5423}
5424#else
5425static inline SIMD_CFUNC simd_float4 __tg_remainder(simd_float4 x, simd_float4 y) {
5426 return simd_make_float4(remainder(x.x, y.x), remainder(x.y, y.y), remainder(x.z, y.z), remainder(x.w, y.w));
5427}
5428#endif
5429
5430#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5431extern simd_float8 _simd_remainder_f8(simd_float8 x, simd_float8 y);
5432static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y) {
5433 return _simd_remainder_f8(x, y);
5434}
5435#else
5436static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y) {
5437 return simd_make_float8(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi));
5438}
5439#endif
5440
5441#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5442extern simd_float16 _simd_remainder_f16(simd_float16 x, simd_float16 y);
5443static inline SIMD_CFUNC simd_float16 __tg_remainder(simd_float16 x, simd_float16 y) {
5444 return _simd_remainder_f16(x, y);
5445}
5446#else
5447static inline SIMD_CFUNC simd_float16 __tg_remainder(simd_float16 x, simd_float16 y) {
5448 return simd_make_float16(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi));
5449}
5450#endif
5451
5452#if SIMD_LIBRARY_VERSION >= 3
5453extern simd_double2 _simd_remainder_d2(simd_double2 x, simd_double2 y);
5454static inline SIMD_CFUNC simd_double2 __tg_remainder(simd_double2 x, simd_double2 y) {
5455 return _simd_remainder_d2(x, y);
5456}
5457#else
5458static inline SIMD_CFUNC simd_double2 __tg_remainder(simd_double2 x, simd_double2 y) {
5459 return simd_make_double2(remainder(x.x, y.x), remainder(x.y, y.y));
5460}
5461#endif
5462
5463static inline SIMD_CFUNC simd_double3 __tg_remainder(simd_double3 x, simd_double3 y) {
5464 return simd_make_double3(__tg_remainder(simd_make_double4(x), simd_make_double4(y)));
5465}
5466
5467#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5468extern simd_double4 _simd_remainder_d4(simd_double4 x, simd_double4 y);
5469static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double4 y) {
5470 return _simd_remainder_d4(x, y);
5471}
5472#else
5473static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double4 y) {
5474 return simd_make_double4(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi));
5475}
5476#endif
5477
5478#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5479extern simd_double8 _simd_remainder_d8(simd_double8 x, simd_double8 y);
5480static inline SIMD_CFUNC simd_double8 __tg_remainder(simd_double8 x, simd_double8 y) {
5481 return _simd_remainder_d8(x, y);
5482}
5483#else
5484static inline SIMD_CFUNC simd_double8 __tg_remainder(simd_double8 x, simd_double8 y) {
5485 return simd_make_double8(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi));
5486}
5487#endif
5488
5489#pragma mark - nextafter implementation
5490static inline SIMD_CFUNC simd_float2 __tg_nextafter(simd_float2 x, simd_float2 y) {
5491 return simd_make_float2(__tg_nextafter(simd_make_float4(x), simd_make_float4(y)));
5492}
5493
5494static inline SIMD_CFUNC simd_float3 __tg_nextafter(simd_float3 x, simd_float3 y) {
5495 return simd_make_float3(__tg_nextafter(simd_make_float4(x), simd_make_float4(y)));
5496}
5497
5498#if SIMD_LIBRARY_VERSION >= 3
5499extern simd_float4 _simd_nextafter_f4(simd_float4 x, simd_float4 y);
5500static inline SIMD_CFUNC simd_float4 __tg_nextafter(simd_float4 x, simd_float4 y) {
5501 return _simd_nextafter_f4(x, y);
5502}
5503#else
5504static inline SIMD_CFUNC simd_float4 __tg_nextafter(simd_float4 x, simd_float4 y) {
5505 return simd_make_float4(nextafter(x.x, y.x), nextafter(x.y, y.y), nextafter(x.z, y.z), nextafter(x.w, y.w));
5506}
5507#endif
5508
5509#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5510extern simd_float8 _simd_nextafter_f8(simd_float8 x, simd_float8 y);
5511static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y) {
5512 return _simd_nextafter_f8(x, y);
5513}
5514#else
5515static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y) {
5516 return simd_make_float8(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi));
5517}
5518#endif
5519
5520#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5521extern simd_float16 _simd_nextafter_f16(simd_float16 x, simd_float16 y);
5522static inline SIMD_CFUNC simd_float16 __tg_nextafter(simd_float16 x, simd_float16 y) {
5523 return _simd_nextafter_f16(x, y);
5524}
5525#else
5526static inline SIMD_CFUNC simd_float16 __tg_nextafter(simd_float16 x, simd_float16 y) {
5527 return simd_make_float16(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi));
5528}
5529#endif
5530
5531#if SIMD_LIBRARY_VERSION >= 3
5532extern simd_double2 _simd_nextafter_d2(simd_double2 x, simd_double2 y);
5533static inline SIMD_CFUNC simd_double2 __tg_nextafter(simd_double2 x, simd_double2 y) {
5534 return _simd_nextafter_d2(x, y);
5535}
5536#else
5537static inline SIMD_CFUNC simd_double2 __tg_nextafter(simd_double2 x, simd_double2 y) {
5538 return simd_make_double2(nextafter(x.x, y.x), nextafter(x.y, y.y));
5539}
5540#endif
5541
5542static inline SIMD_CFUNC simd_double3 __tg_nextafter(simd_double3 x, simd_double3 y) {
5543 return simd_make_double3(__tg_nextafter(simd_make_double4(x), simd_make_double4(y)));
5544}
5545
5546#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5547extern simd_double4 _simd_nextafter_d4(simd_double4 x, simd_double4 y);
5548static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double4 y) {
5549 return _simd_nextafter_d4(x, y);
5550}
5551#else
5552static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double4 y) {
5553 return simd_make_double4(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi));
5554}
5555#endif
5556
5557#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5558extern simd_double8 _simd_nextafter_d8(simd_double8 x, simd_double8 y);
5559static inline SIMD_CFUNC simd_double8 __tg_nextafter(simd_double8 x, simd_double8 y) {
5560 return _simd_nextafter_d8(x, y);
5561}
5562#else
5563static inline SIMD_CFUNC simd_double8 __tg_nextafter(simd_double8 x, simd_double8 y) {
5564 return simd_make_double8(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi));
5565}
5566#endif
5567
5568#pragma mark - lgamma implementation
5569static inline SIMD_CFUNC simd_float2 __tg_lgamma(simd_float2 x) {
5570 return simd_make_float2(__tg_lgamma(simd_make_float4(x)));
5571}
5572
5573static inline SIMD_CFUNC simd_float3 __tg_lgamma(simd_float3 x) {
5574 return simd_make_float3(__tg_lgamma(simd_make_float4(x)));
5575}
5576
5577#if SIMD_LIBRARY_VERSION >= 4
5578extern simd_float4 _simd_lgamma_f4(simd_float4 x);
5579static inline SIMD_CFUNC simd_float4 __tg_lgamma(simd_float4 x) {
5580 return _simd_lgamma_f4(x);
5581}
5582#else
5583static inline SIMD_CFUNC simd_float4 __tg_lgamma(simd_float4 x) {
5584 return simd_make_float4(lgamma(x.x), lgamma(x.y), lgamma(x.z), lgamma(x.w));
5585}
5586#endif
5587
5588#if SIMD_LIBRARY_VERSION >= 4 && defined __x86_64__ && defined __AVX2__
5589extern simd_float8 _simd_lgamma_f8(simd_float8 x);
5590static inline SIMD_CFUNC simd_float8 __tg_lgamma(simd_float8 x) {
5591 return _simd_lgamma_f8(x);
5592}
5593#else
5594static inline SIMD_CFUNC simd_float8 __tg_lgamma(simd_float8 x) {
5595 return simd_make_float8(__tg_lgamma(x.lo), __tg_lgamma(x.hi));
5596}
5597#endif
5598
5599#if SIMD_LIBRARY_VERSION >= 4 && defined __x86_64__ && defined __AVX512F__
5600extern simd_float16 _simd_lgamma_f16(simd_float16 x);
5601static inline SIMD_CFUNC simd_float16 __tg_lgamma(simd_float16 x) {
5602 return _simd_lgamma_f16(x);
5603}
5604#else
5605static inline SIMD_CFUNC simd_float16 __tg_lgamma(simd_float16 x) {
5606 return simd_make_float16(__tg_lgamma(x.lo), __tg_lgamma(x.hi));
5607}
5608#endif
5609
5610#if SIMD_LIBRARY_VERSION >= 4
5611extern simd_double2 _simd_lgamma_d2(simd_double2 x);
5612static inline SIMD_CFUNC simd_double2 __tg_lgamma(simd_double2 x) {
5613 return _simd_lgamma_d2(x);
5614}
5615#else
5616static inline SIMD_CFUNC simd_double2 __tg_lgamma(simd_double2 x) {
5617 return simd_make_double2(lgamma(x.x), lgamma(x.y));
5618}
5619#endif
5620
5621static inline SIMD_CFUNC simd_double3 __tg_lgamma(simd_double3 x) {
5622 return simd_make_double3(__tg_lgamma(simd_make_double4(x)));
5623}
5624
5625#if SIMD_LIBRARY_VERSION >= 4 && defined __x86_64__ && defined __AVX2__
5626extern simd_double4 _simd_lgamma_d4(simd_double4 x);
5627static inline SIMD_CFUNC simd_double4 __tg_lgamma(simd_double4 x) {
5628 return _simd_lgamma_d4(x);
5629}
5630#else
5631static inline SIMD_CFUNC simd_double4 __tg_lgamma(simd_double4 x) {
5632 return simd_make_double4(__tg_lgamma(x.lo), __tg_lgamma(x.hi));
5633}
5634#endif
5635
5636#if SIMD_LIBRARY_VERSION >= 4 && defined __x86_64__ && defined __AVX512F__
5637extern simd_double8 _simd_lgamma_d8(simd_double8 x);
5638static inline SIMD_CFUNC simd_double8 __tg_lgamma(simd_double8 x) {
5639 return _simd_lgamma_d8(x);
5640}
5641#else
5642static inline SIMD_CFUNC simd_double8 __tg_lgamma(simd_double8 x) {
5643 return simd_make_double8(__tg_lgamma(x.lo), __tg_lgamma(x.hi));
5644}
5645#endif
5646
5647static inline SIMD_CFUNC simd_float2 __tg_fdim(simd_float2 x, simd_float2 y) { return simd_bitselect(x-y, 0, x<y); }
5648static inline SIMD_CFUNC simd_float3 __tg_fdim(simd_float3 x, simd_float3 y) { return simd_bitselect(x-y, 0, x<y); }
5649static inline SIMD_CFUNC simd_float4 __tg_fdim(simd_float4 x, simd_float4 y) { return simd_bitselect(x-y, 0, x<y); }
5650static inline SIMD_CFUNC simd_float8 __tg_fdim(simd_float8 x, simd_float8 y) { return simd_bitselect(x-y, 0, x<y); }
5651static inline SIMD_CFUNC simd_float16 __tg_fdim(simd_float16 x, simd_float16 y) { return simd_bitselect(x-y, 0, x<y); }
5652static inline SIMD_CFUNC simd_double2 __tg_fdim(simd_double2 x, simd_double2 y) { return simd_bitselect(x-y, 0, x<y); }
5653static inline SIMD_CFUNC simd_double3 __tg_fdim(simd_double3 x, simd_double3 y) { return simd_bitselect(x-y, 0, x<y); }
5654static inline SIMD_CFUNC simd_double4 __tg_fdim(simd_double4 x, simd_double4 y) { return simd_bitselect(x-y, 0, x<y); }
5655static inline SIMD_CFUNC simd_double8 __tg_fdim(simd_double8 x, simd_double8 y) { return simd_bitselect(x-y, 0, x<y); }
5656
5657static inline SIMD_CFUNC simd_float2 __tg_fma(simd_float2 x, simd_float2 y, simd_float2 z) {
5658#if defined __arm64__ || defined __ARM_VFPV4__
5659 return vfma_f32(z, x, y);
5660#else
5661 return simd_make_float2(__tg_fma(simd_make_float4_undef(x), simd_make_float4_undef(y), simd_make_float4_undef(z)));
5662#endif
5663}
5664
5665static inline SIMD_CFUNC simd_float3 __tg_fma(simd_float3 x, simd_float3 y, simd_float3 z) {
5666 return simd_make_float3(__tg_fma(simd_make_float4(x), simd_make_float4(y), simd_make_float4(z)));
5667}
5668
5669#if SIMD_LIBRARY_VERSION >= 3
5670extern simd_float4 _simd_fma_f4(simd_float4 x, simd_float4 y, simd_float4 z);
5671#endif
5672static inline SIMD_CFUNC simd_float4 __tg_fma(simd_float4 x, simd_float4 y, simd_float4 z) {
5673#if defined __arm64__ || defined __ARM_VFPV4__
5674 return vfmaq_f32(z, x, y);
5675#elif (defined __i386__ || defined __x86_64__) && defined __FMA__
5676 return _mm_fmadd_ps(x, y, z);
5677#elif SIMD_LIBRARY_VERSION >= 3
5678 return _simd_fma_f4(x, y, z);
5679#else
5680 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));
5681#endif
5682}
5683
5684static inline SIMD_CFUNC simd_float8 __tg_fma(simd_float8 x, simd_float8 y, simd_float8 z) {
5685#if (defined __i386__ || defined __x86_64__) && defined __FMA__
5686 return _mm256_fmadd_ps(x, y, z);
5687#else
5688 return simd_make_float8(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi));
5689#endif
5690}
5691
5692static inline SIMD_CFUNC simd_float16 __tg_fma(simd_float16 x, simd_float16 y, simd_float16 z) {
5693#if defined __x86_64__ && defined __AVX512F__
5694 return _mm512_fmadd_ps(x, y, z);
5695#else
5696 return simd_make_float16(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi));
5697#endif
5698}
5699
5700#if SIMD_LIBRARY_VERSION >= 3
5701extern simd_double2 _simd_fma_d2(simd_double2 x, simd_double2 y, simd_double2 z);
5702#endif
5703static inline SIMD_CFUNC simd_double2 __tg_fma(simd_double2 x, simd_double2 y, simd_double2 z) {
5704#if defined __arm64__
5705 return vfmaq_f64(z, x, y);
5706#elif (defined __i386__ || defined __x86_64__) && defined __FMA__
5707 return _mm_fmadd_pd(x, y, z);
5708#elif SIMD_LIBRARY_VERSION >= 3
5709 return _simd_fma_d2(x, y, z);
5710#else
5711 return simd_make_double2(fma(x.x, y.x, z.x), fma(x.y, y.y, z.y));
5712#endif
5713}
5714
5715static inline SIMD_CFUNC simd_double3 __tg_fma(simd_double3 x, simd_double3 y, simd_double3 z) {
5716 return simd_make_double3(__tg_fma(simd_make_double4(x), simd_make_double4(y), simd_make_double4(z)));
5717}
5718
5719static inline SIMD_CFUNC simd_double4 __tg_fma(simd_double4 x, simd_double4 y, simd_double4 z) {
5720#if (defined __i386__ || defined __x86_64__) && defined __FMA__
5721 return _mm256_fmadd_pd(x, y, z);
5722#else
5723 return simd_make_double4(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi));
5724#endif
5725}
5726
5727static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, simd_double8 z) {
5728#if defined __x86_64__ && defined __AVX512F__
5729 return _mm512_fmadd_pd(x, y, z);
5730#else
5731 return simd_make_double8(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi));
5732#endif
5733}
5734
5735static inline SIMD_CFUNC float simd_muladd(float x, float y, float z) {
5736#pragma STDC FP_CONTRACT ON
5737 return x*y + z;
5738}
5739static inline SIMD_CFUNC simd_float2 simd_muladd(simd_float2 x, simd_float2 y, simd_float2 z) {
5740#pragma STDC FP_CONTRACT ON
5741 return x*y + z;
5742}
5743static inline SIMD_CFUNC simd_float3 simd_muladd(simd_float3 x, simd_float3 y, simd_float3 z) {
5744#pragma STDC FP_CONTRACT ON
5745 return x*y + z;
5746}
5747static inline SIMD_CFUNC simd_float4 simd_muladd(simd_float4 x, simd_float4 y, simd_float4 z) {
5748#pragma STDC FP_CONTRACT ON
5749 return x*y + z;
5750}
5751static inline SIMD_CFUNC simd_float8 simd_muladd(simd_float8 x, simd_float8 y, simd_float8 z) {
5752#pragma STDC FP_CONTRACT ON
5753 return x*y + z;
5754}
5755static inline SIMD_CFUNC simd_float16 simd_muladd(simd_float16 x, simd_float16 y, simd_float16 z) {
5756#pragma STDC FP_CONTRACT ON
5757 return x*y + z;
5758}
5759static inline SIMD_CFUNC double simd_muladd(double x, double y, double z) {
5760#pragma STDC FP_CONTRACT ON
5761 return x*y + z;
5762}
5763static inline SIMD_CFUNC simd_double2 simd_muladd(simd_double2 x, simd_double2 y, simd_double2 z) {
5764#pragma STDC FP_CONTRACT ON
5765 return x*y + z;
5766}
5767static inline SIMD_CFUNC simd_double3 simd_muladd(simd_double3 x, simd_double3 y, simd_double3 z) {
5768#pragma STDC FP_CONTRACT ON
5769 return x*y + z;
5770}
5771static inline SIMD_CFUNC simd_double4 simd_muladd(simd_double4 x, simd_double4 y, simd_double4 z) {
5772#pragma STDC FP_CONTRACT ON
5773 return x*y + z;
5774}
5775static inline SIMD_CFUNC simd_double8 simd_muladd(simd_double8 x, simd_double8 y, simd_double8 z) {
5776#pragma STDC FP_CONTRACT ON
5777 return x*y + z;
5778}
5779#ifdef __cplusplus
5780} /* extern "C" */
5781#endif
5782#endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */
5783#endif /* SIMD_MATH_HEADER */
\ No newline at end of file
lib/libc/include/any-macos-any/stddef.h created+90
......@@ -0,0 +1,90 @@
1/*
2 * Copyright (c) 2000-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/* $OpenBSD: stddef.h,v 1.2 1997/09/21 10:45:52 niklas Exp $ */
24/* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */
25
26/*-
27 * Copyright (c) 1990 The Regents of the University of California.
28 * All rights reserved.
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 * @(#)stddef.h 5.5 (Berkeley) 4/3/91
59 */
60
61#ifndef __STDDEF_H__
62#define __STDDEF_H__
63
64#include <_types.h>
65
66#include <sys/_types.h>
67#include <sys/_types/_null.h>
68#include <sys/_types/_offsetof.h>
69#include <sys/_types/_ptrdiff_t.h>
70
71#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
72#include <sys/_types/_rsize_t.h>
73#endif /* __STDC_WANT_LIB_EXT1__ >= 1 */
74
75/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
76 * _GCC_SIZE_T */
77#include <sys/_types/_size_t.h>
78
79#include <sys/_types/_wchar_t.h>
80
81#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
82#include <sys/_types/_wint_t.h>
83#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
84
85#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
86 || (defined(__cplusplus) && __cplusplus >= 201103L)
87typedef long double max_align_t;
88#endif
89
90#endif /* __STDDEF_H__ */
\ No newline at end of file
lib/libc/include/any-macos-any/stdio.h deleted-402
......@@ -1,402 +0,0 @@
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
221#if __DARWIN_C_LEVEL >= 199209L
222__BEGIN_DECLS
223int pclose(FILE *) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
224#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
225FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
226#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
227FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
228#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
229__END_DECLS
230#endif /* __DARWIN_C_LEVEL >= 199209L */
231
232/* Additional functionality provided by:
233 * POSIX.1c-1995,
234 * POSIX.1i-1995,
235 * and the omnibus ISO/IEC 9945-1: 1996
236 */
237
238#if __DARWIN_C_LEVEL >= 199506L
239
240/* Functions internal to the implementation. */
241__BEGIN_DECLS
242int __srget(FILE *);
243int __svfscanf(FILE *, const char *, va_list) __scanflike(2, 0);
244int __swbuf(int, FILE *);
245__END_DECLS
246
247/*
248 * The __sfoo macros are here so that we can
249 * define function versions in the C library.
250 */
251#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
252#if defined(__GNUC__) && defined(__STDC__)
253__header_always_inline int __sputc(int _c, FILE *_p) {
254 if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
255 return (*_p->_p++ = _c);
256 else
257 return (__swbuf(_c, _p));
258}
259#else
260/*
261 * This has been tuned to generate reasonable code on the vax using pcc.
262 */
263#define __sputc(c, p) \
264 (--(p)->_w < 0 ? \
265 (p)->_w >= (p)->_lbfsize ? \
266 (*(p)->_p = (c)), *(p)->_p != '\n' ? \
267 (int)*(p)->_p++ : \
268 __swbuf('\n', p) : \
269 __swbuf((int)(c), p) : \
270 (*(p)->_p = (c), (int)*(p)->_p++))
271#endif
272
273#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
274#define __sferror(p) (((p)->_flags & __SERR) != 0)
275#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
276#define __sfileno(p) ((p)->_file)
277
278__BEGIN_DECLS
279void flockfile(FILE *);
280int ftrylockfile(FILE *);
281void funlockfile(FILE *);
282int getc_unlocked(FILE *);
283int getchar_unlocked(void);
284int putc_unlocked(int, FILE *);
285int putchar_unlocked(int);
286
287/* Removed in Issue 6 */
288#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
289int getw(FILE *);
290int putw(int, FILE *);
291#endif
292
293__swift_unavailable("Use mkstemp(3) instead.")
294#if !defined(_POSIX_C_SOURCE)
295__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.")
296#endif
297char *tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam);
298__END_DECLS
299
300#ifndef lint
301#define getc_unlocked(fp) __sgetc(fp)
302#define putc_unlocked(x, fp) __sputc(x, fp)
303#endif /* lint */
304
305#define getchar_unlocked() getc_unlocked(stdin)
306#define putchar_unlocked(x) putc_unlocked(x, stdout)
307#endif /* __DARWIN_C_LEVEL >= 199506L */
308
309
310
311/* Additional functionality provided by:
312 * POSIX.1-2001
313 * ISO C99
314 */
315
316#if __DARWIN_C_LEVEL >= 200112L
317#include <sys/_types/_off_t.h>
318
319__BEGIN_DECLS
320int fseeko(FILE * __stream, off_t __offset, int __whence);
321off_t ftello(FILE * __stream);
322__END_DECLS
323#endif /* __DARWIN_C_LEVEL >= 200112L */
324
325#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
326__BEGIN_DECLS
327int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
328int vfscanf(FILE * __restrict __stream, const char * __restrict __format, va_list) __scanflike(2, 0);
329int vscanf(const char * __restrict __format, va_list) __scanflike(1, 0);
330int vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0);
331int vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0);
332__END_DECLS
333#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */
334
335
336
337/* Additional functionality provided by:
338 * POSIX.1-2008
339 */
340
341#if __DARWIN_C_LEVEL >= 200809L
342#include <sys/_types/_ssize_t.h>
343
344__BEGIN_DECLS
345int dprintf(int, const char * __restrict, ...) __printflike(2, 3) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
346int vdprintf(int, const char * __restrict, va_list) __printflike(2, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
347ssize_t getdelim(char ** __restrict __linep, size_t * __restrict __linecapp, int __delimiter, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
348ssize_t getline(char ** __restrict __linep, size_t * __restrict __linecapp, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
349FILE *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));
350FILE *open_memstream(char **__bufp, size_t *__sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
351__END_DECLS
352#endif /* __DARWIN_C_LEVEL >= 200809L */
353
354
355
356/* Darwin extensions */
357
358#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
359__BEGIN_DECLS
360extern __const int sys_nerr; /* perror(3) external variables */
361extern __const char *__const sys_errlist[];
362
363int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
364char *ctermid_r(char *);
365char *fgetln(FILE *, size_t *);
366__const char *fmtcheck(const char *, const char *);
367int fpurge(FILE *);
368void setbuffer(FILE *, char *, int);
369int setlinebuf(FILE *);
370int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
371
372
373/*
374 * Stdio function-access interface.
375 */
376FILE *funopen(const void *,
377 int (* _Nullable)(void *, char *, int),
378 int (* _Nullable)(void *, const char *, int),
379 fpos_t (* _Nullable)(void *, fpos_t, int),
380 int (* _Nullable)(void *));
381__END_DECLS
382#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
383#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
384
385#define feof_unlocked(p) __sfeof(p)
386#define ferror_unlocked(p) __sferror(p)
387#define clearerr_unlocked(p) __sclearerr(p)
388#define fileno_unlocked(p) __sfileno(p)
389
390#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
391
392
393#ifdef _USE_EXTENDED_LOCALES_
394#include <xlocale/_stdio.h>
395#endif /* _USE_EXTENDED_LOCALES_ */
396
397#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
398/* Security checking functions. */
399#include <secure/_stdio.h>
400#endif
401
402#endif /* _STDIO_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/stdlib.h deleted-375
......@@ -1,375 +0,0 @@
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__swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)")
182__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
183__WATCHOS_PROHIBITED __TVOS_PROHIBITED
184int system(const char *) __DARWIN_ALIAS_C(system);
185
186
187size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
188int wctomb(char *, wchar_t);
189
190#ifndef _ANSI_SOURCE
191void _Exit(int) __dead2;
192long a64l(const char *);
193double drand48(void);
194char *ecvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
195double erand48(unsigned short[3]);
196char *fcvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
197char *gcvt(double, int, char *); /* LEGACY */
198int getsubopt(char **, char * const *, char **);
199int grantpt(int);
200#if __DARWIN_UNIX03
201char *initstate(unsigned, char *, size_t); /* no __DARWIN_ALIAS needed */
202#else /* !__DARWIN_UNIX03 */
203char *initstate(unsigned long, char *, long);
204#endif /* __DARWIN_UNIX03 */
205long jrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
206char *l64a(long);
207void lcong48(unsigned short[7]);
208long lrand48(void) __swift_unavailable("Use arc4random instead.");
209char *mktemp(char *);
210int mkstemp(char *);
211long mrand48(void) __swift_unavailable("Use arc4random instead.");
212long nrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
213int posix_openpt(int);
214char *ptsname(int);
215
216#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
217int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3));
218#endif
219
220int putenv(char *) __DARWIN_ALIAS(putenv);
221long random(void) __swift_unavailable("Use arc4random instead.");
222int rand_r(unsigned *) __swift_unavailable("Use arc4random instead.");
223#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH)
224char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath);
225#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */
226char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath);
227#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */
228unsigned short
229 *seed48(unsigned short[3]);
230int setenv(const char * __name, const char * __value, int __overwrite) __DARWIN_ALIAS(setenv);
231#if __DARWIN_UNIX03
232void setkey(const char *) __DARWIN_ALIAS(setkey);
233#else /* !__DARWIN_UNIX03 */
234int setkey(const char *);
235#endif /* __DARWIN_UNIX03 */
236char *setstate(const char *);
237void srand48(long);
238#if __DARWIN_UNIX03
239void srandom(unsigned);
240#else /* !__DARWIN_UNIX03 */
241void srandom(unsigned long);
242#endif /* __DARWIN_UNIX03 */
243int unlockpt(int);
244#if __DARWIN_UNIX03
245int unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
246#else /* !__DARWIN_UNIX03 */
247void unsetenv(const char *);
248#endif /* __DARWIN_UNIX03 */
249#endif /* !_ANSI_SOURCE */
250
251#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
252#include <machine/types.h>
253#include <sys/_types/_dev_t.h>
254#include <sys/_types/_mode_t.h>
255#include <_types/_uint32_t.h>
256
257uint32_t arc4random(void);
258void arc4random_addrandom(unsigned char * /*dat*/, int /*datlen*/)
259 __OSX_DEPRECATED(10.0, 10.12, "use arc4random_stir")
260 __IOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
261 __TVOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
262 __WATCHOS_DEPRECATED(1.0, 3.0, "use arc4random_stir");
263void arc4random_buf(void * __buf, size_t __nbytes) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
264void arc4random_stir(void);
265uint32_t
266 arc4random_uniform(uint32_t __upper_bound) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
267#ifdef __BLOCKS__
268int atexit_b(void (^ _Nonnull)(void)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
269
270#ifdef __BLOCKS__
271#if __has_attribute(noescape)
272#define __bsearch_noescape __attribute__((__noescape__))
273#else
274#define __bsearch_noescape
275#endif
276#endif /* __BLOCKS__ */
277void *bsearch_b(const void *__key, const void *__base, size_t __nel,
278 size_t __width, int (^ _Nonnull __compar)(const void *, const void *) __bsearch_noescape)
279 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
280#endif /* __BLOCKS__ */
281
282 /* getcap(3) functions */
283char *cgetcap(char *, const char *, int);
284int cgetclose(void);
285int cgetent(char **, char **, const char *);
286int cgetfirst(char **, char **);
287int cgetmatch(const char *, const char *);
288int cgetnext(char **, char **);
289int cgetnum(char *, const char *, long *);
290int cgetset(const char *);
291int cgetstr(char *, const char *, char **);
292int cgetustr(char *, const char *, char **);
293
294int 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;
295char *devname(dev_t, mode_t);
296char *devname_r(dev_t, mode_t, char *buf, int len);
297char *getbsize(int *, long *);
298int getloadavg(double [], int);
299const char
300 *getprogname(void);
301void setprogname(const char *);
302
303#ifdef __BLOCKS__
304#if __has_attribute(noescape)
305#define __sort_noescape __attribute__((__noescape__))
306#else
307#define __sort_noescape
308#endif
309#endif /* __BLOCKS__ */
310
311int heapsort(void *__base, size_t __nel, size_t __width,
312 int (* _Nonnull __compar)(const void *, const void *));
313#ifdef __BLOCKS__
314int heapsort_b(void *__base, size_t __nel, size_t __width,
315 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
316 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
317#endif /* __BLOCKS__ */
318int mergesort(void *__base, size_t __nel, size_t __width,
319 int (* _Nonnull __compar)(const void *, const void *));
320#ifdef __BLOCKS__
321int mergesort_b(void *__base, size_t __nel, size_t __width,
322 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
323 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
324#endif /* __BLOCKS__ */
325void psort(void *__base, size_t __nel, size_t __width,
326 int (* _Nonnull __compar)(const void *, const void *))
327 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
328#ifdef __BLOCKS__
329void psort_b(void *__base, size_t __nel, size_t __width,
330 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
331 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
332#endif /* __BLOCKS__ */
333void psort_r(void *__base, size_t __nel, size_t __width, void *,
334 int (* _Nonnull __compar)(void *, const void *, const void *))
335 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
336#ifdef __BLOCKS__
337void qsort_b(void *__base, size_t __nel, size_t __width,
338 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
339 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
340#endif /* __BLOCKS__ */
341void qsort_r(void *__base, size_t __nel, size_t __width, void *,
342 int (* _Nonnull __compar)(void *, const void *, const void *));
343int radixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
344 unsigned __endbyte);
345int rpmatch(const char *)
346 __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
347int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
348 unsigned __endbyte);
349void sranddev(void);
350void srandomdev(void);
351void *reallocf(void *__ptr, size_t __size) __alloc_size(2);
352long long
353 strtonum(const char *__numstr, long long __minval, long long __maxval, const char **__errstrp)
354 __API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0));
355#if !__DARWIN_NO_LONG_LONG
356long long
357 strtoq(const char *__str, char **__endptr, int __base);
358unsigned long long
359 strtouq(const char *__str, char **__endptr, int __base);
360#endif /* !__DARWIN_NO_LONG_LONG */
361extern char *suboptarg; /* getsubopt(3) external variable */
362/* valloc is now declared in _malloc.h */
363#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
364
365/* Poison the following routines if -fshort-wchar is set */
366#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
367#pragma GCC poison mbstowcs mbtowc wcstombs wctomb
368#endif
369__END_DECLS
370
371#ifdef _USE_EXTENDED_LOCALES_
372#include <xlocale/_stdlib.h>
373#endif /* _USE_EXTENDED_LOCALES_ */
374
375#endif /* _STDLIB_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/sys/_types/_offsetof.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 offsetof
29#define offsetof(type, field) __offsetof(type, field)
30#endif /* offsetof */
\ No newline at end of file
lib/libc/include/any-macos-any/sys/_types/_ptrdiff_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 _PTRDIFF_T
30#define _PTRDIFF_T
31#include <machine/types.h> /* __darwin_ptrdiff_t */
32typedef __darwin_ptrdiff_t ptrdiff_t;
33#endif /* _PTRDIFF_T */
\ No newline at end of file
lib/libc/include/any-macos-any/sys/resource.h deleted-524
......@@ -1,524 +0,0 @@
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#define IOPOL_TYPE_VFS_IGNORE_PERMISSIONS 7
461#define IOPOL_TYPE_VFS_SKIP_MTIME_UPDATE 8
462#define IOPOL_TYPE_VFS_ALLOW_LOW_SPACE_WRITES 9
463
464/* scope */
465#define IOPOL_SCOPE_PROCESS 0
466#define IOPOL_SCOPE_THREAD 1
467#define IOPOL_SCOPE_DARWIN_BG 2
468
469/* I/O Priority */
470#define IOPOL_DEFAULT 0
471#define IOPOL_IMPORTANT 1
472#define IOPOL_PASSIVE 2
473#define IOPOL_THROTTLE 3
474#define IOPOL_UTILITY 4
475#define IOPOL_STANDARD 5
476
477/* compatibility with older names */
478#define IOPOL_APPLICATION IOPOL_STANDARD
479#define IOPOL_NORMAL IOPOL_IMPORTANT
480
481
482#define IOPOL_ATIME_UPDATES_DEFAULT 0
483#define IOPOL_ATIME_UPDATES_OFF 1
484
485#define IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT 0
486#define IOPOL_MATERIALIZE_DATALESS_FILES_OFF 1
487#define IOPOL_MATERIALIZE_DATALESS_FILES_ON 2
488
489#define IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT 0
490#define IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME 1
491
492#define IOPOL_VFS_TRIGGER_RESOLVE_DEFAULT 0
493#define IOPOL_VFS_TRIGGER_RESOLVE_OFF 1
494
495#define IOPOL_VFS_CONTENT_PROTECTION_DEFAULT 0
496#define IOPOL_VFS_CONTENT_PROTECTION_IGNORE 1
497
498#define IOPOL_VFS_IGNORE_PERMISSIONS_OFF 0
499#define IOPOL_VFS_IGNORE_PERMISSIONS_ON 1
500
501#define IOPOL_VFS_SKIP_MTIME_UPDATE_OFF 0
502#define IOPOL_VFS_SKIP_MTIME_UPDATE_ON 1
503
504#define IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_OFF 0
505#define IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_ON 1
506
507#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
508
509
510__BEGIN_DECLS
511int getpriority(int, id_t);
512#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
513int getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
514#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
515int getrlimit(int, struct rlimit *) __DARWIN_ALIAS(getrlimit);
516int getrusage(int, struct rusage *);
517int setpriority(int, id_t, int);
518#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
519int setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
520#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
521int setrlimit(int, const struct rlimit *) __DARWIN_ALIAS(setrlimit);
522__END_DECLS
523
524#endif /* !_SYS_RESOURCE_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/sys/socket.h deleted-745
......@@ -1,745 +0,0 @@
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
82#include <Availability.h>
83
84/*
85 * Definitions related to sockets: types, address families, options.
86 */
87
88/*
89 * Data types.
90 */
91
92#include <sys/_types/_gid_t.h>
93#include <sys/_types/_off_t.h>
94#include <sys/_types/_pid_t.h>
95#include <sys/_types/_sa_family_t.h>
96#include <sys/_types/_socklen_t.h>
97
98/* XXX Not explicitly defined by POSIX, but function return types are */
99#include <sys/_types/_size_t.h>
100
101/* XXX Not explicitly defined by POSIX, but function return types are */
102#include <sys/_types/_ssize_t.h>
103
104/*
105 * [XSI] The iovec structure shall be defined as described in <sys/uio.h>.
106 */
107#include <sys/_types/_iovec_t.h>
108
109/*
110 * Types
111 */
112#define SOCK_STREAM 1 /* stream socket */
113#define SOCK_DGRAM 2 /* datagram socket */
114#define SOCK_RAW 3 /* raw-protocol interface */
115#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
116#define SOCK_RDM 4 /* reliably-delivered message */
117#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
118#define SOCK_SEQPACKET 5 /* sequenced packet stream */
119
120/*
121 * Option flags per-socket.
122 */
123#define SO_DEBUG 0x0001 /* turn on debugging info recording */
124#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
125#define SO_REUSEADDR 0x0004 /* allow local address reuse */
126#define SO_KEEPALIVE 0x0008 /* keep connections alive */
127#define SO_DONTROUTE 0x0010 /* just use interface addresses */
128#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
129#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
130#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
131#define SO_LINGER 0x0080 /* linger on close if data present (in ticks) */
132#else
133#define SO_LINGER 0x1080 /* linger on close if data present (in seconds) */
134#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
135#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
136#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
137#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
138#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */
139#define SO_TIMESTAMP_MONOTONIC 0x0800 /* Monotonically increasing timestamp on rcvd dgram */
140#ifndef __APPLE__
141#define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */
142#else
143#define SO_DONTTRUNC 0x2000 /* APPLE: Retain unread data */
144 /* (ATOMIC proto) */
145#define SO_WANTMORE 0x4000 /* APPLE: Give hint when more data ready */
146#define SO_WANTOOBFLAG 0x8000 /* APPLE: Want OOB in MSG_FLAG on receive */
147
148
149#endif /* (!__APPLE__) */
150#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
151
152/*
153 * Additional options, not kept in so_options.
154 */
155#define SO_SNDBUF 0x1001 /* send buffer size */
156#define SO_RCVBUF 0x1002 /* receive buffer size */
157#define SO_SNDLOWAT 0x1003 /* send low-water mark */
158#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
159#define SO_SNDTIMEO 0x1005 /* send timeout */
160#define SO_RCVTIMEO 0x1006 /* receive timeout */
161#define SO_ERROR 0x1007 /* get error status and clear */
162#define SO_TYPE 0x1008 /* get socket type */
163#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
164#define SO_LABEL 0x1010 /* deprecated */
165#define SO_PEERLABEL 0x1011 /* deprecated */
166#ifdef __APPLE__
167#define SO_NREAD 0x1020 /* APPLE: get 1st-packet byte count */
168#define SO_NKE 0x1021 /* APPLE: Install socket-level NKE */
169#define SO_NOSIGPIPE 0x1022 /* APPLE: No SIGPIPE on EPIPE */
170#define SO_NOADDRERR 0x1023 /* APPLE: Returns EADDRNOTAVAIL when src is not available anymore */
171#define SO_NWRITE 0x1024 /* APPLE: Get number of bytes currently in send socket buffer */
172#define SO_REUSESHAREUID 0x1025 /* APPLE: Allow reuse of port/socket by different userids */
173#ifdef __APPLE_API_PRIVATE
174#define SO_NOTIFYCONFLICT 0x1026 /* APPLE: send notification if there is a bind on a port which is already in use */
175#define SO_UPCALLCLOSEWAIT 0x1027 /* APPLE: block on close until an upcall returns */
176#endif
177#define SO_LINGER_SEC 0x1080 /* linger on close if data present (in seconds) */
178#define SO_RANDOMPORT 0x1082 /* APPLE: request local port randomization */
179#define SO_NP_EXTENSIONS 0x1083 /* To turn off some POSIX behavior */
180#endif
181
182#define SO_NUMRCVPKT 0x1112 /* number of datagrams in receive socket buffer */
183#define SO_NET_SERVICE_TYPE 0x1116 /* Network service type */
184
185
186#define SO_NETSVC_MARKING_LEVEL 0x1119 /* Get QoS marking in effect for socket */
187
188
189/* When adding new socket-options, you need to make sure MPTCP supports these as well! */
190
191/*
192 * Network Service Type for option SO_NET_SERVICE_TYPE
193 *
194 * The vast majority of sockets should use Best Effort that is the default
195 * Network Service Type. Other Network Service Types have to be used only if
196 * the traffic actually matches the description of the Network Service Type.
197 *
198 * Network Service Types do not represent priorities but rather describe
199 * different categories of delay, jitter and loss parameters.
200 * Those parameters may influence protocols from layer 4 protocols like TCP
201 * to layer 2 protocols like Wi-Fi. The Network Service Type can determine
202 * how the traffic is queued and scheduled by the host networking stack and
203 * by other entities on the network like switches and routers. For example
204 * for Wi-Fi, the Network Service Type can select the marking of the
205 * layer 2 packet with the appropriate WMM Access Category.
206 *
207 * There is no point in attempting to game the system and use
208 * a Network Service Type that does not correspond to the actual
209 * traffic characteristic but one that seems to have a higher precedence.
210 * The reason is that for service classes that have lower tolerance
211 * for delay and jitter, the queues size is lower than for service
212 * classes that are more tolerant to delay and jitter.
213 *
214 * For example using a voice service type for bulk data transfer will lead
215 * to disastrous results as soon as congestion happens because the voice
216 * queue overflows and packets get dropped. This is not only bad for the bulk
217 * data transfer but it is also bad for VoIP apps that legitimately are using
218 * the voice service type.
219 *
220 * The characteristics of the Network Service Types are based on the service
221 * classes defined in RFC 4594 "Configuration Guidelines for DiffServ Service
222 * Classes"
223 *
224 * When system detects the outgoing interface belongs to a DiffServ domain
225 * that follows the recommendation of the IETF draft "Guidelines for DiffServ to
226 * IEEE 802.11 Mapping", the packet will marked at layer 3 with a DSCP value
227 * that corresponds to Network Service Type.
228 *
229 * NET_SERVICE_TYPE_BE
230 * "Best Effort", unclassified/standard. This is the default service
231 * class and cover the majority of the traffic.
232 *
233 * NET_SERVICE_TYPE_BK
234 * "Background", high delay tolerant, loss tolerant. elastic flow,
235 * variable size & long-lived. E.g: non-interactive network bulk transfer
236 * like synching or backup.
237 *
238 * NET_SERVICE_TYPE_RD
239 * "Responsive Data", a notch higher than "Best Effort", medium delay
240 * tolerant, elastic & inelastic flow, bursty, long-lived. E.g. email,
241 * instant messaging, for which there is a sense of interactivity and
242 * urgency (user waiting for output).
243 *
244 * NET_SERVICE_TYPE_OAM
245 * "Operations, Administration, and Management", medium delay tolerant,
246 * low-medium loss tolerant, elastic & inelastic flows, variable size.
247 * E.g. VPN tunnels.
248 *
249 * NET_SERVICE_TYPE_AV
250 * "Multimedia Audio/Video Streaming", medium delay tolerant, low-medium
251 * loss tolerant, elastic flow, constant packet interval, variable rate
252 * and size. E.g. video and audio playback with buffering.
253 *
254 * NET_SERVICE_TYPE_RV
255 * "Responsive Multimedia Audio/Video", low delay tolerant, low-medium
256 * loss tolerant, elastic flow, variable packet interval, rate and size.
257 * E.g. screen sharing.
258 *
259 * NET_SERVICE_TYPE_VI
260 * "Interactive Video", low delay tolerant, low-medium loss tolerant,
261 * elastic flow, constant packet interval, variable rate & size. E.g.
262 * video telephony.
263 *
264 * NET_SERVICE_TYPE_SIG
265 * "Signaling", low delay tolerant, low loss tolerant, inelastic flow,
266 * jitter tolerant, rate is bursty but short, variable size. E.g. SIP.
267 *
268 * NET_SERVICE_TYPE_VO
269 * "Interactive Voice", very low delay tolerant, very low loss tolerant,
270 * inelastic flow, constant packet rate, somewhat fixed size.
271 * E.g. VoIP.
272 */
273
274#define NET_SERVICE_TYPE_BE 0 /* Best effort */
275#define NET_SERVICE_TYPE_BK 1 /* Background system initiated */
276#define NET_SERVICE_TYPE_SIG 2 /* Signaling */
277#define NET_SERVICE_TYPE_VI 3 /* Interactive Video */
278#define NET_SERVICE_TYPE_VO 4 /* Interactive Voice */
279#define NET_SERVICE_TYPE_RV 5 /* Responsive Multimedia Audio/Video */
280#define NET_SERVICE_TYPE_AV 6 /* Multimedia Audio/Video Streaming */
281#define NET_SERVICE_TYPE_OAM 7 /* Operations, Administration, and Management */
282#define NET_SERVICE_TYPE_RD 8 /* Responsive Data */
283
284
285/* These are supported values for SO_NETSVC_MARKING_LEVEL */
286#define NETSVC_MRKNG_UNKNOWN 0 /* The outgoing network interface is not known */
287#define NETSVC_MRKNG_LVL_L2 1 /* Default marking at layer 2 (for example Wi-Fi WMM) */
288#define NETSVC_MRKNG_LVL_L3L2_ALL 2 /* Layer 3 DSCP marking and layer 2 marking for all Network Service Types */
289#define NETSVC_MRKNG_LVL_L3L2_BK 3 /* The system policy limits layer 3 DSCP marking and layer 2 marking
290 * to background Network Service Types */
291
292
293typedef __uint32_t sae_associd_t;
294#define SAE_ASSOCID_ANY 0
295#define SAE_ASSOCID_ALL ((sae_associd_t)(-1ULL))
296
297typedef __uint32_t sae_connid_t;
298#define SAE_CONNID_ANY 0
299#define SAE_CONNID_ALL ((sae_connid_t)(-1ULL))
300
301/* connectx() flag parameters */
302#define CONNECT_RESUME_ON_READ_WRITE 0x1 /* resume connect() on read/write */
303#define CONNECT_DATA_IDEMPOTENT 0x2 /* data is idempotent */
304#define CONNECT_DATA_AUTHENTICATED 0x4 /* data includes security that replaces the TFO-cookie */
305
306/* sockaddr endpoints */
307typedef struct sa_endpoints {
308 unsigned int sae_srcif; /* optional source interface */
309 const struct sockaddr *sae_srcaddr; /* optional source address */
310 socklen_t sae_srcaddrlen; /* size of source address */
311 const struct sockaddr *sae_dstaddr; /* destination address */
312 socklen_t sae_dstaddrlen; /* size of destination address */
313} sa_endpoints_t;
314#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
315
316/*
317 * Structure used for manipulating linger option.
318 */
319struct linger {
320 int l_onoff; /* option on/off */
321 int l_linger; /* linger time */
322};
323
324#ifndef __APPLE__
325struct accept_filter_arg {
326 char af_name[16];
327 char af_arg[256 - 16];
328};
329#endif
330
331#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
332#ifdef __APPLE__
333
334/*
335 * Structure to control non-portable Sockets extension to POSIX
336 */
337struct so_np_extensions {
338 u_int32_t npx_flags;
339 u_int32_t npx_mask;
340};
341
342#define SONPX_SETOPTSHUT 0x000000001 /* flag for allowing setsockopt after shutdown */
343
344
345
346#endif
347#endif
348
349/*
350 * Level number for (get/set)sockopt() to apply to socket itself.
351 */
352#define SOL_SOCKET 0xffff /* options for socket level */
353
354
355/*
356 * Address families.
357 */
358#define AF_UNSPEC 0 /* unspecified */
359#define AF_UNIX 1 /* local to host (pipes) */
360#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
361#define AF_LOCAL AF_UNIX /* backward compatibility */
362#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
363#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
364#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
365#define AF_IMPLINK 3 /* arpanet imp addresses */
366#define AF_PUP 4 /* pup protocols: e.g. BSP */
367#define AF_CHAOS 5 /* mit CHAOS protocols */
368#define AF_NS 6 /* XEROX NS protocols */
369#define AF_ISO 7 /* ISO protocols */
370#define AF_OSI AF_ISO
371#define AF_ECMA 8 /* European computer manufacturers */
372#define AF_DATAKIT 9 /* datakit protocols */
373#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
374#define AF_SNA 11 /* IBM SNA */
375#define AF_DECnet 12 /* DECnet */
376#define AF_DLI 13 /* DEC Direct data link interface */
377#define AF_LAT 14 /* LAT */
378#define AF_HYLINK 15 /* NSC Hyperchannel */
379#define AF_APPLETALK 16 /* Apple Talk */
380#define AF_ROUTE 17 /* Internal Routing Protocol */
381#define AF_LINK 18 /* Link layer interface */
382#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
383#define AF_COIP 20 /* connection-oriented IP, aka ST II */
384#define AF_CNT 21 /* Computer Network Technology */
385#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */
386#define AF_IPX 23 /* Novell Internet Protocol */
387#define AF_SIP 24 /* Simple Internet Protocol */
388#define pseudo_AF_PIP 25 /* Help Identify PIP packets */
389#define AF_NDRV 27 /* Network Driver 'raw' access */
390#define AF_ISDN 28 /* Integrated Services Digital Network */
391#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */
392#define pseudo_AF_KEY 29 /* Internal key-management function */
393#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
394#define AF_INET6 30 /* IPv6 */
395#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
396#define AF_NATM 31 /* native ATM access */
397#define AF_SYSTEM 32 /* Kernel event messages */
398#define AF_NETBIOS 33 /* NetBIOS */
399#define AF_PPP 34 /* PPP communication protocol */
400#define pseudo_AF_HDRCMPLT 35 /* Used by BPF to not rewrite headers
401 * in interface output routine */
402#define AF_RESERVED_36 36 /* Reserved for internal usage */
403#define AF_IEEE80211 37 /* IEEE 802.11 protocol */
404#define AF_UTUN 38
405#define AF_VSOCK 40 /* VM Sockets */
406#define AF_MAX 41
407#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
408
409/*
410 * [XSI] Structure used by kernel to store most addresses.
411 */
412struct sockaddr {
413 __uint8_t sa_len; /* total length */
414 sa_family_t sa_family; /* [XSI] address family */
415 char sa_data[14]; /* [XSI] addr value (actually larger) */
416};
417
418#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
419#define SOCK_MAXADDRLEN 255 /* longest possible addresses */
420
421/*
422 * Structure used by kernel to pass protocol
423 * information in raw sockets.
424 */
425struct sockproto {
426 __uint16_t sp_family; /* address family */
427 __uint16_t sp_protocol; /* protocol */
428};
429#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
430
431/*
432 * RFC 2553: protocol-independent placeholder for socket addresses
433 */
434#define _SS_MAXSIZE 128
435#define _SS_ALIGNSIZE (sizeof(__int64_t))
436#define _SS_PAD1SIZE \
437 (_SS_ALIGNSIZE - sizeof(__uint8_t) - sizeof(sa_family_t))
438#define _SS_PAD2SIZE \
439 (_SS_MAXSIZE - sizeof(__uint8_t) - sizeof(sa_family_t) - \
440 _SS_PAD1SIZE - _SS_ALIGNSIZE)
441
442/*
443 * [XSI] sockaddr_storage
444 */
445struct sockaddr_storage {
446 __uint8_t ss_len; /* address length */
447 sa_family_t ss_family; /* [XSI] address family */
448 char __ss_pad1[_SS_PAD1SIZE];
449 __int64_t __ss_align; /* force structure storage alignment */
450 char __ss_pad2[_SS_PAD2SIZE];
451};
452
453/*
454 * Protocol families, same as address families for now.
455 */
456#define PF_UNSPEC AF_UNSPEC
457#define PF_LOCAL AF_LOCAL
458#define PF_UNIX PF_LOCAL /* backward compatibility */
459#define PF_INET AF_INET
460#define PF_IMPLINK AF_IMPLINK
461#define PF_PUP AF_PUP
462#define PF_CHAOS AF_CHAOS
463#define PF_NS AF_NS
464#define PF_ISO AF_ISO
465#define PF_OSI AF_ISO
466#define PF_ECMA AF_ECMA
467#define PF_DATAKIT AF_DATAKIT
468#define PF_CCITT AF_CCITT
469#define PF_SNA AF_SNA
470#define PF_DECnet AF_DECnet
471#define PF_DLI AF_DLI
472#define PF_LAT AF_LAT
473#define PF_HYLINK AF_HYLINK
474#define PF_APPLETALK AF_APPLETALK
475#define PF_ROUTE AF_ROUTE
476#define PF_LINK AF_LINK
477#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
478#define PF_COIP AF_COIP
479#define PF_CNT AF_CNT
480#define PF_SIP AF_SIP
481#define PF_IPX AF_IPX /* same format as AF_NS */
482#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */
483#define PF_PIP pseudo_AF_PIP
484#define PF_NDRV AF_NDRV
485#define PF_ISDN AF_ISDN
486#define PF_KEY pseudo_AF_KEY
487#define PF_INET6 AF_INET6
488#define PF_NATM AF_NATM
489#define PF_SYSTEM AF_SYSTEM
490#define PF_NETBIOS AF_NETBIOS
491#define PF_PPP AF_PPP
492#define PF_RESERVED_36 AF_RESERVED_36
493#define PF_UTUN AF_UTUN
494#define PF_VSOCK AF_VSOCK
495#define PF_MAX AF_MAX
496
497/*
498 * These do not have socket-layer support:
499 */
500#define PF_VLAN ((uint32_t)0x766c616e) /* 'vlan' */
501#define PF_BOND ((uint32_t)0x626f6e64) /* 'bond' */
502
503/*
504 * Definitions for network related sysctl, CTL_NET.
505 *
506 * Second level is protocol family.
507 * Third level is protocol number.
508 *
509 * Further levels are defined by the individual families below.
510 */
511#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
512#define NET_MAXID AF_MAX
513#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
514
515
516#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
517/*
518 * PF_ROUTE - Routing table
519 *
520 * Three additional levels are defined:
521 * Fourth: address family, 0 is wildcard
522 * Fifth: type of info, defined below
523 * Sixth: flag(s) to mask with for NET_RT_FLAGS
524 */
525#define NET_RT_DUMP 1 /* dump; may limit to a.f. */
526#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */
527#define NET_RT_IFLIST 3 /* survey interface list */
528#define NET_RT_STAT 4 /* routing statistics */
529#define NET_RT_TRASH 5 /* routes not in table but not freed */
530#define NET_RT_IFLIST2 6 /* interface list with addresses */
531#define NET_RT_DUMP2 7 /* dump; may limit to a.f. */
532/*
533 * Allows read access non-local host's MAC address
534 * if the process has neighbor cache entitlement.
535 */
536#define NET_RT_FLAGS_PRIV 10
537#define NET_RT_MAXID 11
538#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
539
540
541
542
543/*
544 * Maximum queue length specifiable by listen.
545 */
546#define SOMAXCONN 128
547
548/*
549 * [XSI] Message header for recvmsg and sendmsg calls.
550 * Used value-result for recvmsg, value only for sendmsg.
551 */
552struct msghdr {
553 void *msg_name; /* [XSI] optional address */
554 socklen_t msg_namelen; /* [XSI] size of address */
555 struct iovec *msg_iov; /* [XSI] scatter/gather array */
556 int msg_iovlen; /* [XSI] # elements in msg_iov */
557 void *msg_control; /* [XSI] ancillary data, see below */
558 socklen_t msg_controllen; /* [XSI] ancillary data buffer len */
559 int msg_flags; /* [XSI] flags on received message */
560};
561
562
563
564#define MSG_OOB 0x1 /* process out-of-band data */
565#define MSG_PEEK 0x2 /* peek at incoming message */
566#define MSG_DONTROUTE 0x4 /* send without using routing tables */
567#define MSG_EOR 0x8 /* data completes record */
568#define MSG_TRUNC 0x10 /* data discarded before delivery */
569#define MSG_CTRUNC 0x20 /* control data lost before delivery */
570#define MSG_WAITALL 0x40 /* wait for full request or error */
571#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
572#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */
573#define MSG_EOF 0x100 /* data completes connection */
574#ifdef __APPLE__
575#ifdef __APPLE_API_OBSOLETE
576#define MSG_WAITSTREAM 0x200 /* wait up to full request.. may return partial */
577#endif
578#define MSG_FLUSH 0x400 /* Start of 'hold' seq; dump so_temp, deprecated */
579#define MSG_HOLD 0x800 /* Hold frag in so_temp, deprecated */
580#define MSG_SEND 0x1000 /* Send the packet in so_temp, deprecated */
581#define MSG_HAVEMORE 0x2000 /* Data ready to be read */
582#define MSG_RCVMORE 0x4000 /* Data remains in current pkt */
583#endif
584#define MSG_NEEDSA 0x10000 /* Fail receive if socket address cannot be allocated */
585#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
586
587#if __DARWIN_C_LEVEL >= 200809L
588#define MSG_NOSIGNAL 0x80000 /* do not generate SIGPIPE on EOF */
589#endif /* __DARWIN_C_LEVEL */
590
591#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
592#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
593
594/*
595 * Header for ancillary data objects in msg_control buffer.
596 * Used for additional information with/about a datagram
597 * not expressible by flags. The format is a sequence
598 * of message elements headed by cmsghdr structures.
599 */
600struct cmsghdr {
601 socklen_t cmsg_len; /* [XSI] data byte count, including hdr */
602 int cmsg_level; /* [XSI] originating protocol */
603 int cmsg_type; /* [XSI] protocol-specific type */
604/* followed by unsigned char cmsg_data[]; */
605};
606
607#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
608#ifndef __APPLE__
609/*
610 * While we may have more groups than this, the cmsgcred struct must
611 * be able to fit in an mbuf, and NGROUPS_MAX is too large to allow
612 * this.
613 */
614#define CMGROUP_MAX 16
615
616/*
617 * Credentials structure, used to verify the identity of a peer
618 * process that has sent us a message. This is allocated by the
619 * peer process but filled in by the kernel. This prevents the
620 * peer from lying about its identity. (Note that cmcred_groups[0]
621 * is the effective GID.)
622 */
623struct cmsgcred {
624 pid_t cmcred_pid; /* PID of sending process */
625 uid_t cmcred_uid; /* real UID of sending process */
626 uid_t cmcred_euid; /* effective UID of sending process */
627 gid_t cmcred_gid; /* real GID of sending process */
628 short cmcred_ngroups; /* number or groups */
629 gid_t cmcred_groups[CMGROUP_MAX]; /* groups */
630};
631#endif
632#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
633
634/* given pointer to struct cmsghdr, return pointer to data */
635#define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \
636 __DARWIN_ALIGN32(sizeof(struct cmsghdr)))
637
638/*
639 * RFC 2292 requires to check msg_controllen, in case that the kernel returns
640 * an empty list for some reasons.
641 */
642#define CMSG_FIRSTHDR(mhdr) \
643 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
644 (struct cmsghdr *)(mhdr)->msg_control : \
645 (struct cmsghdr *)0L)
646
647
648/*
649 * Given pointer to struct cmsghdr, return pointer to next cmsghdr
650 * RFC 2292 says that CMSG_NXTHDR(mhdr, NULL) is equivalent to CMSG_FIRSTHDR(mhdr)
651 */
652#define CMSG_NXTHDR(mhdr, cmsg) \
653 ((char *)(cmsg) == (char *)0L ? CMSG_FIRSTHDR(mhdr) : \
654 ((((unsigned char *)(cmsg) + \
655 __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len) + \
656 __DARWIN_ALIGN32(sizeof(struct cmsghdr))) > \
657 ((unsigned char *)(mhdr)->msg_control + \
658 (mhdr)->msg_controllen)) ? \
659 (struct cmsghdr *)0L /* NULL */ : \
660 (struct cmsghdr *)(void *)((unsigned char *)(cmsg) + \
661 __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len))))
662
663#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
664/* RFC 2292 additions */
665#define CMSG_SPACE(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + __DARWIN_ALIGN32(l))
666#define CMSG_LEN(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + (l))
667
668#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
669
670/* "Socket"-level control message types: */
671#define SCM_RIGHTS 0x01 /* access rights (array of int) */
672#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
673#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */
674#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
675#define SCM_TIMESTAMP_MONOTONIC 0x04 /* timestamp (uint64_t) */
676
677
678#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
679
680/*
681 * howto arguments for shutdown(2), specified by Posix.1g.
682 */
683#define SHUT_RD 0 /* shut down the reading side */
684#define SHUT_WR 1 /* shut down the writing side */
685#define SHUT_RDWR 2 /* shut down both sides */
686
687#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
688/*
689 * sendfile(2) header/trailer struct
690 */
691struct sf_hdtr {
692 struct iovec *headers; /* pointer to an array of header struct iovec's */
693 int hdr_cnt; /* number of header iovec's */
694 struct iovec *trailers; /* pointer to an array of trailer struct iovec's */
695 int trl_cnt; /* number of trailer iovec's */
696};
697
698
699#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
700
701
702__BEGIN_DECLS
703
704int accept(int, struct sockaddr * __restrict, socklen_t * __restrict)
705__DARWIN_ALIAS_C(accept);
706int bind(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS(bind);
707int connect(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(connect);
708int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict)
709__DARWIN_ALIAS(getpeername);
710int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict)
711__DARWIN_ALIAS(getsockname);
712int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict);
713int listen(int, int) __DARWIN_ALIAS(listen);
714ssize_t recv(int, void *, size_t, int) __DARWIN_ALIAS_C(recv);
715ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict,
716 socklen_t * __restrict) __DARWIN_ALIAS_C(recvfrom);
717ssize_t recvmsg(int, struct msghdr *, int) __DARWIN_ALIAS_C(recvmsg);
718ssize_t send(int, const void *, size_t, int) __DARWIN_ALIAS_C(send);
719ssize_t sendmsg(int, const struct msghdr *, int) __DARWIN_ALIAS_C(sendmsg);
720ssize_t sendto(int, const void *, size_t,
721 int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(sendto);
722int setsockopt(int, int, int, const void *, socklen_t);
723int shutdown(int, int);
724int sockatmark(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
725int socket(int, int, int);
726int socketpair(int, int, int, int *) __DARWIN_ALIAS(socketpair);
727
728#if !defined(_POSIX_C_SOURCE)
729int sendfile(int, int, off_t, off_t *, struct sf_hdtr *, int);
730#endif /* !_POSIX_C_SOURCE */
731
732#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
733void pfctlinput(int, struct sockaddr *);
734
735__API_AVAILABLE(macosx(10.11), ios(9.0), tvos(9.0), watchos(2.0))
736int connectx(int, const sa_endpoints_t *, sae_associd_t, unsigned int,
737 const struct iovec *, unsigned int, size_t *, sae_connid_t *);
738
739__API_AVAILABLE(macosx(10.11), ios(9.0), tvos(9.0), watchos(2.0))
740int disconnectx(int, sae_associd_t, sae_connid_t);
741#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
742__END_DECLS
743
744
745#endif /* !_SYS_SOCKET_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/vis.h created+138
......@@ -0,0 +1,138 @@
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/* $NetBSD: vis.h,v 1.21 2013/02/20 17:01:15 christos Exp $ */
24/* $FreeBSD$ */
25
26/*-
27 * Copyright (c) 1990, 1993
28 * The Regents of the University of California. All rights reserved.
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. Neither the name of the University nor the names of its contributors
39 * may be used to endorse or promote products derived from this software
40 * without specific prior written permission.
41 *
42 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
43 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
46 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
48 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
52 * SUCH DAMAGE.
53 *
54 * @(#)vis.h 8.1 (Berkeley) 6/2/93
55 */
56
57#ifndef _VIS_H_
58#define _VIS_H_
59
60#include <_types.h>
61#include <sys/_types/_size_t.h>
62
63/*
64 * to select alternate encoding format
65 */
66#define VIS_OCTAL 0x0001 /* use octal \ddd format */
67#define VIS_CSTYLE 0x0002 /* use \[nrft0..] where appropiate */
68
69/*
70 * to alter set of characters encoded (default is to encode all
71 * non-graphic except space, tab, and newline).
72 */
73#define VIS_SP 0x0004 /* also encode space */
74#define VIS_TAB 0x0008 /* also encode tab */
75#define VIS_NL 0x0010 /* also encode newline */
76#define VIS_WHITE (VIS_SP | VIS_TAB | VIS_NL)
77#define VIS_SAFE 0x0020 /* only encode "unsafe" characters */
78
79/*
80 * other
81 */
82#define VIS_NOSLASH 0x0040 /* inhibit printing '\' */
83#define VIS_HTTP1808 0x0080 /* http-style escape % hex hex */
84#define VIS_HTTPSTYLE 0x0080 /* http-style escape % hex hex */
85#define VIS_GLOB 0x0100 /* encode glob(3) magic characters */
86#define VIS_MIMESTYLE 0x0200 /* mime-style escape = HEX HEX */
87#define VIS_HTTP1866 0x0400 /* http-style &#num; or &string; */
88#define VIS_NOESCAPE 0x0800 /* don't decode `\' */
89#define _VIS_END 0x1000 /* for unvis */
90
91/*
92 * unvis return codes
93 */
94#define UNVIS_VALID 1 /* character valid */
95#define UNVIS_VALIDPUSH 2 /* character valid, push back passed char */
96#define UNVIS_NOCHAR 3 /* valid sequence, no character produced */
97#define UNVIS_SYNBAD -1 /* unrecognized escape sequence */
98#define UNVIS_ERROR -2 /* decoder in unknown state (unrecoverable) */
99
100/*
101 * unvis flags
102 */
103#define UNVIS_END _VIS_END /* no more characters */
104
105#include <sys/cdefs.h>
106
107__BEGIN_DECLS
108char *vis(char *, int, int, int);
109char *nvis(char *, size_t, int, int, int);
110
111char *svis(char *, int, int, int, const char *);
112char *snvis(char *, size_t, int, int, int, const char *);
113
114int strvis(char *, const char *, int);
115int strnvis(char *, size_t, const char *, int);
116
117int strsvis(char *, const char *, int, const char *);
118int strsnvis(char *, size_t, const char *, int, const char *);
119
120int strvisx(char *, const char *, size_t, int);
121int strnvisx(char *, size_t, const char *, size_t, int);
122int strenvisx(char *, size_t, const char *, size_t, int, int *);
123
124int strsvisx(char *, const char *, size_t, int, const char *);
125int strsnvisx(char *, size_t, const char *, size_t, int, const char *);
126int strsenvisx(char *, size_t, const char *, size_t , int, const char *,
127 int *);
128
129int strunvis(char *, const char *);
130int strnunvis(char *, size_t, const char *);
131
132int strunvisx(char *, const char *, int);
133int strnunvisx(char *, size_t, const char *, int);
134
135int unvis(char *, int, int *, int);
136__END_DECLS
137
138#endif /* !_VIS_H_ */
\ No newline at end of file
lib/libc/include/any-macos-any/xpc/base.h deleted-216
......@@ -1,216 +0,0 @@
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#ifndef XPC_TESTEXPORT
90#define XPC_TESTEXPORT XPC_NOEXPORT
91#endif // XPC_TESTEXPORT
92
93#if defined(__XPC_TEST__) && __XPC_TEST__
94#define XPC_TESTSTATIC
95#define XPC_TESTEXTERN extern
96#else // defined(__XPC_TEST__) && __XPC_TEST__
97#define XPC_TESTSTATIC static
98#endif // defined(__XPC_TEST__) && __XPC_TEST__
99
100#if __has_feature(objc_arc)
101#define XPC_GIVES_REFERENCE __strong
102#define XPC_UNRETAINED __unsafe_unretained
103#define XPC_BRIDGE(xo) ((__bridge void *)(xo))
104#define XPC_BRIDGEREF_BEGIN(xo) ((__bridge_retained void *)(xo))
105#define XPC_BRIDGEREF_BEGIN_WITH_REF(xo) ((__bridge void *)(xo))
106#define XPC_BRIDGEREF_MIDDLE(xo) ((__bridge id)(xo))
107#define XPC_BRIDGEREF_END(xo) ((__bridge_transfer id)(xo))
108#else // __has_feature(objc_arc)
109#define XPC_GIVES_REFERENCE
110#define XPC_UNRETAINED
111#define XPC_BRIDGE(xo) (xo)
112#define XPC_BRIDGEREF_BEGIN(xo) (xo)
113#define XPC_BRIDGEREF_BEGIN_WITH_REF(xo) (xo)
114#define XPC_BRIDGEREF_MIDDLE(xo) (xo)
115#define XPC_BRIDGEREF_END(xo) (xo)
116#endif // __has_feature(objc_arc)
117
118#define _xpc_unreachable() __builtin_unreachable()
119#else // __GNUC__
120/*! @parseOnly */
121#define XPC_CONSTRUCTOR
122/*! @parseOnly */
123#define XPC_NORETURN
124/*! @parseOnly */
125#define XPC_NOTHROW
126/*! @parseOnly */
127#define XPC_NONNULL1
128/*! @parseOnly */
129#define XPC_NONNULL2
130/*! @parseOnly */
131#define XPC_NONNULL3
132/*! @parseOnly */
133#define XPC_NONNULL4
134/*! @parseOnly */
135#define XPC_NONNULL5
136/*! @parseOnly */
137#define XPC_NONNULL6
138/*! @parseOnly */
139#define XPC_NONNULL7
140/*! @parseOnly */
141#define XPC_NONNULL8
142/*! @parseOnly */
143#define XPC_NONNULL9
144/*! @parseOnly */
145#define XPC_NONNULL10
146/*! @parseOnly */
147#define XPC_NONNULL11
148/*! @parseOnly */
149#define XPC_NONNULL(n)
150/*! @parseOnly */
151#define XPC_NONNULL_ALL
152/*! @parseOnly */
153#define XPC_SENTINEL
154/*! @parseOnly */
155#define XPC_PURE
156/*! @parseOnly */
157#define XPC_WARN_RESULT
158/*! @parseOnly */
159#define XPC_MALLOC
160/*! @parseOnly */
161#define XPC_UNUSED
162/*! @parseOnly */
163#define XPC_PACKED
164/*! @parseOnly */
165#define XPC_PRINTF(m, n)
166/*! @parseOnly */
167#define XPC_INLINE static inline
168/*! @parseOnly */
169#define XPC_NOINLINE
170/*! @parseOnly */
171#define XPC_NOIMPL
172/*! @parseOnly */
173#define XPC_EXPORT extern
174/*! @parseOnly */
175#define XPC_WEAKIMPORT
176/*! @parseOnly */
177#define XPC_DEPRECATED
178/*! @parseOnly */
179#define XPC_UNAVAILABLE(m)
180/*! @parseOnly */
181#define XPC_NOESCAPE
182#endif // __GNUC__
183
184#if __has_feature(assume_nonnull)
185#define XPC_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
186#define XPC_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
187#else
188#define XPC_ASSUME_NONNULL_BEGIN
189#define XPC_ASSUME_NONNULL_END
190#endif
191
192#if __has_feature(nullability_on_arrays)
193#define XPC_NONNULL_ARRAY _Nonnull
194#else
195#define XPC_NONNULL_ARRAY
196#endif
197
198#ifdef OS_CLOSED_OPTIONS
199#define XPC_FLAGS_ENUM(_name, _type, ...) \
200 OS_CLOSED_OPTIONS(_name, _type, __VA_ARGS__)
201#else // OS_CLOSED_ENUM
202#define XPC_FLAGS_ENUM(_name, _type, ...) \
203 OS_ENUM(_name, _type, __VA_ARGS__)
204#endif // OS_CLOSED_ENUM
205
206#ifdef OS_CLOSED_ENUM
207#define XPC_ENUM(_name, _type, ...) \
208 OS_CLOSED_ENUM(_name, _type, __VA_ARGS__)
209#else // OS_CLOSED_ENUM
210#define XPC_ENUM(_name, _type, ...) \
211 OS_ENUM(_name, _type, __VA_ARGS__)
212#endif // OS_CLOSED_ENUM
213
214__END_DECLS
215
216#endif // __XPC_BASE_H__
\ No newline at end of file
lib/libc/include/any-macos-any/xpc/connection.h deleted-794
......@@ -1,794 +0,0 @@
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_ERROR_PEER_CODE_SIGNING_REQUIREMENT
84 * On macOS, this error will be delivered to a peer connection's event handler
85 * when the XPC runtime has detected that a peer connection does not
86 * satisfy the code signing requirement specified for the connection.
87 *
88 * See {@link xpc_connection_set_peer_code_signing_requirement}
89 */
90#define XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT \
91 XPC_GLOBAL_OBJECT(_xpc_error_peer_code_signing_requirement)
92__API_AVAILABLE(macos(12.0))
93XPC_EXPORT
94const struct _xpc_dictionary_s _xpc_error_peer_code_signing_requirement;
95
96/*!
97 * @constant XPC_CONNECTION_MACH_SERVICE_LISTENER
98 * Passed to xpc_connection_create_mach_service(). This flag indicates that the
99 * caller is the listener for the named service. This flag may only be passed
100 * for services which are advertised in the process' launchd.plist(5). You may
101 * not use this flag to dynamically add services to the Mach bootstrap
102 * namespace.
103 */
104#define XPC_CONNECTION_MACH_SERVICE_LISTENER (1 << 0)
105
106/*!
107 * @constant XPC_CONNECTION_MACH_SERVICE_PRIVILEGED
108 * Passed to xpc_connection_create_mach_service(). This flag indicates that the
109 * job advertising the service name in its launchd.plist(5) should be in the
110 * privileged Mach bootstrap. This is typically accomplished by placing your
111 * launchd.plist(5) in /Library/LaunchDaemons. If specified alongside the
112 * XPC_CONNECTION_MACH_SERVICE_LISTENER flag, this flag is a no-op.
113 */
114#define XPC_CONNECTION_MACH_SERVICE_PRIVILEGED (1 << 1)
115
116/*!
117 * @typedef xpc_finalizer_f
118 * A function that is invoked when a connection is being torn down and its
119 * context needs to be freed. The sole argument is the value that was given to
120 * {@link xpc_connection_set_context} or NULL if no context has been set. It is
121 * not safe to reference the connection from within this function.
122 *
123 * @param value
124 * The context object that is to be disposed of.
125 */
126typedef void (*xpc_finalizer_t)(void * _Nullable value);
127
128/*!
129 * @function xpc_connection_create
130 * Creates a new connection object.
131 *
132 * @param name
133 * If non-NULL, the name of the service with which to connect. The returned
134 * connection will be a peer.
135 *
136 * If NULL, an anonymous listener connection will be created. You can embed the
137 * ability to create new peer connections in an endpoint, which can be inserted
138 * into a message and sent to another process .
139 *
140 * @param targetq
141 * The GCD queue to which the event handler block will be submitted. This
142 * parameter may be NULL, in which case the connection's target queue will be
143 * libdispatch's default target queue, defined as DISPATCH_TARGET_QUEUE_DEFAULT.
144 * The target queue may be changed later with a call to
145 * xpc_connection_set_target_queue().
146 *
147 * @result
148 * A new connection object. The caller is responsible for disposing of the
149 * returned object with {@link xpc_release} when it is no longer needed.
150 *
151 * @discussion
152 * This method will succeed even if the named service does not exist. This is
153 * because the XPC namespace is not queried for the service name until the
154 * connection has been activated. See {@link xpc_connection_activate()}.
155 *
156 * XPC connections, like dispatch sources, are returned in an inactive state, so
157 * you must call {@link xpc_connection_activate()} in order to begin receiving
158 * events from the connection. Also like dispatch sources, connections must be
159 * activated and not suspended in order to be safely released. It is
160 * a programming error to release an inactive or suspended connection.
161 */
162__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
163XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
164xpc_connection_t
165xpc_connection_create(const char * _Nullable name,
166 dispatch_queue_t _Nullable targetq);
167
168/*!
169 * @function xpc_connection_create_mach_service
170 * Creates a new connection object representing a Mach service.
171 *
172 * @param name
173 * The name of the remote service with which to connect. The service name must
174 * exist in a Mach bootstrap that is accessible to the process and be advertised
175 * in a launchd.plist.
176 *
177 * @param targetq
178 * The GCD queue to which the event handler block will be submitted. This
179 * parameter may be NULL, in which case the connection's target queue will be
180 * libdispatch's default target queue, defined as DISPATCH_TARGET_QUEUE_DEFAULT.
181 * The target queue may be changed later with a call to
182 * xpc_connection_set_target_queue().
183 *
184 * @param flags
185 * Additional attributes with which to create the connection.
186 *
187 * @result
188 * A new connection object.
189 *
190 * @discussion
191 * If the XPC_CONNECTION_MACH_SERVICE_LISTENER flag is given to this method,
192 * then the connection returned will be a listener connection. Otherwise, a peer
193 * connection will be returned. See the documentation for
194 * {@link xpc_connection_set_event_handler()} for the semantics of listener
195 * connections versus peer connections.
196 *
197 * This method will succeed even if the named service does not exist. This is
198 * because the Mach namespace is not queried for the service name until the
199 * connection has been activated. See {@link xpc_connection_activate()}.
200 */
201__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
202XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
203xpc_connection_t
204xpc_connection_create_mach_service(const char *name,
205 dispatch_queue_t _Nullable targetq, uint64_t flags);
206
207/*!
208 * @function xpc_connection_create_from_endpoint
209 * Creates a new connection from the given endpoint.
210 *
211 * @param endpoint
212 * The endpoint from which to create the new connection.
213 *
214 * @result
215 * A new peer connection to the listener represented by the given endpoint.
216 *
217 * The same responsibilities of setting an event handler and activating the
218 * connection after calling xpc_connection_create() apply to the connection
219 * returned by this API. Since the connection yielded by this API is not
220 * associated with a name (and therefore is not rediscoverable), this connection
221 * will receive XPC_ERROR_CONNECTION_INVALID if the listening side crashes,
222 * exits or cancels the listener connection.
223 */
224__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
225XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL_ALL
226xpc_connection_t
227xpc_connection_create_from_endpoint(xpc_endpoint_t endpoint);
228
229/*!
230 * @function xpc_connection_set_target_queue
231 * Sets the target queue of the given connection.
232 *
233 * @param connection
234 * The connection object which is to be manipulated.
235 *
236 * @param targetq
237 * The GCD queue to which the event handler block will be submitted. This
238 * parameter may be NULL, in which case the connection's target queue will be
239 * libdispatch's default target queue, defined as DISPATCH_TARGET_QUEUE_DEFAULT.
240 *
241 * @discussion
242 * Setting the target queue is asynchronous and non-preemptive and therefore
243 * this method will not interrupt the execution of an already-running event
244 * handler block. Setting the target queue may be likened to issuing a barrier
245 * to the connection which does the actual work of changing the target queue.
246 *
247 * The XPC runtime guarantees this non-preemptiveness even for concurrent target
248 * queues. If the target queue is a concurrent queue, then XPC still guarantees
249 * that there will never be more than one invocation of the connection's event
250 * handler block executing concurrently. If you wish to process events
251 * concurrently, you can dispatch_async(3) to a concurrent queue from within
252 * the event handler.
253 *
254 * IMPORTANT: When called from within the event handler block,
255 * dispatch_get_current_queue(3) is NOT guaranteed to return a pointer to the
256 * queue set with this method.
257 *
258 * Despite this seeming inconsistency, the XPC runtime guarantees that, when the
259 * target queue is a serial queue, the event handler block will execute
260 * synchonously with respect to other blocks submitted to that same queue. When
261 * the target queue is a concurrent queue, the event handler block may run
262 * concurrently with other blocks submitted to that queue, but it will never run
263 * concurrently with other invocations of itself for the same connection, as
264 * discussed previously.
265 */
266__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
267XPC_EXPORT XPC_NONNULL1
268void
269xpc_connection_set_target_queue(xpc_connection_t connection,
270 dispatch_queue_t _Nullable targetq);
271
272/*!
273 * @function xpc_connection_set_event_handler
274 * Sets the event handler block for the connection.
275 *
276 * @param connection
277 * The connection object which is to be manipulated.
278 *
279 * @param handler
280 * The event handler block.
281 *
282 * @discussion
283 * Setting the event handler is asynchronous and non-preemptive, and therefore
284 * this method will not interrupt the execution of an already-running event
285 * handler block. If the event handler is executing at the time of this call, it
286 * will finish, and then the connection's event handler will be changed before
287 * the next invocation of the event handler. The XPC runtime guarantees this
288 * non-preemptiveness even for concurrent target queues.
289 *
290 * Connection event handlers are non-reentrant, so it is safe to call
291 * xpc_connection_set_event_handler() from within the event handler block.
292 *
293 * The event handler's execution should be treated as a barrier to all
294 * connection activity. When it is executing, the connection will not attempt to
295 * send or receive messages, including reply messages. Thus, it is not safe to
296 * call xpc_connection_send_message_with_reply_sync() on the connection from
297 * within the event handler.
298 *
299 * You do not hold a reference on the object received as the event handler's
300 * only argument. Regardless of the type of object received, it is safe to call
301 * xpc_retain() on the object to obtain a reference to it.
302 *
303 * A connection may receive different events depending upon whether it is a
304 * listener or not. Any connection may receive an error in its event handler.
305 * But while normal connections may receive messages in addition to errors,
306 * listener connections will receive connections and and not messages.
307 *
308 * Connections received by listeners are equivalent to those returned by
309 * xpc_connection_create() with a non-NULL name argument and a NULL targetq
310 * argument with the exception that you do not hold a reference on them.
311 * You must set an event handler and activate the connection. If you do not wish
312 * to accept the connection, you may simply call xpc_connection_cancel() on it
313 * and return. The runtime will dispose of it for you.
314 *
315 * If there is an error in the connection, this handler will be invoked with the
316 * error dictionary as its argument. This dictionary will be one of the well-
317 * known XPC_ERROR_* dictionaries.
318 *
319 * Regardless of the type of event, ownership of the event object is NOT
320 * implicitly transferred. Thus, the object will be released and deallocated at
321 * some point in the future after the event handler returns. If you wish the
322 * event's lifetime to persist, you must retain it with xpc_retain().
323 *
324 * Connections received through the event handler will be released and
325 * deallocated after the connection has gone invalid and delivered that event to
326 * its event handler.
327 */
328__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
329XPC_EXPORT XPC_NONNULL_ALL
330void
331xpc_connection_set_event_handler(xpc_connection_t connection,
332 xpc_handler_t handler);
333
334/*!
335 * @function xpc_connection_activate
336 * Activates the connection. Connections start in an inactive state, so you must
337 * call xpc_connection_activate() on a connection before it will send or receive
338 * any messages.
339 *
340 * @param connection
341 * The connection object which is to be manipulated.
342 *
343 * @discussion
344 * Calling xpc_connection_activate() on an active connection has no effect.
345 * Releasing the last reference on an inactive connection that was created with
346 * an xpc_connection_create*() call is undefined.
347 *
348 * For backward compatibility reasons, xpc_connection_resume() on an inactive
349 * and not otherwise suspended xpc connection has the same effect as calling
350 * xpc_connection_activate(). For new code, using xpc_connection_activate()
351 * is preferred.
352 */
353__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0)
354__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
355XPC_EXPORT XPC_NONNULL_ALL
356void
357xpc_connection_activate(xpc_connection_t connection);
358
359/*!
360 * @function xpc_connection_suspend
361 * Suspends the connection so that the event handler block will not fire and
362 * that the connection will not attempt to send any messages it has in its
363 * queue. All calls to xpc_connection_suspend() must be balanced with calls to
364 * xpc_connection_resume() before releasing the last reference to the
365 * connection.
366 *
367 * @param connection
368 * The connection object which is to be manipulated.
369 *
370 * @discussion
371 * Suspension is asynchronous and non-preemptive, and therefore this method will
372 * not interrupt the execution of an already-running event handler block. If
373 * the event handler is executing at the time of this call, it will finish, and
374 * then the connection will be suspended before the next scheduled invocation
375 * of the event handler. The XPC runtime guarantees this non-preemptiveness even
376 * for concurrent target queues.
377 *
378 * Connection event handlers are non-reentrant, so it is safe to call
379 * xpc_connection_suspend() from within the event handler block.
380 */
381__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
382XPC_EXPORT XPC_NONNULL_ALL
383void
384xpc_connection_suspend(xpc_connection_t connection);
385
386/*!
387 * @function xpc_connection_resume
388 * Resumes the connection.
389 *
390 * @param connection
391 * The connection object which is to be manipulated.
392 *
393 * @discussion
394 * In order for a connection to become live, every call to
395 * xpc_connection_suspend() must be balanced with a call to
396 * xpc_connection_resume().
397 *
398 * For backward compatibility reasons, xpc_connection_resume() on an inactive
399 * and not otherwise suspended xpc connection has the same effect as calling
400 * xpc_connection_activate(). For new code, using xpc_connection_activate()
401 * is preferred.
402 *
403 * Calling xpc_connection_resume() more times than xpc_connection_suspend()
404 * has been called is otherwise considered an error.
405 */
406__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
407XPC_EXPORT XPC_NONNULL_ALL
408void
409xpc_connection_resume(xpc_connection_t connection);
410
411/*!
412 * @function xpc_connection_send_message
413 * Sends a message over the connection to the destination service.
414 *
415 * @param connection
416 * The connection over which the message shall be sent.
417 *
418 * @param message
419 * The message to send. This must be a dictionary object. This dictionary is
420 * logically copied by the connection, so it is safe to modify the dictionary
421 * after this call.
422 *
423 * @discussion
424 * Messages are delivered in FIFO order. This API is safe to call from multiple
425 * GCD queues. There is no indication that a message was delivered successfully.
426 * This is because even once the message has been successfully enqueued on the
427 * remote end, there are no guarantees about when the runtime will dequeue the
428 * message and invoke the other connection's event handler block.
429 *
430 * If this API is used to send a message that is in reply to another message,
431 * there is no guarantee of ordering between the invocations of the connection's
432 * event handler and the reply handler for that message, even if they are
433 * targeted to the same queue.
434 *
435 * After extensive study, we have found that clients who are interested in
436 * the state of the message on the server end are typically holding open
437 * transactions related to that message. And the only reliable way to track the
438 * lifetime of that transaction is at the protocol layer. So the server should
439 * send a reply message, which upon receiving, will cause the client to close
440 * its transaction.
441 */
442__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
443XPC_EXPORT XPC_NONNULL_ALL
444void
445xpc_connection_send_message(xpc_connection_t connection, xpc_object_t message);
446
447/*!
448 * @function xpc_connection_send_barrier
449 * Issues a barrier against the connection's message-send activity.
450 *
451 * @param connection
452 * The connection against which the barrier is to be issued.
453 *
454 * @param barrier
455 * The barrier block to issue. This barrier prevents concurrent message-send
456 * activity on the connection. No messages will be sent while the barrier block
457 * is executing.
458 *
459 * @discussion
460 * XPC guarantees that, even if the connection's target queue is a concurrent
461 * queue, there are no other messages being sent concurrently while the barrier
462 * block is executing. XPC does not guarantee that the receipt of messages
463 * (either through the connection's event handler or through reply handlers)
464 * will be suspended while the barrier is executing.
465 *
466 * A barrier is issued relative to the message-send queue. Thus, if you call
467 * xpc_connection_send_message() five times and then call
468 * xpc_connection_send_barrier(), the barrier will be invoked after the fifth
469 * message has been sent and its memory disposed of. You may safely cancel a
470 * connection from within a barrier block.
471 *
472 * If a barrier is issued after sending a message which expects a reply, the
473 * behavior is the same as described above. The receipt of a reply message will
474 * not influence when the barrier runs.
475 *
476 * A barrier block can be useful for throttling resource consumption on the
477 * connected side of a connection. For example, if your connection sends many
478 * large messages, you can use a barrier to limit the number of messages that
479 * are inflight at any given time. This can be particularly useful for messages
480 * that contain kernel resources (like file descriptors) which have a system-
481 * wide limit.
482 *
483 * If a barrier is issued on a canceled connection, it will be invoked
484 * immediately. If a connection has been canceled and still has outstanding
485 * barriers, those barriers will be invoked as part of the connection's
486 * unwinding process.
487 *
488 * It is important to note that a barrier block's execution order is not
489 * guaranteed with respect to other blocks that have been scheduled on the
490 * target queue of the connection. Or said differently,
491 * xpc_connection_send_barrier(3) is not equivalent to dispatch_async(3).
492 */
493__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
494XPC_EXPORT XPC_NONNULL_ALL
495void
496xpc_connection_send_barrier(xpc_connection_t connection,
497 dispatch_block_t barrier);
498
499/*!
500 * @function xpc_connection_send_message_with_reply
501 * Sends a message over the connection to the destination service and associates
502 * a handler to be invoked when the remote service sends a reply message.
503 *
504 * @param connection
505 * The connection over which the message shall be sent.
506 *
507 * @param message
508 * The message to send. This must be a dictionary object.
509 *
510 * @param replyq
511 * The GCD queue to which the reply handler will be submitted. This may be a
512 * concurrent queue.
513 *
514 * @param handler
515 * The handler block to invoke when a reply to the message is received from
516 * the connection. If the remote service exits prematurely before the reply was
517 * received, the XPC_ERROR_CONNECTION_INTERRUPTED error will be returned.
518 * If the connection went invalid before the message could be sent, the
519 * XPC_ERROR_CONNECTION_INVALID error will be returned.
520 *
521 * @discussion
522 * If the given GCD queue is a concurrent queue, XPC cannot guarantee that there
523 * will not be multiple reply handlers being invoked concurrently. XPC does not
524 * guarantee any ordering for the invocation of reply handers. So if multiple
525 * messages are waiting for replies and the connection goes invalid, there is no
526 * guarantee that the reply handlers will be invoked in FIFO order. Similarly,
527 * XPC does not guarantee that reply handlers will not run concurrently with
528 * the connection's event handler in the case that the reply queue and the
529 * connection's target queue are the same concurrent queue.
530 */
531__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
532XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL4
533void
534xpc_connection_send_message_with_reply(xpc_connection_t connection,
535 xpc_object_t message, dispatch_queue_t _Nullable replyq,
536 xpc_handler_t handler);
537
538/*!
539 * @function xpc_connection_send_message_with_reply_sync
540 * Sends a message over the connection and blocks the caller until a reply is
541 * received.
542 *
543 * @param connection
544 * The connection over which the message shall be sent.
545 *
546 * @param message
547 * The message to send. This must be a dictionary object.
548 *
549 * @result
550 * The message that the remote service sent in reply to the original message.
551 * If the remote service exits prematurely before the reply was received, the
552 * XPC_ERROR_CONNECTION_INTERRUPTED error will be returned. If the connection
553 * went invalid before the message could be sent, the
554 * XPC_ERROR_CONNECTION_INVALID error will be returned.
555 *
556 * You are responsible for releasing the returned object.
557 *
558 * @discussion
559 * This API supports priority inversion avoidance, and should be used instead of
560 * combining xpc_connection_send_message_with_reply() with a semaphore.
561 *
562 * Invoking this API from a queue that is a part of the target queue hierarchy
563 * results in deadlocks under certain conditions.
564 *
565 * Be judicious about your use of this API. It can block indefinitely, so if you
566 * are using it to implement an API that can be called from the main thread, you
567 * may wish to consider allowing the API to take a queue and callback block so
568 * that results may be delivered asynchronously if possible.
569 */
570__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
571XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT XPC_RETURNS_RETAINED
572xpc_object_t
573xpc_connection_send_message_with_reply_sync(xpc_connection_t connection,
574 xpc_object_t message);
575
576/*!
577 * @function xpc_connection_cancel
578 * Cancels the connection and ensures that its event handler will not fire
579 * again. After this call, any messages that have not yet been sent will be
580 * discarded, and the connection will be unwound. If there are messages that are
581 * awaiting replies, they will have their reply handlers invoked with the
582 * XPC_ERROR_CONNECTION_INVALID error.
583 *
584 * @param connection
585 * The connection object which is to be manipulated.
586 *
587 * @discussion
588 * Cancellation is asynchronous and non-preemptive and therefore this method
589 * will not interrupt the execution of an already-running event handler block.
590 * If the event handler is executing at the time of this call, it will finish,
591 * and then the connection will be canceled, causing a final invocation of the
592 * event handler to be scheduled with the XPC_ERROR_CONNECTION_INVALID error.
593 * After that invocation, there will be no further invocations of the event
594 * handler.
595 *
596 * The XPC runtime guarantees this non-preemptiveness even for concurrent target
597 * queues.
598 */
599__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
600XPC_EXPORT XPC_NONNULL_ALL
601void
602xpc_connection_cancel(xpc_connection_t connection);
603
604/*!
605 * @function xpc_connection_get_name
606 * Returns the name of the service with which the connections was created.
607 *
608 * @param connection
609 * The connection object which is to be examined.
610 *
611 * @result
612 * The name of the remote service. If you obtained the connection through an
613 * invocation of another connection's event handler, NULL is returned.
614 */
615__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
616XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
617const char * _Nullable
618xpc_connection_get_name(xpc_connection_t connection);
619
620/*!
621 * @function xpc_connection_get_euid
622 * Returns the EUID of the remote peer.
623 *
624 * @param connection
625 * The connection object which is to be examined.
626 *
627 * @result
628 * The EUID of the remote peer at the time the connection was made.
629 */
630__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
631XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
632uid_t
633xpc_connection_get_euid(xpc_connection_t connection);
634
635/*!
636 * @function xpc_connection_get_egid
637 * Returns the EGID of the remote peer.
638 *
639 * @param connection
640 * The connection object which is to be examined.
641 *
642 * @result
643 * The EGID of the remote peer at the time the connection was made.
644 */
645__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
646XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
647gid_t
648xpc_connection_get_egid(xpc_connection_t connection);
649
650/*!
651 * @function xpc_connection_get_pid
652 * Returns the PID of the remote peer.
653 *
654 * @param connection
655 * The connection object which is to be examined.
656 *
657 * @result
658 * The PID of the remote peer.
659 *
660 * @discussion
661 * A given PID is not guaranteed to be unique across an entire boot cycle.
662 * Great care should be taken when dealing with this information, as it can go
663 * stale after the connection is established. OS X recycles PIDs, and therefore
664 * another process could spawn and claim the PID before a message is actually
665 * received from the connection.
666 *
667 * XPC will deliver an error to your event handler if the remote process goes
668 * away, but there are no guarantees as to the timing of this notification's
669 * delivery either at the kernel layer or at the XPC layer.
670 */
671__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
672XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
673pid_t
674xpc_connection_get_pid(xpc_connection_t connection);
675
676/*!
677 * @function xpc_connection_get_asid
678 * Returns the audit session identifier of the remote peer.
679 *
680 * @param connection
681 * The connection object which is to be examined.
682 *
683 * @result
684 * The audit session ID of the remote peer at the time the connection was made.
685 */
686__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
687XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
688au_asid_t
689xpc_connection_get_asid(xpc_connection_t connection);
690
691/*!
692 * @function xpc_connection_set_context
693 * Sets context on an connection.
694 *
695 * @param connection
696 * The connection which is to be manipulated.
697 *
698 * @param context
699 * The context to associate with the connection.
700 *
701 * @discussion
702 * If you must manage the memory of the context object, you must set a finalizer
703 * to dispose of it. If this method is called on a connection which already has
704 * context associated with it, the finalizer will NOT be invoked. The finalizer
705 * is only invoked when the connection is being deallocated.
706 *
707 * It is recommended that, instead of changing the actual context pointer
708 * associated with the object, you instead change the state of the context
709 * object itself.
710 */
711__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
712XPC_EXPORT XPC_NONNULL1
713void
714xpc_connection_set_context(xpc_connection_t connection,
715 void * _Nullable context);
716
717/*!
718 * @function xpc_connection_get_context
719 * Returns the context associated with the connection.
720 *
721 * @param connection
722 * The connection which is to be examined.
723 *
724 * @result
725 * The context associated with the connection. NULL if there has been no context
726 * associated with the object.
727 */
728__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
729XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
730void * _Nullable
731xpc_connection_get_context(xpc_connection_t connection);
732
733/*!
734 * @function xpc_connection_set_finalizer_f
735 * Sets the finalizer for the given connection.
736 *
737 * @param connection
738 * The connection on which to set the finalizer.
739 *
740 * @param finalizer
741 * The function that will be invoked when the connection's retain count has
742 * dropped to zero and is being torn down.
743 *
744 * @discussion
745 * This method disposes of the context value associated with a connection, as
746 * set by {@link xpc_connection_set_context}.
747 *
748 * For many uses of context objects, this API allows for a convenient shorthand
749 * for freeing them. For example, for a context object allocated with malloc(3):
750 *
751 * xpc_connection_set_finalizer_f(object, free);
752 */
753__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
754XPC_EXPORT XPC_NONNULL1
755void
756xpc_connection_set_finalizer_f(xpc_connection_t connection,
757 xpc_finalizer_t _Nullable finalizer);
758
759/*!
760 * @function xpc_connection_set_peer_code_signing_requirement
761 * Requires that the connection peer satisfies a code signing requirement.
762 *
763 * @param connection
764 * The connection object which is to be modified.
765 *
766 * @param requirement
767 * The code signing requirement to be satisfied by the peer
768 * It is safe to deallocate the requirement string after calling `xpc_connection_set_peer_code_signing_requirement`
769 *
770 * @result
771 * 0 on success, non-zero on error
772 *
773 * @discussion
774 * This function will return an error promptly if the code signing requirement string is invalid.
775 *
776 * It is a programming error to call `xpc_connection_set_peer_code_signing_requirement` more than once per connection.
777 *
778 * All messages received on this connection will be checked to ensure they come from a peer who satisfies
779 * the code signing requirement. For a listener connection, requests that do not satisfy the requirement
780 * are dropped. When a reply is expected on the connection and the peer does not satisfy the requirement
781 * XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT will be delivered instead of the reply.
782 *
783 * @see https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html
784 */
785__API_AVAILABLE(macos(12.0))
786XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
787int
788xpc_connection_set_peer_code_signing_requirement(xpc_connection_t connection, const char *requirement);
789
790
791__END_DECLS
792XPC_ASSUME_NONNULL_END
793
794#endif // __XPC_CONNECTION_H__
\ No newline at end of file
lib/libc/include/any-macos.11-any/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__ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/AvailabilityInternal.h+5-5
......@@ -55,7 +55,7 @@
5555 #ifdef __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
5656 /* compiler sets __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ when -mtvos-version-min is used */
5757 #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
58 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_15_2
58 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_14_5
5959 /* for compatibility with existing code. New code should use platform specific checks */
6060 #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000
6161 #endif
......@@ -65,7 +65,7 @@
6565 #ifdef __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
6666 /* compiler sets __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ when -mwatchos-version-min is used */
6767 #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
68 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_8_3
68 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_7_4
6969 /* for compatibility with existing code. New code should use platform specific checks */
7070 #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000
7171 #endif
......@@ -75,7 +75,7 @@
7575 #ifdef __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__
7676
7777 #define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__
78 #define __BRIDGE_OS_VERSION_MAX_ALLOWED 60100
78 #define __BRIDGE_OS_VERSION_MAX_ALLOWED 50300
7979 /* for compatibility with existing code. New code should use platform specific checks */
8080 #define __IPHONE_OS_VERSION_MIN_REQUIRED 110000
8181 #endif
......@@ -90,14 +90,14 @@
9090#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
9191 /* make sure a default max version is set */
9292 #ifndef __MAC_OS_X_VERSION_MAX_ALLOWED
93 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_12_1
93 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_11_3
9494 #endif
9595#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
9696
9797#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
9898 /* make sure a default max version is set */
9999 #ifndef __IPHONE_OS_VERSION_MAX_ALLOWED
100 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_15_2
100 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_14_5
101101 #endif
102102 /* make sure a valid min is set */
103103 #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0
lib/libc/include/any-macos.11-any/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#define MAC_OS_VERSION_11_1 110100
122#define MAC_OS_VERSION_11_3 110300
123
124/*
125 * If min OS not specified, assume 10.4 for intel
126 * Note: compiler driver may set _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ based on MACOSX_DEPLOYMENT_TARGET environment variable
127 */
128#ifndef MAC_OS_X_VERSION_MIN_REQUIRED
129 #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
130 #if (__i386__ || __x86_64__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < MAC_OS_X_VERSION_10_4)
131 #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid.
132 #endif
133 #define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
134 #else
135 #if __i386__ || __x86_64__
136 #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4
137 #elif __arm__ || __arm64__
138 #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_5
139 #else
140 #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_1
141 #endif
142 #endif
143#endif
144
145/*
146 * if max OS not specified, assume larger of (10.15, min)
147 */
148#ifndef MAC_OS_X_VERSION_MAX_ALLOWED
149 #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_VERSION_11_3
150 #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED
151 #else
152 #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_VERSION_11_3
153 #endif
154#endif
155
156/*
157 * Error on bad values
158 */
159#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_MIN_REQUIRED
160 #error MAC_OS_X_VERSION_MAX_ALLOWED must be >= MAC_OS_X_VERSION_MIN_REQUIRED
161#endif
162#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_0
163 #error MAC_OS_X_VERSION_MIN_REQUIRED must be >= MAC_OS_X_VERSION_10_0
164#endif
165
166/*
167 * only certain compilers support __attribute__((weak_import))
168 */
169#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)
170 #define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
171#elif defined(__MWERKS__) && (__MWERKS__ >= 0x3205) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) && !defined(__INTEL__)
172 #define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
173#else
174 #define WEAK_IMPORT_ATTRIBUTE
175#endif
176
177/*
178 * only certain compilers support __attribute__((deprecated))
179 */
180#if defined(__has_feature) && defined(__has_attribute)
181 #if __has_attribute(deprecated)
182 #define DEPRECATED_ATTRIBUTE __attribute__((deprecated))
183 #if __has_feature(attribute_deprecated_with_message)
184 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
185 #else
186 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated))
187 #endif
188 #else
189 #define DEPRECATED_ATTRIBUTE
190 #define DEPRECATED_MSG_ATTRIBUTE(s)
191 #endif
192#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
193 #define DEPRECATED_ATTRIBUTE __attribute__((deprecated))
194 #if (__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))
195 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
196 #else
197 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated))
198 #endif
199#else
200 #define DEPRECATED_ATTRIBUTE
201 #define DEPRECATED_MSG_ATTRIBUTE(s)
202#endif
203
204/*
205 * only certain compilers support __attribute__((unavailable))
206 */
207#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
208 #define UNAVAILABLE_ATTRIBUTE __attribute__((unavailable))
209#else
210 #define UNAVAILABLE_ATTRIBUTE
211#endif
212
213
214/*
215 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
216 *
217 * Used on functions introduced in Mac OS X 10.0
218 */
219#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
220
221/*
222 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED
223 *
224 * Used on functions introduced in Mac OS X 10.0,
225 * and deprecated in Mac OS X 10.0
226 */
227#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
228
229/*
230 * DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER
231 *
232 * Used on types deprecated in Mac OS X 10.0
233 */
234#define DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER DEPRECATED_ATTRIBUTE
235
236#ifndef __AVAILABILITY_MACROS_USES_AVAILABILITY
237 #ifdef __has_attribute
238 #if __has_attribute(availability)
239 #include <Availability.h>
240 #define __AVAILABILITY_MACROS_USES_AVAILABILITY 1
241 #endif
242 #endif
243#endif
244
245#if TARGET_OS_OSX
246#define __IPHONE_COMPAT_VERSION __IPHONE_NA
247#elif TARGET_OS_MACCATALYST
248#define __IPHONE_COMPAT_VERSION __IPHONE_NA
249#else
250#define __IPHONE_COMPAT_VERSION __IPHONE_4_0
251#endif
252
253/*
254 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
255 *
256 * Used on declarations introduced in Mac OS X 10.1
257 */
258#if __AVAILABILITY_MACROS_USES_AVAILABILITY
259 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_COMPAT_VERSION)
260#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_1
261 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER UNAVAILABLE_ATTRIBUTE
262#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_1
263 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER WEAK_IMPORT_ATTRIBUTE
264#else
265 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
266#endif
267
268/*
269 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED
270 *
271 * Used on declarations introduced in Mac OS X 10.1,
272 * and deprecated in Mac OS X 10.1
273 */
274#if __AVAILABILITY_MACROS_USES_AVAILABILITY
275 #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)
276#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
277 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
278#else
279 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
280#endif
281
282/*
283 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1
284 *
285 * Used on declarations introduced in Mac OS X 10.0,
286 * but later deprecated in Mac OS X 10.1
287 */
288#if __AVAILABILITY_MACROS_USES_AVAILABILITY
289 #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)
290#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
291 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 DEPRECATED_ATTRIBUTE
292#else
293 #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
294#endif
295
296/*
297 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
298 *
299 * Used on declarations introduced in Mac OS X 10.2
300 */
301#if __AVAILABILITY_MACROS_USES_AVAILABILITY
302 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_COMPAT_VERSION)
303#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2
304 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER UNAVAILABLE_ATTRIBUTE
305#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2
306 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
307#else
308 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
309#endif
310
311/*
312 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED
313 *
314 * Used on declarations introduced in Mac OS X 10.2,
315 * and deprecated in Mac OS X 10.2
316 */
317#if __AVAILABILITY_MACROS_USES_AVAILABILITY
318 #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)
319#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
320 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
321#else
322 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
323#endif
324
325/*
326 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2
327 *
328 * Used on declarations introduced in Mac OS X 10.0,
329 * but later deprecated in Mac OS X 10.2
330 */
331#if __AVAILABILITY_MACROS_USES_AVAILABILITY
332 #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)
333#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
334 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE
335#else
336 #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
337#endif
338
339/*
340 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2
341 *
342 * Used on declarations introduced in Mac OS X 10.1,
343 * but later deprecated in Mac OS X 10.2
344 */
345#if __AVAILABILITY_MACROS_USES_AVAILABILITY
346 #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)
347#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
348 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE
349#else
350 #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
351#endif
352
353/*
354 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
355 *
356 * Used on declarations introduced in Mac OS X 10.3
357 */
358#if __AVAILABILITY_MACROS_USES_AVAILABILITY
359 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_COMPAT_VERSION)
360#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3
361 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER UNAVAILABLE_ATTRIBUTE
362#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3
363 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
364#else
365 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
366#endif
367
368/*
369 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED
370 *
371 * Used on declarations introduced in Mac OS X 10.3,
372 * and deprecated in Mac OS X 10.3
373 */
374#if __AVAILABILITY_MACROS_USES_AVAILABILITY
375 #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)
376#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
377 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
378#else
379 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
380#endif
381
382/*
383 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
384 *
385 * Used on declarations introduced in Mac OS X 10.0,
386 * but later deprecated in Mac OS X 10.3
387 */
388#if __AVAILABILITY_MACROS_USES_AVAILABILITY
389 #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)
390#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
391 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
392#else
393 #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
394#endif
395
396/*
397 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
398 *
399 * Used on declarations introduced in Mac OS X 10.1,
400 * but later deprecated in Mac OS X 10.3
401 */
402#if __AVAILABILITY_MACROS_USES_AVAILABILITY
403 #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)
404#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
405 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
406#else
407 #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
408#endif
409
410/*
411 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
412 *
413 * Used on declarations introduced in Mac OS X 10.2,
414 * but later deprecated in Mac OS X 10.3
415 */
416#if __AVAILABILITY_MACROS_USES_AVAILABILITY
417 #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)
418#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
419 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
420#else
421 #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
422#endif
423
424/*
425 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
426 *
427 * Used on declarations introduced in Mac OS X 10.4
428 */
429#if __AVAILABILITY_MACROS_USES_AVAILABILITY
430 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_COMPAT_VERSION)
431#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
432 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER UNAVAILABLE_ATTRIBUTE
433#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4
434 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
435#else
436 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
437#endif
438
439/*
440 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED
441 *
442 * Used on declarations introduced in Mac OS X 10.4,
443 * and deprecated in Mac OS X 10.4
444 */
445#if __AVAILABILITY_MACROS_USES_AVAILABILITY
446 #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)
447#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
448 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
449#else
450 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
451#endif
452
453/*
454 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
455 *
456 * Used on declarations introduced in Mac OS X 10.0,
457 * but later deprecated in Mac OS X 10.4
458 */
459#if __AVAILABILITY_MACROS_USES_AVAILABILITY
460 #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)
461#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
462 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
463#else
464 #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
465#endif
466
467/*
468 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
469 *
470 * Used on declarations introduced in Mac OS X 10.1,
471 * but later deprecated in Mac OS X 10.4
472 */
473#if __AVAILABILITY_MACROS_USES_AVAILABILITY
474 #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)
475#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
476 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
477#else
478 #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
479#endif
480
481/*
482 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
483 *
484 * Used on declarations introduced in Mac OS X 10.2,
485 * but later deprecated in Mac OS X 10.4
486 */
487#if __AVAILABILITY_MACROS_USES_AVAILABILITY
488 #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)
489#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
490 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
491#else
492 #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
493#endif
494
495/*
496 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
497 *
498 * Used on declarations introduced in Mac OS X 10.3,
499 * but later deprecated in Mac OS X 10.4
500 */
501#if __AVAILABILITY_MACROS_USES_AVAILABILITY
502 #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)
503#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
504 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
505#else
506 #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
507#endif
508
509/*
510 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
511 *
512 * Used on declarations introduced in Mac OS X 10.5
513 */
514#if __AVAILABILITY_MACROS_USES_AVAILABILITY
515 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_COMPAT_VERSION)
516#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
517 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER UNAVAILABLE_ATTRIBUTE
518#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
519 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER WEAK_IMPORT_ATTRIBUTE
520#else
521 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
522#endif
523
524/*
525 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED
526 *
527 * Used on declarations introduced in Mac OS X 10.5,
528 * and deprecated in Mac OS X 10.5
529 */
530#if __AVAILABILITY_MACROS_USES_AVAILABILITY
531 #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)
532#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
533 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
534#else
535 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
536#endif
537
538/*
539 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
540 *
541 * Used on declarations introduced in Mac OS X 10.0,
542 * but later deprecated in Mac OS X 10.5
543 */
544#if __AVAILABILITY_MACROS_USES_AVAILABILITY
545 #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)
546#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
547 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
548#else
549 #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
550#endif
551
552/*
553 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
554 *
555 * Used on declarations introduced in Mac OS X 10.1,
556 * but later deprecated in Mac OS X 10.5
557 */
558#if __AVAILABILITY_MACROS_USES_AVAILABILITY
559 #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)
560#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
561 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
562#else
563 #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
564#endif
565
566/*
567 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
568 *
569 * Used on declarations introduced in Mac OS X 10.2,
570 * but later deprecated in Mac OS X 10.5
571 */
572#if __AVAILABILITY_MACROS_USES_AVAILABILITY
573 #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)
574#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
575 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
576#else
577 #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
578#endif
579
580/*
581 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
582 *
583 * Used on declarations introduced in Mac OS X 10.3,
584 * but later deprecated in Mac OS X 10.5
585 */
586#if __AVAILABILITY_MACROS_USES_AVAILABILITY
587 #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)
588#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
589 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
590#else
591 #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
592#endif
593
594/*
595 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
596 *
597 * Used on declarations introduced in Mac OS X 10.4,
598 * but later deprecated in Mac OS X 10.5
599 */
600#if __AVAILABILITY_MACROS_USES_AVAILABILITY
601 #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)
602#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
603 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
604#else
605 #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
606#endif
607
608/*
609 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
610 *
611 * Used on declarations introduced in Mac OS X 10.6
612 */
613#if __AVAILABILITY_MACROS_USES_AVAILABILITY
614 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_COMPAT_VERSION)
615#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
616 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER UNAVAILABLE_ATTRIBUTE
617#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
618 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER WEAK_IMPORT_ATTRIBUTE
619#else
620 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
621#endif
622
623/*
624 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED
625 *
626 * Used on declarations introduced in Mac OS X 10.6,
627 * and deprecated in Mac OS X 10.6
628 */
629#if __AVAILABILITY_MACROS_USES_AVAILABILITY
630 #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)
631#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
632 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
633#else
634 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
635#endif
636
637/*
638 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
639 *
640 * Used on declarations introduced in Mac OS X 10.0,
641 * but later deprecated in Mac OS X 10.6
642 */
643#if __AVAILABILITY_MACROS_USES_AVAILABILITY
644 #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)
645#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
646 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
647#else
648 #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
649#endif
650
651/*
652 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
653 *
654 * Used on declarations introduced in Mac OS X 10.1,
655 * but later deprecated in Mac OS X 10.6
656 */
657#if __AVAILABILITY_MACROS_USES_AVAILABILITY
658 #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)
659#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
660 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
661#else
662 #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
663#endif
664
665/*
666 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
667 *
668 * Used on declarations introduced in Mac OS X 10.2,
669 * but later deprecated in Mac OS X 10.6
670 */
671#if __AVAILABILITY_MACROS_USES_AVAILABILITY
672 #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)
673#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
674 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
675#else
676 #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
677#endif
678
679/*
680 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
681 *
682 * Used on declarations introduced in Mac OS X 10.3,
683 * but later deprecated in Mac OS X 10.6
684 */
685#if __AVAILABILITY_MACROS_USES_AVAILABILITY
686 #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)
687#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
688 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
689#else
690 #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
691#endif
692
693/*
694 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
695 *
696 * Used on declarations introduced in Mac OS X 10.4,
697 * but later deprecated in Mac OS X 10.6
698 */
699#if __AVAILABILITY_MACROS_USES_AVAILABILITY
700 #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)
701#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
702 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
703#else
704 #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
705#endif
706
707/*
708 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
709 *
710 * Used on declarations introduced in Mac OS X 10.5,
711 * but later deprecated in Mac OS X 10.6
712 */
713#if __AVAILABILITY_MACROS_USES_AVAILABILITY
714 #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)
715#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
716 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
717#else
718 #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
719#endif
720
721/*
722 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
723 *
724 * Used on declarations introduced in Mac OS X 10.7
725 */
726#if __AVAILABILITY_MACROS_USES_AVAILABILITY
727 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_COMPAT_VERSION)
728#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
729 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER UNAVAILABLE_ATTRIBUTE
730#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
731 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER WEAK_IMPORT_ATTRIBUTE
732#else
733 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
734#endif
735
736/*
737 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED
738 *
739 * Used on declarations introduced in Mac OS X 10.7,
740 * and deprecated in Mac OS X 10.7
741 */
742#if __AVAILABILITY_MACROS_USES_AVAILABILITY
743 #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)
744#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
745 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
746#else
747 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
748#endif
749
750/*
751 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
752 *
753 * Used on declarations introduced in Mac OS X 10.0,
754 * but later deprecated in Mac OS X 10.7
755 */
756#if __AVAILABILITY_MACROS_USES_AVAILABILITY
757 #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)
758#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
759 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
760#else
761 #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
762#endif
763
764/*
765 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
766 *
767 * Used on declarations introduced in Mac OS X 10.1,
768 * but later deprecated in Mac OS X 10.7
769 */
770#if __AVAILABILITY_MACROS_USES_AVAILABILITY
771 #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)
772#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
773 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
774#else
775 #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
776#endif
777
778/*
779 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
780 *
781 * Used on declarations introduced in Mac OS X 10.2,
782 * but later deprecated in Mac OS X 10.7
783 */
784#if __AVAILABILITY_MACROS_USES_AVAILABILITY
785 #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)
786#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
787 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
788#else
789 #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
790#endif
791
792/*
793 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
794 *
795 * Used on declarations introduced in Mac OS X 10.3,
796 * but later deprecated in Mac OS X 10.7
797 */
798#if __AVAILABILITY_MACROS_USES_AVAILABILITY
799 #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)
800#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
801 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
802#else
803 #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
804#endif
805
806/*
807 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
808 *
809 * Used on declarations introduced in Mac OS X 10.4,
810 * but later deprecated in Mac OS X 10.7
811 */
812#if __AVAILABILITY_MACROS_USES_AVAILABILITY
813 #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)
814#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
815 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
816#else
817 #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
818#endif
819
820/*
821 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
822 *
823 * Used on declarations introduced in Mac OS X 10.5,
824 * but later deprecated in Mac OS X 10.7
825 */
826#if __AVAILABILITY_MACROS_USES_AVAILABILITY
827 #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)
828#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
829 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
830#else
831 #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
832#endif
833
834/*
835 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
836 *
837 * Used on declarations introduced in Mac OS X 10.6,
838 * but later deprecated in Mac OS X 10.7
839 */
840#if __AVAILABILITY_MACROS_USES_AVAILABILITY
841 #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)
842#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
843 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
844#else
845 #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
846#endif
847
848/*
849 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_13
850 *
851 * Used on declarations introduced in Mac OS X 10.6,
852 * but later deprecated in Mac OS X 10.13
853 */
854#if __AVAILABILITY_MACROS_USES_AVAILABILITY
855#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)
856#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
857#define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_13 DEPRECATED_ATTRIBUTE
858#else
859#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
860#endif
861
862/*
863 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
864 *
865 * Used on declarations introduced in Mac OS X 10.8
866 */
867#if __AVAILABILITY_MACROS_USES_AVAILABILITY
868 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_COMPAT_VERSION)
869#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8
870 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER UNAVAILABLE_ATTRIBUTE
871#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
872 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER WEAK_IMPORT_ATTRIBUTE
873#else
874 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
875#endif
876
877/*
878 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED
879 *
880 * Used on declarations introduced in Mac OS X 10.8,
881 * and deprecated in Mac OS X 10.8
882 */
883#if __AVAILABILITY_MACROS_USES_AVAILABILITY
884 #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)
885#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
886 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
887#else
888 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
889#endif
890
891/*
892 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
893 *
894 * Used on declarations introduced in Mac OS X 10.0,
895 * but later deprecated in Mac OS X 10.8
896 */
897#if __AVAILABILITY_MACROS_USES_AVAILABILITY
898 #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)
899#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
900 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
901#else
902 #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
903#endif
904
905/*
906 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
907 *
908 * Used on declarations introduced in Mac OS X 10.1,
909 * but later deprecated in Mac OS X 10.8
910 */
911#if __AVAILABILITY_MACROS_USES_AVAILABILITY
912 #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)
913#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
914 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
915#else
916 #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
917#endif
918
919/*
920 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
921 *
922 * Used on declarations introduced in Mac OS X 10.2,
923 * but later deprecated in Mac OS X 10.8
924 */
925#if __AVAILABILITY_MACROS_USES_AVAILABILITY
926 #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)
927#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
928 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
929#else
930 #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
931#endif
932
933/*
934 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
935 *
936 * Used on declarations introduced in Mac OS X 10.3,
937 * but later deprecated in Mac OS X 10.8
938 */
939#if __AVAILABILITY_MACROS_USES_AVAILABILITY
940 #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)
941#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
942 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
943#else
944 #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
945#endif
946
947/*
948 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
949 *
950 * Used on declarations introduced in Mac OS X 10.4,
951 * but later deprecated in Mac OS X 10.8
952 */
953#if __AVAILABILITY_MACROS_USES_AVAILABILITY
954 #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)
955#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
956 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
957#else
958 #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
959#endif
960
961/*
962 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
963 *
964 * Used on declarations introduced in Mac OS X 10.5,
965 * but later deprecated in Mac OS X 10.8
966 */
967#if __AVAILABILITY_MACROS_USES_AVAILABILITY
968 #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)
969#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
970 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
971#else
972 #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
973#endif
974
975/*
976 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
977 *
978 * Used on declarations introduced in Mac OS X 10.6,
979 * but later deprecated in Mac OS X 10.8
980 */
981#if __AVAILABILITY_MACROS_USES_AVAILABILITY
982 #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)
983#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
984 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
985#else
986 #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
987#endif
988
989/*
990 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
991 *
992 * Used on declarations introduced in Mac OS X 10.7,
993 * but later deprecated in Mac OS X 10.8
994 */
995#if __AVAILABILITY_MACROS_USES_AVAILABILITY
996 #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)
997#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
998 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
999#else
1000 #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
1001#endif
1002
1003/*
1004 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
1005 *
1006 * Used on declarations introduced in Mac OS X 10.9
1007 */
1008#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1009 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_COMPAT_VERSION)
1010#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
1011 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER UNAVAILABLE_ATTRIBUTE
1012#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9
1013 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER WEAK_IMPORT_ATTRIBUTE
1014#else
1015 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
1016#endif
1017
1018/*
1019 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED
1020 *
1021 * Used on declarations introduced in Mac OS X 10.9,
1022 * and deprecated in Mac OS X 10.9
1023 */
1024#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1025 #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)
1026#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1027 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1028#else
1029 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
1030#endif
1031
1032/*
1033 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1034 *
1035 * Used on declarations introduced in Mac OS X 10.0,
1036 * but later deprecated in Mac OS X 10.9
1037 */
1038#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1039 #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)
1040#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1041 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1042#else
1043 #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
1044#endif
1045
1046/*
1047 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1048 *
1049 * Used on declarations introduced in Mac OS X 10.1,
1050 * but later deprecated in Mac OS X 10.9
1051 */
1052#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1053 #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)
1054#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1055 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1056#else
1057 #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
1058#endif
1059
1060/*
1061 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1062 *
1063 * Used on declarations introduced in Mac OS X 10.2,
1064 * but later deprecated in Mac OS X 10.9
1065 */
1066#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1067 #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)
1068#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1069 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1070#else
1071 #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
1072#endif
1073
1074/*
1075 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1076 *
1077 * Used on declarations introduced in Mac OS X 10.3,
1078 * but later deprecated in Mac OS X 10.9
1079 */
1080#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1081 #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)
1082#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1083 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1084#else
1085 #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
1086#endif
1087
1088/*
1089 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1090 *
1091 * Used on declarations introduced in Mac OS X 10.4,
1092 * but later deprecated in Mac OS X 10.9
1093 */
1094#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1095 #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)
1096#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1097 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1098#else
1099 #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
1100#endif
1101
1102/*
1103 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1104 *
1105 * Used on declarations introduced in Mac OS X 10.5,
1106 * but later deprecated in Mac OS X 10.9
1107 */
1108#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1109 #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)
1110#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1111 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1112#else
1113 #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
1114#endif
1115
1116/*
1117 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1118 *
1119 * Used on declarations introduced in Mac OS X 10.6,
1120 * but later deprecated in Mac OS X 10.9
1121 */
1122#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1123 #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)
1124#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1125 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1126#else
1127 #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
1128#endif
1129
1130/*
1131 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1132 *
1133 * Used on declarations introduced in Mac OS X 10.7,
1134 * but later deprecated in Mac OS X 10.9
1135 */
1136#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1137 #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)
1138#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1139 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1140#else
1141 #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
1142#endif
1143
1144/*
1145 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1146 *
1147 * Used on declarations introduced in Mac OS X 10.8,
1148 * but later deprecated in Mac OS X 10.9
1149 */
1150#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1151 #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)
1152#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1153 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1154#else
1155 #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
1156#endif
1157
1158/*
1159 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
1160 *
1161 * Used on declarations introduced in Mac OS X 10.10
1162 */
1163#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1164 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_COMPAT_VERSION)
1165#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10
1166 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER UNAVAILABLE_ATTRIBUTE
1167#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
1168 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER WEAK_IMPORT_ATTRIBUTE
1169#else
1170 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
1171#endif
1172
1173/*
1174 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED
1175 *
1176 * Used on declarations introduced in Mac OS X 10.10,
1177 * and deprecated in Mac OS X 10.10
1178 */
1179#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1180 #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)
1181#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1182 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1183#else
1184 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
1185#endif
1186
1187/*
1188 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1189 *
1190 * Used on declarations introduced in Mac OS X 10.0,
1191 * but later deprecated in Mac OS X 10.10
1192 */
1193#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1194 #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)
1195#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1196 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1197#else
1198 #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
1199#endif
1200
1201/*
1202 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1203 *
1204 * Used on declarations introduced in Mac OS X 10.1,
1205 * but later deprecated in Mac OS X 10.10
1206 */
1207#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1208 #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)
1209#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1210 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1211#else
1212 #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
1213#endif
1214
1215/*
1216 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1217 *
1218 * Used on declarations introduced in Mac OS X 10.2,
1219 * but later deprecated in Mac OS X 10.10
1220 */
1221#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1222 #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)
1223#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1224 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1225#else
1226 #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
1227#endif
1228
1229/*
1230 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1231 *
1232 * Used on declarations introduced in Mac OS X 10.3,
1233 * but later deprecated in Mac OS X 10.10
1234 */
1235#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1236 #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)
1237#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1238 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1239#else
1240 #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
1241#endif
1242
1243/*
1244 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1245 *
1246 * Used on declarations introduced in Mac OS X 10.4,
1247 * but later deprecated in Mac OS X 10.10
1248 */
1249#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1250 #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)
1251#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1252 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1253#else
1254 #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
1255#endif
1256
1257/*
1258 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1259 *
1260 * Used on declarations introduced in Mac OS X 10.5,
1261 * but later deprecated in Mac OS X 10.10
1262 */
1263#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1264 #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)
1265#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1266 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1267#else
1268 #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
1269#endif
1270
1271/*
1272 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1273 *
1274 * Used on declarations introduced in Mac OS X 10.6,
1275 * but later deprecated in Mac OS X 10.10
1276 */
1277#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1278 #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)
1279#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1280 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1281#else
1282 #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
1283#endif
1284
1285/*
1286 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1287 *
1288 * Used on declarations introduced in Mac OS X 10.7,
1289 * but later deprecated in Mac OS X 10.10
1290 */
1291#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1292 #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)
1293#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1294 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1295#else
1296 #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
1297#endif
1298
1299/*
1300 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1301 *
1302 * Used on declarations introduced in Mac OS X 10.8,
1303 * but later deprecated in Mac OS X 10.10
1304 */
1305#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1306 #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)
1307#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1308 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1309#else
1310 #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
1311#endif
1312
1313/*
1314 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1315 *
1316 * Used on declarations introduced in Mac OS X 10.9,
1317 * but later deprecated in Mac OS X 10.10
1318 */
1319#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1320 #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)
1321#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1322 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1323#else
1324 #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
1325#endif
1326
1327/*
1328 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER
1329 *
1330 * Used on declarations introduced in Mac OS X 10.10.2
1331 */
1332#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1333 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10_2, __IPHONE_COMPAT_VERSION)
1334#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10_2
1335 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER UNAVAILABLE_ATTRIBUTE
1336#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10_2
1337 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
1338#else
1339 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER
1340#endif
1341
1342/*
1343 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED
1344 *
1345 * Used on declarations introduced in Mac OS X 10.10.2,
1346 * and deprecated in Mac OS X 10.10.2
1347 */
1348#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1349 #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)
1350#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1351 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1352#else
1353 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER
1354#endif
1355
1356/*
1357 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1358 *
1359 * Used on declarations introduced in Mac OS X 10.0,
1360 * but later deprecated in Mac OS X 10.10.2
1361 */
1362#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1363 #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)
1364#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1365 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1366#else
1367 #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
1368#endif
1369
1370/*
1371 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1372 *
1373 * Used on declarations introduced in Mac OS X 10.1,
1374 * but later deprecated in Mac OS X 10.10.2
1375 */
1376#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1377 #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)
1378#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1379 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1380#else
1381 #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
1382#endif
1383
1384/*
1385 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1386 *
1387 * Used on declarations introduced in Mac OS X 10.2,
1388 * but later deprecated in Mac OS X 10.10.2
1389 */
1390#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1391 #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)
1392#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1393 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1394#else
1395 #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
1396#endif
1397
1398/*
1399 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1400 *
1401 * Used on declarations introduced in Mac OS X 10.3,
1402 * but later deprecated in Mac OS X 10.10.2
1403 */
1404#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1405 #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)
1406#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1407 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1408#else
1409 #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
1410#endif
1411
1412/*
1413 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1414 *
1415 * Used on declarations introduced in Mac OS X 10.4,
1416 * but later deprecated in Mac OS X 10.10.2
1417 */
1418#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1419 #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)
1420#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1421 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1422#else
1423 #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
1424#endif
1425
1426/*
1427 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1428 *
1429 * Used on declarations introduced in Mac OS X 10.5,
1430 * but later deprecated in Mac OS X 10.10.2
1431 */
1432#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1433 #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)
1434#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1435 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1436#else
1437 #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
1438#endif
1439
1440/*
1441 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1442 *
1443 * Used on declarations introduced in Mac OS X 10.6,
1444 * but later deprecated in Mac OS X 10.10.2
1445 */
1446#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1447 #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)
1448#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1449 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1450#else
1451 #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
1452#endif
1453
1454/*
1455 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1456 *
1457 * Used on declarations introduced in Mac OS X 10.7,
1458 * but later deprecated in Mac OS X 10.10.2
1459 */
1460#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1461 #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)
1462#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1463 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1464#else
1465 #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
1466#endif
1467
1468/*
1469 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1470 *
1471 * Used on declarations introduced in Mac OS X 10.8,
1472 * but later deprecated in Mac OS X 10.10.2
1473 */
1474#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1475 #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)
1476#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1477 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1478#else
1479 #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
1480#endif
1481
1482/*
1483 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1484 *
1485 * Used on declarations introduced in Mac OS X 10.9,
1486 * but later deprecated in Mac OS X 10.10.2
1487 */
1488#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1489 #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)
1490#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1491 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1492#else
1493 #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
1494#endif
1495
1496/*
1497 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1498 *
1499 * Used on declarations introduced in Mac OS X 10.10,
1500 * but later deprecated in Mac OS X 10.10.2
1501 */
1502#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1503 #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)
1504#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1505 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1506#else
1507 #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
1508#endif
1509
1510/*
1511 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER
1512 *
1513 * Used on declarations introduced in Mac OS X 10.10.3
1514 */
1515#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1516 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10_3, __IPHONE_COMPAT_VERSION)
1517#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10_3
1518 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER UNAVAILABLE_ATTRIBUTE
1519#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10_3
1520 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
1521#else
1522 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER
1523#endif
1524
1525/*
1526 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED
1527 *
1528 * Used on declarations introduced in Mac OS X 10.10.3,
1529 * and deprecated in Mac OS X 10.10.3
1530 */
1531#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1532 #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)
1533#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1534 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1535#else
1536 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER
1537#endif
1538
1539/*
1540 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1541 *
1542 * Used on declarations introduced in Mac OS X 10.0,
1543 * but later deprecated in Mac OS X 10.10.3
1544 */
1545#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1546 #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)
1547#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1548 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1549#else
1550 #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
1551#endif
1552
1553/*
1554 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1555 *
1556 * Used on declarations introduced in Mac OS X 10.1,
1557 * but later deprecated in Mac OS X 10.10.3
1558 */
1559#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1560 #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)
1561#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1562 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1563#else
1564 #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
1565#endif
1566
1567/*
1568 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1569 *
1570 * Used on declarations introduced in Mac OS X 10.2,
1571 * but later deprecated in Mac OS X 10.10.3
1572 */
1573#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1574 #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)
1575#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1576 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1577#else
1578 #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
1579#endif
1580
1581/*
1582 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1583 *
1584 * Used on declarations introduced in Mac OS X 10.3,
1585 * but later deprecated in Mac OS X 10.10.3
1586 */
1587#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1588 #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)
1589#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1590 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1591#else
1592 #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
1593#endif
1594
1595/*
1596 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1597 *
1598 * Used on declarations introduced in Mac OS X 10.4,
1599 * but later deprecated in Mac OS X 10.10.3
1600 */
1601#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1602 #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)
1603#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1604 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1605#else
1606 #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
1607#endif
1608
1609/*
1610 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1611 *
1612 * Used on declarations introduced in Mac OS X 10.5,
1613 * but later deprecated in Mac OS X 10.10.3
1614 */
1615#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1616 #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)
1617#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1618 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1619#else
1620 #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
1621#endif
1622
1623/*
1624 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1625 *
1626 * Used on declarations introduced in Mac OS X 10.6,
1627 * but later deprecated in Mac OS X 10.10.3
1628 */
1629#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1630 #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)
1631#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1632 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1633#else
1634 #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
1635#endif
1636
1637/*
1638 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1639 *
1640 * Used on declarations introduced in Mac OS X 10.7,
1641 * but later deprecated in Mac OS X 10.10.3
1642 */
1643#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1644 #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)
1645#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1646 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1647#else
1648 #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
1649#endif
1650
1651/*
1652 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1653 *
1654 * Used on declarations introduced in Mac OS X 10.8,
1655 * but later deprecated in Mac OS X 10.10.3
1656 */
1657#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1658 #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)
1659#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1660 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1661#else
1662 #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
1663#endif
1664
1665/*
1666 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1667 *
1668 * Used on declarations introduced in Mac OS X 10.9,
1669 * but later deprecated in Mac OS X 10.10.3
1670 */
1671#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1672 #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)
1673#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1674 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1675#else
1676 #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
1677#endif
1678
1679/*
1680 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1681 *
1682 * Used on declarations introduced in Mac OS X 10.10,
1683 * but later deprecated in Mac OS X 10.10.3
1684 */
1685#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1686 #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)
1687#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1688 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1689#else
1690 #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
1691#endif
1692
1693/*
1694 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1695 *
1696 * Used on declarations introduced in Mac OS X 10.10.2,
1697 * but later deprecated in Mac OS X 10.10.3
1698 */
1699#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1700 #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)
1701#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1702 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1703#else
1704 #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
1705#endif
1706
1707/*
1708 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER
1709 *
1710 * Used on declarations introduced in Mac OS X 10.11
1711 */
1712#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1713 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_COMPAT_VERSION)
1714#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11
1715 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER UNAVAILABLE_ATTRIBUTE
1716#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11
1717 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER WEAK_IMPORT_ATTRIBUTE
1718#else
1719 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER
1720#endif
1721
1722/*
1723 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED
1724 *
1725 * Used on declarations introduced in Mac OS X 10.11,
1726 * and deprecated in Mac OS X 10.11
1727 */
1728#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1729 #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)
1730#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1731 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1732#else
1733 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER
1734#endif
1735
1736/*
1737 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1738 *
1739 * Used on declarations introduced in Mac OS X 10.0,
1740 * but later deprecated in Mac OS X 10.11
1741 */
1742#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1743 #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)
1744#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1745 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1746#else
1747 #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
1748#endif
1749
1750/*
1751 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1752 *
1753 * Used on declarations introduced in Mac OS X 10.1,
1754 * but later deprecated in Mac OS X 10.11
1755 */
1756#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1757 #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)
1758#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1759 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1760#else
1761 #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
1762#endif
1763
1764/*
1765 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1766 *
1767 * Used on declarations introduced in Mac OS X 10.2,
1768 * but later deprecated in Mac OS X 10.11
1769 */
1770#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1771 #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)
1772#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1773 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1774#else
1775 #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
1776#endif
1777
1778/*
1779 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1780 *
1781 * Used on declarations introduced in Mac OS X 10.3,
1782 * but later deprecated in Mac OS X 10.11
1783 */
1784#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1785 #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)
1786#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1787 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1788#else
1789 #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
1790#endif
1791
1792/*
1793 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1794 *
1795 * Used on declarations introduced in Mac OS X 10.4,
1796 * but later deprecated in Mac OS X 10.11
1797 */
1798#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1799 #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)
1800#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1801 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1802#else
1803 #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
1804#endif
1805
1806/*
1807 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1808 *
1809 * Used on declarations introduced in Mac OS X 10.5,
1810 * but later deprecated in Mac OS X 10.11
1811 */
1812#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1813 #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)
1814#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1815 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1816#else
1817 #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
1818#endif
1819
1820/*
1821 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1822 *
1823 * Used on declarations introduced in Mac OS X 10.6,
1824 * but later deprecated in Mac OS X 10.11
1825 */
1826#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1827 #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)
1828#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1829 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1830#else
1831 #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
1832#endif
1833
1834/*
1835 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1836 *
1837 * Used on declarations introduced in Mac OS X 10.7,
1838 * but later deprecated in Mac OS X 10.11
1839 */
1840#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1841 #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)
1842#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1843 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1844#else
1845 #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
1846#endif
1847
1848/*
1849 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1850 *
1851 * Used on declarations introduced in Mac OS X 10.8,
1852 * but later deprecated in Mac OS X 10.11
1853 */
1854#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1855 #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)
1856#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1857 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1858#else
1859 #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
1860#endif
1861
1862/*
1863 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1864 *
1865 * Used on declarations introduced in Mac OS X 10.9,
1866 * but later deprecated in Mac OS X 10.11
1867 */
1868#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1869 #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)
1870#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1871 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1872#else
1873 #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
1874#endif
1875
1876/*
1877 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1878 *
1879 * Used on declarations introduced in Mac OS X 10.10,
1880 * but later deprecated in Mac OS X 10.11
1881 */
1882#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1883 #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)
1884#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1885 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1886#else
1887 #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
1888#endif
1889
1890/*
1891 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1892 *
1893 * Used on declarations introduced in Mac OS X 10.10.2,
1894 * but later deprecated in Mac OS X 10.11
1895 */
1896#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1897 #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)
1898#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1899 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1900#else
1901 #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
1902#endif
1903
1904/*
1905 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1906 *
1907 * Used on declarations introduced in Mac OS X 10.10.3,
1908 * but later deprecated in Mac OS X 10.11
1909 */
1910#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1911 #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)
1912#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1913 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1914#else
1915 #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
1916#endif
1917
1918/*
1919 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER
1920 *
1921 * Used on declarations introduced in Mac OS X 10.11.2
1922 */
1923#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1924 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_2, __IPHONE_COMPAT_VERSION)
1925#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_2
1926 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER UNAVAILABLE_ATTRIBUTE
1927#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_2
1928 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
1929#else
1930 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER
1931#endif
1932
1933/*
1934 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED
1935 *
1936 * Used on declarations introduced in Mac OS X 10.11.2,
1937 * and deprecated in Mac OS X 10.11.2
1938 */
1939#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1940 #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)
1941#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1942 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1943#else
1944 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER
1945#endif
1946
1947/*
1948 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1949 *
1950 * Used on declarations introduced in Mac OS X 10.0,
1951 * but later deprecated in Mac OS X 10.11.2
1952 */
1953#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1954 #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)
1955#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1956 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
1957#else
1958 #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
1959#endif
1960
1961/*
1962 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1963 *
1964 * Used on declarations introduced in Mac OS X 10.1,
1965 * but later deprecated in Mac OS X 10.11.2
1966 */
1967#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1968 #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)
1969#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1970 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
1971#else
1972 #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
1973#endif
1974
1975/*
1976 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1977 *
1978 * Used on declarations introduced in Mac OS X 10.2,
1979 * but later deprecated in Mac OS X 10.11.2
1980 */
1981#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1982 #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)
1983#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1984 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
1985#else
1986 #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
1987#endif
1988
1989/*
1990 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1991 *
1992 * Used on declarations introduced in Mac OS X 10.3,
1993 * but later deprecated in Mac OS X 10.11.2
1994 */
1995#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1996 #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)
1997#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1998 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
1999#else
2000 #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
2001#endif
2002
2003/*
2004 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2005 *
2006 * Used on declarations introduced in Mac OS X 10.4,
2007 * but later deprecated in Mac OS X 10.11.2
2008 */
2009#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2010 #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)
2011#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2012 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2013#else
2014 #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
2015#endif
2016
2017/*
2018 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2019 *
2020 * Used on declarations introduced in Mac OS X 10.5,
2021 * but later deprecated in Mac OS X 10.11.2
2022 */
2023#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2024 #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)
2025#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2026 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2027#else
2028 #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
2029#endif
2030
2031/*
2032 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2033 *
2034 * Used on declarations introduced in Mac OS X 10.6,
2035 * but later deprecated in Mac OS X 10.11.2
2036 */
2037#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2038 #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)
2039#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2040 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2041#else
2042 #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
2043#endif
2044
2045/*
2046 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2047 *
2048 * Used on declarations introduced in Mac OS X 10.7,
2049 * but later deprecated in Mac OS X 10.11.2
2050 */
2051#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2052 #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)
2053#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2054 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2055#else
2056 #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
2057#endif
2058
2059/*
2060 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2061 *
2062 * Used on declarations introduced in Mac OS X 10.8,
2063 * but later deprecated in Mac OS X 10.11.2
2064 */
2065#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2066 #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)
2067#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2068 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2069#else
2070 #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
2071#endif
2072
2073/*
2074 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2075 *
2076 * Used on declarations introduced in Mac OS X 10.9,
2077 * but later deprecated in Mac OS X 10.11.2
2078 */
2079#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2080 #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)
2081#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2082 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2083#else
2084 #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
2085#endif
2086
2087/*
2088 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2089 *
2090 * Used on declarations introduced in Mac OS X 10.10,
2091 * but later deprecated in Mac OS X 10.11.2
2092 */
2093#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2094 #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)
2095#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2096 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2097#else
2098 #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
2099#endif
2100
2101/*
2102 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2103 *
2104 * Used on declarations introduced in Mac OS X 10.10.2,
2105 * but later deprecated in Mac OS X 10.11.2
2106 */
2107#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2108 #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)
2109#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2110 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2111#else
2112 #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
2113#endif
2114
2115/*
2116 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2117 *
2118 * Used on declarations introduced in Mac OS X 10.10.3,
2119 * but later deprecated in Mac OS X 10.11.2
2120 */
2121#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2122 #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)
2123#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2124 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2125#else
2126 #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
2127#endif
2128
2129/*
2130 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2131 *
2132 * Used on declarations introduced in Mac OS X 10.11,
2133 * but later deprecated in Mac OS X 10.11.2
2134 */
2135#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2136 #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)
2137#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2138 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2139#else
2140 #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
2141#endif
2142
2143/*
2144 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER
2145 *
2146 * Used on declarations introduced in Mac OS X 10.11.3
2147 */
2148#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2149 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_3, __IPHONE_COMPAT_VERSION)
2150#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_3
2151 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER UNAVAILABLE_ATTRIBUTE
2152#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_3
2153 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
2154#else
2155 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER
2156#endif
2157
2158/*
2159 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED
2160 *
2161 * Used on declarations introduced in Mac OS X 10.11.3,
2162 * and deprecated in Mac OS X 10.11.3
2163 */
2164#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2165 #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)
2166#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2167 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2168#else
2169 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER
2170#endif
2171
2172/*
2173 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2174 *
2175 * Used on declarations introduced in Mac OS X 10.0,
2176 * but later deprecated in Mac OS X 10.11.3
2177 */
2178#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2179 #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)
2180#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2181 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2182#else
2183 #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
2184#endif
2185
2186/*
2187 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2188 *
2189 * Used on declarations introduced in Mac OS X 10.1,
2190 * but later deprecated in Mac OS X 10.11.3
2191 */
2192#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2193 #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)
2194#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2195 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2196#else
2197 #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
2198#endif
2199
2200/*
2201 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2202 *
2203 * Used on declarations introduced in Mac OS X 10.2,
2204 * but later deprecated in Mac OS X 10.11.3
2205 */
2206#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2207 #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)
2208#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2209 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2210#else
2211 #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
2212#endif
2213
2214/*
2215 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2216 *
2217 * Used on declarations introduced in Mac OS X 10.3,
2218 * but later deprecated in Mac OS X 10.11.3
2219 */
2220#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2221 #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)
2222#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2223 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2224#else
2225 #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
2226#endif
2227
2228/*
2229 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2230 *
2231 * Used on declarations introduced in Mac OS X 10.4,
2232 * but later deprecated in Mac OS X 10.11.3
2233 */
2234#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2235 #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)
2236#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2237 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2238#else
2239 #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
2240#endif
2241
2242/*
2243 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2244 *
2245 * Used on declarations introduced in Mac OS X 10.5,
2246 * but later deprecated in Mac OS X 10.11.3
2247 */
2248#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2249 #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)
2250#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2251 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2252#else
2253 #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
2254#endif
2255
2256/*
2257 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2258 *
2259 * Used on declarations introduced in Mac OS X 10.6,
2260 * but later deprecated in Mac OS X 10.11.3
2261 */
2262#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2263 #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)
2264#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2265 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2266#else
2267 #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
2268#endif
2269
2270/*
2271 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2272 *
2273 * Used on declarations introduced in Mac OS X 10.7,
2274 * but later deprecated in Mac OS X 10.11.3
2275 */
2276#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2277 #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)
2278#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2279 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2280#else
2281 #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
2282#endif
2283
2284/*
2285 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2286 *
2287 * Used on declarations introduced in Mac OS X 10.8,
2288 * but later deprecated in Mac OS X 10.11.3
2289 */
2290#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2291 #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)
2292#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2293 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2294#else
2295 #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
2296#endif
2297
2298/*
2299 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2300 *
2301 * Used on declarations introduced in Mac OS X 10.9,
2302 * but later deprecated in Mac OS X 10.11.3
2303 */
2304#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2305 #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)
2306#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2307 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2308#else
2309 #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
2310#endif
2311
2312/*
2313 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2314 *
2315 * Used on declarations introduced in Mac OS X 10.10,
2316 * but later deprecated in Mac OS X 10.11.3
2317 */
2318#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2319 #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)
2320#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2321 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2322#else
2323 #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
2324#endif
2325
2326/*
2327 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2328 *
2329 * Used on declarations introduced in Mac OS X 10.10.2,
2330 * but later deprecated in Mac OS X 10.11.3
2331 */
2332#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2333 #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)
2334#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2335 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2336#else
2337 #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
2338#endif
2339
2340/*
2341 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2342 *
2343 * Used on declarations introduced in Mac OS X 10.10.3,
2344 * but later deprecated in Mac OS X 10.11.3
2345 */
2346#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2347 #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)
2348#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2349 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2350#else
2351 #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
2352#endif
2353
2354/*
2355 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2356 *
2357 * Used on declarations introduced in Mac OS X 10.11,
2358 * but later deprecated in Mac OS X 10.11.3
2359 */
2360#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2361 #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)
2362#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2363 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2364#else
2365 #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
2366#endif
2367
2368/*
2369 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2370 *
2371 * Used on declarations introduced in Mac OS X 10.11.2,
2372 * but later deprecated in Mac OS X 10.11.3
2373 */
2374#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2375 #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)
2376#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2377 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2378#else
2379 #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
2380#endif
2381
2382/*
2383 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER
2384 *
2385 * Used on declarations introduced in Mac OS X 10.11.4
2386 */
2387#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2388 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_4, __IPHONE_COMPAT_VERSION)
2389#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_4
2390 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER UNAVAILABLE_ATTRIBUTE
2391#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_4
2392 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
2393#else
2394 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER
2395#endif
2396
2397/*
2398 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED
2399 *
2400 * Used on declarations introduced in Mac OS X 10.11.4,
2401 * and deprecated in Mac OS X 10.11.4
2402 */
2403#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2404 #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)
2405#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2406 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2407#else
2408 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER
2409#endif
2410
2411/*
2412 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2413 *
2414 * Used on declarations introduced in Mac OS X 10.0,
2415 * but later deprecated in Mac OS X 10.11.4
2416 */
2417#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2418 #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)
2419#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2420 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2421#else
2422 #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
2423#endif
2424
2425/*
2426 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2427 *
2428 * Used on declarations introduced in Mac OS X 10.1,
2429 * but later deprecated in Mac OS X 10.11.4
2430 */
2431#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2432 #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)
2433#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2434 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2435#else
2436 #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
2437#endif
2438
2439/*
2440 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2441 *
2442 * Used on declarations introduced in Mac OS X 10.2,
2443 * but later deprecated in Mac OS X 10.11.4
2444 */
2445#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2446 #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)
2447#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2448 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2449#else
2450 #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
2451#endif
2452
2453/*
2454 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2455 *
2456 * Used on declarations introduced in Mac OS X 10.3,
2457 * but later deprecated in Mac OS X 10.11.4
2458 */
2459#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2460 #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)
2461#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2462 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2463#else
2464 #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
2465#endif
2466
2467/*
2468 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2469 *
2470 * Used on declarations introduced in Mac OS X 10.4,
2471 * but later deprecated in Mac OS X 10.11.4
2472 */
2473#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2474 #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)
2475#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2476 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2477#else
2478 #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
2479#endif
2480
2481/*
2482 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2483 *
2484 * Used on declarations introduced in Mac OS X 10.5,
2485 * but later deprecated in Mac OS X 10.11.4
2486 */
2487#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2488 #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)
2489#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2490 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2491#else
2492 #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
2493#endif
2494
2495/*
2496 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2497 *
2498 * Used on declarations introduced in Mac OS X 10.6,
2499 * but later deprecated in Mac OS X 10.11.4
2500 */
2501#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2502 #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)
2503#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2504 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2505#else
2506 #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
2507#endif
2508
2509/*
2510 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2511 *
2512 * Used on declarations introduced in Mac OS X 10.7,
2513 * but later deprecated in Mac OS X 10.11.4
2514 */
2515#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2516 #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)
2517#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2518 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2519#else
2520 #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
2521#endif
2522
2523/*
2524 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2525 *
2526 * Used on declarations introduced in Mac OS X 10.8,
2527 * but later deprecated in Mac OS X 10.11.4
2528 */
2529#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2530 #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)
2531#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2532 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2533#else
2534 #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
2535#endif
2536
2537/*
2538 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2539 *
2540 * Used on declarations introduced in Mac OS X 10.9,
2541 * but later deprecated in Mac OS X 10.11.4
2542 */
2543#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2544 #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)
2545#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2546 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2547#else
2548 #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
2549#endif
2550
2551/*
2552 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2553 *
2554 * Used on declarations introduced in Mac OS X 10.10,
2555 * but later deprecated in Mac OS X 10.11.4
2556 */
2557#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2558 #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)
2559#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2560 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2561#else
2562 #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
2563#endif
2564
2565/*
2566 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2567 *
2568 * Used on declarations introduced in Mac OS X 10.10.2,
2569 * but later deprecated in Mac OS X 10.11.4
2570 */
2571#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2572 #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)
2573#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2574 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2575#else
2576 #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
2577#endif
2578
2579/*
2580 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2581 *
2582 * Used on declarations introduced in Mac OS X 10.10.3,
2583 * but later deprecated in Mac OS X 10.11.4
2584 */
2585#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2586 #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)
2587#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2588 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2589#else
2590 #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
2591#endif
2592
2593/*
2594 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2595 *
2596 * Used on declarations introduced in Mac OS X 10.11,
2597 * but later deprecated in Mac OS X 10.11.4
2598 */
2599#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2600 #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)
2601#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2602 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2603#else
2604 #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
2605#endif
2606
2607/*
2608 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2609 *
2610 * Used on declarations introduced in Mac OS X 10.11.2,
2611 * but later deprecated in Mac OS X 10.11.4
2612 */
2613#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2614 #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)
2615#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2616 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2617#else
2618 #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
2619#endif
2620
2621/*
2622 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2623 *
2624 * Used on declarations introduced in Mac OS X 10.11.3,
2625 * but later deprecated in Mac OS X 10.11.4
2626 */
2627#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2628 #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)
2629#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2630 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2631#else
2632 #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
2633#endif
2634
2635/*
2636 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
2637 *
2638 * Used on declarations introduced in Mac OS X 10.12
2639 */
2640#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2641 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_COMPAT_VERSION)
2642#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
2643 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER UNAVAILABLE_ATTRIBUTE
2644#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
2645 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER WEAK_IMPORT_ATTRIBUTE
2646#else
2647 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
2648#endif
2649
2650/*
2651 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED
2652 *
2653 * Used on declarations introduced in Mac OS X 10.12,
2654 * and deprecated in Mac OS X 10.12
2655 */
2656#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2657 #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)
2658#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2659 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2660#else
2661 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
2662#endif
2663
2664/*
2665 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2666 *
2667 * Used on declarations introduced in Mac OS X 10.0,
2668 * but later deprecated in Mac OS X 10.12
2669 */
2670#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2671 #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)
2672#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2673 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2674#else
2675 #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
2676#endif
2677
2678/*
2679 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2680 *
2681 * Used on declarations introduced in Mac OS X 10.1,
2682 * but later deprecated in Mac OS X 10.12
2683 */
2684#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2685 #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)
2686#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2687 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2688#else
2689 #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
2690#endif
2691
2692/*
2693 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2694 *
2695 * Used on declarations introduced in Mac OS X 10.2,
2696 * but later deprecated in Mac OS X 10.12
2697 */
2698#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2699 #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)
2700#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2701 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2702#else
2703 #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
2704#endif
2705
2706/*
2707 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2708 *
2709 * Used on declarations introduced in Mac OS X 10.3,
2710 * but later deprecated in Mac OS X 10.12
2711 */
2712#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2713 #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)
2714#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2715 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2716#else
2717 #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
2718#endif
2719
2720/*
2721 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2722 *
2723 * Used on declarations introduced in Mac OS X 10.4,
2724 * but later deprecated in Mac OS X 10.12
2725 */
2726#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2727 #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)
2728#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2729 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2730#else
2731 #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
2732#endif
2733
2734/*
2735 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2736 *
2737 * Used on declarations introduced in Mac OS X 10.5,
2738 * but later deprecated in Mac OS X 10.12
2739 */
2740#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2741 #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)
2742#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2743 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2744#else
2745 #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
2746#endif
2747
2748/*
2749 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2750 *
2751 * Used on declarations introduced in Mac OS X 10.6,
2752 * but later deprecated in Mac OS X 10.12
2753 */
2754#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2755 #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)
2756#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2757 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2758#else
2759 #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
2760#endif
2761
2762/*
2763 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2764 *
2765 * Used on declarations introduced in Mac OS X 10.7,
2766 * but later deprecated in Mac OS X 10.12
2767 */
2768#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2769 #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)
2770#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2771 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2772#else
2773 #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
2774#endif
2775
2776/*
2777 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2778 *
2779 * Used on declarations introduced in Mac OS X 10.8,
2780 * but later deprecated in Mac OS X 10.12
2781 */
2782#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2783 #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)
2784#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2785 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2786#else
2787 #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
2788#endif
2789
2790/*
2791 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2792 *
2793 * Used on declarations introduced in Mac OS X 10.9,
2794 * but later deprecated in Mac OS X 10.12
2795 */
2796#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2797 #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)
2798#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2799 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2800#else
2801 #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
2802#endif
2803
2804/*
2805 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2806 *
2807 * Used on declarations introduced in Mac OS X 10.10,
2808 * but later deprecated in Mac OS X 10.12
2809 */
2810#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2811 #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)
2812#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2813 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2814#else
2815 #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
2816#endif
2817
2818/*
2819 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2820 *
2821 * Used on declarations introduced in Mac OS X 10.10.2,
2822 * but later deprecated in Mac OS X 10.12
2823 */
2824#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2825 #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)
2826#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2827 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2828#else
2829 #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
2830#endif
2831
2832/*
2833 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2834 *
2835 * Used on declarations introduced in Mac OS X 10.10.3,
2836 * but later deprecated in Mac OS X 10.12
2837 */
2838#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2839 #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)
2840#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2841 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2842#else
2843 #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
2844#endif
2845
2846/*
2847 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2848 *
2849 * Used on declarations introduced in Mac OS X 10.11,
2850 * but later deprecated in Mac OS X 10.12
2851 */
2852#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2853 #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)
2854#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2855 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2856#else
2857 #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
2858#endif
2859
2860/*
2861 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2862 *
2863 * Used on declarations introduced in Mac OS X 10.11.2,
2864 * but later deprecated in Mac OS X 10.12
2865 */
2866#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2867 #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)
2868#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2869 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2870#else
2871 #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
2872#endif
2873
2874/*
2875 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2876 *
2877 * Used on declarations introduced in Mac OS X 10.11.3,
2878 * but later deprecated in Mac OS X 10.12
2879 */
2880#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2881 #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)
2882#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2883 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2884#else
2885 #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
2886#endif
2887
2888/*
2889 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2890 *
2891 * Used on declarations introduced in Mac OS X 10.11.4,
2892 * but later deprecated in Mac OS X 10.12
2893 */
2894#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2895 #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)
2896#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2897 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2898#else
2899 #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
2900#endif
2901
2902/*
2903 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER
2904 *
2905 * Used on declarations introduced in Mac OS X 10.12.1
2906 */
2907#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2908 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_1, __IPHONE_COMPAT_VERSION)
2909#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_1
2910 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER UNAVAILABLE_ATTRIBUTE
2911#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_1
2912 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER WEAK_IMPORT_ATTRIBUTE
2913#else
2914 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER
2915#endif
2916
2917/*
2918 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED
2919 *
2920 * Used on declarations introduced in Mac OS X 10.12.1,
2921 * and deprecated in Mac OS X 10.12.1
2922 */
2923#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2924 #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)
2925#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2926 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2927#else
2928 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER
2929#endif
2930
2931/*
2932 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2933 *
2934 * Used on declarations introduced in Mac OS X 10.0,
2935 * but later deprecated in Mac OS X 10.12.1
2936 */
2937#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2938 #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)
2939#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2940 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2941#else
2942 #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
2943#endif
2944
2945/*
2946 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2947 *
2948 * Used on declarations introduced in Mac OS X 10.1,
2949 * but later deprecated in Mac OS X 10.12.1
2950 */
2951#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2952 #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)
2953#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2954 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2955#else
2956 #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
2957#endif
2958
2959/*
2960 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2961 *
2962 * Used on declarations introduced in Mac OS X 10.2,
2963 * but later deprecated in Mac OS X 10.12.1
2964 */
2965#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2966 #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)
2967#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2968 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2969#else
2970 #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
2971#endif
2972
2973/*
2974 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2975 *
2976 * Used on declarations introduced in Mac OS X 10.3,
2977 * but later deprecated in Mac OS X 10.12.1
2978 */
2979#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2980 #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)
2981#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2982 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2983#else
2984 #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
2985#endif
2986
2987/*
2988 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2989 *
2990 * Used on declarations introduced in Mac OS X 10.4,
2991 * but later deprecated in Mac OS X 10.12.1
2992 */
2993#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2994 #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)
2995#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2996 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2997#else
2998 #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
2999#endif
3000
3001/*
3002 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3003 *
3004 * Used on declarations introduced in Mac OS X 10.5,
3005 * but later deprecated in Mac OS X 10.12.1
3006 */
3007#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3008 #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)
3009#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3010 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3011#else
3012 #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
3013#endif
3014
3015/*
3016 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3017 *
3018 * Used on declarations introduced in Mac OS X 10.6,
3019 * but later deprecated in Mac OS X 10.12.1
3020 */
3021#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3022 #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)
3023#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3024 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3025#else
3026 #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
3027#endif
3028
3029/*
3030 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3031 *
3032 * Used on declarations introduced in Mac OS X 10.7,
3033 * but later deprecated in Mac OS X 10.12.1
3034 */
3035#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3036 #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)
3037#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3038 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3039#else
3040 #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
3041#endif
3042
3043/*
3044 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3045 *
3046 * Used on declarations introduced in Mac OS X 10.8,
3047 * but later deprecated in Mac OS X 10.12.1
3048 */
3049#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3050 #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)
3051#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3052 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3053#else
3054 #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
3055#endif
3056
3057/*
3058 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3059 *
3060 * Used on declarations introduced in Mac OS X 10.9,
3061 * but later deprecated in Mac OS X 10.12.1
3062 */
3063#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3064 #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)
3065#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3066 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3067#else
3068 #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
3069#endif
3070
3071/*
3072 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3073 *
3074 * Used on declarations introduced in Mac OS X 10.10,
3075 * but later deprecated in Mac OS X 10.12.1
3076 */
3077#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3078 #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)
3079#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3080 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3081#else
3082 #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
3083#endif
3084
3085/*
3086 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3087 *
3088 * Used on declarations introduced in Mac OS X 10.10.2,
3089 * but later deprecated in Mac OS X 10.12.1
3090 */
3091#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3092 #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)
3093#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3094 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3095#else
3096 #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
3097#endif
3098
3099/*
3100 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3101 *
3102 * Used on declarations introduced in Mac OS X 10.10.3,
3103 * but later deprecated in Mac OS X 10.12.1
3104 */
3105#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3106 #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)
3107#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3108 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3109#else
3110 #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
3111#endif
3112
3113/*
3114 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3115 *
3116 * Used on declarations introduced in Mac OS X 10.11,
3117 * but later deprecated in Mac OS X 10.12.1
3118 */
3119#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3120 #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)
3121#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3122 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3123#else
3124 #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
3125#endif
3126
3127/*
3128 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3129 *
3130 * Used on declarations introduced in Mac OS X 10.11.2,
3131 * but later deprecated in Mac OS X 10.12.1
3132 */
3133#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3134 #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)
3135#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3136 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3137#else
3138 #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
3139#endif
3140
3141/*
3142 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3143 *
3144 * Used on declarations introduced in Mac OS X 10.11.3,
3145 * but later deprecated in Mac OS X 10.12.1
3146 */
3147#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3148 #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)
3149#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3150 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3151#else
3152 #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
3153#endif
3154
3155/*
3156 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3157 *
3158 * Used on declarations introduced in Mac OS X 10.11.4,
3159 * but later deprecated in Mac OS X 10.12.1
3160 */
3161#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3162 #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)
3163#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3164 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3165#else
3166 #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
3167#endif
3168
3169/*
3170 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3171 *
3172 * Used on declarations introduced in Mac OS X 10.12,
3173 * but later deprecated in Mac OS X 10.12.1
3174 */
3175#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3176 #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)
3177#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3178 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3179#else
3180 #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
3181#endif
3182
3183/*
3184 * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER
3185 *
3186 * Used on declarations introduced in Mac OS X 10.12.2
3187 */
3188#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3189 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_2, __IPHONE_COMPAT_VERSION)
3190#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_2
3191 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER UNAVAILABLE_ATTRIBUTE
3192#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_2
3193 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
3194#else
3195 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER
3196#endif
3197
3198/*
3199 * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED
3200 *
3201 * Used on declarations introduced in Mac OS X 10.12.2,
3202 * and deprecated in Mac OS X 10.12.2
3203 */
3204#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3205 #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)
3206#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3207 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
3208#else
3209 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER
3210#endif
3211
3212/*
3213 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3214 *
3215 * Used on declarations introduced in Mac OS X 10.0,
3216 * but later deprecated in Mac OS X 10.12.2
3217 */
3218#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3219 #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)
3220#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3221 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3222#else
3223 #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
3224#endif
3225
3226/*
3227 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3228 *
3229 * Used on declarations introduced in Mac OS X 10.1,
3230 * but later deprecated in Mac OS X 10.12.2
3231 */
3232#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3233 #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)
3234#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3235 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3236#else
3237 #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
3238#endif
3239
3240/*
3241 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3242 *
3243 * Used on declarations introduced in Mac OS X 10.2,
3244 * but later deprecated in Mac OS X 10.12.2
3245 */
3246#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3247 #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)
3248#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3249 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3250#else
3251 #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
3252#endif
3253
3254/*
3255 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3256 *
3257 * Used on declarations introduced in Mac OS X 10.3,
3258 * but later deprecated in Mac OS X 10.12.2
3259 */
3260#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3261 #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)
3262#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3263 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3264#else
3265 #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
3266#endif
3267
3268/*
3269 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3270 *
3271 * Used on declarations introduced in Mac OS X 10.4,
3272 * but later deprecated in Mac OS X 10.12.2
3273 */
3274#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3275 #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)
3276#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3277 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3278#else
3279 #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
3280#endif
3281
3282/*
3283 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3284 *
3285 * Used on declarations introduced in Mac OS X 10.5,
3286 * but later deprecated in Mac OS X 10.12.2
3287 */
3288#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3289 #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)
3290#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3291 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3292#else
3293 #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
3294#endif
3295
3296/*
3297 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3298 *
3299 * Used on declarations introduced in Mac OS X 10.6,
3300 * but later deprecated in Mac OS X 10.12.2
3301 */
3302#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3303 #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)
3304#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3305 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3306#else
3307 #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
3308#endif
3309
3310/*
3311 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3312 *
3313 * Used on declarations introduced in Mac OS X 10.7,
3314 * but later deprecated in Mac OS X 10.12.2
3315 */
3316#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3317 #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)
3318#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3319 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3320#else
3321 #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
3322#endif
3323
3324/*
3325 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3326 *
3327 * Used on declarations introduced in Mac OS X 10.8,
3328 * but later deprecated in Mac OS X 10.12.2
3329 */
3330#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3331 #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)
3332#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3333 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3334#else
3335 #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
3336#endif
3337
3338/*
3339 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3340 *
3341 * Used on declarations introduced in Mac OS X 10.9,
3342 * but later deprecated in Mac OS X 10.12.2
3343 */
3344#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3345 #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)
3346#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3347 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3348#else
3349 #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
3350#endif
3351
3352/*
3353 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3354 *
3355 * Used on declarations introduced in Mac OS X 10.10,
3356 * but later deprecated in Mac OS X 10.12.2
3357 */
3358#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3359 #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)
3360#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3361 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3362#else
3363 #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
3364#endif
3365
3366/*
3367 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3368 *
3369 * Used on declarations introduced in Mac OS X 10.10.2,
3370 * but later deprecated in Mac OS X 10.12.2
3371 */
3372#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3373 #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)
3374#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3375 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3376#else
3377 #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
3378#endif
3379
3380/*
3381 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3382 *
3383 * Used on declarations introduced in Mac OS X 10.10.3,
3384 * but later deprecated in Mac OS X 10.12.2
3385 */
3386#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3387 #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)
3388#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3389 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3390#else
3391 #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
3392#endif
3393
3394/*
3395 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3396 *
3397 * Used on declarations introduced in Mac OS X 10.11,
3398 * but later deprecated in Mac OS X 10.12.2
3399 */
3400#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3401 #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)
3402#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3403 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3404#else
3405 #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
3406#endif
3407
3408/*
3409 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3410 *
3411 * Used on declarations introduced in Mac OS X 10.11.2,
3412 * but later deprecated in Mac OS X 10.12.2
3413 */
3414#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3415 #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)
3416#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3417 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3418#else
3419 #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
3420#endif
3421
3422/*
3423 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3424 *
3425 * Used on declarations introduced in Mac OS X 10.11.3,
3426 * but later deprecated in Mac OS X 10.12.2
3427 */
3428#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3429 #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)
3430#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3431 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3432#else
3433 #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
3434#endif
3435
3436/*
3437 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3438 *
3439 * Used on declarations introduced in Mac OS X 10.11.4,
3440 * but later deprecated in Mac OS X 10.12.2
3441 */
3442#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3443 #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)
3444#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3445 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3446#else
3447 #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
3448#endif
3449
3450/*
3451 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3452 *
3453 * Used on declarations introduced in Mac OS X 10.12,
3454 * but later deprecated in Mac OS X 10.12.2
3455 */
3456#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3457 #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)
3458#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3459 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3460#else
3461 #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
3462#endif
3463
3464/*
3465 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3466 *
3467 * Used on declarations introduced in Mac OS X 10.12.1,
3468 * but later deprecated in Mac OS X 10.12.2
3469 */
3470#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3471 #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)
3472#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3473 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3474#else
3475 #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
3476#endif
3477
3478/*
3479 * AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER
3480 *
3481 * Used on declarations introduced in Mac OS X 10.12.4
3482 */
3483#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3484 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_4, __IPHONE_COMPAT_VERSION)
3485#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_4
3486 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER UNAVAILABLE_ATTRIBUTE
3487#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_4
3488 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
3489#else
3490 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER
3491#endif
3492
3493/*
3494 * AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED
3495 *
3496 * Used on declarations introduced in Mac OS X 10.12.4,
3497 * and deprecated in Mac OS X 10.12.4
3498 */
3499#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3500 #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)
3501#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3502 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
3503#else
3504 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER
3505#endif
3506
3507/*
3508 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3509 *
3510 * Used on declarations introduced in Mac OS X 10.0,
3511 * but later deprecated in Mac OS X 10.12.4
3512 */
3513#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3514 #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)
3515#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3516 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3517#else
3518 #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
3519#endif
3520
3521/*
3522 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3523 *
3524 * Used on declarations introduced in Mac OS X 10.1,
3525 * but later deprecated in Mac OS X 10.12.4
3526 */
3527#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3528 #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)
3529#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3530 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3531#else
3532 #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
3533#endif
3534
3535/*
3536 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3537 *
3538 * Used on declarations introduced in Mac OS X 10.2,
3539 * but later deprecated in Mac OS X 10.12.4
3540 */
3541#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3542 #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)
3543#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3544 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3545#else
3546 #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
3547#endif
3548
3549/*
3550 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3551 *
3552 * Used on declarations introduced in Mac OS X 10.3,
3553 * but later deprecated in Mac OS X 10.12.4
3554 */
3555#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3556 #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)
3557#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3558 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3559#else
3560 #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
3561#endif
3562
3563/*
3564 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3565 *
3566 * Used on declarations introduced in Mac OS X 10.4,
3567 * but later deprecated in Mac OS X 10.12.4
3568 */
3569#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3570 #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)
3571#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3572 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3573#else
3574 #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
3575#endif
3576
3577/*
3578 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3579 *
3580 * Used on declarations introduced in Mac OS X 10.5,
3581 * but later deprecated in Mac OS X 10.12.4
3582 */
3583#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3584 #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)
3585#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3586 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3587#else
3588 #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
3589#endif
3590
3591/*
3592 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3593 *
3594 * Used on declarations introduced in Mac OS X 10.6,
3595 * but later deprecated in Mac OS X 10.12.4
3596 */
3597#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3598 #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)
3599#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3600 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3601#else
3602 #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
3603#endif
3604
3605/*
3606 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3607 *
3608 * Used on declarations introduced in Mac OS X 10.7,
3609 * but later deprecated in Mac OS X 10.12.4
3610 */
3611#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3612 #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)
3613#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3614 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3615#else
3616 #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
3617#endif
3618
3619/*
3620 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3621 *
3622 * Used on declarations introduced in Mac OS X 10.8,
3623 * but later deprecated in Mac OS X 10.12.4
3624 */
3625#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3626 #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)
3627#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3628 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3629#else
3630 #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
3631#endif
3632
3633/*
3634 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3635 *
3636 * Used on declarations introduced in Mac OS X 10.9,
3637 * but later deprecated in Mac OS X 10.12.4
3638 */
3639#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3640 #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)
3641#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3642 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3643#else
3644 #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
3645#endif
3646
3647/*
3648 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3649 *
3650 * Used on declarations introduced in Mac OS X 10.10,
3651 * but later deprecated in Mac OS X 10.12.4
3652 */
3653#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3654 #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)
3655#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3656 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3657#else
3658 #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
3659#endif
3660
3661/*
3662 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3663 *
3664 * Used on declarations introduced in Mac OS X 10.10.2,
3665 * but later deprecated in Mac OS X 10.12.4
3666 */
3667#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3668 #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)
3669#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3670 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3671#else
3672 #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
3673#endif
3674
3675/*
3676 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3677 *
3678 * Used on declarations introduced in Mac OS X 10.10.3,
3679 * but later deprecated in Mac OS X 10.12.4
3680 */
3681#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3682 #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)
3683#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3684 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3685#else
3686 #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
3687#endif
3688
3689/*
3690 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3691 *
3692 * Used on declarations introduced in Mac OS X 10.11,
3693 * but later deprecated in Mac OS X 10.12.4
3694 */
3695#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3696 #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)
3697#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3698 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3699#else
3700 #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
3701#endif
3702
3703/*
3704 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3705 *
3706 * Used on declarations introduced in Mac OS X 10.11.2,
3707 * but later deprecated in Mac OS X 10.12.4
3708 */
3709#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3710 #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)
3711#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3712 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3713#else
3714 #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
3715#endif
3716
3717/*
3718 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3719 *
3720 * Used on declarations introduced in Mac OS X 10.11.3,
3721 * but later deprecated in Mac OS X 10.12.4
3722 */
3723#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3724 #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)
3725#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3726 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3727#else
3728 #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
3729#endif
3730
3731/*
3732 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3733 *
3734 * Used on declarations introduced in Mac OS X 10.11.4,
3735 * but later deprecated in Mac OS X 10.12.4
3736 */
3737#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3738 #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)
3739#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3740 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3741#else
3742 #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
3743#endif
3744
3745/*
3746 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3747 *
3748 * Used on declarations introduced in Mac OS X 10.12,
3749 * but later deprecated in Mac OS X 10.12.4
3750 */
3751#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3752 #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)
3753#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3754 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3755#else
3756 #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
3757#endif
3758
3759/*
3760 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3761 *
3762 * Used on declarations introduced in Mac OS X 10.12.1,
3763 * but later deprecated in Mac OS X 10.12.4
3764 */
3765#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3766 #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)
3767#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3768 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3769#else
3770 #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
3771#endif
3772
3773/*
3774 * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3775 *
3776 * Used on declarations introduced in Mac OS X 10.12.2,
3777 * but later deprecated in Mac OS X 10.12.4
3778 */
3779#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3780 #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)
3781#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3782 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3783#else
3784 #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
3785#endif
3786
3787/*
3788 * AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
3789 *
3790 * Used on declarations introduced in Mac OS X 10.13
3791 */
3792#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3793 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_13, __IPHONE_COMPAT_VERSION)
3794#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13
3795 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER UNAVAILABLE_ATTRIBUTE
3796#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_13
3797 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER WEAK_IMPORT_ATTRIBUTE
3798#else
3799 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
3800#endif
3801
3802/*
3803 * AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER
3804 *
3805 * Used on declarations introduced in Mac OS X 10.14
3806 */
3807#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3808 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_14, __IPHONE_COMPAT_VERSION)
3809#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_14
3810 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER UNAVAILABLE_ATTRIBUTE
3811#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14
3812 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER WEAK_IMPORT_ATTRIBUTE
3813#else
3814 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER
3815#endif
3816
3817/*
3818 * AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER
3819 *
3820 * Used on declarations introduced in Mac OS X 10.15
3821 */
3822#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3823 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_15, __IPHONE_COMPAT_VERSION)
3824#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_15
3825 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER UNAVAILABLE_ATTRIBUTE
3826#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
3827 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER WEAK_IMPORT_ATTRIBUTE
3828#else
3829 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER
3830#endif
3831
3832/*
3833 * DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER
3834 *
3835 * Used on types deprecated in Mac OS X 10.1
3836 */
3837#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3838 #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)
3839#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
3840 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER DEPRECATED_ATTRIBUTE
3841#else
3842 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER
3843#endif
3844
3845/*
3846 * DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER
3847 *
3848 * Used on types deprecated in Mac OS X 10.2
3849 */
3850#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3851 #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)
3852#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
3853 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER DEPRECATED_ATTRIBUTE
3854#else
3855 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER
3856#endif
3857
3858/*
3859 * DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER
3860 *
3861 * Used on types deprecated in Mac OS X 10.3
3862 */
3863#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3864 #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)
3865#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
3866 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER DEPRECATED_ATTRIBUTE
3867#else
3868 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER
3869#endif
3870
3871/*
3872 * DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER
3873 *
3874 * Used on types deprecated in Mac OS X 10.4
3875 */
3876#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3877 #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)
3878#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
3879 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER DEPRECATED_ATTRIBUTE
3880#else
3881 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER
3882#endif
3883
3884
3885/*
3886 * DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
3887 *
3888 * Used on types deprecated in Mac OS X 10.5
3889 */
3890#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3891 #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)
3892#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
3893 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER DEPRECATED_ATTRIBUTE
3894#else
3895 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
3896#endif
3897
3898/*
3899 * DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER
3900 *
3901 * Used on types deprecated in Mac OS X 10.6
3902 */
3903#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3904 #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)
3905#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
3906 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER DEPRECATED_ATTRIBUTE
3907#else
3908 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER
3909#endif
3910
3911/*
3912 * DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
3913 *
3914 * Used on types deprecated in Mac OS X 10.7
3915 */
3916#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3917 #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)
3918#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
3919 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER DEPRECATED_ATTRIBUTE
3920#else
3921 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
3922#endif
3923
3924/*
3925 * DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER
3926 *
3927 * Used on types deprecated in Mac OS X 10.8
3928 */
3929#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3930 #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)
3931#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
3932 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER DEPRECATED_ATTRIBUTE
3933#else
3934 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER
3935#endif
3936
3937/*
3938 * DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER
3939 *
3940 * Used on types deprecated in Mac OS X 10.9
3941 */
3942#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3943 #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)
3944#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
3945 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER DEPRECATED_ATTRIBUTE
3946#else
3947 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER
3948#endif
3949
3950/*
3951 * DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER
3952 *
3953 * Used on types deprecated in Mac OS X 10.10
3954 */
3955#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3956 #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)
3957#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
3958 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER DEPRECATED_ATTRIBUTE
3959#else
3960 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER
3961#endif
3962
3963/*
3964 * DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER
3965 *
3966 * Used on types deprecated in Mac OS X 10.11
3967 */
3968#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3969 #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)
3970#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
3971 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER DEPRECATED_ATTRIBUTE
3972#else
3973 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER
3974#endif
3975
3976/*
3977 * DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER
3978 *
3979 * Used on types deprecated in Mac OS X 10.12
3980 */
3981#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3982 #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)
3983#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
3984 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER DEPRECATED_ATTRIBUTE
3985#else
3986 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER
3987#endif
3988
3989/*
3990 * DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER
3991 *
3992 * Used on types deprecated in Mac OS X 10.13
3993 */
3994#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3995 #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)
3996#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
3997 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER DEPRECATED_ATTRIBUTE
3998#else
3999 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER
4000#endif
4001
4002/*
4003 * DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER
4004 *
4005 * Used on types deprecated in Mac OS X 10.14.4
4006 */
4007#if __AVAILABILITY_MACROS_USES_AVAILABILITY
4008 #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)
4009#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_14_4
4010 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER DEPRECATED_ATTRIBUTE
4011#else
4012 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER
4013#endif
4014
4015#endif /* __AVAILABILITYMACROS__ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/AvailabilityVersions.h-24
......@@ -60,11 +60,6 @@
6060#define __MAC_11_0 110000
6161#define __MAC_11_1 110100
6262#define __MAC_11_3 110300
63#define __MAC_11_4 110400
64#define __MAC_11_5 110500
65#define __MAC_11_6 110600
66#define __MAC_12_0 120000
67#define __MAC_12_1 120100
6863/* __MAC_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
6964
7065#define __IPHONE_2_0 20000
......@@ -119,12 +114,6 @@
119114#define __IPHONE_14_2 140200
120115#define __IPHONE_14_3 140300
121116#define __IPHONE_14_5 140500
122#define __IPHONE_14_6 140600
123#define __IPHONE_14_7 140700
124#define __IPHONE_14_8 140800
125#define __IPHONE_15_0 150000
126#define __IPHONE_15_1 150100
127#define __IPHONE_15_2 150200
128117/* __IPHONE_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
129118
130119#define __TVOS_9_0 90000
......@@ -153,11 +142,6 @@
153142#define __TVOS_14_2 140200
154143#define __TVOS_14_3 140300
155144#define __TVOS_14_5 140500
156#define __TVOS_14_6 140600
157#define __TVOS_14_7 140700
158#define __TVOS_15_0 150000
159#define __TVOS_15_1 150100
160#define __TVOS_15_2 150200
161145
162146#define __WATCHOS_1_0 10000
163147#define __WATCHOS_2_0 20000
......@@ -183,12 +167,6 @@
183167#define __WATCHOS_7_2 70200
184168#define __WATCHOS_7_3 70300
185169#define __WATCHOS_7_4 70400
186#define __WATCHOS_7_5 70500
187#define __WATCHOS_7_6 70600
188#define __WATCHOS_8_0 80000
189#define __WATCHOS_8_1 80100
190#define __WATCHOS_8_3 80300
191
192170
193171/*
194172 * Set up standard Mac OS X versions
......@@ -229,12 +207,10 @@
229207#define MAC_OS_X_VERSION_10_15_1 101501
230208#define MAC_OS_X_VERSION_10_16 101600
231209#define MAC_OS_VERSION_11_0 110000
232#define MAC_OS_VERSION_12_0 120000
233210
234211#endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */
235212
236213#define __DRIVERKIT_19_0 190000
237214#define __DRIVERKIT_20_0 200000
238#define __DRIVERKIT_21_0 210000
239215
240216#endif /* __AVAILABILITY_VERSIONS__ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/TargetConditionals.h+2-10
......@@ -61,10 +61,8 @@
6161 * The IOS/TV/WATCH conditionals are mutually exclusive.
6262 *
6363 *
64 * TARGET_OS_WIN32 - Generated code will run under WIN32 API
65 * TARGET_OS_WINDOWS - Generated code will run under Windows
64 * TARGET_OS_WIN32 - Generated code will run under 32-bit Windows
6665 * TARGET_OS_UNIX - Generated code will run under some Unix (not OSX)
67 * TARGET_OS_LINUX - Generated code will run under Linux
6866 * TARGET_OS_MAC - Generated code will run under Mac OS X variant
6967 * TARGET_OS_OSX - Generated code will run under OS X devices
7068 * TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator
......@@ -180,7 +178,7 @@
180178 /* -target=x86_64-apple-driverkit19.0 */
181179 /* -target=arm64-apple-driverkit19.0 */
182180 /* -target=arm64e-apple-driverkit19.0 */
183 #if __is_target_vendor(apple) && __is_target_os(driverkit)
181 #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(driverkit)
184182 #define TARGET_OS_OSX 0
185183 #define TARGET_OS_IPHONE 0
186184 #define TARGET_OS_IOS 0
......@@ -216,9 +214,7 @@
216214#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
217215 #define TARGET_OS_MAC 1
218216 #define TARGET_OS_WIN32 0
219 #define TARGET_OS_WINDOWS 0
220217 #define TARGET_OS_UNIX 0
221 #define TARGET_OS_LINUX 0
222218
223219 #if !DYNAMIC_TARGETS_ENABLED
224220 #define TARGET_OS_OSX 1
......@@ -359,9 +355,7 @@
359355#elif defined(__MWERKS__)
360356 #define TARGET_OS_MAC 1
361357 #define TARGET_OS_WIN32 0
362 #define TARGET_OS_WINDOWS 0
363358 #define TARGET_OS_UNIX 0
364 #define TARGET_OS_LINUX 0
365359 #define TARGET_OS_EMBEDDED 0
366360 #if defined(__POWERPC__)
367361 #define TARGET_CPU_PPC 1
......@@ -487,9 +481,7 @@
487481 #endif
488482 #define TARGET_OS_MAC 1
489483 #define TARGET_OS_WIN32 0
490 #define TARGET_OS_WINDOWS 0
491484 #define TARGET_OS_UNIX 0
492 #define TARGET_OS_LINUX 0
493485 #define TARGET_OS_EMBEDDED 0
494486 #if TARGET_CPU_PPC || TARGET_CPU_PPC64
495487 #define TARGET_RT_BIG_ENDIAN 1
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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 */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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
\ No newline at end of file
lib/libc/include/any-macos.11-any/dispatch/queue.h+2-2
......@@ -480,7 +480,7 @@ DISPATCH_EXPORT DISPATCH_NONNULL3 DISPATCH_NOTHROW
480480void
481481dispatch_apply(size_t iterations,
482482 dispatch_queue_t DISPATCH_APPLY_QUEUE_ARG_NULLABILITY queue,
483 DISPATCH_NOESCAPE void (^block)(size_t iteration));
483 DISPATCH_NOESCAPE void (^block)(size_t));
484484#endif
485485
486486/*!
......@@ -515,7 +515,7 @@ DISPATCH_EXPORT DISPATCH_NONNULL4 DISPATCH_NOTHROW
515515void
516516dispatch_apply_f(size_t iterations,
517517 dispatch_queue_t DISPATCH_APPLY_QUEUE_ARG_NULLABILITY queue,
518 void *_Nullable context, void (*work)(void *_Nullable context, size_t iteration));
518 void *_Nullable context, void (*work)(void *_Nullable, size_t));
519519
520520/*!
521521 * @function dispatch_get_current_queue
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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 */
\ No newline at end of file
lib/libc/include/any-macos.11-any/libkern/OSDebug.h created+69
......@@ -0,0 +1,69 @@
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) 1999 Apple Computer, Inc. All rights reserved.
30 *
31 * HISTORY
32 *
33 */
34
35#ifndef _OS_OSDEBBUG_H
36#define _OS_OSDEBBUG_H
37
38#include <sys/cdefs.h>
39#include <mach/mach_types.h>
40
41__BEGIN_DECLS
42
43extern int log_leaks;
44
45/* Use kernel_debug() to log a backtrace */
46extern void trace_backtrace(unsigned int debugid, unsigned int debugid2, unsigned long size, unsigned long data);
47/* Report a message with a 4 entry backtrace - very slow */
48extern void OSReportWithBacktrace(const char *str, ...);
49extern unsigned OSBacktrace(void **bt, unsigned maxAddrs);
50
51/* Simple dump of 20 backtrace entries */
52extern void OSPrintBacktrace(void);
53
54/*! @function OSKernelStackRemaining
55 * @abstract Returns bytes available below the current stack frame.
56 * @discussion Returns bytes available below the current stack frame. Safe for interrupt or thread context.
57 * @result Approximate byte count available. */
58
59vm_offset_t OSKernelStackRemaining( void );
60
61__END_DECLS
62
63#define TRACE_MACHLEAKS(a, b, c, d) \
64do { \
65 if (__builtin_expect(!!log_leaks, 0)) \
66 trace_backtrace(a,b,c,d); \
67} while(0)
68
69#endif /* !_OS_OSDEBBUG_H */
\ No newline at end of file
lib/libc/include/any-macos.11-any/libkern/OSKextLib.h created+572
......@@ -0,0 +1,572 @@
1/*
2 * Copyright (c) 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 _LIBKERN_OSKEXTLIB_H
30#define _LIBKERN_OSKEXTLIB_H
31
32#include <sys/cdefs.h>
33__BEGIN_DECLS
34
35#include <stdint.h>
36#include <mach/kmod.h>
37#include <mach/vm_types.h>
38#include <uuid/uuid.h>
39
40#include <CoreFoundation/CoreFoundation.h>
41#include <libkern/OSReturn.h>
42
43/*!
44 * @header
45 *
46 * Declares functions, basic return values, and other constants
47 * related to kernel extensions (kexts).
48 */
49
50#if PRAGMA_MARK
51#pragma mark -
52/********************************************************************/
53#pragma mark OSReturn Values for Kernel Extensions
54/********************************************************************/
55#endif
56/*!
57 * @group OSReturn Values for Kernel Extensions
58 * Many kext-related functions return these values,
59 * as well as those defined under
60 * <code>@link //apple_ref/c/tdef/OSReturn OSReturn@/link</code>
61 * and other variants of <code>kern_return_t</code>.
62 */
63
64
65#define sub_libkern_kext err_sub(2)
66#define libkern_kext_err(code) (sys_libkern|sub_libkern_kext|(code))
67
68
69/*!
70 * @define kOSKextReturnInternalError
71 * @abstract An internal error in the kext library.
72 * Contrast with <code>@link //apple_ref/c/econst/OSReturnError
73 * OSReturnError@/link</code>.
74 */
75#define kOSKextReturnInternalError libkern_kext_err(0x1)
76
77/*!
78 * @define kOSKextReturnNoMemory
79 * @abstract Memory allocation failed.
80 */
81#define kOSKextReturnNoMemory libkern_kext_err(0x2)
82
83/*!
84 * @define kOSKextReturnNoResources
85 * @abstract Some resource other than memory (such as available load tags)
86 * is exhausted.
87 */
88#define kOSKextReturnNoResources libkern_kext_err(0x3)
89
90/*!
91 * @define kOSKextReturnNotPrivileged
92 * @abstract The caller lacks privileges to perform the requested operation.
93 */
94#define kOSKextReturnNotPrivileged libkern_kext_err(0x4)
95
96/*!
97 * @define kOSKextReturnInvalidArgument
98 * @abstract Invalid argument.
99 */
100#define kOSKextReturnInvalidArgument libkern_kext_err(0x5)
101
102/*!
103 * @define kOSKextReturnNotFound
104 * @abstract Search item not found.
105 */
106#define kOSKextReturnNotFound libkern_kext_err(0x6)
107
108/*!
109 * @define kOSKextReturnBadData
110 * @abstract Malformed data (not used for XML).
111 */
112#define kOSKextReturnBadData libkern_kext_err(0x7)
113
114/*!
115 * @define kOSKextReturnSerialization
116 * @abstract Error converting or (un)serializing URL, string, or XML.
117 */
118#define kOSKextReturnSerialization libkern_kext_err(0x8)
119
120/*!
121 * @define kOSKextReturnUnsupported
122 * @abstract Operation is no longer or not yet supported.
123 */
124#define kOSKextReturnUnsupported libkern_kext_err(0x9)
125
126/*!
127 * @define kOSKextReturnDisabled
128 * @abstract Operation is currently disabled.
129 */
130#define kOSKextReturnDisabled libkern_kext_err(0xa)
131
132/*!
133 * @define kOSKextReturnNotAKext
134 * @abstract Bundle is not a kernel extension.
135 */
136#define kOSKextReturnNotAKext libkern_kext_err(0xb)
137
138/*!
139 * @define kOSKextReturnValidation
140 * @abstract Validation failures encountered; check diagnostics for details.
141 */
142#define kOSKextReturnValidation libkern_kext_err(0xc)
143
144/*!
145 * @define kOSKextReturnAuthentication
146 * @abstract Authetication failures encountered; check diagnostics for details.
147 */
148#define kOSKextReturnAuthentication libkern_kext_err(0xd)
149
150/*!
151 * @define kOSKextReturnDependencies
152 * @abstract Dependency resolution failures encountered; check diagnostics for details.
153 */
154#define kOSKextReturnDependencies libkern_kext_err(0xe)
155
156/*!
157 * @define kOSKextReturnArchNotFound
158 * @abstract Kext does not contain code for the requested architecture.
159 */
160#define kOSKextReturnArchNotFound libkern_kext_err(0xf)
161
162/*!
163 * @define kOSKextReturnCache
164 * @abstract An error occurred processing a system kext cache.
165 */
166#define kOSKextReturnCache libkern_kext_err(0x10)
167
168/*!
169 * @define kOSKextReturnDeferred
170 * @abstract Operation has been posted asynchronously to user space (kernel only).
171 */
172#define kOSKextReturnDeferred libkern_kext_err(0x11)
173
174/*!
175 * @define kOSKextReturnBootLevel
176 * @abstract Kext not loadable or operation not allowed at current boot level.
177 */
178#define kOSKextReturnBootLevel libkern_kext_err(0x12)
179
180/*!
181 * @define kOSKextReturnNotLoadable
182 * @abstract Kext cannot be loaded; check diagnostics for details.
183 */
184#define kOSKextReturnNotLoadable libkern_kext_err(0x13)
185
186/*!
187 * @define kOSKextReturnLoadedVersionDiffers
188 * @abstract A different version (or executable UUID, or executable by checksum)
189 * of the requested kext is already loaded.
190 */
191#define kOSKextReturnLoadedVersionDiffers libkern_kext_err(0x14)
192
193/*!
194 * @define kOSKextReturnDependencyLoadError
195 * @abstract A load error occurred on a dependency of the kext being loaded.
196 */
197#define kOSKextReturnDependencyLoadError libkern_kext_err(0x15)
198
199/*!
200 * @define kOSKextReturnLinkError
201 * @abstract A link failure occured with this kext or a dependency.
202 */
203#define kOSKextReturnLinkError libkern_kext_err(0x16)
204
205/*!
206 * @define kOSKextReturnStartStopError
207 * @abstract The kext start or stop routine returned an error.
208 */
209#define kOSKextReturnStartStopError libkern_kext_err(0x17)
210
211/*!
212 * @define kOSKextReturnInUse
213 * @abstract The kext is currently in use or has outstanding references,
214 * and cannot be unloaded.
215 */
216#define kOSKextReturnInUse libkern_kext_err(0x18)
217
218/*!
219 * @define kOSKextReturnTimeout
220 * @abstract A kext request has timed out.
221 */
222#define kOSKextReturnTimeout libkern_kext_err(0x19)
223
224/*!
225 * @define kOSKextReturnStopping
226 * @abstract The kext is in the process of stopping; requests cannot be made.
227 */
228#define kOSKextReturnStopping libkern_kext_err(0x1a)
229
230/*!
231 * @define kOSKextReturnSystemPolicy
232 * @abstract The kext was prevented from loading due to system policy.
233 */
234#define kOSKextReturnSystemPolicy libkern_kext_err(0x1b)
235
236/*!
237 * @define kOSKextReturnKCLoadFailure
238 * @abstract Loading of the System KC failed
239 */
240#define kOSKextReturnKCLoadFailure libkern_kext_err(0x1c)
241
242/*!
243 * @define kOSKextReturnKCLoadFailureSystemKC
244 * @abstract Loading of the System KC failed
245 *
246 * This a sub-code of kOSKextReturnKCLoadFailure. It can be OR'd together
247 * with: kOSKextReturnKCLoadFailureAuxKC
248 *
249 * If both the System and Aux KCs fail to load, then the error code will be:
250 * libkern_kext_err(0x1f)
251 */
252#define kOSKextReturnKCLoadFailureSystemKC libkern_kext_err(0x1d)
253
254/*!
255 * @define kOSKextReturnKCLoadFailureAuxKC
256 * @abstract Loading of the Aux KC failed
257 *
258 * This a sub-code of kOSKextReturnKCLoadFailure. It can be OR'd together
259 * with: kOSKextReturnKCLoadFailureSystemKC
260 *
261 * If both the System and Aux KCs fail to load, then the error code will be:
262 * libkern_kext_err(0x1f)
263 */
264#define kOSKextReturnKCLoadFailureAuxKC libkern_kext_err(0x1e)
265
266/* next available error is: libkern_kext_err(0x20) */
267
268#if PRAGMA_MARK
269#pragma mark -
270/********************************************************************/
271#pragma mark Kext/OSBundle Property List Keys
272/********************************************************************/
273#endif
274/*!
275 * @group Kext Property List Keys
276 * These constants cover CFBundle properties defined for kernel extensions.
277 * Because they are used in the kernel, if you want to use one with
278 * CFBundle APIs you'll need to wrap it in a <code>CFSTR()</code> macro.
279 */
280
281
282/*!
283 * @define kOSBundleCompatibleVersionKey
284 * @abstract A string giving the backwards-compatible version of a library kext
285 * in extended Mac OS 'vers' format (####.##.##s{1-255} where 's'
286 * is a build stage 'd', 'a', 'b', 'f' or 'fc').
287 */
288#define kOSBundleCompatibleVersionKey "OSBundleCompatibleVersion"
289
290/*!
291 * @define kOSBundleEnableKextLoggingKey
292 * @abstract Set to true to have the kernel kext logging spec applied
293 * to the kext.
294 * See <code>@link //apple_ref/c/econst/OSKextLogSpec
295 * OSKextLogSpec@/link</code>.
296 */
297#define kOSBundleEnableKextLoggingKey "OSBundleEnableKextLogging"
298
299/*!
300 * @define kOSBundleIsInterfaceKey
301 * @abstract A boolean value indicating whether the kext executable
302 * contains only symbol references.
303 */
304#define kOSBundleIsInterfaceKey "OSBundleIsInterface"
305
306/*!
307 * @define kOSBundleLibrariesKey
308 * @abstract A dictionary listing link dependencies for this kext.
309 * Keys are bundle identifiers, values are version strings.
310 */
311#define kOSBundleLibrariesKey "OSBundleLibraries"
312
313/*!
314 * @define kOSBundleRequiredKey
315 * @abstract A string indicating in which kinds of startup this kext
316 * may need to load during early startup (before
317 * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code>).
318 * @discussion
319 * The value is one of:
320 * <ul>
321 * <li>@link kOSBundleRequiredRoot "OSBundleRequiredRoot"@/link</li>
322 * <li>@link kOSBundleRequiredLocalRoot "OSBundleRequiredLocalRoot"@/link</li>
323 * <li>@link kOSBundleRequiredNetworkRoot "OSBundleRequiredNetworkRoot"@/link</li>
324 * <li>@link kOSBundleRequiredSafeBoot "OSBundleRequiredSafeBoot"@/link</li>
325 * <li>@link kOSBundleRequiredConsole "OSBundleRequiredConsole"@/link</li>
326 * </ul>
327 *
328 * Use this property judiciously.
329 * Every kext that declares a value other than "OSBundleRequiredSafeBoot"
330 * increases startup time, as the booter must read it into memory,
331 * or startup kext caches must include it.
332 */
333#define kOSBundleRequiredKey "OSBundleRequired"
334
335/*!
336 * @define kOSBundleRequireExplicitLoadKey
337 * @abstract A boolean value indicating whether the kext requires an
338 * explicit kextload in order to start/match.
339 */
340#define kOSBundleRequireExplicitLoadKey "OSBundleRequireExplicitLoad"
341
342/*!
343 * @define kOSBundleAllowUserLoadKey
344 * @abstract A boolean value indicating whether
345 * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code>
346 * will honor a non-root process's request to load a kext.
347 * @discussion
348 * See <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithURL
349 * KextManagerLoadKextWithURL@/link</code>
350 * and <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithIdentifier
351 * KextManagerLoadKextWithIdentifier@/link</code>.
352 */
353#define kOSBundleAllowUserLoadKey "OSBundleAllowUserLoad"
354
355/*!
356 * @define kOSBundleAllowUserTerminateKey
357 * @abstract A boolean value indicating whether the kextunload tool
358 * is allowed to issue IOService terminate to classes defined in this kext.
359 * @discussion A boolean value indicating whether the kextunload tool
360 * is allowed to issue IOService terminate to classes defined in this kext.
361 */
362#define kOSBundleAllowUserTerminateKey "OSBundleAllowUserTerminate"
363
364/*!
365 * @define kOSKernelResourceKey
366 * @abstract A boolean value indicating whether the kext represents a built-in
367 * component of the kernel.
368 */
369#define kOSKernelResourceKey "OSKernelResource"
370
371/*!
372 * @define kOSKextVariantOverrideKey
373 * @abstract A dictionary with target names as key and a target-specific variant
374 * name as value.
375 */
376#define kOSKextVariantOverrideKey "OSKextVariantOverride"
377
378/*!
379 * @define kIOKitPersonalitiesKey
380 * @abstract A dictionary of dictionaries used in matching for I/O Kit drivers.
381 */
382#define kIOKitPersonalitiesKey "IOKitPersonalities"
383
384/*
385 * @define kIOPersonalityPublisherKey
386 * @abstract Used in personalities sent to the I/O Kit,
387 * contains the CFBundleIdentifier of the kext
388 * that the personality originated in.
389 */
390#define kIOPersonalityPublisherKey "IOPersonalityPublisher"
391
392#if CONFIG_KEC_FIPS
393/*
394 * @define kAppleTextHashesKey
395 * @abstract A dictionary conataining hashes for corecrypto kext.
396 */
397#define kAppleTextHashesKey "AppleTextHashes"
398#endif
399
400/*!
401 * @define kOSMutableSegmentCopy
402 * @abstract A boolean value indicating whether the kext requires a copy of
403 * its mutable segments to be kept in memory, and then reset when the kext
404 * unloads. This should be used with caution as it will increase the
405 * amount of memory used by the kext.
406 */
407#define kOSMutableSegmentCopy "OSMutableSegmentCopy"
408
409
410#if PRAGMA_MARK
411/********************************************************************/
412#pragma mark Kext/OSBundle Property Deprecated Keys
413/********************************************************************/
414#endif
415/*
416 * @define kOSBundleDebugLevelKey
417 * @abstract
418 * Deprecated (used on some releases of Mac OS X prior to 10.6 Snow Leopard).
419 * Value is an integer from 1-6, corresponding to the verbose levels
420 * of kext tools on those releases.
421 * On 10.6 Snow Leopard, use <code>@link OSKextEnableKextLogging
422 * OSKextEnableKextLogging@/link</code>.
423 */
424#define kOSBundleDebugLevelKey "OSBundleDebugLevel"
425
426/*!
427 * @define kOSBundleSharedExecutableIdentifierKey
428 * @abstract Deprecated (used on some releases of Mac OS X
429 * prior to 10.6 Snow Leopard).
430 * Value is the bundle identifier of the pseudokext
431 * that contains an executable shared by this kext.
432 */
433#define kOSBundleSharedExecutableIdentifierKey "OSBundleSharedExecutableIdentifier"
434
435
436#if PRAGMA_MARK
437/********************************************************************/
438#pragma mark Kext/OSBundle Property List Values
439/********************************************************************/
440#endif
441
442/*!
443 * @group Kext Property List Values
444 * These constants encompass established values
445 * for kernel extension bundle properties.
446 */
447
448/*!
449 * @define kOSKextKernelIdentifier
450 * @abstract
451 * This is the CFBundleIdentifier user for the kernel itself.
452 */
453#define kOSKextKernelIdentifier "__kernel__"
454
455/*!
456 * @define kOSKextBundlePackageTypeKext
457 * @abstract
458 * The bundle type value for Kernel Extensions.
459 */
460#define kOSKextBundlePackageTypeKext "KEXT"
461
462/*!
463 * @define kOSKextBundlePackageTypeDriverKit
464 * @abstract
465 * The bundle type value for Driver Extensions.
466 */
467#define kOSKextBundlePackageTypeDriverKit "DEXT"
468
469/*!
470 * @define kOSBundleRequiredRoot
471 * @abstract
472 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
473 * value indicates that the kext may be needed to mount the root filesystem
474 * whether starting from a local or a network volume.
475 */
476#define kOSBundleRequiredRoot "Root"
477
478/*!
479 * @define kOSBundleRequiredLocalRoot
480 * @abstract
481 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
482 * value indicates that the kext may be needed to mount the root filesystem
483 * when starting from a local disk.
484 */
485#define kOSBundleRequiredLocalRoot "Local-Root"
486
487/*!
488 * @define kOSBundleRequiredNetworkRoot
489 * @abstract
490 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
491 * value indicates that the kext may be needed to mount the root filesystem
492 * when starting over a network connection.
493 */
494#define kOSBundleRequiredNetworkRoot "Network-Root"
495
496/*!
497 * @define kOSBundleRequiredSafeBoot
498 * @abstract
499 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
500 * value indicates that the kext can be loaded during a safe startup.
501 * This value does not normally cause the kext to be read by the booter
502 * or included in startup kext caches.
503 */
504#define kOSBundleRequiredSafeBoot "Safe Boot"
505
506/*!
507 * @define kOSBundleRequiredConsole
508 * @abstract
509 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
510 * value indicates that the kext may be needed for console access
511 * (specifically in a single-user startup when
512 * <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code>.
513 * does not run)
514 * and should be loaded during early startup.
515 */
516#define kOSBundleRequiredConsole "Console"
517
518/*!
519 * @define kOSBundleRequiredDriverKit
520 * @abstract
521 * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code>
522 * value indicates that the driver extension's (DriverKit driver's)
523 * personalities must be present in the kernel at early boot (specifically
524 * before <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code> starts)
525 * in order to compete with kexts built into the prelinkedkernel. Note that
526 * kextd is still required to launch the user space driver binary. The IOKit
527 * matching will happen during early boot, and the actual driver launch
528 * will happen after kextd starts.
529 */
530#define kOSBundleRequiredDriverKit "DriverKit"
531
532#if PRAGMA_MARK
533#pragma mark -
534/********************************************************************/
535#pragma mark Kext Information
536/********************************************************************/
537#endif
538/*!
539 * @group Kext Information
540 * Types, constants, and macros providing a kext with information
541 * about itself.
542 */
543
544/*!
545 * @typedef OSKextLoadTag
546 *
547 * @abstract
548 * A unique identifier assigned to a loaded instanace of a kext.
549 *
550 * @discussion
551 * If a kext is unloaded and later reloaded, the new instance
552 * has a different load tag.
553 *
554 * A kext can get its own load tag in the <code>kmod_info_t</code>
555 * structure passed into its module start routine, as the
556 * <code>id</code> field (cast to this type).
557 */
558typedef uint32_t OSKextLoadTag;
559
560/*!
561 * @define kOSKextInvalidLoadTag
562 *
563 * @abstract
564 * A load tag value that will never be used for a loaded kext;
565 * indicates kext not found.
566 */
567#define kOSKextInvalidLoadTag ((OSKextLoadTag)(-1))
568
569
570__END_DECLS
571
572#endif /* _LIBKERN_OSKEXTLIB_H */
\ No newline at end of file
lib/libc/include/any-macos.11-any/libproc.h created+187
......@@ -0,0 +1,187 @@
1/*
2 * Copyright (c) 2006, 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#ifndef _LIBPROC_H_
24#define _LIBPROC_H_
25
26#include <sys/cdefs.h>
27#include <sys/param.h>
28#include <sys/types.h>
29#include <sys/stat.h>
30#include <sys/mount.h>
31#include <sys/resource.h>
32#include <stdint.h>
33#include <stdbool.h>
34#include <mach/message.h> /* for audit_token_t */
35
36#include <sys/proc_info.h>
37
38#include <Availability.h>
39#include <os/availability.h>
40
41/*
42 * This header file contains private interfaces to obtain process information.
43 * These interfaces are subject to change in future releases.
44 */
45
46/*!
47 * @define PROC_LISTPIDSPATH_PATH_IS_VOLUME
48 * @discussion This flag indicates that all processes that hold open
49 * file references on the volume associated with the specified
50 * path should be returned.
51 */
52#define PROC_LISTPIDSPATH_PATH_IS_VOLUME 1
53
54
55/*!
56 * @define PROC_LISTPIDSPATH_EXCLUDE_EVTONLY
57 * @discussion This flag indicates that file references that were opened
58 * with the O_EVTONLY flag should be excluded from the matching
59 * criteria.
60 */
61#define PROC_LISTPIDSPATH_EXCLUDE_EVTONLY 2
62
63__BEGIN_DECLS
64
65
66/*!
67 * @function proc_listpidspath
68 * @discussion A function which will search through the current
69 * processes looking for open file references which match
70 * a specified path or volume.
71 * @param type types of processes to be searched (see proc_listpids)
72 * @param typeinfo adjunct information for type
73 * @param path file or volume path
74 * @param pathflags flags to control which files should be considered
75 * during the process search.
76 * @param buffer a C array of int-sized values to be filled with
77 * process identifiers that hold an open file reference
78 * matching the specified path or volume. Pass NULL to
79 * obtain the minimum buffer size needed to hold the
80 * currently active processes.
81 * @param buffersize the size (in bytes) of the provided buffer.
82 * @result the number of bytes of data returned in the provided buffer;
83 * -1 if an error was encountered;
84 */
85int proc_listpidspath(uint32_t type,
86 uint32_t typeinfo,
87 const char *path,
88 uint32_t pathflags,
89 void *buffer,
90 int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
91
92int proc_listpids(uint32_t type, uint32_t typeinfo, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
93int proc_listallpids(void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
94int proc_listpgrppids(pid_t pgrpid, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
95int proc_listchildpids(pid_t ppid, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
96int proc_pidinfo(int pid, int flavor, uint64_t arg, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
97int proc_pidfdinfo(int pid, int fd, int flavor, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
98int proc_pidfileportinfo(int pid, uint32_t fileport, int flavor, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
99int proc_name(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
100int proc_regionfilename(int pid, uint64_t address, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
101int proc_kmsgbuf(void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
102int proc_pidpath(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
103int proc_pidpath_audittoken(audit_token_t *audittoken, void * buffer, uint32_t buffersize) API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));
104int proc_libversion(int *major, int * minor) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
105
106/*
107 * Return resource usage information for the given pid, which can be a live process or a zombie.
108 *
109 * Returns 0 on success; or -1 on failure, with errno set to indicate the specific error.
110 */
111int proc_pid_rusage(int pid, int flavor, rusage_info_t *buffer) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
112
113/*
114 * A process can use the following api to set its own process control
115 * state on resoure starvation. The argument can have one of the PROC_SETPC_XX values
116 */
117#define PROC_SETPC_NONE 0
118#define PROC_SETPC_THROTTLEMEM 1
119#define PROC_SETPC_SUSPEND 2
120#define PROC_SETPC_TERMINATE 3
121
122int proc_setpcontrol(const int control) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
123int proc_setpcontrol(const int control);
124
125int proc_track_dirty(pid_t pid, uint32_t flags);
126int proc_set_dirty(pid_t pid, bool dirty);
127int proc_get_dirty(pid_t pid, uint32_t *flags);
128int proc_clear_dirty(pid_t pid, uint32_t flags);
129
130int proc_terminate(pid_t pid, int *sig);
131
132/*
133 * NO_SMT means that on an SMT CPU, this thread must be scheduled alone,
134 * with the paired CPU idle.
135 *
136 * Set NO_SMT on the current proc (all existing and future threads)
137 * This attribute is inherited on fork and exec
138 */
139int proc_set_no_smt(void) __API_AVAILABLE(macos(11.0));
140
141/* Set NO_SMT on the current thread */
142int proc_setthread_no_smt(void) __API_AVAILABLE(macos(11.0));
143
144/*
145 * CPU Security Mitigation APIs
146 *
147 * Set CPU security mitigation on the current proc (all existing and future threads)
148 * This attribute is inherited on fork and exec
149 */
150int proc_set_csm(uint32_t flags) __API_AVAILABLE(macos(11.0));
151
152/* Set CPU security mitigation on the current thread */
153int proc_setthread_csm(uint32_t flags) __API_AVAILABLE(macos(11.0));
154
155/*
156 * flags for CPU Security Mitigation APIs
157 * PROC_CSM_ALL should be used in most cases,
158 * the individual flags are provided only for performance evaluation etc
159 */
160#define PROC_CSM_ALL 0x0001 /* Set all available mitigations */
161#define PROC_CSM_NOSMT 0x0002 /* Set NO_SMT - see above */
162#define PROC_CSM_TECS 0x0004 /* Execute VERW on every return to user mode */
163
164#ifdef PRIVATE
165#include <sys/event.h>
166/*
167 * Enumerate potential userspace pointers embedded in kernel data structures.
168 * Currently inspects kqueues only.
169 *
170 * NOTE: returned "pointers" are opaque user-supplied values and thus not
171 * guaranteed to address valid objects or be pointers at all.
172 *
173 * Returns the number of pointers found (which may exceed buffersize), or -1 on
174 * failure and errno set appropriately.
175 */
176int proc_list_uptrs(pid_t pid, uint64_t *buffer, uint32_t buffersize);
177
178int proc_list_dynkqueueids(int pid, kqueue_id_t *buf, uint32_t bufsz);
179int proc_piddynkqueueinfo(int pid, int flavor, kqueue_id_t kq_id, void *buffer,
180 int buffersize);
181#endif /* PRIVATE */
182
183int proc_udata_info(int pid, int flavor, void *buffer, int buffersize);
184
185__END_DECLS
186
187#endif /*_LIBPROC_H_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach-o/loader.h-4
......@@ -1274,8 +1274,6 @@ struct build_tool_version {
12741274#define PLATFORM_WATCHOSSIMULATOR 9
12751275#define PLATFORM_DRIVERKIT 10
12761276
1277
1278
12791277/* Known values for the tool field above. */
12801278#define TOOL_CLANG 1
12811279#define TOOL_SWIFT 2
......@@ -1458,8 +1456,6 @@ struct dyld_info_command {
14581456#define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04
14591457#define EXPORT_SYMBOL_FLAGS_REEXPORT 0x08
14601458#define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10
1461#define EXPORT_SYMBOL_FLAGS_STATIC_RESOLVER 0x20
1462
14631459
14641460/*
14651461 * The linker_option_command contains linker options embedded in object files.
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/exception_types.h created+206
......@@ -0,0 +1,206 @@
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#include <mach_debug/ipc_info.h>
185/*
186 * Exported types
187 */
188
189typedef int exception_type_t;
190typedef integer_t exception_data_type_t;
191typedef int64_t mach_exception_data_type_t;
192typedef int exception_behavior_t;
193typedef exception_data_type_t *exception_data_t;
194typedef mach_exception_data_type_t *mach_exception_data_t;
195typedef unsigned int exception_mask_t;
196typedef exception_mask_t *exception_mask_array_t;
197typedef exception_behavior_t *exception_behavior_array_t;
198typedef thread_state_flavor_t *exception_flavor_array_t;
199typedef mach_port_t *exception_port_array_t;
200typedef ipc_info_port_t *exception_port_info_array_t;
201typedef mach_exception_data_type_t mach_exception_code_t;
202typedef mach_exception_data_type_t mach_exception_subcode_t;
203
204#endif /* ASSEMBLER */
205
206#endif /* _MACH_EXCEPTION_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/kern_return.h created+342
......@@ -0,0 +1,342 @@
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_MISSING_KC 54
331/* The KC on which the function is operating is missing
332 */
333
334#define KERN_INVALID_KC 55
335/* The KC on which the function is operating is invalid
336 */
337
338#define KERN_RETURN_MAX 0x100
339/* Maximum return value allowable
340 */
341
342#endif /* _MACH_KERN_RETURN_H_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/mach_init.h+2
......@@ -64,7 +64,9 @@
6464
6565#include <sys/cdefs.h>
6666
67#ifndef KERNEL
6768#include <Availability.h>
69#endif
6870
6971/*
7072 * Kernel-related ports; how a task/thread controls itself
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/mach_types.h-5
......@@ -218,7 +218,6 @@ typedef exception_handler_t exception_port_t;
218218typedef exception_handler_array_t exception_port_arrary_t;
219219typedef char vfs_path_t[4096];
220220typedef char nspace_path_t[1024]; /* 1024 == PATH_MAX */
221typedef char nspace_name_t[1024]; /* 1024 == PATH_MAX */
222221typedef char suid_cred_path_t[1024];
223222typedef uint32_t suid_cred_uid_t;
224223
......@@ -262,16 +261,12 @@ typedef unsigned int mach_task_flavor_t;
262261#define TASK_FLAVOR_INSPECT 2 /* a task_inspect_t */
263262#define TASK_FLAVOR_NAME 3 /* a task_name_t */
264263
265#define TASK_FLAVOR_MAX TASK_FLAVOR_NAME
266
267264/* capability strictly _DECREASING_ */
268265typedef unsigned int mach_thread_flavor_t;
269266#define THREAD_FLAVOR_CONTROL 0 /* a thread_t */
270267#define THREAD_FLAVOR_READ 1 /* a thread_read_t */
271268#define THREAD_FLAVOR_INSPECT 2 /* a thread_inspect_t */
272269
273#define THREAD_FLAVOR_MAX THREAD_FLAVOR_INSPECT
274
275270/* DEPRECATED */
276271typedef natural_t ledger_item_t;
277272#define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0))
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/machine.h created+409
......@@ -0,0 +1,409 @@
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#define CPUFAMILY_INTEL_COMETLAKE 0x1cf8a03e
380#define CPUFAMILY_ARM_9 0xe73283ae
381#define CPUFAMILY_ARM_11 0x8ff620d8
382#define CPUFAMILY_ARM_XSCALE 0x53b005f5
383#define CPUFAMILY_ARM_12 0xbd1b0ae9
384#define CPUFAMILY_ARM_13 0x0cc90e64
385#define CPUFAMILY_ARM_14 0x96077ef1
386#define CPUFAMILY_ARM_15 0xa8511bca
387#define CPUFAMILY_ARM_SWIFT 0x1e2d6381
388#define CPUFAMILY_ARM_CYCLONE 0x37a09642
389#define CPUFAMILY_ARM_TYPHOON 0x2c91a47e
390#define CPUFAMILY_ARM_TWISTER 0x92fb37c8
391#define CPUFAMILY_ARM_HURRICANE 0x67ceee93
392#define CPUFAMILY_ARM_MONSOON_MISTRAL 0xe81e7ef6
393#define CPUFAMILY_ARM_VORTEX_TEMPEST 0x07d34b9f
394#define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504d2
395#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3
396
397#define CPUSUBFAMILY_UNKNOWN 0
398#define CPUSUBFAMILY_ARM_HP 1
399#define CPUSUBFAMILY_ARM_HG 2
400#define CPUSUBFAMILY_ARM_M 3
401#define CPUSUBFAMILY_ARM_HS 4
402#define CPUSUBFAMILY_ARM_HC_HD 5
403
404/* The following synonyms are deprecated: */
405#define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN
406#define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM
407
408
409#endif /* _MACH_MACHINE_H_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/port.h created+445
......@@ -0,0 +1,445 @@
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/* Convenient combinations. */
215
216#define MACH_PORT_TYPE_SEND_RECEIVE \
217 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE)
218#define MACH_PORT_TYPE_SEND_RIGHTS \
219 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE)
220#define MACH_PORT_TYPE_PORT_RIGHTS \
221 (MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE)
222#define MACH_PORT_TYPE_PORT_OR_DEAD \
223 (MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME)
224#define MACH_PORT_TYPE_ALL_RIGHTS \
225 (MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET)
226
227/* Dummy type bits that mach_port_type/mach_port_names can return. */
228
229#define MACH_PORT_TYPE_DNREQUEST 0x80000000
230#define MACH_PORT_TYPE_SPREQUEST 0x40000000
231#define MACH_PORT_TYPE_SPREQUEST_DELAYED 0x20000000
232
233/* User-references for capabilities. */
234
235typedef natural_t mach_port_urefs_t;
236typedef integer_t mach_port_delta_t; /* change in urefs */
237
238/* Attributes of ports. (See mach_port_get_receive_status.) */
239
240typedef natural_t mach_port_seqno_t; /* sequence number */
241typedef natural_t mach_port_mscount_t; /* make-send count */
242typedef natural_t mach_port_msgcount_t; /* number of msgs */
243typedef natural_t mach_port_rights_t; /* number of rights */
244
245/*
246 * Are there outstanding send rights for a given port?
247 */
248#define MACH_PORT_SRIGHTS_NONE 0 /* no srights */
249#define MACH_PORT_SRIGHTS_PRESENT 1 /* srights */
250typedef unsigned int mach_port_srights_t; /* status of send rights */
251
252typedef struct mach_port_status {
253 mach_port_rights_t mps_pset; /* count of containing port sets */
254 mach_port_seqno_t mps_seqno; /* sequence number */
255 mach_port_mscount_t mps_mscount; /* make-send count */
256 mach_port_msgcount_t mps_qlimit; /* queue limit */
257 mach_port_msgcount_t mps_msgcount; /* number in the queue */
258 mach_port_rights_t mps_sorights; /* how many send-once rights */
259 boolean_t mps_srights; /* do send rights exist? */
260 boolean_t mps_pdrequest; /* port-deleted requested? */
261 boolean_t mps_nsrequest; /* no-senders requested? */
262 natural_t mps_flags; /* port flags */
263} mach_port_status_t;
264
265/* System-wide values for setting queue limits on a port */
266#define MACH_PORT_QLIMIT_ZERO (0)
267#define MACH_PORT_QLIMIT_BASIC (5)
268#define MACH_PORT_QLIMIT_SMALL (16)
269#define MACH_PORT_QLIMIT_LARGE (1024)
270#define MACH_PORT_QLIMIT_KERNEL (65534)
271#define MACH_PORT_QLIMIT_MIN MACH_PORT_QLIMIT_ZERO
272#define MACH_PORT_QLIMIT_DEFAULT MACH_PORT_QLIMIT_BASIC
273#define MACH_PORT_QLIMIT_MAX MACH_PORT_QLIMIT_LARGE
274
275typedef struct mach_port_limits {
276 mach_port_msgcount_t mpl_qlimit; /* number of msgs */
277} mach_port_limits_t;
278
279/* Possible values for mps_flags (part of mach_port_status_t) */
280#define MACH_PORT_STATUS_FLAG_TEMPOWNER 0x01
281#define MACH_PORT_STATUS_FLAG_GUARDED 0x02
282#define MACH_PORT_STATUS_FLAG_STRICT_GUARD 0x04
283#define MACH_PORT_STATUS_FLAG_IMP_DONATION 0x08
284#define MACH_PORT_STATUS_FLAG_REVIVE 0x10
285#define MACH_PORT_STATUS_FLAG_TASKPTR 0x20
286#define MACH_PORT_STATUS_FLAG_GUARD_IMMOVABLE_RECEIVE 0x40
287#define MACH_PORT_STATUS_FLAG_NO_GRANT 0x80
288
289typedef struct mach_port_info_ext {
290 mach_port_status_t mpie_status;
291 mach_port_msgcount_t mpie_boost_cnt;
292 uint32_t reserved[6];
293} mach_port_info_ext_t;
294
295typedef integer_t *mach_port_info_t; /* varying array of natural_t */
296
297/* Flavors for mach_port_get/set_attributes() */
298typedef int mach_port_flavor_t;
299#define MACH_PORT_LIMITS_INFO 1 /* uses mach_port_limits_t */
300#define MACH_PORT_RECEIVE_STATUS 2 /* uses mach_port_status_t */
301#define MACH_PORT_DNREQUESTS_SIZE 3 /* info is int */
302#define MACH_PORT_TEMPOWNER 4 /* indicates receive right will be reassigned to another task */
303#define MACH_PORT_IMPORTANCE_RECEIVER 5 /* indicates recieve right accepts priority donation */
304#define MACH_PORT_DENAP_RECEIVER 6 /* indicates receive right accepts de-nap donation */
305#define MACH_PORT_INFO_EXT 7 /* uses mach_port_info_ext_t */
306
307#define MACH_PORT_LIMITS_INFO_COUNT ((natural_t) \
308 (sizeof(mach_port_limits_t)/sizeof(natural_t)))
309#define MACH_PORT_RECEIVE_STATUS_COUNT ((natural_t) \
310 (sizeof(mach_port_status_t)/sizeof(natural_t)))
311#define MACH_PORT_DNREQUESTS_SIZE_COUNT 1
312#define MACH_PORT_INFO_EXT_COUNT ((natural_t) \
313 (sizeof(mach_port_info_ext_t)/sizeof(natural_t)))
314/*
315 * Structure used to pass information about port allocation requests.
316 * Must be padded to 64-bits total length.
317 */
318typedef struct mach_port_qos {
319 unsigned int name:1; /* name given */
320 unsigned int prealloc:1; /* prealloced message */
321 boolean_t pad1:30;
322 natural_t len;
323} mach_port_qos_t;
324
325/* Mach Port Guarding definitions */
326
327/*
328 * Flags for mach_port_options (used for
329 * invocation of mach_port_construct).
330 * Indicates attributes to be set for the newly
331 * allocated port.
332 */
333#define MPO_CONTEXT_AS_GUARD 0x01 /* Add guard to the port */
334#define MPO_QLIMIT 0x02 /* Set qlimit for the port msg queue */
335#define MPO_TEMPOWNER 0x04 /* Set the tempowner bit of the port */
336#define MPO_IMPORTANCE_RECEIVER 0x08 /* Mark the port as importance receiver */
337#define MPO_INSERT_SEND_RIGHT 0x10 /* Insert a send right for the port */
338#define MPO_STRICT 0x20 /* Apply strict guarding for port */
339#define MPO_DENAP_RECEIVER 0x40 /* Mark the port as App de-nap receiver */
340#define MPO_IMMOVABLE_RECEIVE 0x80 /* Mark the port as immovable; protected by the guard context */
341#define MPO_FILTER_MSG 0x100 /* Allow message filtering */
342#define MPO_TG_BLOCK_TRACKING 0x200 /* Track blocking relationship for thread group during sync IPC */
343
344/*
345 * Structure to define optional attributes for a newly
346 * constructed port.
347 */
348typedef struct mach_port_options {
349 uint32_t flags; /* Flags defining attributes for port */
350 mach_port_limits_t mpl; /* Message queue limit for port */
351 union {
352 uint64_t reserved[2]; /* Reserved */
353 mach_port_name_t work_interval_port; /* Work interval port */
354 };
355}mach_port_options_t;
356
357typedef mach_port_options_t *mach_port_options_ptr_t;
358
359/*
360 * EXC_GUARD represents a guard violation for both
361 * mach ports and file descriptors. GUARD_TYPE_ is used
362 * to differentiate among them.
363 */
364#define GUARD_TYPE_MACH_PORT 0x1
365
366/* Reasons for exception for a guarded mach port */
367enum mach_port_guard_exception_codes {
368 kGUARD_EXC_DESTROY = 1u << 0,
369 kGUARD_EXC_MOD_REFS = 1u << 1,
370 kGUARD_EXC_SET_CONTEXT = 1u << 2,
371 kGUARD_EXC_UNGUARDED = 1u << 3,
372 kGUARD_EXC_INCORRECT_GUARD = 1u << 4,
373 kGUARD_EXC_IMMOVABLE = 1u << 5,
374 kGUARD_EXC_STRICT_REPLY = 1u << 6,
375 kGUARD_EXC_MSG_FILTERED = 1u << 7,
376 /* start of [optionally] non-fatal guards */
377 kGUARD_EXC_INVALID_RIGHT = 1u << 8,
378 kGUARD_EXC_INVALID_NAME = 1u << 9,
379 kGUARD_EXC_INVALID_VALUE = 1u << 10,
380 kGUARD_EXC_INVALID_ARGUMENT = 1u << 11,
381 kGUARD_EXC_RIGHT_EXISTS = 1u << 12,
382 kGUARD_EXC_KERN_NO_SPACE = 1u << 13,
383 kGUARD_EXC_KERN_FAILURE = 1u << 14,
384 kGUARD_EXC_KERN_RESOURCE = 1u << 15,
385 kGUARD_EXC_SEND_INVALID_REPLY = 1u << 16,
386 kGUARD_EXC_SEND_INVALID_VOUCHER = 1u << 17,
387 kGUARD_EXC_SEND_INVALID_RIGHT = 1u << 18,
388 kGUARD_EXC_RCV_INVALID_NAME = 1u << 19,
389 kGUARD_EXC_RCV_GUARDED_DESC = 1u << 20, /* should never be fatal; for development only */
390 kGUARD_EXC_MOD_REFS_NON_FATAL = 1u << 21,
391 kGUARD_EXC_IMMOVABLE_NON_FATAL = 1u << 22,
392};
393
394#define MAX_FATAL_kGUARD_EXC_CODE (1u << 7)
395
396/*
397 * Mach port guard flags.
398 */
399#define MPG_FLAGS_NONE (0x00ull)
400
401/*
402 * These flags are used as bits in the subcode of kGUARD_EXC_STRICT_REPLY exceptions.
403 */
404#define MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_DISP (0x01ull << 56)
405#define MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_PORT (0x02ull << 56)
406#define MPG_FLAGS_STRICT_REPLY_INVALID_VOUCHER (0x04ull << 56)
407#define MPG_FLAGS_STRICT_REPLY_NO_BANK_ATTR (0x08ull << 56)
408#define MPG_FLAGS_STRICT_REPLY_MISMATCHED_PERSONA (0x10ull << 56)
409#define MPG_FLAGS_STRICT_REPLY_MASK (0xffull << 56)
410
411/*
412 * These flags are used as bits in the subcode of kGUARD_EXC_MOD_REFS exceptions.
413 */
414#define MPG_FLAGS_MOD_REFS_PINNED_DEALLOC (0x01ull << 56)
415
416/*
417 * These flags are used as bits in the subcode of kGUARD_EXC_IMMOVABLE exceptions.
418 */
419#define MPG_FLAGS_IMMOVABLE_PINNED (0x01ull << 56)
420
421/*
422 * Flags for mach_port_guard_with_flags. These flags extend
423 * the attributes associated with a guarded port.
424 */
425#define MPG_STRICT 0x01 /* Apply strict guarding for a port */
426#define MPG_IMMOVABLE_RECEIVE 0x02 /* Receive right cannot be moved out of the space */
427
428#if !__DARWIN_UNIX03 && !defined(_NO_PORT_T_FROM_MACH)
429/*
430 * Mach 3.0 renamed everything to have mach_ in front of it.
431 * These types and macros are provided for backward compatibility
432 * but are deprecated.
433 */
434typedef mach_port_t port_t;
435typedef mach_port_name_t port_name_t;
436typedef mach_port_name_t *port_name_array_t;
437
438#define PORT_NULL ((port_t) 0)
439#define PORT_DEAD ((port_t) ~0)
440#define PORT_VALID(name) \
441 ((port_t)(name) != PORT_NULL && (port_t)(name) != PORT_DEAD)
442
443#endif /* !__DARWIN_UNIX03 && !_NO_PORT_T_FROM_MACH */
444
445#endif /* _MACH_PORT_H_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/task.h+48-106
......@@ -49,10 +49,9 @@ typedef function_table_entry *function_table_t;
4949#endif /* AUTOTEST */
5050
5151#ifndef task_MSG_COUNT
52#define task_MSG_COUNT 63
52#define task_MSG_COUNT 61
5353#endif /* task_MSG_COUNT */
5454
55#include <Availability.h>
5655#include <mach/std_types.h>
5756#include <mach/mig.h>
5857#include <mach/mig.h>
......@@ -112,7 +111,8 @@ mig_external
112111#else
113112extern
114113#endif /* mig_external */
115__TVOS_PROHIBITED __WATCHOS_PROHIBITED
114__WATCHOS_PROHIBITED
115__TVOS_PROHIBITED
116116kern_return_t mach_ports_register
117117(
118118 task_t target_task,
......@@ -126,7 +126,8 @@ mig_external
126126#else
127127extern
128128#endif /* mig_external */
129__TVOS_PROHIBITED __WATCHOS_PROHIBITED
129__WATCHOS_PROHIBITED
130__TVOS_PROHIBITED
130131kern_return_t mach_ports_lookup
131132(
132133 task_t target_task,
......@@ -154,7 +155,8 @@ mig_external
154155#else
155156extern
156157#endif /* mig_external */
157__TVOS_PROHIBITED __WATCHOS_PROHIBITED
158__WATCHOS_PROHIBITED
159__TVOS_PROHIBITED
158160kern_return_t task_set_info
159161(
160162 task_t target_task,
......@@ -169,7 +171,8 @@ mig_external
169171#else
170172extern
171173#endif /* mig_external */
172__TVOS_PROHIBITED __WATCHOS_PROHIBITED
174__WATCHOS_PROHIBITED
175__TVOS_PROHIBITED
173176kern_return_t task_suspend
174177(
175178 task_read_t target_task
......@@ -181,7 +184,8 @@ mig_external
181184#else
182185extern
183186#endif /* mig_external */
184__TVOS_PROHIBITED __WATCHOS_PROHIBITED
187__WATCHOS_PROHIBITED
188__TVOS_PROHIBITED
185189kern_return_t task_resume
186190(
187191 task_read_t target_task
......@@ -193,7 +197,8 @@ mig_external
193197#else
194198extern
195199#endif /* mig_external */
196__TVOS_PROHIBITED __WATCHOS_PROHIBITED
200__WATCHOS_PROHIBITED
201__TVOS_PROHIBITED
197202kern_return_t task_get_special_port
198203(
199204 task_inspect_t task,
......@@ -207,7 +212,8 @@ mig_external
207212#else
208213extern
209214#endif /* mig_external */
210__TVOS_PROHIBITED __WATCHOS_PROHIBITED
215__WATCHOS_PROHIBITED
216__TVOS_PROHIBITED
211217kern_return_t task_set_special_port
212218(
213219 task_t task,
......@@ -221,7 +227,8 @@ mig_external
221227#else
222228extern
223229#endif /* mig_external */
224__TVOS_PROHIBITED __WATCHOS_PROHIBITED
230__WATCHOS_PROHIBITED
231__TVOS_PROHIBITED
225232kern_return_t thread_create
226233(
227234 task_t parent_task,
......@@ -234,7 +241,8 @@ mig_external
234241#else
235242extern
236243#endif /* mig_external */
237__TVOS_PROHIBITED __WATCHOS_PROHIBITED
244__WATCHOS_PROHIBITED
245__TVOS_PROHIBITED
238246kern_return_t thread_create_running
239247(
240248 task_t parent_task,
......@@ -250,7 +258,8 @@ mig_external
250258#else
251259extern
252260#endif /* mig_external */
253__TVOS_PROHIBITED __WATCHOS_PROHIBITED
261__WATCHOS_PROHIBITED
262__TVOS_PROHIBITED
254263kern_return_t task_set_exception_ports
255264(
256265 task_t task,
......@@ -266,7 +275,8 @@ mig_external
266275#else
267276extern
268277#endif /* mig_external */
269__TVOS_PROHIBITED __WATCHOS_PROHIBITED
278__WATCHOS_PROHIBITED
279__TVOS_PROHIBITED
270280kern_return_t task_get_exception_ports
271281(
272282 task_t task,
......@@ -284,7 +294,8 @@ mig_external
284294#else
285295extern
286296#endif /* mig_external */
287__TVOS_PROHIBITED __WATCHOS_PROHIBITED
297__WATCHOS_PROHIBITED
298__TVOS_PROHIBITED
288299kern_return_t task_swap_exception_ports
289300(
290301 task_t task,
......@@ -357,7 +368,8 @@ mig_external
357368#else
358369extern
359370#endif /* mig_external */
360__TVOS_PROHIBITED __WATCHOS_PROHIBITED
371__WATCHOS_PROHIBITED
372__TVOS_PROHIBITED
361373kern_return_t task_policy_set
362374(
363375 task_policy_set_t task,
......@@ -372,7 +384,8 @@ mig_external
372384#else
373385extern
374386#endif /* mig_external */
375__TVOS_PROHIBITED __WATCHOS_PROHIBITED
387__WATCHOS_PROHIBITED
388__TVOS_PROHIBITED
376389kern_return_t task_policy_get
377390(
378391 task_policy_get_t task,
......@@ -470,7 +483,8 @@ mig_external
470483#else
471484extern
472485#endif /* mig_external */
473__TVOS_PROHIBITED __WATCHOS_PROHIBITED
486__WATCHOS_PROHIBITED
487__TVOS_PROHIBITED
474488kern_return_t task_zone_info
475489(
476490 task_inspect_t target_task,
......@@ -541,7 +555,8 @@ mig_external
541555#else
542556extern
543557#endif /* mig_external */
544__TVOS_PROHIBITED __WATCHOS_PROHIBITED
558__WATCHOS_PROHIBITED
559__TVOS_PROHIBITED
545560kern_return_t task_get_state
546561(
547562 task_read_t task,
......@@ -556,7 +571,8 @@ mig_external
556571#else
557572extern
558573#endif /* mig_external */
559__TVOS_PROHIBITED __WATCHOS_PROHIBITED
574__WATCHOS_PROHIBITED
575__TVOS_PROHIBITED
560576kern_return_t task_set_state
561577(
562578 task_t task,
......@@ -571,7 +587,8 @@ mig_external
571587#else
572588extern
573589#endif /* mig_external */
574__TVOS_PROHIBITED __WATCHOS_PROHIBITED
590__WATCHOS_PROHIBITED
591__TVOS_PROHIBITED
575592kern_return_t task_set_phys_footprint_limit
576593(
577594 task_t task,
......@@ -585,7 +602,8 @@ mig_external
585602#else
586603extern
587604#endif /* mig_external */
588__TVOS_PROHIBITED __WATCHOS_PROHIBITED
605__WATCHOS_PROHIBITED
606__TVOS_PROHIBITED
589607kern_return_t task_suspend2
590608(
591609 task_read_t target_task,
......@@ -598,7 +616,8 @@ mig_external
598616#else
599617extern
600618#endif /* mig_external */
601__TVOS_PROHIBITED __WATCHOS_PROHIBITED
619__WATCHOS_PROHIBITED
620__TVOS_PROHIBITED
602621kern_return_t task_resume2
603622(
604623 task_suspension_token_t suspend_token
......@@ -622,7 +641,8 @@ mig_external
622641#else
623642extern
624643#endif /* mig_external */
625__TVOS_PROHIBITED __WATCHOS_PROHIBITED
644__WATCHOS_PROHIBITED
645__TVOS_PROHIBITED
626646kern_return_t task_get_mach_voucher
627647(
628648 task_read_t task,
......@@ -636,7 +656,8 @@ mig_external
636656#else
637657extern
638658#endif /* mig_external */
639__TVOS_PROHIBITED __WATCHOS_PROHIBITED
659__WATCHOS_PROHIBITED
660__TVOS_PROHIBITED
640661kern_return_t task_set_mach_voucher
641662(
642663 task_t task,
......@@ -649,7 +670,8 @@ mig_external
649670#else
650671extern
651672#endif /* mig_external */
652__TVOS_PROHIBITED __WATCHOS_PROHIBITED
673__WATCHOS_PROHIBITED
674__TVOS_PROHIBITED
653675kern_return_t task_swap_mach_voucher
654676(
655677 task_t task,
......@@ -892,30 +914,6 @@ kern_return_t task_get_exception_ports_info
892914 exception_flavor_array_t old_flavors
893915);
894916
895/* Routine task_test_sync_upcall */
896#ifdef mig_external
897mig_external
898#else
899extern
900#endif /* mig_external */
901kern_return_t task_test_sync_upcall
902(
903 task_t task,
904 mach_port_t port
905);
906
907/* Routine task_set_corpse_forking_behavior */
908#ifdef mig_external
909mig_external
910#else
911extern
912#endif /* mig_external */
913kern_return_t task_set_corpse_forking_behavior
914(
915 task_t task,
916 task_corpse_forking_behavior_t behavior
917);
918
919917__END_DECLS
920918
921919/********************** Caution **************************/
......@@ -1714,32 +1712,6 @@ __END_DECLS
17141712#ifdef __MigPackStructs
17151713#pragma pack(pop)
17161714#endif
1717
1718#ifdef __MigPackStructs
1719#pragma pack(push, 4)
1720#endif
1721 typedef struct {
1722 mach_msg_header_t Head;
1723 /* start of the kernel processed data */
1724 mach_msg_body_t msgh_body;
1725 mach_msg_port_descriptor_t port;
1726 /* end of the kernel processed data */
1727 } __Request__task_test_sync_upcall_t __attribute__((unused));
1728#ifdef __MigPackStructs
1729#pragma pack(pop)
1730#endif
1731
1732#ifdef __MigPackStructs
1733#pragma pack(push, 4)
1734#endif
1735 typedef struct {
1736 mach_msg_header_t Head;
1737 NDR_record_t NDR;
1738 task_corpse_forking_behavior_t behavior;
1739 } __Request__task_set_corpse_forking_behavior_t __attribute__((unused));
1740#ifdef __MigPackStructs
1741#pragma pack(pop)
1742#endif
17431715#endif /* !__Request__task_subsystem__defined */
17441716
17451717/* union of all requests */
......@@ -1807,8 +1779,6 @@ union __RequestUnion__task_subsystem {
18071779 __Request__task_identity_token_get_task_port_t Request_task_identity_token_get_task_port;
18081780 __Request__task_dyld_process_info_notify_deregister_t Request_task_dyld_process_info_notify_deregister;
18091781 __Request__task_get_exception_ports_info_t Request_task_get_exception_ports_info;
1810 __Request__task_test_sync_upcall_t Request_task_test_sync_upcall;
1811 __Request__task_set_corpse_forking_behavior_t Request_task_set_corpse_forking_behavior;
18121782};
18131783#endif /* !__RequestUnion__task_subsystem__defined */
18141784/* typedefs for all replies */
......@@ -2622,30 +2592,6 @@ union __RequestUnion__task_subsystem {
26222592#ifdef __MigPackStructs
26232593#pragma pack(pop)
26242594#endif
2625
2626#ifdef __MigPackStructs
2627#pragma pack(push, 4)
2628#endif
2629 typedef struct {
2630 mach_msg_header_t Head;
2631 NDR_record_t NDR;
2632 kern_return_t RetCode;
2633 } __Reply__task_test_sync_upcall_t __attribute__((unused));
2634#ifdef __MigPackStructs
2635#pragma pack(pop)
2636#endif
2637
2638#ifdef __MigPackStructs
2639#pragma pack(push, 4)
2640#endif
2641 typedef struct {
2642 mach_msg_header_t Head;
2643 NDR_record_t NDR;
2644 kern_return_t RetCode;
2645 } __Reply__task_set_corpse_forking_behavior_t __attribute__((unused));
2646#ifdef __MigPackStructs
2647#pragma pack(pop)
2648#endif
26492595#endif /* !__Reply__task_subsystem__defined */
26502596
26512597/* union of all replies */
......@@ -2713,8 +2659,6 @@ union __ReplyUnion__task_subsystem {
27132659 __Reply__task_identity_token_get_task_port_t Reply_task_identity_token_get_task_port;
27142660 __Reply__task_dyld_process_info_notify_deregister_t Reply_task_dyld_process_info_notify_deregister;
27152661 __Reply__task_get_exception_ports_info_t Reply_task_get_exception_ports_info;
2716 __Reply__task_test_sync_upcall_t Reply_task_test_sync_upcall;
2717 __Reply__task_set_corpse_forking_behavior_t Reply_task_set_corpse_forking_behavior;
27182662};
27192663#endif /* !__RequestUnion__task_subsystem__defined */
27202664
......@@ -2779,9 +2723,7 @@ union __ReplyUnion__task_subsystem {
27792723 { "task_create_identity_token", 3457 },\
27802724 { "task_identity_token_get_task_port", 3458 },\
27812725 { "task_dyld_process_info_notify_deregister", 3459 },\
2782 { "task_get_exception_ports_info", 3460 },\
2783 { "task_test_sync_upcall", 3461 },\
2784 { "task_set_corpse_forking_behavior", 3462 }
2726 { "task_get_exception_ports_info", 3460 }
27852727#endif
27862728
27872729#ifdef __AfterMigUserHeader
lib/libc/include/any-macos.11-any/mach/task_info.h-10
......@@ -494,7 +494,6 @@ typedef struct task_flags_info * task_flags_info_t;
494494typedef uint32_t task_exc_guard_behavior_t;
495495
496496/* EXC_GUARD optional delivery settings on a per-task basis */
497#define TASK_EXC_GUARD_NONE 0x00
498497#define TASK_EXC_GUARD_VM_DELIVER 0x01 /* Deliver virtual memory EXC_GUARD exceptions */
499498#define TASK_EXC_GUARD_VM_ONCE 0x02 /* Deliver them only once */
500499#define TASK_EXC_GUARD_VM_CORPSE 0x04 /* Deliver them via a forked corpse */
......@@ -510,15 +509,6 @@ typedef uint32_t task_exc_guard_behavior_t;
510509#define TASK_EXC_GUARD_ALL 0xff /* All optional deliver settings */
511510
512511
513/*
514 * Type to control corpse forking options for a task
515 * via task_get/set_corpse_forking_behavior interface(s).
516 */
517typedef uint32_t task_corpse_forking_behavior_t;
518
519#define TASK_CORPSE_FORKING_DISABLED_MEM_DIAG 0x01 /* Disable corpse forking because the task is running under a diagnostic tool */
520
521
522512/*
523513 * Obsolete interfaces.
524514 */
lib/libc/include/any-macos.11-any/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) */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/task_special_ports.h created+135
......@@ -0,0 +1,135 @@
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 * Evolving and likely to change.
86 */
87
88#define TASK_SEATBELT_PORT 7 /* Seatbelt compiler/DEM port for task. */
89
90/* PORT 8 was the GSSD TASK PORT which transformed to a host port */
91
92#define TASK_ACCESS_PORT 9 /* Permission check for task_for_pid. */
93
94#define TASK_DEBUG_CONTROL_PORT 10 /* debug control port */
95
96#define TASK_RESOURCE_NOTIFY_PORT 11 /* overrides host special RN port */
97
98#define TASK_MAX_SPECIAL_PORT TASK_RESOURCE_NOTIFY_PORT
99
100/*
101 * Definitions for ease of use
102 */
103
104#define task_get_kernel_port(task, port) \
105 (task_get_special_port((task), TASK_KERNEL_PORT, (port)))
106
107#define task_set_kernel_port(task, port) \
108 (task_set_special_port((task), TASK_KERNEL_PORT, (port)))
109
110#define task_get_host_port(task, port) \
111 (task_get_special_port((task), TASK_HOST_PORT, (port)))
112
113#define task_set_host_port(task, port) \
114 (task_set_special_port((task), TASK_HOST_PORT, (port)))
115
116#define task_get_bootstrap_port(task, port) \
117 (task_get_special_port((task), TASK_BOOTSTRAP_PORT, (port)))
118
119#define task_get_debug_control_port(task, port) \
120 (task_get_special_port((task), TASK_DEBUG_CONTROL_PORT, (port)))
121
122#define task_set_bootstrap_port(task, port) \
123 (task_set_special_port((task), TASK_BOOTSTRAP_PORT, (port)))
124
125#define task_get_task_access_port(task, port) \
126 (task_get_special_port((task), TASK_ACCESS_PORT, (port)))
127
128#define task_set_task_access_port(task, port) \
129 (task_set_special_port((task), TASK_ACCESS_PORT, (port)))
130
131#define task_set_task_debug_control_port(task, port) \
132 (task_set_special_port((task), TASK_DEBUG_CONTROL_PORT, (port)))
133
134
135#endif /* _MACH_TASK_SPECIAL_PORTS_H_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/thread_act.h created+1435
......@@ -0,0 +1,1435 @@
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 31
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_read_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_read_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/* Routine thread_get_exception_ports_info */
488#ifdef mig_external
489mig_external
490#else
491extern
492#endif /* mig_external */
493kern_return_t thread_get_exception_ports_info
494(
495 mach_port_t port,
496 exception_mask_t exception_mask,
497 exception_mask_array_t masks,
498 mach_msg_type_number_t *masksCnt,
499 exception_handler_info_array_t old_handlers_info,
500 exception_behavior_array_t old_behaviors,
501 exception_flavor_array_t old_flavors
502);
503
504__END_DECLS
505
506/********************** Caution **************************/
507/* The following data types should be used to calculate */
508/* maximum message sizes only. The actual message may be */
509/* smaller, and the position of the arguments within the */
510/* message layout may vary from what is presented here. */
511/* For example, if any of the arguments are variable- */
512/* sized, and less than the maximum is sent, the data */
513/* will be packed tight in the actual message to reduce */
514/* the presence of holes. */
515/********************** Caution **************************/
516
517/* typedefs for all requests */
518
519#ifndef __Request__thread_act_subsystem__defined
520#define __Request__thread_act_subsystem__defined
521
522#ifdef __MigPackStructs
523#pragma pack(push, 4)
524#endif
525 typedef struct {
526 mach_msg_header_t Head;
527 } __Request__thread_terminate_t __attribute__((unused));
528#ifdef __MigPackStructs
529#pragma pack(pop)
530#endif
531
532#ifdef __MigPackStructs
533#pragma pack(push, 4)
534#endif
535 typedef struct {
536 mach_msg_header_t Head;
537 NDR_record_t NDR;
538 int flavor;
539 mach_msg_type_number_t old_stateCnt;
540 } __Request__act_get_state_t __attribute__((unused));
541#ifdef __MigPackStructs
542#pragma pack(pop)
543#endif
544
545#ifdef __MigPackStructs
546#pragma pack(push, 4)
547#endif
548 typedef struct {
549 mach_msg_header_t Head;
550 NDR_record_t NDR;
551 int flavor;
552 mach_msg_type_number_t new_stateCnt;
553 natural_t new_state[1296];
554 } __Request__act_set_state_t __attribute__((unused));
555#ifdef __MigPackStructs
556#pragma pack(pop)
557#endif
558
559#ifdef __MigPackStructs
560#pragma pack(push, 4)
561#endif
562 typedef struct {
563 mach_msg_header_t Head;
564 NDR_record_t NDR;
565 thread_state_flavor_t flavor;
566 mach_msg_type_number_t old_stateCnt;
567 } __Request__thread_get_state_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 NDR_record_t NDR;
578 thread_state_flavor_t flavor;
579 mach_msg_type_number_t new_stateCnt;
580 natural_t new_state[1296];
581 } __Request__thread_set_state_t __attribute__((unused));
582#ifdef __MigPackStructs
583#pragma pack(pop)
584#endif
585
586#ifdef __MigPackStructs
587#pragma pack(push, 4)
588#endif
589 typedef struct {
590 mach_msg_header_t Head;
591 } __Request__thread_suspend_t __attribute__((unused));
592#ifdef __MigPackStructs
593#pragma pack(pop)
594#endif
595
596#ifdef __MigPackStructs
597#pragma pack(push, 4)
598#endif
599 typedef struct {
600 mach_msg_header_t Head;
601 } __Request__thread_resume_t __attribute__((unused));
602#ifdef __MigPackStructs
603#pragma pack(pop)
604#endif
605
606#ifdef __MigPackStructs
607#pragma pack(push, 4)
608#endif
609 typedef struct {
610 mach_msg_header_t Head;
611 } __Request__thread_abort_t __attribute__((unused));
612#ifdef __MigPackStructs
613#pragma pack(pop)
614#endif
615
616#ifdef __MigPackStructs
617#pragma pack(push, 4)
618#endif
619 typedef struct {
620 mach_msg_header_t Head;
621 } __Request__thread_abort_safely_t __attribute__((unused));
622#ifdef __MigPackStructs
623#pragma pack(pop)
624#endif
625
626#ifdef __MigPackStructs
627#pragma pack(push, 4)
628#endif
629 typedef struct {
630 mach_msg_header_t Head;
631 } __Request__thread_depress_abort_t __attribute__((unused));
632#ifdef __MigPackStructs
633#pragma pack(pop)
634#endif
635
636#ifdef __MigPackStructs
637#pragma pack(push, 4)
638#endif
639 typedef struct {
640 mach_msg_header_t Head;
641 NDR_record_t NDR;
642 int which_port;
643 } __Request__thread_get_special_port_t __attribute__((unused));
644#ifdef __MigPackStructs
645#pragma pack(pop)
646#endif
647
648#ifdef __MigPackStructs
649#pragma pack(push, 4)
650#endif
651 typedef struct {
652 mach_msg_header_t Head;
653 /* start of the kernel processed data */
654 mach_msg_body_t msgh_body;
655 mach_msg_port_descriptor_t special_port;
656 /* end of the kernel processed data */
657 NDR_record_t NDR;
658 int which_port;
659 } __Request__thread_set_special_port_t __attribute__((unused));
660#ifdef __MigPackStructs
661#pragma pack(pop)
662#endif
663
664#ifdef __MigPackStructs
665#pragma pack(push, 4)
666#endif
667 typedef struct {
668 mach_msg_header_t Head;
669 NDR_record_t NDR;
670 thread_flavor_t flavor;
671 mach_msg_type_number_t thread_info_outCnt;
672 } __Request__thread_info_t __attribute__((unused));
673#ifdef __MigPackStructs
674#pragma pack(pop)
675#endif
676
677#ifdef __MigPackStructs
678#pragma pack(push, 4)
679#endif
680 typedef struct {
681 mach_msg_header_t Head;
682 /* start of the kernel processed data */
683 mach_msg_body_t msgh_body;
684 mach_msg_port_descriptor_t new_port;
685 /* end of the kernel processed data */
686 NDR_record_t NDR;
687 exception_mask_t exception_mask;
688 exception_behavior_t behavior;
689 thread_state_flavor_t new_flavor;
690 } __Request__thread_set_exception_ports_t __attribute__((unused));
691#ifdef __MigPackStructs
692#pragma pack(pop)
693#endif
694
695#ifdef __MigPackStructs
696#pragma pack(push, 4)
697#endif
698 typedef struct {
699 mach_msg_header_t Head;
700 NDR_record_t NDR;
701 exception_mask_t exception_mask;
702 } __Request__thread_get_exception_ports_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 /* start of the kernel processed data */
713 mach_msg_body_t msgh_body;
714 mach_msg_port_descriptor_t new_port;
715 /* end of the kernel processed data */
716 NDR_record_t NDR;
717 exception_mask_t exception_mask;
718 exception_behavior_t behavior;
719 thread_state_flavor_t new_flavor;
720 } __Request__thread_swap_exception_ports_t __attribute__((unused));
721#ifdef __MigPackStructs
722#pragma pack(pop)
723#endif
724
725#ifdef __MigPackStructs
726#pragma pack(push, 4)
727#endif
728 typedef struct {
729 mach_msg_header_t Head;
730 NDR_record_t NDR;
731 policy_t policy;
732 mach_msg_type_number_t baseCnt;
733 integer_t base[5];
734 boolean_t set_limit;
735 } __Request__thread_policy_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 NDR_record_t NDR;
746 thread_policy_flavor_t flavor;
747 mach_msg_type_number_t policy_infoCnt;
748 integer_t policy_info[16];
749 } __Request__thread_policy_set_t __attribute__((unused));
750#ifdef __MigPackStructs
751#pragma pack(pop)
752#endif
753
754#ifdef __MigPackStructs
755#pragma pack(push, 4)
756#endif
757 typedef struct {
758 mach_msg_header_t Head;
759 NDR_record_t NDR;
760 thread_policy_flavor_t flavor;
761 mach_msg_type_number_t policy_infoCnt;
762 boolean_t get_default;
763 } __Request__thread_policy_get_t __attribute__((unused));
764#ifdef __MigPackStructs
765#pragma pack(pop)
766#endif
767
768#ifdef __MigPackStructs
769#pragma pack(push, 4)
770#endif
771 typedef struct {
772 mach_msg_header_t Head;
773 /* start of the kernel processed data */
774 mach_msg_body_t msgh_body;
775 mach_msg_port_descriptor_t reply;
776 /* end of the kernel processed data */
777 } __Request__thread_sample_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 boolean_t trace_status;
789 } __Request__etap_trace_thread_t __attribute__((unused));
790#ifdef __MigPackStructs
791#pragma pack(pop)
792#endif
793
794#ifdef __MigPackStructs
795#pragma pack(push, 4)
796#endif
797 typedef struct {
798 mach_msg_header_t Head;
799 /* start of the kernel processed data */
800 mach_msg_body_t msgh_body;
801 mach_msg_port_descriptor_t new_set;
802 /* end of the kernel processed data */
803 } __Request__thread_assign_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 } __Request__thread_assign_default_t __attribute__((unused));
814#ifdef __MigPackStructs
815#pragma pack(pop)
816#endif
817
818#ifdef __MigPackStructs
819#pragma pack(push, 4)
820#endif
821 typedef struct {
822 mach_msg_header_t Head;
823 } __Request__thread_get_assignment_t __attribute__((unused));
824#ifdef __MigPackStructs
825#pragma pack(pop)
826#endif
827
828#ifdef __MigPackStructs
829#pragma pack(push, 4)
830#endif
831 typedef struct {
832 mach_msg_header_t Head;
833 /* start of the kernel processed data */
834 mach_msg_body_t msgh_body;
835 mach_msg_port_descriptor_t pset;
836 /* end of the kernel processed data */
837 NDR_record_t NDR;
838 policy_t policy;
839 mach_msg_type_number_t baseCnt;
840 integer_t base[5];
841 mach_msg_type_number_t limitCnt;
842 integer_t limit[1];
843 } __Request__thread_set_policy_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 mach_voucher_selector_t which;
855 } __Request__thread_get_mach_voucher_t __attribute__((unused));
856#ifdef __MigPackStructs
857#pragma pack(pop)
858#endif
859
860#ifdef __MigPackStructs
861#pragma pack(push, 4)
862#endif
863 typedef struct {
864 mach_msg_header_t Head;
865 /* start of the kernel processed data */
866 mach_msg_body_t msgh_body;
867 mach_msg_port_descriptor_t voucher;
868 /* end of the kernel processed data */
869 } __Request__thread_set_mach_voucher_t __attribute__((unused));
870#ifdef __MigPackStructs
871#pragma pack(pop)
872#endif
873
874#ifdef __MigPackStructs
875#pragma pack(push, 4)
876#endif
877 typedef struct {
878 mach_msg_header_t Head;
879 /* start of the kernel processed data */
880 mach_msg_body_t msgh_body;
881 mach_msg_port_descriptor_t new_voucher;
882 mach_msg_port_descriptor_t old_voucher;
883 /* end of the kernel processed data */
884 } __Request__thread_swap_mach_voucher_t __attribute__((unused));
885#ifdef __MigPackStructs
886#pragma pack(pop)
887#endif
888
889#ifdef __MigPackStructs
890#pragma pack(push, 4)
891#endif
892 typedef struct {
893 mach_msg_header_t Head;
894 NDR_record_t NDR;
895 int direction;
896 thread_state_flavor_t flavor;
897 mach_msg_type_number_t in_stateCnt;
898 natural_t in_state[1296];
899 mach_msg_type_number_t out_stateCnt;
900 } __Request__thread_convert_thread_state_t __attribute__((unused));
901#ifdef __MigPackStructs
902#pragma pack(pop)
903#endif
904
905#ifdef __MigPackStructs
906#pragma pack(push, 4)
907#endif
908 typedef struct {
909 mach_msg_header_t Head;
910 NDR_record_t NDR;
911 exception_mask_t exception_mask;
912 } __Request__thread_get_exception_ports_info_t __attribute__((unused));
913#ifdef __MigPackStructs
914#pragma pack(pop)
915#endif
916#endif /* !__Request__thread_act_subsystem__defined */
917
918/* union of all requests */
919
920#ifndef __RequestUnion__thread_act_subsystem__defined
921#define __RequestUnion__thread_act_subsystem__defined
922union __RequestUnion__thread_act_subsystem {
923 __Request__thread_terminate_t Request_thread_terminate;
924 __Request__act_get_state_t Request_act_get_state;
925 __Request__act_set_state_t Request_act_set_state;
926 __Request__thread_get_state_t Request_thread_get_state;
927 __Request__thread_set_state_t Request_thread_set_state;
928 __Request__thread_suspend_t Request_thread_suspend;
929 __Request__thread_resume_t Request_thread_resume;
930 __Request__thread_abort_t Request_thread_abort;
931 __Request__thread_abort_safely_t Request_thread_abort_safely;
932 __Request__thread_depress_abort_t Request_thread_depress_abort;
933 __Request__thread_get_special_port_t Request_thread_get_special_port;
934 __Request__thread_set_special_port_t Request_thread_set_special_port;
935 __Request__thread_info_t Request_thread_info;
936 __Request__thread_set_exception_ports_t Request_thread_set_exception_ports;
937 __Request__thread_get_exception_ports_t Request_thread_get_exception_ports;
938 __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports;
939 __Request__thread_policy_t Request_thread_policy;
940 __Request__thread_policy_set_t Request_thread_policy_set;
941 __Request__thread_policy_get_t Request_thread_policy_get;
942 __Request__thread_sample_t Request_thread_sample;
943 __Request__etap_trace_thread_t Request_etap_trace_thread;
944 __Request__thread_assign_t Request_thread_assign;
945 __Request__thread_assign_default_t Request_thread_assign_default;
946 __Request__thread_get_assignment_t Request_thread_get_assignment;
947 __Request__thread_set_policy_t Request_thread_set_policy;
948 __Request__thread_get_mach_voucher_t Request_thread_get_mach_voucher;
949 __Request__thread_set_mach_voucher_t Request_thread_set_mach_voucher;
950 __Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher;
951 __Request__thread_convert_thread_state_t Request_thread_convert_thread_state;
952 __Request__thread_get_exception_ports_info_t Request_thread_get_exception_ports_info;
953};
954#endif /* !__RequestUnion__thread_act_subsystem__defined */
955/* typedefs for all replies */
956
957#ifndef __Reply__thread_act_subsystem__defined
958#define __Reply__thread_act_subsystem__defined
959
960#ifdef __MigPackStructs
961#pragma pack(push, 4)
962#endif
963 typedef struct {
964 mach_msg_header_t Head;
965 NDR_record_t NDR;
966 kern_return_t RetCode;
967 } __Reply__thread_terminate_t __attribute__((unused));
968#ifdef __MigPackStructs
969#pragma pack(pop)
970#endif
971
972#ifdef __MigPackStructs
973#pragma pack(push, 4)
974#endif
975 typedef struct {
976 mach_msg_header_t Head;
977 NDR_record_t NDR;
978 kern_return_t RetCode;
979 mach_msg_type_number_t old_stateCnt;
980 natural_t old_state[1296];
981 } __Reply__act_get_state_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 kern_return_t RetCode;
993 } __Reply__act_set_state_t __attribute__((unused));
994#ifdef __MigPackStructs
995#pragma pack(pop)
996#endif
997
998#ifdef __MigPackStructs
999#pragma pack(push, 4)
1000#endif
1001 typedef struct {
1002 mach_msg_header_t Head;
1003 NDR_record_t NDR;
1004 kern_return_t RetCode;
1005 mach_msg_type_number_t old_stateCnt;
1006 natural_t old_state[1296];
1007 } __Reply__thread_get_state_t __attribute__((unused));
1008#ifdef __MigPackStructs
1009#pragma pack(pop)
1010#endif
1011
1012#ifdef __MigPackStructs
1013#pragma pack(push, 4)
1014#endif
1015 typedef struct {
1016 mach_msg_header_t Head;
1017 NDR_record_t NDR;
1018 kern_return_t RetCode;
1019 } __Reply__thread_set_state_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__thread_suspend_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 NDR_record_t NDR;
1042 kern_return_t RetCode;
1043 } __Reply__thread_resume_t __attribute__((unused));
1044#ifdef __MigPackStructs
1045#pragma pack(pop)
1046#endif
1047
1048#ifdef __MigPackStructs
1049#pragma pack(push, 4)
1050#endif
1051 typedef struct {
1052 mach_msg_header_t Head;
1053 NDR_record_t NDR;
1054 kern_return_t RetCode;
1055 } __Reply__thread_abort_t __attribute__((unused));
1056#ifdef __MigPackStructs
1057#pragma pack(pop)
1058#endif
1059
1060#ifdef __MigPackStructs
1061#pragma pack(push, 4)
1062#endif
1063 typedef struct {
1064 mach_msg_header_t Head;
1065 NDR_record_t NDR;
1066 kern_return_t RetCode;
1067 } __Reply__thread_abort_safely_t __attribute__((unused));
1068#ifdef __MigPackStructs
1069#pragma pack(pop)
1070#endif
1071
1072#ifdef __MigPackStructs
1073#pragma pack(push, 4)
1074#endif
1075 typedef struct {
1076 mach_msg_header_t Head;
1077 NDR_record_t NDR;
1078 kern_return_t RetCode;
1079 } __Reply__thread_depress_abort_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 special_port;
1092 /* end of the kernel processed data */
1093 } __Reply__thread_get_special_port_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 NDR_record_t NDR;
1104 kern_return_t RetCode;
1105 } __Reply__thread_set_special_port_t __attribute__((unused));
1106#ifdef __MigPackStructs
1107#pragma pack(pop)
1108#endif
1109
1110#ifdef __MigPackStructs
1111#pragma pack(push, 4)
1112#endif
1113 typedef struct {
1114 mach_msg_header_t Head;
1115 NDR_record_t NDR;
1116 kern_return_t RetCode;
1117 mach_msg_type_number_t thread_info_outCnt;
1118 integer_t thread_info_out[32];
1119 } __Reply__thread_info_t __attribute__((unused));
1120#ifdef __MigPackStructs
1121#pragma pack(pop)
1122#endif
1123
1124#ifdef __MigPackStructs
1125#pragma pack(push, 4)
1126#endif
1127 typedef struct {
1128 mach_msg_header_t Head;
1129 NDR_record_t NDR;
1130 kern_return_t RetCode;
1131 } __Reply__thread_set_exception_ports_t __attribute__((unused));
1132#ifdef __MigPackStructs
1133#pragma pack(pop)
1134#endif
1135
1136#ifdef __MigPackStructs
1137#pragma pack(push, 4)
1138#endif
1139 typedef struct {
1140 mach_msg_header_t Head;
1141 /* start of the kernel processed data */
1142 mach_msg_body_t msgh_body;
1143 mach_msg_port_descriptor_t old_handlers[32];
1144 /* end of the kernel processed data */
1145 NDR_record_t NDR;
1146 mach_msg_type_number_t masksCnt;
1147 exception_mask_t masks[32];
1148 exception_behavior_t old_behaviors[32];
1149 thread_state_flavor_t old_flavors[32];
1150 } __Reply__thread_get_exception_ports_t __attribute__((unused));
1151#ifdef __MigPackStructs
1152#pragma pack(pop)
1153#endif
1154
1155#ifdef __MigPackStructs
1156#pragma pack(push, 4)
1157#endif
1158 typedef struct {
1159 mach_msg_header_t Head;
1160 /* start of the kernel processed data */
1161 mach_msg_body_t msgh_body;
1162 mach_msg_port_descriptor_t old_handlers[32];
1163 /* end of the kernel processed data */
1164 NDR_record_t NDR;
1165 mach_msg_type_number_t masksCnt;
1166 exception_mask_t masks[32];
1167 exception_behavior_t old_behaviors[32];
1168 thread_state_flavor_t old_flavors[32];
1169 } __Reply__thread_swap_exception_ports_t __attribute__((unused));
1170#ifdef __MigPackStructs
1171#pragma pack(pop)
1172#endif
1173
1174#ifdef __MigPackStructs
1175#pragma pack(push, 4)
1176#endif
1177 typedef struct {
1178 mach_msg_header_t Head;
1179 NDR_record_t NDR;
1180 kern_return_t RetCode;
1181 } __Reply__thread_policy_t __attribute__((unused));
1182#ifdef __MigPackStructs
1183#pragma pack(pop)
1184#endif
1185
1186#ifdef __MigPackStructs
1187#pragma pack(push, 4)
1188#endif
1189 typedef struct {
1190 mach_msg_header_t Head;
1191 NDR_record_t NDR;
1192 kern_return_t RetCode;
1193 } __Reply__thread_policy_set_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 mach_msg_type_number_t policy_infoCnt;
1206 integer_t policy_info[16];
1207 boolean_t get_default;
1208 } __Reply__thread_policy_get_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 } __Reply__thread_sample_t __attribute__((unused));
1221#ifdef __MigPackStructs
1222#pragma pack(pop)
1223#endif
1224
1225#ifdef __MigPackStructs
1226#pragma pack(push, 4)
1227#endif
1228 typedef struct {
1229 mach_msg_header_t Head;
1230 NDR_record_t NDR;
1231 kern_return_t RetCode;
1232 } __Reply__etap_trace_thread_t __attribute__((unused));
1233#ifdef __MigPackStructs
1234#pragma pack(pop)
1235#endif
1236
1237#ifdef __MigPackStructs
1238#pragma pack(push, 4)
1239#endif
1240 typedef struct {
1241 mach_msg_header_t Head;
1242 NDR_record_t NDR;
1243 kern_return_t RetCode;
1244 } __Reply__thread_assign_t __attribute__((unused));
1245#ifdef __MigPackStructs
1246#pragma pack(pop)
1247#endif
1248
1249#ifdef __MigPackStructs
1250#pragma pack(push, 4)
1251#endif
1252 typedef struct {
1253 mach_msg_header_t Head;
1254 NDR_record_t NDR;
1255 kern_return_t RetCode;
1256 } __Reply__thread_assign_default_t __attribute__((unused));
1257#ifdef __MigPackStructs
1258#pragma pack(pop)
1259#endif
1260
1261#ifdef __MigPackStructs
1262#pragma pack(push, 4)
1263#endif
1264 typedef struct {
1265 mach_msg_header_t Head;
1266 /* start of the kernel processed data */
1267 mach_msg_body_t msgh_body;
1268 mach_msg_port_descriptor_t assigned_set;
1269 /* end of the kernel processed data */
1270 } __Reply__thread_get_assignment_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__thread_set_policy_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 /* start of the kernel processed data */
1293 mach_msg_body_t msgh_body;
1294 mach_msg_port_descriptor_t voucher;
1295 /* end of the kernel processed data */
1296 } __Reply__thread_get_mach_voucher_t __attribute__((unused));
1297#ifdef __MigPackStructs
1298#pragma pack(pop)
1299#endif
1300
1301#ifdef __MigPackStructs
1302#pragma pack(push, 4)
1303#endif
1304 typedef struct {
1305 mach_msg_header_t Head;
1306 NDR_record_t NDR;
1307 kern_return_t RetCode;
1308 } __Reply__thread_set_mach_voucher_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 old_voucher;
1321 /* end of the kernel processed data */
1322 } __Reply__thread_swap_mach_voucher_t __attribute__((unused));
1323#ifdef __MigPackStructs
1324#pragma pack(pop)
1325#endif
1326
1327#ifdef __MigPackStructs
1328#pragma pack(push, 4)
1329#endif
1330 typedef struct {
1331 mach_msg_header_t Head;
1332 NDR_record_t NDR;
1333 kern_return_t RetCode;
1334 mach_msg_type_number_t out_stateCnt;
1335 natural_t out_state[1296];
1336 } __Reply__thread_convert_thread_state_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 NDR_record_t NDR;
1347 kern_return_t RetCode;
1348 mach_msg_type_number_t masksCnt;
1349 exception_mask_t masks[32];
1350 exception_handler_info_t old_handlers_info[32];
1351 exception_behavior_t old_behaviors[32];
1352 thread_state_flavor_t old_flavors[32];
1353 } __Reply__thread_get_exception_ports_info_t __attribute__((unused));
1354#ifdef __MigPackStructs
1355#pragma pack(pop)
1356#endif
1357#endif /* !__Reply__thread_act_subsystem__defined */
1358
1359/* union of all replies */
1360
1361#ifndef __ReplyUnion__thread_act_subsystem__defined
1362#define __ReplyUnion__thread_act_subsystem__defined
1363union __ReplyUnion__thread_act_subsystem {
1364 __Reply__thread_terminate_t Reply_thread_terminate;
1365 __Reply__act_get_state_t Reply_act_get_state;
1366 __Reply__act_set_state_t Reply_act_set_state;
1367 __Reply__thread_get_state_t Reply_thread_get_state;
1368 __Reply__thread_set_state_t Reply_thread_set_state;
1369 __Reply__thread_suspend_t Reply_thread_suspend;
1370 __Reply__thread_resume_t Reply_thread_resume;
1371 __Reply__thread_abort_t Reply_thread_abort;
1372 __Reply__thread_abort_safely_t Reply_thread_abort_safely;
1373 __Reply__thread_depress_abort_t Reply_thread_depress_abort;
1374 __Reply__thread_get_special_port_t Reply_thread_get_special_port;
1375 __Reply__thread_set_special_port_t Reply_thread_set_special_port;
1376 __Reply__thread_info_t Reply_thread_info;
1377 __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports;
1378 __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports;
1379 __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports;
1380 __Reply__thread_policy_t Reply_thread_policy;
1381 __Reply__thread_policy_set_t Reply_thread_policy_set;
1382 __Reply__thread_policy_get_t Reply_thread_policy_get;
1383 __Reply__thread_sample_t Reply_thread_sample;
1384 __Reply__etap_trace_thread_t Reply_etap_trace_thread;
1385 __Reply__thread_assign_t Reply_thread_assign;
1386 __Reply__thread_assign_default_t Reply_thread_assign_default;
1387 __Reply__thread_get_assignment_t Reply_thread_get_assignment;
1388 __Reply__thread_set_policy_t Reply_thread_set_policy;
1389 __Reply__thread_get_mach_voucher_t Reply_thread_get_mach_voucher;
1390 __Reply__thread_set_mach_voucher_t Reply_thread_set_mach_voucher;
1391 __Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher;
1392 __Reply__thread_convert_thread_state_t Reply_thread_convert_thread_state;
1393 __Reply__thread_get_exception_ports_info_t Reply_thread_get_exception_ports_info;
1394};
1395#endif /* !__RequestUnion__thread_act_subsystem__defined */
1396
1397#ifndef subsystem_to_name_map_thread_act
1398#define subsystem_to_name_map_thread_act \
1399 { "thread_terminate", 3600 },\
1400 { "act_get_state", 3601 },\
1401 { "act_set_state", 3602 },\
1402 { "thread_get_state", 3603 },\
1403 { "thread_set_state", 3604 },\
1404 { "thread_suspend", 3605 },\
1405 { "thread_resume", 3606 },\
1406 { "thread_abort", 3607 },\
1407 { "thread_abort_safely", 3608 },\
1408 { "thread_depress_abort", 3609 },\
1409 { "thread_get_special_port", 3610 },\
1410 { "thread_set_special_port", 3611 },\
1411 { "thread_info", 3612 },\
1412 { "thread_set_exception_ports", 3613 },\
1413 { "thread_get_exception_ports", 3614 },\
1414 { "thread_swap_exception_ports", 3615 },\
1415 { "thread_policy", 3616 },\
1416 { "thread_policy_set", 3617 },\
1417 { "thread_policy_get", 3618 },\
1418 { "thread_sample", 3619 },\
1419 { "etap_trace_thread", 3620 },\
1420 { "thread_assign", 3621 },\
1421 { "thread_assign_default", 3622 },\
1422 { "thread_get_assignment", 3623 },\
1423 { "thread_set_policy", 3624 },\
1424 { "thread_get_mach_voucher", 3625 },\
1425 { "thread_set_mach_voucher", 3626 },\
1426 { "thread_swap_mach_voucher", 3627 },\
1427 { "thread_convert_thread_state", 3628 },\
1428 { "thread_get_exception_ports_info", 3630 }
1429#endif
1430
1431#ifdef __AfterMigUserHeader
1432__AfterMigUserHeader
1433#endif /* __AfterMigUserHeader */
1434
1435#endif /* _thread_act_user_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/thread_state.h created+63
......@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 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#ifndef _MACH_THREAD_STATE_H_
30#define _MACH_THREAD_STATE_H_
31
32#include <Availability.h>
33#include <mach/mach.h>
34
35#ifndef KERNEL
36/*
37 * Gets all register values in the target thread with pointer-like contents.
38 *
39 * There is no guarantee that the returned values are valid pointers, but all
40 * valid pointers will be returned. The order and count of the provided
41 * register values is unspecified and may change; registers with values that
42 * are not valid pointers may be omitted, so the number of pointers returned
43 * may vary from call to call.
44 *
45 * sp is an out parameter that will contain the stack pointer.
46 * length is an in/out parameter for the length of the values array.
47 * values is an array of pointers.
48 *
49 * This may only be called on threads in the current task. If the current
50 * platform defines a stack red zone, the stack pointer returned will be
51 * adjusted to account for red zone.
52 *
53 * If length is insufficient, KERN_INSUFFICIENT_BUFFER_SIZE will be returned
54 * and length set to the amount of memory required. Callers MUST NOT assume
55 * that any particular size of buffer will be sufficient and should retry with
56 * an appropriately sized buffer upon this error.
57 */
58__API_AVAILABLE(macosx(10.14), ios(12.0), tvos(9.0), watchos(5.0))
59kern_return_t thread_get_register_pointer_values(thread_t thread,
60 uintptr_t *sp, size_t *length, uintptr_t *values);
61#endif
62
63#endif /* _MACH_THREAD_STATE_H_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/vm_map.h created+1503
......@@ -0,0 +1,1503 @@
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 33
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/* Routine vm_remap_new */
497#ifdef mig_external
498mig_external
499#else
500extern
501#endif /* mig_external */
502kern_return_t vm_remap_new
503(
504 vm_map_t target_task,
505 vm_address_t *target_address,
506 vm_size_t size,
507 vm_address_t mask,
508 int flags,
509 vm_map_read_t src_task,
510 vm_address_t src_address,
511 boolean_t copy,
512 vm_prot_t *cur_protection,
513 vm_prot_t *max_protection,
514 vm_inherit_t inheritance
515);
516
517__END_DECLS
518
519/********************** Caution **************************/
520/* The following data types should be used to calculate */
521/* maximum message sizes only. The actual message may be */
522/* smaller, and the position of the arguments within the */
523/* message layout may vary from what is presented here. */
524/* For example, if any of the arguments are variable- */
525/* sized, and less than the maximum is sent, the data */
526/* will be packed tight in the actual message to reduce */
527/* the presence of holes. */
528/********************** Caution **************************/
529
530/* typedefs for all requests */
531
532#ifndef __Request__vm_map_subsystem__defined
533#define __Request__vm_map_subsystem__defined
534
535#ifdef __MigPackStructs
536#pragma pack(push, 4)
537#endif
538 typedef struct {
539 mach_msg_header_t Head;
540 NDR_record_t NDR;
541 vm_address_t address;
542 vm_region_flavor_t flavor;
543 mach_msg_type_number_t infoCnt;
544 } __Request__vm_region_t __attribute__((unused));
545#ifdef __MigPackStructs
546#pragma pack(pop)
547#endif
548
549#ifdef __MigPackStructs
550#pragma pack(push, 4)
551#endif
552 typedef struct {
553 mach_msg_header_t Head;
554 NDR_record_t NDR;
555 vm_address_t address;
556 vm_size_t size;
557 int flags;
558 } __Request__vm_allocate_t __attribute__((unused));
559#ifdef __MigPackStructs
560#pragma pack(pop)
561#endif
562
563#ifdef __MigPackStructs
564#pragma pack(push, 4)
565#endif
566 typedef struct {
567 mach_msg_header_t Head;
568 NDR_record_t NDR;
569 vm_address_t address;
570 vm_size_t size;
571 } __Request__vm_deallocate_t __attribute__((unused));
572#ifdef __MigPackStructs
573#pragma pack(pop)
574#endif
575
576#ifdef __MigPackStructs
577#pragma pack(push, 4)
578#endif
579 typedef struct {
580 mach_msg_header_t Head;
581 NDR_record_t NDR;
582 vm_address_t address;
583 vm_size_t size;
584 boolean_t set_maximum;
585 vm_prot_t new_protection;
586 } __Request__vm_protect_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 NDR_record_t NDR;
597 vm_address_t address;
598 vm_size_t size;
599 vm_inherit_t new_inheritance;
600 } __Request__vm_inherit_t __attribute__((unused));
601#ifdef __MigPackStructs
602#pragma pack(pop)
603#endif
604
605#ifdef __MigPackStructs
606#pragma pack(push, 4)
607#endif
608 typedef struct {
609 mach_msg_header_t Head;
610 NDR_record_t NDR;
611 vm_address_t address;
612 vm_size_t size;
613 } __Request__vm_read_t __attribute__((unused));
614#ifdef __MigPackStructs
615#pragma pack(pop)
616#endif
617
618#ifdef __MigPackStructs
619#pragma pack(push, 4)
620#endif
621 typedef struct {
622 mach_msg_header_t Head;
623 NDR_record_t NDR;
624 vm_read_entry_t data_list;
625 natural_t count;
626 } __Request__vm_read_list_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_ool_descriptor_t data;
639 /* end of the kernel processed data */
640 NDR_record_t NDR;
641 vm_address_t address;
642 mach_msg_type_number_t dataCnt;
643 } __Request__vm_write_t __attribute__((unused));
644#ifdef __MigPackStructs
645#pragma pack(pop)
646#endif
647
648#ifdef __MigPackStructs
649#pragma pack(push, 4)
650#endif
651 typedef struct {
652 mach_msg_header_t Head;
653 NDR_record_t NDR;
654 vm_address_t source_address;
655 vm_size_t size;
656 vm_address_t dest_address;
657 } __Request__vm_copy_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 NDR_record_t NDR;
668 vm_address_t address;
669 vm_size_t size;
670 vm_address_t data;
671 } __Request__vm_read_overwrite_t __attribute__((unused));
672#ifdef __MigPackStructs
673#pragma pack(pop)
674#endif
675
676#ifdef __MigPackStructs
677#pragma pack(push, 4)
678#endif
679 typedef struct {
680 mach_msg_header_t Head;
681 NDR_record_t NDR;
682 vm_address_t address;
683 vm_size_t size;
684 vm_sync_t sync_flags;
685 } __Request__vm_msync_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 NDR_record_t NDR;
696 vm_address_t address;
697 vm_size_t size;
698 vm_behavior_t new_behavior;
699 } __Request__vm_behavior_set_t __attribute__((unused));
700#ifdef __MigPackStructs
701#pragma pack(pop)
702#endif
703
704#ifdef __MigPackStructs
705#pragma pack(push, 4)
706#endif
707 typedef struct {
708 mach_msg_header_t Head;
709 /* start of the kernel processed data */
710 mach_msg_body_t msgh_body;
711 mach_msg_port_descriptor_t object;
712 /* end of the kernel processed data */
713 NDR_record_t NDR;
714 vm_address_t address;
715 vm_size_t size;
716 vm_address_t mask;
717 int flags;
718 vm_offset_t offset;
719 boolean_t copy;
720 vm_prot_t cur_protection;
721 vm_prot_t max_protection;
722 vm_inherit_t inheritance;
723 } __Request__vm_map_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 vm_address_t address;
735 vm_size_t size;
736 vm_machine_attribute_t attribute;
737 vm_machine_attribute_val_t value;
738 } __Request__vm_machine_attribute_t __attribute__((unused));
739#ifdef __MigPackStructs
740#pragma pack(pop)
741#endif
742
743#ifdef __MigPackStructs
744#pragma pack(push, 4)
745#endif
746 typedef struct {
747 mach_msg_header_t Head;
748 /* start of the kernel processed data */
749 mach_msg_body_t msgh_body;
750 mach_msg_port_descriptor_t src_task;
751 /* end of the kernel processed data */
752 NDR_record_t NDR;
753 vm_address_t target_address;
754 vm_size_t size;
755 vm_address_t mask;
756 int flags;
757 vm_address_t src_address;
758 boolean_t copy;
759 vm_inherit_t inheritance;
760 } __Request__vm_remap_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 must_wire;
772 } __Request__task_wire_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 parent_entry;
785 /* end of the kernel processed data */
786 NDR_record_t NDR;
787 vm_size_t size;
788 vm_offset_t offset;
789 vm_prot_t permission;
790 } __Request__mach_make_memory_entry_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 NDR_record_t NDR;
801 vm_offset_t offset;
802 } __Request__vm_map_page_query_t __attribute__((unused));
803#ifdef __MigPackStructs
804#pragma pack(pop)
805#endif
806
807#ifdef __MigPackStructs
808#pragma pack(push, 4)
809#endif
810 typedef struct {
811 mach_msg_header_t Head;
812 NDR_record_t NDR;
813 vm_address_t address;
814 } __Request__mach_vm_region_info_t __attribute__((unused));
815#ifdef __MigPackStructs
816#pragma pack(pop)
817#endif
818
819#ifdef __MigPackStructs
820#pragma pack(push, 4)
821#endif
822 typedef struct {
823 mach_msg_header_t Head;
824 } __Request__vm_mapped_pages_info_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 vm_address_t address;
836 natural_t nesting_depth;
837 mach_msg_type_number_t infoCnt;
838 } __Request__vm_region_recurse_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 NDR_record_t NDR;
849 vm_address_t address;
850 natural_t nesting_depth;
851 mach_msg_type_number_t infoCnt;
852 } __Request__vm_region_recurse_64_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 NDR_record_t NDR;
863 vm_address_t address;
864 } __Request__mach_vm_region_info_64_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 vm_address_t address;
876 vm_region_flavor_t flavor;
877 mach_msg_type_number_t infoCnt;
878 } __Request__vm_region_64_t __attribute__((unused));
879#ifdef __MigPackStructs
880#pragma pack(pop)
881#endif
882
883#ifdef __MigPackStructs
884#pragma pack(push, 4)
885#endif
886 typedef struct {
887 mach_msg_header_t Head;
888 /* start of the kernel processed data */
889 mach_msg_body_t msgh_body;
890 mach_msg_port_descriptor_t parent_entry;
891 /* end of the kernel processed data */
892 NDR_record_t NDR;
893 memory_object_size_t size;
894 memory_object_offset_t offset;
895 vm_prot_t permission;
896 } __Request__mach_make_memory_entry_64_t __attribute__((unused));
897#ifdef __MigPackStructs
898#pragma pack(pop)
899#endif
900
901#ifdef __MigPackStructs
902#pragma pack(push, 4)
903#endif
904 typedef struct {
905 mach_msg_header_t Head;
906 /* start of the kernel processed data */
907 mach_msg_body_t msgh_body;
908 mach_msg_port_descriptor_t object;
909 /* end of the kernel processed data */
910 NDR_record_t NDR;
911 vm_address_t address;
912 vm_size_t size;
913 vm_address_t mask;
914 int flags;
915 memory_object_offset_t offset;
916 boolean_t copy;
917 vm_prot_t cur_protection;
918 vm_prot_t max_protection;
919 vm_inherit_t inheritance;
920 } __Request__vm_map_64_t __attribute__((unused));
921#ifdef __MigPackStructs
922#pragma pack(pop)
923#endif
924
925#ifdef __MigPackStructs
926#pragma pack(push, 4)
927#endif
928 typedef struct {
929 mach_msg_header_t Head;
930 NDR_record_t NDR;
931 vm_address_t address;
932 vm_purgable_t control;
933 int state;
934 } __Request__vm_purgable_control_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__vm_map_exec_lockdown_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 /* start of the kernel processed data */
955 mach_msg_body_t msgh_body;
956 mach_msg_port_descriptor_t src_task;
957 /* end of the kernel processed data */
958 NDR_record_t NDR;
959 vm_address_t target_address;
960 vm_size_t size;
961 vm_address_t mask;
962 int flags;
963 vm_address_t src_address;
964 boolean_t copy;
965 vm_prot_t cur_protection;
966 vm_prot_t max_protection;
967 vm_inherit_t inheritance;
968 } __Request__vm_remap_new_t __attribute__((unused));
969#ifdef __MigPackStructs
970#pragma pack(pop)
971#endif
972#endif /* !__Request__vm_map_subsystem__defined */
973
974/* union of all requests */
975
976#ifndef __RequestUnion__vm_map_subsystem__defined
977#define __RequestUnion__vm_map_subsystem__defined
978union __RequestUnion__vm_map_subsystem {
979 __Request__vm_region_t Request_vm_region;
980 __Request__vm_allocate_t Request_vm_allocate;
981 __Request__vm_deallocate_t Request_vm_deallocate;
982 __Request__vm_protect_t Request_vm_protect;
983 __Request__vm_inherit_t Request_vm_inherit;
984 __Request__vm_read_t Request_vm_read;
985 __Request__vm_read_list_t Request_vm_read_list;
986 __Request__vm_write_t Request_vm_write;
987 __Request__vm_copy_t Request_vm_copy;
988 __Request__vm_read_overwrite_t Request_vm_read_overwrite;
989 __Request__vm_msync_t Request_vm_msync;
990 __Request__vm_behavior_set_t Request_vm_behavior_set;
991 __Request__vm_map_t Request_vm_map;
992 __Request__vm_machine_attribute_t Request_vm_machine_attribute;
993 __Request__vm_remap_t Request_vm_remap;
994 __Request__task_wire_t Request_task_wire;
995 __Request__mach_make_memory_entry_t Request_mach_make_memory_entry;
996 __Request__vm_map_page_query_t Request_vm_map_page_query;
997 __Request__mach_vm_region_info_t Request_mach_vm_region_info;
998 __Request__vm_mapped_pages_info_t Request_vm_mapped_pages_info;
999 __Request__vm_region_recurse_t Request_vm_region_recurse;
1000 __Request__vm_region_recurse_64_t Request_vm_region_recurse_64;
1001 __Request__mach_vm_region_info_64_t Request_mach_vm_region_info_64;
1002 __Request__vm_region_64_t Request_vm_region_64;
1003 __Request__mach_make_memory_entry_64_t Request_mach_make_memory_entry_64;
1004 __Request__vm_map_64_t Request_vm_map_64;
1005 __Request__vm_purgable_control_t Request_vm_purgable_control;
1006 __Request__vm_map_exec_lockdown_t Request_vm_map_exec_lockdown;
1007 __Request__vm_remap_new_t Request_vm_remap_new;
1008};
1009#endif /* !__RequestUnion__vm_map_subsystem__defined */
1010/* typedefs for all replies */
1011
1012#ifndef __Reply__vm_map_subsystem__defined
1013#define __Reply__vm_map_subsystem__defined
1014
1015#ifdef __MigPackStructs
1016#pragma pack(push, 4)
1017#endif
1018 typedef struct {
1019 mach_msg_header_t Head;
1020 /* start of the kernel processed data */
1021 mach_msg_body_t msgh_body;
1022 mach_msg_port_descriptor_t object_name;
1023 /* end of the kernel processed data */
1024 NDR_record_t NDR;
1025 vm_address_t address;
1026 vm_size_t size;
1027 mach_msg_type_number_t infoCnt;
1028 int info[10];
1029 } __Reply__vm_region_t __attribute__((unused));
1030#ifdef __MigPackStructs
1031#pragma pack(pop)
1032#endif
1033
1034#ifdef __MigPackStructs
1035#pragma pack(push, 4)
1036#endif
1037 typedef struct {
1038 mach_msg_header_t Head;
1039 NDR_record_t NDR;
1040 kern_return_t RetCode;
1041 vm_address_t address;
1042 } __Reply__vm_allocate_t __attribute__((unused));
1043#ifdef __MigPackStructs
1044#pragma pack(pop)
1045#endif
1046
1047#ifdef __MigPackStructs
1048#pragma pack(push, 4)
1049#endif
1050 typedef struct {
1051 mach_msg_header_t Head;
1052 NDR_record_t NDR;
1053 kern_return_t RetCode;
1054 } __Reply__vm_deallocate_t __attribute__((unused));
1055#ifdef __MigPackStructs
1056#pragma pack(pop)
1057#endif
1058
1059#ifdef __MigPackStructs
1060#pragma pack(push, 4)
1061#endif
1062 typedef struct {
1063 mach_msg_header_t Head;
1064 NDR_record_t NDR;
1065 kern_return_t RetCode;
1066 } __Reply__vm_protect_t __attribute__((unused));
1067#ifdef __MigPackStructs
1068#pragma pack(pop)
1069#endif
1070
1071#ifdef __MigPackStructs
1072#pragma pack(push, 4)
1073#endif
1074 typedef struct {
1075 mach_msg_header_t Head;
1076 NDR_record_t NDR;
1077 kern_return_t RetCode;
1078 } __Reply__vm_inherit_t __attribute__((unused));
1079#ifdef __MigPackStructs
1080#pragma pack(pop)
1081#endif
1082
1083#ifdef __MigPackStructs
1084#pragma pack(push, 4)
1085#endif
1086 typedef struct {
1087 mach_msg_header_t Head;
1088 /* start of the kernel processed data */
1089 mach_msg_body_t msgh_body;
1090 mach_msg_ool_descriptor_t data;
1091 /* end of the kernel processed data */
1092 NDR_record_t NDR;
1093 mach_msg_type_number_t dataCnt;
1094 } __Reply__vm_read_t __attribute__((unused));
1095#ifdef __MigPackStructs
1096#pragma pack(pop)
1097#endif
1098
1099#ifdef __MigPackStructs
1100#pragma pack(push, 4)
1101#endif
1102 typedef struct {
1103 mach_msg_header_t Head;
1104 NDR_record_t NDR;
1105 kern_return_t RetCode;
1106 vm_read_entry_t data_list;
1107 } __Reply__vm_read_list_t __attribute__((unused));
1108#ifdef __MigPackStructs
1109#pragma pack(pop)
1110#endif
1111
1112#ifdef __MigPackStructs
1113#pragma pack(push, 4)
1114#endif
1115 typedef struct {
1116 mach_msg_header_t Head;
1117 NDR_record_t NDR;
1118 kern_return_t RetCode;
1119 } __Reply__vm_write_t __attribute__((unused));
1120#ifdef __MigPackStructs
1121#pragma pack(pop)
1122#endif
1123
1124#ifdef __MigPackStructs
1125#pragma pack(push, 4)
1126#endif
1127 typedef struct {
1128 mach_msg_header_t Head;
1129 NDR_record_t NDR;
1130 kern_return_t RetCode;
1131 } __Reply__vm_copy_t __attribute__((unused));
1132#ifdef __MigPackStructs
1133#pragma pack(pop)
1134#endif
1135
1136#ifdef __MigPackStructs
1137#pragma pack(push, 4)
1138#endif
1139 typedef struct {
1140 mach_msg_header_t Head;
1141 NDR_record_t NDR;
1142 kern_return_t RetCode;
1143 vm_size_t outsize;
1144 } __Reply__vm_read_overwrite_t __attribute__((unused));
1145#ifdef __MigPackStructs
1146#pragma pack(pop)
1147#endif
1148
1149#ifdef __MigPackStructs
1150#pragma pack(push, 4)
1151#endif
1152 typedef struct {
1153 mach_msg_header_t Head;
1154 NDR_record_t NDR;
1155 kern_return_t RetCode;
1156 } __Reply__vm_msync_t __attribute__((unused));
1157#ifdef __MigPackStructs
1158#pragma pack(pop)
1159#endif
1160
1161#ifdef __MigPackStructs
1162#pragma pack(push, 4)
1163#endif
1164 typedef struct {
1165 mach_msg_header_t Head;
1166 NDR_record_t NDR;
1167 kern_return_t RetCode;
1168 } __Reply__vm_behavior_set_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 vm_address_t address;
1181 } __Reply__vm_map_t __attribute__((unused));
1182#ifdef __MigPackStructs
1183#pragma pack(pop)
1184#endif
1185
1186#ifdef __MigPackStructs
1187#pragma pack(push, 4)
1188#endif
1189 typedef struct {
1190 mach_msg_header_t Head;
1191 NDR_record_t NDR;
1192 kern_return_t RetCode;
1193 vm_machine_attribute_val_t value;
1194 } __Reply__vm_machine_attribute_t __attribute__((unused));
1195#ifdef __MigPackStructs
1196#pragma pack(pop)
1197#endif
1198
1199#ifdef __MigPackStructs
1200#pragma pack(push, 4)
1201#endif
1202 typedef struct {
1203 mach_msg_header_t Head;
1204 NDR_record_t NDR;
1205 kern_return_t RetCode;
1206 vm_address_t target_address;
1207 vm_prot_t cur_protection;
1208 vm_prot_t max_protection;
1209 } __Reply__vm_remap_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 NDR_record_t NDR;
1220 kern_return_t RetCode;
1221 } __Reply__task_wire_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 /* start of the kernel processed data */
1232 mach_msg_body_t msgh_body;
1233 mach_msg_port_descriptor_t object_handle;
1234 /* end of the kernel processed data */
1235 NDR_record_t NDR;
1236 vm_size_t size;
1237 } __Reply__mach_make_memory_entry_t __attribute__((unused));
1238#ifdef __MigPackStructs
1239#pragma pack(pop)
1240#endif
1241
1242#ifdef __MigPackStructs
1243#pragma pack(push, 4)
1244#endif
1245 typedef struct {
1246 mach_msg_header_t Head;
1247 NDR_record_t NDR;
1248 kern_return_t RetCode;
1249 integer_t disposition;
1250 integer_t ref_count;
1251 } __Reply__vm_map_page_query_t __attribute__((unused));
1252#ifdef __MigPackStructs
1253#pragma pack(pop)
1254#endif
1255
1256#ifdef __MigPackStructs
1257#pragma pack(push, 4)
1258#endif
1259 typedef struct {
1260 mach_msg_header_t Head;
1261 /* start of the kernel processed data */
1262 mach_msg_body_t msgh_body;
1263 mach_msg_ool_descriptor_t objects;
1264 /* end of the kernel processed data */
1265 NDR_record_t NDR;
1266 vm_info_region_t region;
1267 mach_msg_type_number_t objectsCnt;
1268 } __Reply__mach_vm_region_info_t __attribute__((unused));
1269#ifdef __MigPackStructs
1270#pragma pack(pop)
1271#endif
1272
1273#ifdef __MigPackStructs
1274#pragma pack(push, 4)
1275#endif
1276 typedef struct {
1277 mach_msg_header_t Head;
1278 /* start of the kernel processed data */
1279 mach_msg_body_t msgh_body;
1280 mach_msg_ool_descriptor_t pages;
1281 /* end of the kernel processed data */
1282 NDR_record_t NDR;
1283 mach_msg_type_number_t pagesCnt;
1284 } __Reply__vm_mapped_pages_info_t __attribute__((unused));
1285#ifdef __MigPackStructs
1286#pragma pack(pop)
1287#endif
1288
1289#ifdef __MigPackStructs
1290#pragma pack(push, 4)
1291#endif
1292 typedef struct {
1293 mach_msg_header_t Head;
1294 NDR_record_t NDR;
1295 kern_return_t RetCode;
1296 vm_address_t address;
1297 vm_size_t size;
1298 natural_t nesting_depth;
1299 mach_msg_type_number_t infoCnt;
1300 int info[19];
1301 } __Reply__vm_region_recurse_t __attribute__((unused));
1302#ifdef __MigPackStructs
1303#pragma pack(pop)
1304#endif
1305
1306#ifdef __MigPackStructs
1307#pragma pack(push, 4)
1308#endif
1309 typedef struct {
1310 mach_msg_header_t Head;
1311 NDR_record_t NDR;
1312 kern_return_t RetCode;
1313 vm_address_t address;
1314 vm_size_t size;
1315 natural_t nesting_depth;
1316 mach_msg_type_number_t infoCnt;
1317 int info[19];
1318 } __Reply__vm_region_recurse_64_t __attribute__((unused));
1319#ifdef __MigPackStructs
1320#pragma pack(pop)
1321#endif
1322
1323#ifdef __MigPackStructs
1324#pragma pack(push, 4)
1325#endif
1326 typedef struct {
1327 mach_msg_header_t Head;
1328 /* start of the kernel processed data */
1329 mach_msg_body_t msgh_body;
1330 mach_msg_ool_descriptor_t objects;
1331 /* end of the kernel processed data */
1332 NDR_record_t NDR;
1333 vm_info_region_64_t region;
1334 mach_msg_type_number_t objectsCnt;
1335 } __Reply__mach_vm_region_info_64_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 /* start of the kernel processed data */
1346 mach_msg_body_t msgh_body;
1347 mach_msg_port_descriptor_t object_name;
1348 /* end of the kernel processed data */
1349 NDR_record_t NDR;
1350 vm_address_t address;
1351 vm_size_t size;
1352 mach_msg_type_number_t infoCnt;
1353 int info[10];
1354 } __Reply__vm_region_64_t __attribute__((unused));
1355#ifdef __MigPackStructs
1356#pragma pack(pop)
1357#endif
1358
1359#ifdef __MigPackStructs
1360#pragma pack(push, 4)
1361#endif
1362 typedef struct {
1363 mach_msg_header_t Head;
1364 /* start of the kernel processed data */
1365 mach_msg_body_t msgh_body;
1366 mach_msg_port_descriptor_t object_handle;
1367 /* end of the kernel processed data */
1368 NDR_record_t NDR;
1369 memory_object_size_t size;
1370 } __Reply__mach_make_memory_entry_64_t __attribute__((unused));
1371#ifdef __MigPackStructs
1372#pragma pack(pop)
1373#endif
1374
1375#ifdef __MigPackStructs
1376#pragma pack(push, 4)
1377#endif
1378 typedef struct {
1379 mach_msg_header_t Head;
1380 NDR_record_t NDR;
1381 kern_return_t RetCode;
1382 vm_address_t address;
1383 } __Reply__vm_map_64_t __attribute__((unused));
1384#ifdef __MigPackStructs
1385#pragma pack(pop)
1386#endif
1387
1388#ifdef __MigPackStructs
1389#pragma pack(push, 4)
1390#endif
1391 typedef struct {
1392 mach_msg_header_t Head;
1393 NDR_record_t NDR;
1394 kern_return_t RetCode;
1395 int state;
1396 } __Reply__vm_purgable_control_t __attribute__((unused));
1397#ifdef __MigPackStructs
1398#pragma pack(pop)
1399#endif
1400
1401#ifdef __MigPackStructs
1402#pragma pack(push, 4)
1403#endif
1404 typedef struct {
1405 mach_msg_header_t Head;
1406 NDR_record_t NDR;
1407 kern_return_t RetCode;
1408 } __Reply__vm_map_exec_lockdown_t __attribute__((unused));
1409#ifdef __MigPackStructs
1410#pragma pack(pop)
1411#endif
1412
1413#ifdef __MigPackStructs
1414#pragma pack(push, 4)
1415#endif
1416 typedef struct {
1417 mach_msg_header_t Head;
1418 NDR_record_t NDR;
1419 kern_return_t RetCode;
1420 vm_address_t target_address;
1421 vm_prot_t cur_protection;
1422 vm_prot_t max_protection;
1423 } __Reply__vm_remap_new_t __attribute__((unused));
1424#ifdef __MigPackStructs
1425#pragma pack(pop)
1426#endif
1427#endif /* !__Reply__vm_map_subsystem__defined */
1428
1429/* union of all replies */
1430
1431#ifndef __ReplyUnion__vm_map_subsystem__defined
1432#define __ReplyUnion__vm_map_subsystem__defined
1433union __ReplyUnion__vm_map_subsystem {
1434 __Reply__vm_region_t Reply_vm_region;
1435 __Reply__vm_allocate_t Reply_vm_allocate;
1436 __Reply__vm_deallocate_t Reply_vm_deallocate;
1437 __Reply__vm_protect_t Reply_vm_protect;
1438 __Reply__vm_inherit_t Reply_vm_inherit;
1439 __Reply__vm_read_t Reply_vm_read;
1440 __Reply__vm_read_list_t Reply_vm_read_list;
1441 __Reply__vm_write_t Reply_vm_write;
1442 __Reply__vm_copy_t Reply_vm_copy;
1443 __Reply__vm_read_overwrite_t Reply_vm_read_overwrite;
1444 __Reply__vm_msync_t Reply_vm_msync;
1445 __Reply__vm_behavior_set_t Reply_vm_behavior_set;
1446 __Reply__vm_map_t Reply_vm_map;
1447 __Reply__vm_machine_attribute_t Reply_vm_machine_attribute;
1448 __Reply__vm_remap_t Reply_vm_remap;
1449 __Reply__task_wire_t Reply_task_wire;
1450 __Reply__mach_make_memory_entry_t Reply_mach_make_memory_entry;
1451 __Reply__vm_map_page_query_t Reply_vm_map_page_query;
1452 __Reply__mach_vm_region_info_t Reply_mach_vm_region_info;
1453 __Reply__vm_mapped_pages_info_t Reply_vm_mapped_pages_info;
1454 __Reply__vm_region_recurse_t Reply_vm_region_recurse;
1455 __Reply__vm_region_recurse_64_t Reply_vm_region_recurse_64;
1456 __Reply__mach_vm_region_info_64_t Reply_mach_vm_region_info_64;
1457 __Reply__vm_region_64_t Reply_vm_region_64;
1458 __Reply__mach_make_memory_entry_64_t Reply_mach_make_memory_entry_64;
1459 __Reply__vm_map_64_t Reply_vm_map_64;
1460 __Reply__vm_purgable_control_t Reply_vm_purgable_control;
1461 __Reply__vm_map_exec_lockdown_t Reply_vm_map_exec_lockdown;
1462 __Reply__vm_remap_new_t Reply_vm_remap_new;
1463};
1464#endif /* !__RequestUnion__vm_map_subsystem__defined */
1465
1466#ifndef subsystem_to_name_map_vm_map
1467#define subsystem_to_name_map_vm_map \
1468 { "vm_region", 3800 },\
1469 { "vm_allocate", 3801 },\
1470 { "vm_deallocate", 3802 },\
1471 { "vm_protect", 3803 },\
1472 { "vm_inherit", 3804 },\
1473 { "vm_read", 3805 },\
1474 { "vm_read_list", 3806 },\
1475 { "vm_write", 3807 },\
1476 { "vm_copy", 3808 },\
1477 { "vm_read_overwrite", 3809 },\
1478 { "vm_msync", 3810 },\
1479 { "vm_behavior_set", 3811 },\
1480 { "vm_map", 3812 },\
1481 { "vm_machine_attribute", 3813 },\
1482 { "vm_remap", 3814 },\
1483 { "task_wire", 3815 },\
1484 { "mach_make_memory_entry", 3816 },\
1485 { "vm_map_page_query", 3817 },\
1486 { "mach_vm_region_info", 3818 },\
1487 { "vm_mapped_pages_info", 3819 },\
1488 { "vm_region_recurse", 3821 },\
1489 { "vm_region_recurse_64", 3822 },\
1490 { "mach_vm_region_info_64", 3823 },\
1491 { "vm_region_64", 3824 },\
1492 { "mach_make_memory_entry_64", 3825 },\
1493 { "vm_map_64", 3826 },\
1494 { "vm_purgable_control", 3830 },\
1495 { "vm_map_exec_lockdown", 3831 },\
1496 { "vm_remap_new", 3832 }
1497#endif
1498
1499#ifdef __AfterMigUserHeader
1500__AfterMigUserHeader
1501#endif /* __AfterMigUserHeader */
1502
1503#endif /* _vm_map_user_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/mach/vm_statistics.h created+552
......@@ -0,0 +1,552 @@
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_PERMANENT 0x0080
276#define VM_FLAGS_OVERWRITE 0x4000 /* delete any existing mappings first */
277/*
278 * VM_FLAGS_SUPERPAGE_MASK
279 * 3 bits that specify whether large pages should be used instead of
280 * base pages (!=0), as well as the requested page size.
281 */
282#define VM_FLAGS_SUPERPAGE_MASK 0x70000 /* bits 0x10000, 0x20000, 0x40000 */
283#define VM_FLAGS_RETURN_DATA_ADDR 0x100000 /* Return address of target data, rather than base of page */
284#define VM_FLAGS_RETURN_4K_DATA_ADDR 0x800000 /* Return 4K aligned address of target data */
285#define VM_FLAGS_ALIAS_MASK 0xFF000000
286#define VM_GET_FLAGS_ALIAS(flags, alias) \
287 (alias) = ((flags) & VM_FLAGS_ALIAS_MASK) >> 24
288#define VM_SET_FLAGS_ALIAS(flags, alias) \
289 (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \
290 (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24))
291
292/* These are the flags that we accept from user-space */
293#define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | \
294 VM_FLAGS_ANYWHERE | \
295 VM_FLAGS_PURGABLE | \
296 VM_FLAGS_4GB_CHUNK | \
297 VM_FLAGS_RANDOM_ADDR | \
298 VM_FLAGS_NO_CACHE | \
299 VM_FLAGS_PERMANENT | \
300 VM_FLAGS_OVERWRITE | \
301 VM_FLAGS_SUPERPAGE_MASK | \
302 VM_FLAGS_ALIAS_MASK)
303#define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | \
304 VM_FLAGS_RETURN_4K_DATA_ADDR | \
305 VM_FLAGS_RETURN_DATA_ADDR)
306#define VM_FLAGS_USER_REMAP (VM_FLAGS_FIXED | \
307 VM_FLAGS_ANYWHERE | \
308 VM_FLAGS_RANDOM_ADDR | \
309 VM_FLAGS_OVERWRITE| \
310 VM_FLAGS_RETURN_DATA_ADDR | \
311 VM_FLAGS_RESILIENT_CODESIGN | \
312 VM_FLAGS_RESILIENT_MEDIA)
313
314#define VM_FLAGS_SUPERPAGE_SHIFT 16
315#define SUPERPAGE_NONE 0 /* no superpages, if all bits are 0 */
316#define SUPERPAGE_SIZE_ANY 1
317#define VM_FLAGS_SUPERPAGE_NONE (SUPERPAGE_NONE << VM_FLAGS_SUPERPAGE_SHIFT)
318#define VM_FLAGS_SUPERPAGE_SIZE_ANY (SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT)
319#define SUPERPAGE_SIZE_2MB 2
320#define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<<VM_FLAGS_SUPERPAGE_SHIFT)
321
322/*
323 * EXC_GUARD definitions for virtual memory.
324 */
325#define GUARD_TYPE_VIRT_MEMORY 0x5
326
327/* Reasons for exception for virtual memory */
328enum virtual_memory_guard_exception_codes {
329 kGUARD_EXC_DEALLOC_GAP = 1u << 0
330};
331
332
333/* current accounting postmark */
334#define __VM_LEDGER_ACCOUNTING_POSTMARK 2019032600
335
336/* discrete values: */
337#define VM_LEDGER_TAG_NONE 0x00000000
338#define VM_LEDGER_TAG_DEFAULT 0x00000001
339#define VM_LEDGER_TAG_NETWORK 0x00000002
340#define VM_LEDGER_TAG_MEDIA 0x00000003
341#define VM_LEDGER_TAG_GRAPHICS 0x00000004
342#define VM_LEDGER_TAG_NEURAL 0x00000005
343#define VM_LEDGER_TAG_MAX 0x00000005
344/* individual bits: */
345#define VM_LEDGER_FLAG_NO_FOOTPRINT 0x00000001
346#define VM_LEDGER_FLAGS (VM_LEDGER_FLAG_NO_FOOTPRINT)
347
348
349#define VM_MEMORY_MALLOC 1
350#define VM_MEMORY_MALLOC_SMALL 2
351#define VM_MEMORY_MALLOC_LARGE 3
352#define VM_MEMORY_MALLOC_HUGE 4
353#define VM_MEMORY_SBRK 5// uninteresting -- no one should call
354#define VM_MEMORY_REALLOC 6
355#define VM_MEMORY_MALLOC_TINY 7
356#define VM_MEMORY_MALLOC_LARGE_REUSABLE 8
357#define VM_MEMORY_MALLOC_LARGE_REUSED 9
358
359#define VM_MEMORY_ANALYSIS_TOOL 10
360
361#define VM_MEMORY_MALLOC_NANO 11
362#define VM_MEMORY_MALLOC_MEDIUM 12
363#define VM_MEMORY_MALLOC_PGUARD 13
364
365#define VM_MEMORY_MACH_MSG 20
366#define VM_MEMORY_IOKIT 21
367#define VM_MEMORY_STACK 30
368#define VM_MEMORY_GUARD 31
369#define VM_MEMORY_SHARED_PMAP 32
370/* memory containing a dylib */
371#define VM_MEMORY_DYLIB 33
372#define VM_MEMORY_OBJC_DISPATCHERS 34
373
374/* Was a nested pmap (VM_MEMORY_SHARED_PMAP) which has now been unnested */
375#define VM_MEMORY_UNSHARED_PMAP 35
376
377
378// Placeholders for now -- as we analyze the libraries and find how they
379// use memory, we can make these labels more specific.
380#define VM_MEMORY_APPKIT 40
381#define VM_MEMORY_FOUNDATION 41
382#define VM_MEMORY_COREGRAPHICS 42
383#define VM_MEMORY_CORESERVICES 43
384#define VM_MEMORY_CARBON VM_MEMORY_CORESERVICES
385#define VM_MEMORY_JAVA 44
386#define VM_MEMORY_COREDATA 45
387#define VM_MEMORY_COREDATA_OBJECTIDS 46
388#define VM_MEMORY_ATS 50
389#define VM_MEMORY_LAYERKIT 51
390#define VM_MEMORY_CGIMAGE 52
391#define VM_MEMORY_TCMALLOC 53
392
393/* private raster data (i.e. layers, some images, QGL allocator) */
394#define VM_MEMORY_COREGRAPHICS_DATA 54
395
396/* shared image and font caches */
397#define VM_MEMORY_COREGRAPHICS_SHARED 55
398
399/* Memory used for virtual framebuffers, shadowing buffers, etc... */
400#define VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS 56
401
402/* Window backing stores, custom shadow data, and compressed backing stores */
403#define VM_MEMORY_COREGRAPHICS_BACKINGSTORES 57
404
405/* x-alloc'd memory */
406#define VM_MEMORY_COREGRAPHICS_XALLOC 58
407
408/* catch-all for other uses, such as the read-only shared data page */
409#define VM_MEMORY_COREGRAPHICS_MISC VM_MEMORY_COREGRAPHICS
410
411/* memory allocated by the dynamic loader for itself */
412#define VM_MEMORY_DYLD 60
413/* malloc'd memory created by dyld */
414#define VM_MEMORY_DYLD_MALLOC 61
415
416/* Used for sqlite page cache */
417#define VM_MEMORY_SQLITE 62
418
419/* JavaScriptCore heaps */
420#define VM_MEMORY_JAVASCRIPT_CORE 63
421#define VM_MEMORY_WEBASSEMBLY VM_MEMORY_JAVASCRIPT_CORE
422/* memory allocated for the JIT */
423#define VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR 64
424#define VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE 65
425
426/* memory allocated for GLSL */
427#define VM_MEMORY_GLSL 66
428
429/* memory allocated for OpenCL.framework */
430#define VM_MEMORY_OPENCL 67
431
432/* memory allocated for QuartzCore.framework */
433#define VM_MEMORY_COREIMAGE 68
434
435/* memory allocated for WebCore Purgeable Buffers */
436#define VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS 69
437
438/* ImageIO memory */
439#define VM_MEMORY_IMAGEIO 70
440
441/* CoreProfile memory */
442#define VM_MEMORY_COREPROFILE 71
443
444/* assetsd / MobileSlideShow memory */
445#define VM_MEMORY_ASSETSD 72
446
447/* libsystem_kernel os_once_alloc */
448#define VM_MEMORY_OS_ALLOC_ONCE 73
449
450/* libdispatch internal allocator */
451#define VM_MEMORY_LIBDISPATCH 74
452
453/* Accelerate.framework image backing stores */
454#define VM_MEMORY_ACCELERATE 75
455
456/* CoreUI image block data */
457#define VM_MEMORY_COREUI 76
458
459/* CoreUI image file */
460#define VM_MEMORY_COREUIFILE 77
461
462/* Genealogy buffers */
463#define VM_MEMORY_GENEALOGY 78
464
465/* RawCamera VM allocated memory */
466#define VM_MEMORY_RAWCAMERA 79
467
468/* corpse info for dead process */
469#define VM_MEMORY_CORPSEINFO 80
470
471/* Apple System Logger (ASL) messages */
472#define VM_MEMORY_ASL 81
473
474/* Swift runtime */
475#define VM_MEMORY_SWIFT_RUNTIME 82
476
477/* Swift metadata */
478#define VM_MEMORY_SWIFT_METADATA 83
479
480/* DHMM data */
481#define VM_MEMORY_DHMM 84
482
483
484/* memory allocated by SceneKit.framework */
485#define VM_MEMORY_SCENEKIT 86
486
487/* memory allocated by skywalk networking */
488#define VM_MEMORY_SKYWALK 87
489
490#define VM_MEMORY_IOSURFACE 88
491
492#define VM_MEMORY_LIBNETWORK 89
493
494#define VM_MEMORY_AUDIO 90
495
496#define VM_MEMORY_VIDEOBITSTREAM 91
497
498/* memory allocated by CoreMedia */
499#define VM_MEMORY_CM_XPC 92
500
501#define VM_MEMORY_CM_RPC 93
502
503#define VM_MEMORY_CM_MEMORYPOOL 94
504
505#define VM_MEMORY_CM_READCACHE 95
506
507#define VM_MEMORY_CM_CRABS 96
508
509/* memory allocated for QuickLookThumbnailing */
510#define VM_MEMORY_QUICKLOOK_THUMBNAILS 97
511
512/* memory allocated by Accounts framework */
513#define VM_MEMORY_ACCOUNTS 98
514
515/* memory allocated by Sanitizer runtime libraries */
516#define VM_MEMORY_SANITIZER 99
517
518/* Differentiate memory needed by GPU drivers and frameworks from generic IOKit allocations */
519#define VM_MEMORY_IOACCELERATOR 100
520
521/* memory allocated by CoreMedia for global image registration of frames */
522#define VM_MEMORY_CM_REGWARP 101
523
524/* memory allocated by EmbeddedAcousticRecognition for speech decoder */
525#define VM_MEMORY_EAR_DECODER 102
526
527/* CoreUI cached image data */
528#define VM_MEMORY_COREUI_CACHED_IMAGE_DATA 103
529
530/* Reserve 230-239 for Rosetta */
531#define VM_MEMORY_ROSETTA 230
532#define VM_MEMORY_ROSETTA_THREAD_CONTEXT 231
533#define VM_MEMORY_ROSETTA_INDIRECT_BRANCH_MAP 232
534#define VM_MEMORY_ROSETTA_RETURN_STACK 233
535#define VM_MEMORY_ROSETTA_EXECUTABLE_HEAP 234
536#define VM_MEMORY_ROSETTA_USER_LDT 235
537#define VM_MEMORY_ROSETTA_ARENA 236
538#define VM_MEMORY_ROSETTA_10 239
539
540/* Reserve 240-255 for application */
541#define VM_MEMORY_APPLICATION_SPECIFIC_1 240
542#define VM_MEMORY_APPLICATION_SPECIFIC_16 255
543
544#define VM_MAKE_TAG(tag) ((tag) << 24)
545
546
547
548#ifdef __cplusplus
549}
550#endif
551
552#endif /* _MACH_VM_STATISTICS_H_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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
\ No newline at end of file
lib/libc/include/any-macos.11-any/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
\ No newline at end of file
lib/libc/include/any-macos.11-any/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
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/net/if.h+7-6
......@@ -63,24 +63,21 @@
6363#ifndef _NET_IF_H_
6464#define _NET_IF_H_
6565
66#include <sys/cdefs.h>
67#include <net/net_kev.h>
68
6669#define IF_NAMESIZE 16
6770
6871#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
69#include <sys/cdefs.h>
7072#include <sys/appleapiopts.h>
7173#ifdef __APPLE__
7274
7375#include <net/if_var.h>
74#include <net/net_kev.h>
7576#include <sys/types.h>
7677#include <sys/socket.h>
7778
7879#endif
7980
80#ifndef IFNAMSIZ
81#define IFNAMSIZ IF_NAMESIZE
82#endif
83
8481struct if_clonereq {
8582 int ifcr_total; /* total cloners (out) */
8683 int ifcr_count; /* room for this many in user buffer */
......@@ -288,6 +285,9 @@ struct ifkpi {
288285 * remainder may be interface specific.
289286 */
290287struct ifreq {
288#ifndef IFNAMSIZ
289#define IFNAMSIZ IF_NAMESIZE
290#endif
291291 char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
292292 union {
293293 struct sockaddr ifru_addr;
......@@ -371,6 +371,7 @@ struct ifmediareq {
371371#pragma pack()
372372
373373
374
374375#pragma pack(4)
375376struct ifdrv {
376377 char ifd_name[IFNAMSIZ]; /* if name, e.g. "en0" */
lib/libc/include/any-macos.11-any/net/if_var.h+1-119
......@@ -1,5 +1,5 @@
11/*
2 * Copyright (c) 2000-2021 Apple Inc. All rights reserved.
2 * Copyright (c) 2000-2020 Apple Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
......@@ -222,124 +222,6 @@ struct if_data64 {
222222};
223223
224224
225#if defined (PRIVATE) || defined (DRIVERKIT_PRIVATE)
226/*
227 * This structure is used to define the parameters for advisory notifications
228 * on an interface.
229 */
230#pragma pack(push, 1)
231struct ifnet_interface_advisory {
232 /* The current structure version */
233 uint8_t version;
234#define IF_INTERFACE_ADVISORY_VERSION_1 0x1
235#define IF_INTERFACE_ADVISORY_VERSION_CURRENT IF_INTERFACE_ADVISORY_VERSION_1
236 /* Specifies if the advisory is for transmit or receive path */
237 uint8_t direction;
238#define IF_INTERFACE_ADVISORY_DIRECTION_TX 0x1
239#define IF_INTERFACE_ADVISORY_DIRECTION_RX 0x2
240 /* reserved for future use */
241 uint16_t _reserved;
242 /*
243 * suggestion for data rate change to keep the latency low.
244 * unit: bits per second (bps)
245 * NOTE: if the interface cannot provide suggestions in terms of bps,
246 * it should use the following values:
247 * INT32_MAX : ramp up
248 * INT32_MIN : ramp down
249 * 0 : neutral
250 */
251#define IF_INTERFACE_ADVISORY_RATE_SUGGESTION_RAMP_UP INT32_MAX
252#define IF_INTERFACE_ADVISORY_RATE_SUGGESTION_RAMP_DOWN INT32_MIN
253#define IF_INTERFACE_ADVISORY_RATE_SUGGESTION_RAMP_NEUTRAL 0
254 int32_t rate_trend_suggestion;
255 /*
256 * Time of the issue of advisory.
257 * Timestamp should be in the host domain.
258 * unit: mach absolute time
259 */
260 uint64_t timestamp;
261 /*
262 * Maximum theoretical bandwidth of the interface.
263 * unit: bits per second (bps)
264 */
265 uint64_t max_bandwidth;
266 /*
267 * Total bytes sent or received on the interface.
268 * wrap around possible and the application should account for that.
269 * unit: byte
270 */
271 uint64_t total_byte_count;
272 /*
273 * average throughput observed at the driver stack.
274 * unit: bits per second (bps)
275 */
276 uint64_t average_throughput;
277 /*
278 * flushable queue size at the driver.
279 * should be set to UINT32_MAX if not available.
280 * unit: byte
281 */
282 uint32_t flushable_queue_size;
283 /*
284 * non flushable queue size at the driver.
285 * should be set to UINT32_MAX if not available.
286 * unit: byte
287 */
288 uint32_t non_flushable_queue_size;
289 /*
290 * average delay observed at the interface.
291 * unit: milliseconds (ms)
292 */
293 uint32_t average_delay;
294 /*
295 * Current frequency band (enumeration).
296 */
297#define IF_INTERFACE_ADVISORY_FREQ_BAND_NOT_AVAIL 0
298#define IF_INTERFACE_ADVISORY_FREQ_BAND_WIFI_24GHZ 1
299#define IF_INTERFACE_ADVISORY_FREQ_BAND_WIFI_5GHZ 2
300#define IF_INTERFACE_ADVISORY_FREQ_BAND_WIFI_6GHZ 3
301 uint8_t frequency_band;
302 /*
303 * Intermittent WiFi state [true(1)/false(0)]
304 */
305 uint8_t intermittent_state;
306 /*
307 * Estimated period for which intermittent state is expected to last.
308 * 1 tick -> 1 ms UNDEF => UINT16_MAX
309 */
310 uint16_t estimated_intermittent_period;
311 /*
312 * Expected wifi outage period during intermittent state
313 * 1 tick -> 1 ms UNDEF => UINT16_MAX
314 */
315 uint16_t single_outage_period;
316
317 /*
318 * WiFi-BT coexistence, 1-ON, 0-OFF
319 */
320 uint8_t bt_coex;
321 /*
322 * on scale of 1 to 5
323 */
324 uint8_t quality_score_delay;
325 /*
326 * on scale of 1 to 5
327 */
328 uint8_t quality_score_loss;
329 /*
330 * on scale of 1 to 5
331 */
332 uint8_t quality_score_channel;
333} __attribute__((aligned(sizeof(uint64_t))));
334#pragma pack(pop)
335
336#else
337
338struct ifnet_interface_advisory;
339
340#endif /* defined (PRIVATE) || defined (DRIVERKIT_PRIVATE) */
341
342
343225#pragma pack()
344226
345227/*
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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
\ No newline at end of file
lib/libc/include/any-macos.11-any/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
\ No newline at end of file
lib/libc/include/any-macos.11-any/objc/objc-api.h created+304
......@@ -0,0 +1,304 @@
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/* OBJC_COLD: very rarely called, e.g. on error path */
287#if !defined(OBJC_COLD)
288# if __OBJC__ && __has_attribute(cold)
289# define OBJC_COLD __attribute__((cold))
290# else
291# define OBJC_COLD
292# endif
293#endif
294
295/* OBJC_NORETURN: does not return normally, but may throw */
296#if !defined(OBJC_NORETURN)
297# if __OBJC__ && __has_attribute(noreturn)
298# define OBJC_NORETURN __attribute__((noreturn))
299# else
300# define OBJC_NORETURN
301# endif
302#endif
303
304#endif
\ No newline at end of file
lib/libc/include/any-macos.11-any/objc/runtime.h+263
......@@ -52,6 +52,24 @@ typedef struct objc_category *Category;
5252/// An opaque type that represents an Objective-C declared property.
5353typedef struct objc_property *objc_property_t;
5454
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
5573#endif
5674
5775#ifdef __OBJC__
......@@ -1859,8 +1877,154 @@ _objc_realizeClassFromSwift(Class _Nullable cls, void * _Nullable previously)
18591877#define _C_VECTOR '!'
18601878#define _C_CONST 'r'
18611879
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
18622023struct objc_method_list;
18632024
2025#endif
2026
2027
18642028/* Obsolete functions */
18652029
18662030OBJC_EXPORT IMP _Nullable
......@@ -1893,9 +2057,108 @@ OBJC_EXPORT id _Nullable
18932057object_copyFromZone(id _Nullable anObject, size_t nBytes, void * _Nullable z)
18942058 OBJC_OSX_DEPRECATED_OTHERS_UNAVAILABLE(10.0, 10.5, "use object_copy instead");
18952059
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
18962085OBJC_EXPORT id _Nullable
18972086class_createInstanceFromZone(Class _Nullable, size_t idxIvars,
18982087 void * _Nullable z)
18992088 OBJC_OSX_DEPRECATED_OTHERS_UNAVAILABLE(10.0, 10.5, "use class_createInstance instead");
19002089
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
19012164#endif
\ No newline at end of file
lib/libc/include/any-macos.11-any/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__
\ No newline at end of file
lib/libc/include/any-macos.11-any/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, driverkit)
561void pthread_jit_write_protect_np(int enabled);
562
563__API_AVAILABLE(macos(11.0))
564__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
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 */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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 */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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 */
\ No newline at end of file
lib/libc/include/any-macos.11-any/simd/conversion.h created+1966
......@@ -0,0 +1,1966 @@
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__
\ No newline at end of file
lib/libc/include/any-macos.11-any/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 */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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__ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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 */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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 */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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 */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/sys/_symbol_aliasing.h-30
......@@ -341,24 +341,6 @@
341341#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_5(x)
342342#endif
343343
344#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 150000
345#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_0(x) x
346#else
347#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_0(x)
348#endif
349
350#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 150100
351#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_1(x) x
352#else
353#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_1(x)
354#endif
355
356#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 150200
357#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_2(x) x
358#else
359#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_15_2(x)
360#endif
361
362344#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000
363345#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x
364346#else
......@@ -573,16 +555,4 @@
573555#define __DARWIN_ALIAS_STARTING_MAC___MAC_11_3(x) x
574556#else
575557#define __DARWIN_ALIAS_STARTING_MAC___MAC_11_3(x)
576#endif
577
578#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 120000
579#define __DARWIN_ALIAS_STARTING_MAC___MAC_12_0(x) x
580#else
581#define __DARWIN_ALIAS_STARTING_MAC___MAC_12_0(x)
582#endif
583
584#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 120100
585#define __DARWIN_ALIAS_STARTING_MAC___MAC_12_1(x) x
586#else
587#define __DARWIN_ALIAS_STARTING_MAC___MAC_12_1(x)
588558#endif
\ No newline at end of file
lib/libc/include/any-macos.11-any/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 */
\ No newline at end of file
lib/libc/include/any-macos.11-any/sys/attr.h+1-6
......@@ -83,7 +83,6 @@ struct attrlist {
8383 attrgroup_t fileattr; /* file attribute group */
8484 attrgroup_t forkattr; /* fork attribute group */
8585};
86
8786#define ATTR_BIT_MAP_COUNT 5
8887
8988typedef struct attribute_set {
......@@ -94,9 +93,6 @@ typedef struct attribute_set {
9493 attrgroup_t forkattr; /* fork attribute group */
9594} attribute_set_t;
9695
97#define ATTRIBUTE_SET_INIT(a) do {(a)->commonattr = (a)->volattr = (a)->dirattr = (a)->fileattr = (a)->forkattr = 0; } while(0)
98
99
10096typedef struct attrreference {
10197 int32_t attr_dataoffset;
10298 u_int32_t attr_length;
......@@ -467,13 +463,12 @@ typedef struct vol_attributes_attr {
467463#define ATTR_VOL_ENCODINGSUSED 0x00010000
468464#define ATTR_VOL_CAPABILITIES 0x00020000
469465#define ATTR_VOL_UUID 0x00040000
470#define ATTR_VOL_SPACEUSED 0x00800000
471466#define ATTR_VOL_QUOTA_SIZE 0x10000000
472467#define ATTR_VOL_RESERVED_SIZE 0x20000000
473468#define ATTR_VOL_ATTRIBUTES 0x40000000
474469#define ATTR_VOL_INFO 0x80000000
475470
476#define ATTR_VOL_VALIDMASK 0xF087FFFF
471#define ATTR_VOL_VALIDMASK 0xF007FFFF
477472
478473/*
479474 * The list of settable ATTR_VOL_* attributes include the following:
lib/libc/include/any-macos.11-any/sys/cdefs.h+3-19
......@@ -152,16 +152,8 @@
152152#endif /* !NO_ANSI_KEYWORDS */
153153#endif /* !(__STDC__ || __cplusplus) */
154154
155/*
156 * __pure2 can be used for functions that are only a function of their scalar
157 * arguments (meaning they can't dereference pointers).
158 *
159 * __stateful_pure can be used for functions that have no side effects,
160 * but depend on the state of the memory.
161 */
162155#define __dead2 __attribute__((__noreturn__))
163156#define __pure2 __attribute__((__const__))
164#define __stateful_pure __attribute__((__pure__))
165157
166158/* __unused denotes variables and functions that may not be used, preventing
167159 * the compiler from warning about it if not used.
......@@ -187,9 +179,9 @@
187179 * __exported_push/_exported_pop are pragmas used to delimit a range of
188180 * symbols that should be exported even when symbols are hidden by default.
189181 */
190#define __exported __attribute__((__visibility__("default")))
191#define __exported_push _Pragma("GCC visibility push(default)")
192#define __exported_pop _Pragma("GCC visibility pop")
182#define __exported __attribute__((__visibility__("default")))
183#define __exported_push _Pragma("GCC visibility push(default)")
184#define __exported_pop _Pragma("GCC visibility pop")
193185
194186/* __deprecated causes the compiler to produce a warning when encountering
195187 * code using the deprecated functionality.
......@@ -825,7 +817,6 @@
825817#define __XNU_PRIVATE_EXTERN __attribute__((visibility("hidden")))
826818#endif
827819
828
829820/*
830821 * Architecture validation for current SDK
831822 */
......@@ -882,11 +873,4 @@
882873 typedef _type _name; enum __VA_ARGS__ __enum_closed __enum_options
883874#endif
884875
885
886
887#define __kernel_ptr_semantics
888#define __kernel_data_semantics
889#define __kernel_dual_semantics
890
891
892876#endif /* !_CDEFS_H_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/sys/event.h+3-2
......@@ -58,9 +58,7 @@
5858
5959#include <machine/types.h>
6060#include <sys/cdefs.h>
61#include <sys/queue.h>
6261#include <stdint.h>
63#include <sys/types.h>
6462
6563/*
6664 * Filter types
......@@ -368,10 +366,13 @@ enum {
368366
369367
370368/* Temporay solution for BootX to use inode.h till kqueue moves to vfs layer */
369#include <sys/queue.h>
371370struct knote;
372371SLIST_HEAD(klist, knote);
373372
374373
374#include <sys/types.h>
375
375376struct timespec;
376377
377378__BEGIN_DECLS
lib/libc/include/any-macos.11-any/sys/fcntl.h+2-11
......@@ -134,11 +134,8 @@
134134#define O_NOCTTY 0x00020000 /* don't assign controlling terminal */
135135
136136
137#if __DARWIN_C_LEVEL >= 200809L
138#define O_DIRECTORY 0x00100000
139#endif
140
141137#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
138#define O_DIRECTORY 0x00100000
142139#define O_SYMLINK 0x00200000 /* allow open of a symlink */
143140#endif
144141
......@@ -259,13 +256,7 @@
259256
260257#define F_LOG2PHYS_EXT 65 /* file offset to device offset, extended */
261258
262#define F_GETLKPID 66 /* See man fcntl(2) F_GETLK
263 * Similar to F_GETLK but in addition l_pid is treated as an input parameter
264 * which is used as a matching value when searching locks on the file
265 * so that only locks owned by the process with pid l_pid are returned.
266 * However, any flock(2) type lock will also be found with the returned value
267 * of l_pid set to -1 (as with F_GETLK).
268 */
259#define F_GETLKPID 66 /* get record locking information, per-process */
269260
270261/* See F_DUPFD_CLOEXEC below for 67 */
271262
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/sys/mount.h+1-1
......@@ -388,6 +388,7 @@ struct netfs_status {
388388
389389
390390
391
391392/*
392393 * Generic file handle
393394 */
......@@ -402,7 +403,6 @@ struct fhandle {
402403typedef struct fhandle fhandle_t;
403404
404405
405
406406__BEGIN_DECLS
407407int fhopen(const struct fhandle *, int);
408408int fstatfs(int, struct statfs *) __DARWIN_INODE64(fstatfs);
lib/libc/include/any-macos.11-any/sys/proc_info.h+6-5
......@@ -620,11 +620,12 @@ struct kqueue_dyninfo {
620620};
621621
622622/* keep in sync with KQ_* in sys/eventvar.h */
623#define PROC_KQUEUE_SELECT 0x0001
624#define PROC_KQUEUE_SLEEP 0x0002
625#define PROC_KQUEUE_32 0x0008
626#define PROC_KQUEUE_64 0x0010
627#define PROC_KQUEUE_QOS 0x0020
623#define PROC_KQUEUE_SELECT 0x01
624#define PROC_KQUEUE_SLEEP 0x02
625#define PROC_KQUEUE_32 0x08
626#define PROC_KQUEUE_64 0x10
627#define PROC_KQUEUE_QOS 0x20
628
628629
629630struct kqueue_fdinfo {
630631 struct proc_fileinfo pfi;
lib/libc/include/any-macos.11-any/sys/random.h created+40
......@@ -0,0 +1,40 @@
1/*
2 * Copyright (c) 1999, 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 __SYS_RANDOM_H__
30#define __SYS_RANDOM_H__
31
32#include <sys/appleapiopts.h>
33#include <sys/cdefs.h>
34
35__BEGIN_DECLS
36 __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
37int getentropy(void* buffer, size_t size);
38__END_DECLS
39
40#endif /* __SYS_RANDOM_H__ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/sys/resource.h created+520
......@@ -0,0 +1,520 @@
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#define IOPOL_TYPE_VFS_IGNORE_PERMISSIONS 7
461#define IOPOL_TYPE_VFS_SKIP_MTIME_UPDATE 8
462
463/* scope */
464#define IOPOL_SCOPE_PROCESS 0
465#define IOPOL_SCOPE_THREAD 1
466#define IOPOL_SCOPE_DARWIN_BG 2
467
468/* I/O Priority */
469#define IOPOL_DEFAULT 0
470#define IOPOL_IMPORTANT 1
471#define IOPOL_PASSIVE 2
472#define IOPOL_THROTTLE 3
473#define IOPOL_UTILITY 4
474#define IOPOL_STANDARD 5
475
476/* compatibility with older names */
477#define IOPOL_APPLICATION IOPOL_STANDARD
478#define IOPOL_NORMAL IOPOL_IMPORTANT
479
480
481#define IOPOL_ATIME_UPDATES_DEFAULT 0
482#define IOPOL_ATIME_UPDATES_OFF 1
483
484#define IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT 0
485#define IOPOL_MATERIALIZE_DATALESS_FILES_OFF 1
486#define IOPOL_MATERIALIZE_DATALESS_FILES_ON 2
487
488#define IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT 0
489#define IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME 1
490
491#define IOPOL_VFS_TRIGGER_RESOLVE_DEFAULT 0
492#define IOPOL_VFS_TRIGGER_RESOLVE_OFF 1
493
494#define IOPOL_VFS_CONTENT_PROTECTION_DEFAULT 0
495#define IOPOL_VFS_CONTENT_PROTECTION_IGNORE 1
496
497#define IOPOL_VFS_IGNORE_PERMISSIONS_OFF 0
498#define IOPOL_VFS_IGNORE_PERMISSIONS_ON 1
499
500#define IOPOL_VFS_SKIP_MTIME_UPDATE_OFF 0
501#define IOPOL_VFS_SKIP_MTIME_UPDATE_ON 1
502
503#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
504
505
506__BEGIN_DECLS
507int getpriority(int, id_t);
508#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
509int getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
510#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
511int getrlimit(int, struct rlimit *) __DARWIN_ALIAS(getrlimit);
512int getrusage(int, struct rusage *);
513int setpriority(int, id_t, int);
514#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
515int setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
516#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
517int setrlimit(int, const struct rlimit *) __DARWIN_ALIAS(setrlimit);
518__END_DECLS
519
520#endif /* !_SYS_RESOURCE_H_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/sys/sysctl.h+2-24
......@@ -338,8 +338,8 @@ struct ctlname {
338338#define KERN_KDSET_TYPEFILTER 22
339339#define KERN_KDBUFWAIT 23
340340#define KERN_KDCPUMAP 24
341#define KERN_KDCPUMAP_EXT 25
342/* 25 - 27 unused */
341/* 25 - 26 unused */
342#define KERN_KDWRITEMAP_V3 27
343343#define KERN_KDWRITETR_V3 28
344344
345345#define CTL_KERN_NAMES { \
......@@ -668,28 +668,6 @@ extern struct loadavg averunnable;
668668 * hw.l2cachesize -
669669 * hw.l3cachesize -
670670 *
671 * hw.nperflevels - Number of core types in the system. See the parameters below, which can be used to get
672 * - information associated with a specific perf level.
673 *
674 * The following parameters apply to perflevel N, where N is a number between 0 and the number of core types in the system minus one.
675 * perflevel 0 always refers to the highest performance core type in the system.
676 *
677 * hw.perflevelN.physicalcpu - The number of physical processors available in the current power management mode.
678 * hw.perflevelN.physicalcpumax - The maximum number of physical processors that could be available this boot.
679 * hw.perflevelN.logicalcpu - The number of logical processors available in the current power management mode.
680 * hw.perflevelN.logicalcpumax - The maximum number of logical processors that could be available this boot.
681 *
682 * hw.perflevelN.l1dcachesize - These values provide the size in bytes of the L1, L2 and L3 caches. If a cache is not present
683 * hw.perflevelN.l1icachesize - then the selector will return and error.
684 * hw.perflevelN.l2cachesize -
685 * hw.perflevelN.l3cachesize -
686 *
687 * hw.perflevelN.cpusperl2 - These values provide the number of CPUs of the same type that share L2 and L3 caches.
688 * hw.perflevelN.cpusperl3 - If a cache is not present then the selector will return and error.
689 *
690 * hw.perflevelN.l2perflevels - These values provide a bitmap, where bit number of CPUs of the same type that share L2 and L3 caches.
691 * hw.perflevelN.l3perflevels - If a cache is not present then the selector will return and error.
692 *
693671 * hw.packages - Gives the number of processor packages.
694672 *
695673 * These are the selectors for optional processor features for specific processors. Selectors that return errors are not support
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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_ */
\ No newline at end of file
lib/libc/include/any-macos.11-any/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 */
\ No newline at end of file
lib/libc/include/any-macos.11-any/xpc/activity.h created+446
......@@ -0,0 +1,446 @@
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__
\ No newline at end of file
lib/libc/include/any-macos.11-any/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__
\ No newline at end of file
lib/libc/include/any-macos.11-any/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__
\ No newline at end of file
lib/libc/include/any-macos.11-any/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__
\ No newline at end of file
lib/libc/include/any-macos.12-any/AvailabilityMacros.h created+4016
......@@ -0,0 +1,4016 @@
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#define MAC_OS_VERSION_11_1 110100
122#define MAC_OS_VERSION_11_3 110300
123#define MAC_OS_VERSION_12_0 120000
124
125/*
126 * If min OS not specified, assume 10.4 for intel
127 * Note: compiler driver may set _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ based on MACOSX_DEPLOYMENT_TARGET environment variable
128 */
129#ifndef MAC_OS_X_VERSION_MIN_REQUIRED
130 #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
131 #if (__i386__ || __x86_64__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < MAC_OS_X_VERSION_10_4)
132 #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid.
133 #endif
134 #define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
135 #else
136 #if __i386__ || __x86_64__
137 #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4
138 #elif __arm__ || __arm64__
139 #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_5
140 #else
141 #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_1
142 #endif
143 #endif
144#endif
145
146/*
147 * if max OS not specified, assume larger of (10.15, min)
148 */
149#ifndef MAC_OS_X_VERSION_MAX_ALLOWED
150 #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_VERSION_12_0
151 #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED
152 #else
153 #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_VERSION_12_0
154 #endif
155#endif
156
157/*
158 * Error on bad values
159 */
160#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_MIN_REQUIRED
161 #error MAC_OS_X_VERSION_MAX_ALLOWED must be >= MAC_OS_X_VERSION_MIN_REQUIRED
162#endif
163#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_0
164 #error MAC_OS_X_VERSION_MIN_REQUIRED must be >= MAC_OS_X_VERSION_10_0
165#endif
166
167/*
168 * only certain compilers support __attribute__((weak_import))
169 */
170#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)
171 #define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
172#elif defined(__MWERKS__) && (__MWERKS__ >= 0x3205) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) && !defined(__INTEL__)
173 #define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
174#else
175 #define WEAK_IMPORT_ATTRIBUTE
176#endif
177
178/*
179 * only certain compilers support __attribute__((deprecated))
180 */
181#if defined(__has_feature) && defined(__has_attribute)
182 #if __has_attribute(deprecated)
183 #define DEPRECATED_ATTRIBUTE __attribute__((deprecated))
184 #if __has_feature(attribute_deprecated_with_message)
185 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
186 #else
187 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated))
188 #endif
189 #else
190 #define DEPRECATED_ATTRIBUTE
191 #define DEPRECATED_MSG_ATTRIBUTE(s)
192 #endif
193#elif defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
194 #define DEPRECATED_ATTRIBUTE __attribute__((deprecated))
195 #if (__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))
196 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
197 #else
198 #define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated))
199 #endif
200#else
201 #define DEPRECATED_ATTRIBUTE
202 #define DEPRECATED_MSG_ATTRIBUTE(s)
203#endif
204
205/*
206 * only certain compilers support __attribute__((unavailable))
207 */
208#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
209 #define UNAVAILABLE_ATTRIBUTE __attribute__((unavailable))
210#else
211 #define UNAVAILABLE_ATTRIBUTE
212#endif
213
214
215/*
216 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
217 *
218 * Used on functions introduced in Mac OS X 10.0
219 */
220#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
221
222/*
223 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED
224 *
225 * Used on functions introduced in Mac OS X 10.0,
226 * and deprecated in Mac OS X 10.0
227 */
228#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
229
230/*
231 * DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER
232 *
233 * Used on types deprecated in Mac OS X 10.0
234 */
235#define DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER DEPRECATED_ATTRIBUTE
236
237#ifndef __AVAILABILITY_MACROS_USES_AVAILABILITY
238 #ifdef __has_attribute
239 #if __has_attribute(availability)
240 #include <Availability.h>
241 #define __AVAILABILITY_MACROS_USES_AVAILABILITY 1
242 #endif
243 #endif
244#endif
245
246#if TARGET_OS_OSX
247#define __IPHONE_COMPAT_VERSION __IPHONE_NA
248#elif TARGET_OS_MACCATALYST
249#define __IPHONE_COMPAT_VERSION __IPHONE_NA
250#else
251#define __IPHONE_COMPAT_VERSION __IPHONE_4_0
252#endif
253
254/*
255 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
256 *
257 * Used on declarations introduced in Mac OS X 10.1
258 */
259#if __AVAILABILITY_MACROS_USES_AVAILABILITY
260 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_COMPAT_VERSION)
261#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_1
262 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER UNAVAILABLE_ATTRIBUTE
263#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_1
264 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER WEAK_IMPORT_ATTRIBUTE
265#else
266 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
267#endif
268
269/*
270 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED
271 *
272 * Used on declarations introduced in Mac OS X 10.1,
273 * and deprecated in Mac OS X 10.1
274 */
275#if __AVAILABILITY_MACROS_USES_AVAILABILITY
276 #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)
277#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
278 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
279#else
280 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
281#endif
282
283/*
284 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1
285 *
286 * Used on declarations introduced in Mac OS X 10.0,
287 * but later deprecated in Mac OS X 10.1
288 */
289#if __AVAILABILITY_MACROS_USES_AVAILABILITY
290 #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)
291#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
292 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 DEPRECATED_ATTRIBUTE
293#else
294 #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
295#endif
296
297/*
298 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
299 *
300 * Used on declarations introduced in Mac OS X 10.2
301 */
302#if __AVAILABILITY_MACROS_USES_AVAILABILITY
303 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_COMPAT_VERSION)
304#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2
305 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER UNAVAILABLE_ATTRIBUTE
306#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2
307 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
308#else
309 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
310#endif
311
312/*
313 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED
314 *
315 * Used on declarations introduced in Mac OS X 10.2,
316 * and deprecated in Mac OS X 10.2
317 */
318#if __AVAILABILITY_MACROS_USES_AVAILABILITY
319 #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)
320#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
321 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
322#else
323 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
324#endif
325
326/*
327 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2
328 *
329 * Used on declarations introduced in Mac OS X 10.0,
330 * but later deprecated in Mac OS X 10.2
331 */
332#if __AVAILABILITY_MACROS_USES_AVAILABILITY
333 #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)
334#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
335 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE
336#else
337 #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
338#endif
339
340/*
341 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2
342 *
343 * Used on declarations introduced in Mac OS X 10.1,
344 * but later deprecated in Mac OS X 10.2
345 */
346#if __AVAILABILITY_MACROS_USES_AVAILABILITY
347 #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)
348#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
349 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE
350#else
351 #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
352#endif
353
354/*
355 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
356 *
357 * Used on declarations introduced in Mac OS X 10.3
358 */
359#if __AVAILABILITY_MACROS_USES_AVAILABILITY
360 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_3, __IPHONE_COMPAT_VERSION)
361#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3
362 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER UNAVAILABLE_ATTRIBUTE
363#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3
364 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
365#else
366 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
367#endif
368
369/*
370 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED
371 *
372 * Used on declarations introduced in Mac OS X 10.3,
373 * and deprecated in Mac OS X 10.3
374 */
375#if __AVAILABILITY_MACROS_USES_AVAILABILITY
376 #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)
377#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
378 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
379#else
380 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
381#endif
382
383/*
384 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
385 *
386 * Used on declarations introduced in Mac OS X 10.0,
387 * but later deprecated in Mac OS X 10.3
388 */
389#if __AVAILABILITY_MACROS_USES_AVAILABILITY
390 #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)
391#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
392 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
393#else
394 #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
395#endif
396
397/*
398 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
399 *
400 * Used on declarations introduced in Mac OS X 10.1,
401 * but later deprecated in Mac OS X 10.3
402 */
403#if __AVAILABILITY_MACROS_USES_AVAILABILITY
404 #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)
405#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
406 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
407#else
408 #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
409#endif
410
411/*
412 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
413 *
414 * Used on declarations introduced in Mac OS X 10.2,
415 * but later deprecated in Mac OS X 10.3
416 */
417#if __AVAILABILITY_MACROS_USES_AVAILABILITY
418 #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)
419#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
420 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
421#else
422 #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
423#endif
424
425/*
426 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
427 *
428 * Used on declarations introduced in Mac OS X 10.4
429 */
430#if __AVAILABILITY_MACROS_USES_AVAILABILITY
431 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_COMPAT_VERSION)
432#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
433 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER UNAVAILABLE_ATTRIBUTE
434#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4
435 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
436#else
437 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
438#endif
439
440/*
441 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED
442 *
443 * Used on declarations introduced in Mac OS X 10.4,
444 * and deprecated in Mac OS X 10.4
445 */
446#if __AVAILABILITY_MACROS_USES_AVAILABILITY
447 #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)
448#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
449 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
450#else
451 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
452#endif
453
454/*
455 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
456 *
457 * Used on declarations introduced in Mac OS X 10.0,
458 * but later deprecated in Mac OS X 10.4
459 */
460#if __AVAILABILITY_MACROS_USES_AVAILABILITY
461 #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)
462#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
463 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
464#else
465 #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
466#endif
467
468/*
469 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
470 *
471 * Used on declarations introduced in Mac OS X 10.1,
472 * but later deprecated in Mac OS X 10.4
473 */
474#if __AVAILABILITY_MACROS_USES_AVAILABILITY
475 #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)
476#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
477 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
478#else
479 #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
480#endif
481
482/*
483 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
484 *
485 * Used on declarations introduced in Mac OS X 10.2,
486 * but later deprecated in Mac OS X 10.4
487 */
488#if __AVAILABILITY_MACROS_USES_AVAILABILITY
489 #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)
490#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
491 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
492#else
493 #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
494#endif
495
496/*
497 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
498 *
499 * Used on declarations introduced in Mac OS X 10.3,
500 * but later deprecated in Mac OS X 10.4
501 */
502#if __AVAILABILITY_MACROS_USES_AVAILABILITY
503 #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)
504#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
505 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
506#else
507 #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
508#endif
509
510/*
511 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
512 *
513 * Used on declarations introduced in Mac OS X 10.5
514 */
515#if __AVAILABILITY_MACROS_USES_AVAILABILITY
516 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_COMPAT_VERSION)
517#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
518 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER UNAVAILABLE_ATTRIBUTE
519#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
520 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER WEAK_IMPORT_ATTRIBUTE
521#else
522 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
523#endif
524
525/*
526 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED
527 *
528 * Used on declarations introduced in Mac OS X 10.5,
529 * and deprecated in Mac OS X 10.5
530 */
531#if __AVAILABILITY_MACROS_USES_AVAILABILITY
532 #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)
533#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
534 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
535#else
536 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
537#endif
538
539/*
540 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
541 *
542 * Used on declarations introduced in Mac OS X 10.0,
543 * but later deprecated in Mac OS X 10.5
544 */
545#if __AVAILABILITY_MACROS_USES_AVAILABILITY
546 #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)
547#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
548 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
549#else
550 #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
551#endif
552
553/*
554 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
555 *
556 * Used on declarations introduced in Mac OS X 10.1,
557 * but later deprecated in Mac OS X 10.5
558 */
559#if __AVAILABILITY_MACROS_USES_AVAILABILITY
560 #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)
561#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
562 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
563#else
564 #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
565#endif
566
567/*
568 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
569 *
570 * Used on declarations introduced in Mac OS X 10.2,
571 * but later deprecated in Mac OS X 10.5
572 */
573#if __AVAILABILITY_MACROS_USES_AVAILABILITY
574 #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)
575#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
576 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
577#else
578 #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
579#endif
580
581/*
582 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
583 *
584 * Used on declarations introduced in Mac OS X 10.3,
585 * but later deprecated in Mac OS X 10.5
586 */
587#if __AVAILABILITY_MACROS_USES_AVAILABILITY
588 #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)
589#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
590 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
591#else
592 #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
593#endif
594
595/*
596 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
597 *
598 * Used on declarations introduced in Mac OS X 10.4,
599 * but later deprecated in Mac OS X 10.5
600 */
601#if __AVAILABILITY_MACROS_USES_AVAILABILITY
602 #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)
603#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
604 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
605#else
606 #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
607#endif
608
609/*
610 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
611 *
612 * Used on declarations introduced in Mac OS X 10.6
613 */
614#if __AVAILABILITY_MACROS_USES_AVAILABILITY
615 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_COMPAT_VERSION)
616#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
617 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER UNAVAILABLE_ATTRIBUTE
618#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
619 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER WEAK_IMPORT_ATTRIBUTE
620#else
621 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
622#endif
623
624/*
625 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED
626 *
627 * Used on declarations introduced in Mac OS X 10.6,
628 * and deprecated in Mac OS X 10.6
629 */
630#if __AVAILABILITY_MACROS_USES_AVAILABILITY
631 #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)
632#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
633 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
634#else
635 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
636#endif
637
638/*
639 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
640 *
641 * Used on declarations introduced in Mac OS X 10.0,
642 * but later deprecated in Mac OS X 10.6
643 */
644#if __AVAILABILITY_MACROS_USES_AVAILABILITY
645 #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)
646#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
647 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
648#else
649 #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
650#endif
651
652/*
653 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
654 *
655 * Used on declarations introduced in Mac OS X 10.1,
656 * but later deprecated in Mac OS X 10.6
657 */
658#if __AVAILABILITY_MACROS_USES_AVAILABILITY
659 #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)
660#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
661 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
662#else
663 #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
664#endif
665
666/*
667 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
668 *
669 * Used on declarations introduced in Mac OS X 10.2,
670 * but later deprecated in Mac OS X 10.6
671 */
672#if __AVAILABILITY_MACROS_USES_AVAILABILITY
673 #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)
674#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
675 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
676#else
677 #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
678#endif
679
680/*
681 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
682 *
683 * Used on declarations introduced in Mac OS X 10.3,
684 * but later deprecated in Mac OS X 10.6
685 */
686#if __AVAILABILITY_MACROS_USES_AVAILABILITY
687 #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)
688#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
689 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
690#else
691 #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
692#endif
693
694/*
695 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
696 *
697 * Used on declarations introduced in Mac OS X 10.4,
698 * but later deprecated in Mac OS X 10.6
699 */
700#if __AVAILABILITY_MACROS_USES_AVAILABILITY
701 #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)
702#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
703 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
704#else
705 #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
706#endif
707
708/*
709 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6
710 *
711 * Used on declarations introduced in Mac OS X 10.5,
712 * but later deprecated in Mac OS X 10.6
713 */
714#if __AVAILABILITY_MACROS_USES_AVAILABILITY
715 #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)
716#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
717 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_ATTRIBUTE
718#else
719 #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
720#endif
721
722/*
723 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
724 *
725 * Used on declarations introduced in Mac OS X 10.7
726 */
727#if __AVAILABILITY_MACROS_USES_AVAILABILITY
728 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_COMPAT_VERSION)
729#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
730 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER UNAVAILABLE_ATTRIBUTE
731#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
732 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER WEAK_IMPORT_ATTRIBUTE
733#else
734 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
735#endif
736
737/*
738 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED
739 *
740 * Used on declarations introduced in Mac OS X 10.7,
741 * and deprecated in Mac OS X 10.7
742 */
743#if __AVAILABILITY_MACROS_USES_AVAILABILITY
744 #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)
745#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
746 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
747#else
748 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
749#endif
750
751/*
752 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
753 *
754 * Used on declarations introduced in Mac OS X 10.0,
755 * but later deprecated in Mac OS X 10.7
756 */
757#if __AVAILABILITY_MACROS_USES_AVAILABILITY
758 #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)
759#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
760 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
761#else
762 #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
763#endif
764
765/*
766 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
767 *
768 * Used on declarations introduced in Mac OS X 10.1,
769 * but later deprecated in Mac OS X 10.7
770 */
771#if __AVAILABILITY_MACROS_USES_AVAILABILITY
772 #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)
773#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
774 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
775#else
776 #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
777#endif
778
779/*
780 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
781 *
782 * Used on declarations introduced in Mac OS X 10.2,
783 * but later deprecated in Mac OS X 10.7
784 */
785#if __AVAILABILITY_MACROS_USES_AVAILABILITY
786 #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)
787#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
788 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
789#else
790 #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
791#endif
792
793/*
794 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
795 *
796 * Used on declarations introduced in Mac OS X 10.3,
797 * but later deprecated in Mac OS X 10.7
798 */
799#if __AVAILABILITY_MACROS_USES_AVAILABILITY
800 #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)
801#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
802 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
803#else
804 #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
805#endif
806
807/*
808 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
809 *
810 * Used on declarations introduced in Mac OS X 10.4,
811 * but later deprecated in Mac OS X 10.7
812 */
813#if __AVAILABILITY_MACROS_USES_AVAILABILITY
814 #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)
815#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
816 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
817#else
818 #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
819#endif
820
821/*
822 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
823 *
824 * Used on declarations introduced in Mac OS X 10.5,
825 * but later deprecated in Mac OS X 10.7
826 */
827#if __AVAILABILITY_MACROS_USES_AVAILABILITY
828 #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)
829#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
830 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
831#else
832 #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
833#endif
834
835/*
836 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
837 *
838 * Used on declarations introduced in Mac OS X 10.6,
839 * but later deprecated in Mac OS X 10.7
840 */
841#if __AVAILABILITY_MACROS_USES_AVAILABILITY
842 #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)
843#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
844 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_ATTRIBUTE
845#else
846 #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
847#endif
848
849/*
850 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_13
851 *
852 * Used on declarations introduced in Mac OS X 10.6,
853 * but later deprecated in Mac OS X 10.13
854 */
855#if __AVAILABILITY_MACROS_USES_AVAILABILITY
856#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)
857#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
858#define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_13 DEPRECATED_ATTRIBUTE
859#else
860#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
861#endif
862
863/*
864 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
865 *
866 * Used on declarations introduced in Mac OS X 10.8
867 */
868#if __AVAILABILITY_MACROS_USES_AVAILABILITY
869 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_COMPAT_VERSION)
870#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8
871 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER UNAVAILABLE_ATTRIBUTE
872#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
873 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER WEAK_IMPORT_ATTRIBUTE
874#else
875 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
876#endif
877
878/*
879 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED
880 *
881 * Used on declarations introduced in Mac OS X 10.8,
882 * and deprecated in Mac OS X 10.8
883 */
884#if __AVAILABILITY_MACROS_USES_AVAILABILITY
885 #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)
886#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
887 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
888#else
889 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
890#endif
891
892/*
893 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
894 *
895 * Used on declarations introduced in Mac OS X 10.0,
896 * but later deprecated in Mac OS X 10.8
897 */
898#if __AVAILABILITY_MACROS_USES_AVAILABILITY
899 #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)
900#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
901 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
902#else
903 #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
904#endif
905
906/*
907 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
908 *
909 * Used on declarations introduced in Mac OS X 10.1,
910 * but later deprecated in Mac OS X 10.8
911 */
912#if __AVAILABILITY_MACROS_USES_AVAILABILITY
913 #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)
914#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
915 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
916#else
917 #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
918#endif
919
920/*
921 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
922 *
923 * Used on declarations introduced in Mac OS X 10.2,
924 * but later deprecated in Mac OS X 10.8
925 */
926#if __AVAILABILITY_MACROS_USES_AVAILABILITY
927 #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)
928#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
929 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
930#else
931 #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
932#endif
933
934/*
935 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
936 *
937 * Used on declarations introduced in Mac OS X 10.3,
938 * but later deprecated in Mac OS X 10.8
939 */
940#if __AVAILABILITY_MACROS_USES_AVAILABILITY
941 #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)
942#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
943 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
944#else
945 #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
946#endif
947
948/*
949 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
950 *
951 * Used on declarations introduced in Mac OS X 10.4,
952 * but later deprecated in Mac OS X 10.8
953 */
954#if __AVAILABILITY_MACROS_USES_AVAILABILITY
955 #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)
956#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
957 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
958#else
959 #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
960#endif
961
962/*
963 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
964 *
965 * Used on declarations introduced in Mac OS X 10.5,
966 * but later deprecated in Mac OS X 10.8
967 */
968#if __AVAILABILITY_MACROS_USES_AVAILABILITY
969 #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)
970#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
971 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
972#else
973 #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
974#endif
975
976/*
977 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
978 *
979 * Used on declarations introduced in Mac OS X 10.6,
980 * but later deprecated in Mac OS X 10.8
981 */
982#if __AVAILABILITY_MACROS_USES_AVAILABILITY
983 #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)
984#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
985 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
986#else
987 #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
988#endif
989
990/*
991 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
992 *
993 * Used on declarations introduced in Mac OS X 10.7,
994 * but later deprecated in Mac OS X 10.8
995 */
996#if __AVAILABILITY_MACROS_USES_AVAILABILITY
997 #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)
998#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
999 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8 DEPRECATED_ATTRIBUTE
1000#else
1001 #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
1002#endif
1003
1004/*
1005 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
1006 *
1007 * Used on declarations introduced in Mac OS X 10.9
1008 */
1009#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1010 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_COMPAT_VERSION)
1011#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
1012 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER UNAVAILABLE_ATTRIBUTE
1013#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9
1014 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER WEAK_IMPORT_ATTRIBUTE
1015#else
1016 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
1017#endif
1018
1019/*
1020 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED
1021 *
1022 * Used on declarations introduced in Mac OS X 10.9,
1023 * and deprecated in Mac OS X 10.9
1024 */
1025#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1026 #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)
1027#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1028 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1029#else
1030 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
1031#endif
1032
1033/*
1034 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1035 *
1036 * Used on declarations introduced in Mac OS X 10.0,
1037 * but later deprecated in Mac OS X 10.9
1038 */
1039#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1040 #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)
1041#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1042 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1043#else
1044 #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
1045#endif
1046
1047/*
1048 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1049 *
1050 * Used on declarations introduced in Mac OS X 10.1,
1051 * but later deprecated in Mac OS X 10.9
1052 */
1053#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1054 #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)
1055#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1056 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1057#else
1058 #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
1059#endif
1060
1061/*
1062 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1063 *
1064 * Used on declarations introduced in Mac OS X 10.2,
1065 * but later deprecated in Mac OS X 10.9
1066 */
1067#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1068 #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)
1069#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1070 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1071#else
1072 #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
1073#endif
1074
1075/*
1076 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1077 *
1078 * Used on declarations introduced in Mac OS X 10.3,
1079 * but later deprecated in Mac OS X 10.9
1080 */
1081#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1082 #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)
1083#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1084 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1085#else
1086 #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
1087#endif
1088
1089/*
1090 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1091 *
1092 * Used on declarations introduced in Mac OS X 10.4,
1093 * but later deprecated in Mac OS X 10.9
1094 */
1095#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1096 #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)
1097#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1098 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1099#else
1100 #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
1101#endif
1102
1103/*
1104 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1105 *
1106 * Used on declarations introduced in Mac OS X 10.5,
1107 * but later deprecated in Mac OS X 10.9
1108 */
1109#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1110 #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)
1111#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1112 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1113#else
1114 #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
1115#endif
1116
1117/*
1118 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1119 *
1120 * Used on declarations introduced in Mac OS X 10.6,
1121 * but later deprecated in Mac OS X 10.9
1122 */
1123#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1124 #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)
1125#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1126 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1127#else
1128 #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
1129#endif
1130
1131/*
1132 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1133 *
1134 * Used on declarations introduced in Mac OS X 10.7,
1135 * but later deprecated in Mac OS X 10.9
1136 */
1137#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1138 #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)
1139#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1140 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1141#else
1142 #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
1143#endif
1144
1145/*
1146 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9
1147 *
1148 * Used on declarations introduced in Mac OS X 10.8,
1149 * but later deprecated in Mac OS X 10.9
1150 */
1151#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1152 #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)
1153#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
1154 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9 DEPRECATED_ATTRIBUTE
1155#else
1156 #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
1157#endif
1158
1159/*
1160 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
1161 *
1162 * Used on declarations introduced in Mac OS X 10.10
1163 */
1164#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1165 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_COMPAT_VERSION)
1166#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10
1167 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER UNAVAILABLE_ATTRIBUTE
1168#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
1169 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER WEAK_IMPORT_ATTRIBUTE
1170#else
1171 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
1172#endif
1173
1174/*
1175 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED
1176 *
1177 * Used on declarations introduced in Mac OS X 10.10,
1178 * and deprecated in Mac OS X 10.10
1179 */
1180#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1181 #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)
1182#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1183 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1184#else
1185 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
1186#endif
1187
1188/*
1189 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1190 *
1191 * Used on declarations introduced in Mac OS X 10.0,
1192 * but later deprecated in Mac OS X 10.10
1193 */
1194#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1195 #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)
1196#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1197 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1198#else
1199 #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
1200#endif
1201
1202/*
1203 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1204 *
1205 * Used on declarations introduced in Mac OS X 10.1,
1206 * but later deprecated in Mac OS X 10.10
1207 */
1208#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1209 #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)
1210#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1211 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1212#else
1213 #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
1214#endif
1215
1216/*
1217 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1218 *
1219 * Used on declarations introduced in Mac OS X 10.2,
1220 * but later deprecated in Mac OS X 10.10
1221 */
1222#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1223 #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)
1224#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1225 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1226#else
1227 #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
1228#endif
1229
1230/*
1231 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1232 *
1233 * Used on declarations introduced in Mac OS X 10.3,
1234 * but later deprecated in Mac OS X 10.10
1235 */
1236#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1237 #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)
1238#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1239 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1240#else
1241 #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
1242#endif
1243
1244/*
1245 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1246 *
1247 * Used on declarations introduced in Mac OS X 10.4,
1248 * but later deprecated in Mac OS X 10.10
1249 */
1250#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1251 #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)
1252#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1253 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1254#else
1255 #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
1256#endif
1257
1258/*
1259 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1260 *
1261 * Used on declarations introduced in Mac OS X 10.5,
1262 * but later deprecated in Mac OS X 10.10
1263 */
1264#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1265 #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)
1266#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1267 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1268#else
1269 #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
1270#endif
1271
1272/*
1273 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1274 *
1275 * Used on declarations introduced in Mac OS X 10.6,
1276 * but later deprecated in Mac OS X 10.10
1277 */
1278#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1279 #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)
1280#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1281 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1282#else
1283 #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
1284#endif
1285
1286/*
1287 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1288 *
1289 * Used on declarations introduced in Mac OS X 10.7,
1290 * but later deprecated in Mac OS X 10.10
1291 */
1292#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1293 #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)
1294#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1295 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1296#else
1297 #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
1298#endif
1299
1300/*
1301 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1302 *
1303 * Used on declarations introduced in Mac OS X 10.8,
1304 * but later deprecated in Mac OS X 10.10
1305 */
1306#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1307 #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)
1308#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1309 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1310#else
1311 #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
1312#endif
1313
1314/*
1315 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10
1316 *
1317 * Used on declarations introduced in Mac OS X 10.9,
1318 * but later deprecated in Mac OS X 10.10
1319 */
1320#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1321 #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)
1322#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
1323 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10 DEPRECATED_ATTRIBUTE
1324#else
1325 #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
1326#endif
1327
1328/*
1329 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER
1330 *
1331 * Used on declarations introduced in Mac OS X 10.10.2
1332 */
1333#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1334 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10_2, __IPHONE_COMPAT_VERSION)
1335#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10_2
1336 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER UNAVAILABLE_ATTRIBUTE
1337#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10_2
1338 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
1339#else
1340 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER
1341#endif
1342
1343/*
1344 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED
1345 *
1346 * Used on declarations introduced in Mac OS X 10.10.2,
1347 * and deprecated in Mac OS X 10.10.2
1348 */
1349#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1350 #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)
1351#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1352 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1353#else
1354 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER
1355#endif
1356
1357/*
1358 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1359 *
1360 * Used on declarations introduced in Mac OS X 10.0,
1361 * but later deprecated in Mac OS X 10.10.2
1362 */
1363#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1364 #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)
1365#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1366 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1367#else
1368 #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
1369#endif
1370
1371/*
1372 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1373 *
1374 * Used on declarations introduced in Mac OS X 10.1,
1375 * but later deprecated in Mac OS X 10.10.2
1376 */
1377#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1378 #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)
1379#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1380 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1381#else
1382 #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
1383#endif
1384
1385/*
1386 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1387 *
1388 * Used on declarations introduced in Mac OS X 10.2,
1389 * but later deprecated in Mac OS X 10.10.2
1390 */
1391#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1392 #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)
1393#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1394 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1395#else
1396 #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
1397#endif
1398
1399/*
1400 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1401 *
1402 * Used on declarations introduced in Mac OS X 10.3,
1403 * but later deprecated in Mac OS X 10.10.2
1404 */
1405#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1406 #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)
1407#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1408 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1409#else
1410 #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
1411#endif
1412
1413/*
1414 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1415 *
1416 * Used on declarations introduced in Mac OS X 10.4,
1417 * but later deprecated in Mac OS X 10.10.2
1418 */
1419#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1420 #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)
1421#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1422 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1423#else
1424 #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
1425#endif
1426
1427/*
1428 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1429 *
1430 * Used on declarations introduced in Mac OS X 10.5,
1431 * but later deprecated in Mac OS X 10.10.2
1432 */
1433#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1434 #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)
1435#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1436 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1437#else
1438 #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
1439#endif
1440
1441/*
1442 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1443 *
1444 * Used on declarations introduced in Mac OS X 10.6,
1445 * but later deprecated in Mac OS X 10.10.2
1446 */
1447#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1448 #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)
1449#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1450 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1451#else
1452 #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
1453#endif
1454
1455/*
1456 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1457 *
1458 * Used on declarations introduced in Mac OS X 10.7,
1459 * but later deprecated in Mac OS X 10.10.2
1460 */
1461#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1462 #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)
1463#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1464 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1465#else
1466 #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
1467#endif
1468
1469/*
1470 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1471 *
1472 * Used on declarations introduced in Mac OS X 10.8,
1473 * but later deprecated in Mac OS X 10.10.2
1474 */
1475#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1476 #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)
1477#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1478 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1479#else
1480 #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
1481#endif
1482
1483/*
1484 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1485 *
1486 * Used on declarations introduced in Mac OS X 10.9,
1487 * but later deprecated in Mac OS X 10.10.2
1488 */
1489#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1490 #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)
1491#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1492 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1493#else
1494 #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
1495#endif
1496
1497/*
1498 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2
1499 *
1500 * Used on declarations introduced in Mac OS X 10.10,
1501 * but later deprecated in Mac OS X 10.10.2
1502 */
1503#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1504 #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)
1505#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_2
1506 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_2 DEPRECATED_ATTRIBUTE
1507#else
1508 #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
1509#endif
1510
1511/*
1512 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER
1513 *
1514 * Used on declarations introduced in Mac OS X 10.10.3
1515 */
1516#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1517 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_10_3, __IPHONE_COMPAT_VERSION)
1518#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10_3
1519 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER UNAVAILABLE_ATTRIBUTE
1520#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10_3
1521 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
1522#else
1523 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER
1524#endif
1525
1526/*
1527 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED
1528 *
1529 * Used on declarations introduced in Mac OS X 10.10.3,
1530 * and deprecated in Mac OS X 10.10.3
1531 */
1532#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1533 #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)
1534#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1535 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1536#else
1537 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER
1538#endif
1539
1540/*
1541 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1542 *
1543 * Used on declarations introduced in Mac OS X 10.0,
1544 * but later deprecated in Mac OS X 10.10.3
1545 */
1546#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1547 #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)
1548#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1549 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1550#else
1551 #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
1552#endif
1553
1554/*
1555 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1556 *
1557 * Used on declarations introduced in Mac OS X 10.1,
1558 * but later deprecated in Mac OS X 10.10.3
1559 */
1560#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1561 #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)
1562#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1563 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1564#else
1565 #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
1566#endif
1567
1568/*
1569 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1570 *
1571 * Used on declarations introduced in Mac OS X 10.2,
1572 * but later deprecated in Mac OS X 10.10.3
1573 */
1574#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1575 #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)
1576#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1577 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1578#else
1579 #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
1580#endif
1581
1582/*
1583 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1584 *
1585 * Used on declarations introduced in Mac OS X 10.3,
1586 * but later deprecated in Mac OS X 10.10.3
1587 */
1588#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1589 #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)
1590#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1591 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1592#else
1593 #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
1594#endif
1595
1596/*
1597 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1598 *
1599 * Used on declarations introduced in Mac OS X 10.4,
1600 * but later deprecated in Mac OS X 10.10.3
1601 */
1602#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1603 #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)
1604#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1605 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1606#else
1607 #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
1608#endif
1609
1610/*
1611 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1612 *
1613 * Used on declarations introduced in Mac OS X 10.5,
1614 * but later deprecated in Mac OS X 10.10.3
1615 */
1616#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1617 #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)
1618#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1619 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1620#else
1621 #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
1622#endif
1623
1624/*
1625 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1626 *
1627 * Used on declarations introduced in Mac OS X 10.6,
1628 * but later deprecated in Mac OS X 10.10.3
1629 */
1630#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1631 #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)
1632#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1633 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1634#else
1635 #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
1636#endif
1637
1638/*
1639 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1640 *
1641 * Used on declarations introduced in Mac OS X 10.7,
1642 * but later deprecated in Mac OS X 10.10.3
1643 */
1644#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1645 #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)
1646#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1647 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1648#else
1649 #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
1650#endif
1651
1652/*
1653 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1654 *
1655 * Used on declarations introduced in Mac OS X 10.8,
1656 * but later deprecated in Mac OS X 10.10.3
1657 */
1658#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1659 #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)
1660#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1661 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1662#else
1663 #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
1664#endif
1665
1666/*
1667 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1668 *
1669 * Used on declarations introduced in Mac OS X 10.9,
1670 * but later deprecated in Mac OS X 10.10.3
1671 */
1672#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1673 #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)
1674#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1675 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1676#else
1677 #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
1678#endif
1679
1680/*
1681 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1682 *
1683 * Used on declarations introduced in Mac OS X 10.10,
1684 * but later deprecated in Mac OS X 10.10.3
1685 */
1686#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1687 #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)
1688#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1689 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1690#else
1691 #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
1692#endif
1693
1694/*
1695 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3
1696 *
1697 * Used on declarations introduced in Mac OS X 10.10.2,
1698 * but later deprecated in Mac OS X 10.10.3
1699 */
1700#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1701 #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)
1702#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10_3
1703 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_10_3 DEPRECATED_ATTRIBUTE
1704#else
1705 #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
1706#endif
1707
1708/*
1709 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER
1710 *
1711 * Used on declarations introduced in Mac OS X 10.11
1712 */
1713#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1714 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_COMPAT_VERSION)
1715#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11
1716 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER UNAVAILABLE_ATTRIBUTE
1717#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11
1718 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER WEAK_IMPORT_ATTRIBUTE
1719#else
1720 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER
1721#endif
1722
1723/*
1724 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED
1725 *
1726 * Used on declarations introduced in Mac OS X 10.11,
1727 * and deprecated in Mac OS X 10.11
1728 */
1729#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1730 #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)
1731#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1732 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1733#else
1734 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER
1735#endif
1736
1737/*
1738 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1739 *
1740 * Used on declarations introduced in Mac OS X 10.0,
1741 * but later deprecated in Mac OS X 10.11
1742 */
1743#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1744 #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)
1745#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1746 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1747#else
1748 #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
1749#endif
1750
1751/*
1752 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1753 *
1754 * Used on declarations introduced in Mac OS X 10.1,
1755 * but later deprecated in Mac OS X 10.11
1756 */
1757#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1758 #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)
1759#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1760 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1761#else
1762 #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
1763#endif
1764
1765/*
1766 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1767 *
1768 * Used on declarations introduced in Mac OS X 10.2,
1769 * but later deprecated in Mac OS X 10.11
1770 */
1771#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1772 #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)
1773#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1774 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1775#else
1776 #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
1777#endif
1778
1779/*
1780 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1781 *
1782 * Used on declarations introduced in Mac OS X 10.3,
1783 * but later deprecated in Mac OS X 10.11
1784 */
1785#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1786 #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)
1787#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1788 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1789#else
1790 #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
1791#endif
1792
1793/*
1794 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1795 *
1796 * Used on declarations introduced in Mac OS X 10.4,
1797 * but later deprecated in Mac OS X 10.11
1798 */
1799#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1800 #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)
1801#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1802 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1803#else
1804 #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
1805#endif
1806
1807/*
1808 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1809 *
1810 * Used on declarations introduced in Mac OS X 10.5,
1811 * but later deprecated in Mac OS X 10.11
1812 */
1813#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1814 #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)
1815#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1816 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1817#else
1818 #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
1819#endif
1820
1821/*
1822 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1823 *
1824 * Used on declarations introduced in Mac OS X 10.6,
1825 * but later deprecated in Mac OS X 10.11
1826 */
1827#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1828 #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)
1829#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1830 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1831#else
1832 #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
1833#endif
1834
1835/*
1836 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1837 *
1838 * Used on declarations introduced in Mac OS X 10.7,
1839 * but later deprecated in Mac OS X 10.11
1840 */
1841#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1842 #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)
1843#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1844 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1845#else
1846 #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
1847#endif
1848
1849/*
1850 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1851 *
1852 * Used on declarations introduced in Mac OS X 10.8,
1853 * but later deprecated in Mac OS X 10.11
1854 */
1855#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1856 #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)
1857#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1858 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1859#else
1860 #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
1861#endif
1862
1863/*
1864 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1865 *
1866 * Used on declarations introduced in Mac OS X 10.9,
1867 * but later deprecated in Mac OS X 10.11
1868 */
1869#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1870 #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)
1871#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1872 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1873#else
1874 #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
1875#endif
1876
1877/*
1878 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1879 *
1880 * Used on declarations introduced in Mac OS X 10.10,
1881 * but later deprecated in Mac OS X 10.11
1882 */
1883#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1884 #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)
1885#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1886 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1887#else
1888 #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
1889#endif
1890
1891/*
1892 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1893 *
1894 * Used on declarations introduced in Mac OS X 10.10.2,
1895 * but later deprecated in Mac OS X 10.11
1896 */
1897#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1898 #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)
1899#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1900 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1901#else
1902 #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
1903#endif
1904
1905/*
1906 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11
1907 *
1908 * Used on declarations introduced in Mac OS X 10.10.3,
1909 * but later deprecated in Mac OS X 10.11
1910 */
1911#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1912 #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)
1913#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
1914 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11 DEPRECATED_ATTRIBUTE
1915#else
1916 #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
1917#endif
1918
1919/*
1920 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER
1921 *
1922 * Used on declarations introduced in Mac OS X 10.11.2
1923 */
1924#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1925 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_2, __IPHONE_COMPAT_VERSION)
1926#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_2
1927 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER UNAVAILABLE_ATTRIBUTE
1928#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_2
1929 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
1930#else
1931 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER
1932#endif
1933
1934/*
1935 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED
1936 *
1937 * Used on declarations introduced in Mac OS X 10.11.2,
1938 * and deprecated in Mac OS X 10.11.2
1939 */
1940#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1941 #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)
1942#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1943 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
1944#else
1945 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER
1946#endif
1947
1948/*
1949 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1950 *
1951 * Used on declarations introduced in Mac OS X 10.0,
1952 * but later deprecated in Mac OS X 10.11.2
1953 */
1954#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1955 #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)
1956#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1957 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
1958#else
1959 #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
1960#endif
1961
1962/*
1963 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1964 *
1965 * Used on declarations introduced in Mac OS X 10.1,
1966 * but later deprecated in Mac OS X 10.11.2
1967 */
1968#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1969 #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)
1970#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1971 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
1972#else
1973 #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
1974#endif
1975
1976/*
1977 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1978 *
1979 * Used on declarations introduced in Mac OS X 10.2,
1980 * but later deprecated in Mac OS X 10.11.2
1981 */
1982#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1983 #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)
1984#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1985 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
1986#else
1987 #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
1988#endif
1989
1990/*
1991 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
1992 *
1993 * Used on declarations introduced in Mac OS X 10.3,
1994 * but later deprecated in Mac OS X 10.11.2
1995 */
1996#if __AVAILABILITY_MACROS_USES_AVAILABILITY
1997 #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)
1998#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
1999 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2000#else
2001 #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
2002#endif
2003
2004/*
2005 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2006 *
2007 * Used on declarations introduced in Mac OS X 10.4,
2008 * but later deprecated in Mac OS X 10.11.2
2009 */
2010#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2011 #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)
2012#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2013 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2014#else
2015 #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
2016#endif
2017
2018/*
2019 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2020 *
2021 * Used on declarations introduced in Mac OS X 10.5,
2022 * but later deprecated in Mac OS X 10.11.2
2023 */
2024#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2025 #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)
2026#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2027 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2028#else
2029 #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
2030#endif
2031
2032/*
2033 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2034 *
2035 * Used on declarations introduced in Mac OS X 10.6,
2036 * but later deprecated in Mac OS X 10.11.2
2037 */
2038#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2039 #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)
2040#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2041 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2042#else
2043 #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
2044#endif
2045
2046/*
2047 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2048 *
2049 * Used on declarations introduced in Mac OS X 10.7,
2050 * but later deprecated in Mac OS X 10.11.2
2051 */
2052#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2053 #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)
2054#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2055 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2056#else
2057 #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
2058#endif
2059
2060/*
2061 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2062 *
2063 * Used on declarations introduced in Mac OS X 10.8,
2064 * but later deprecated in Mac OS X 10.11.2
2065 */
2066#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2067 #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)
2068#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2069 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2070#else
2071 #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
2072#endif
2073
2074/*
2075 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2076 *
2077 * Used on declarations introduced in Mac OS X 10.9,
2078 * but later deprecated in Mac OS X 10.11.2
2079 */
2080#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2081 #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)
2082#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2083 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2084#else
2085 #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
2086#endif
2087
2088/*
2089 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2090 *
2091 * Used on declarations introduced in Mac OS X 10.10,
2092 * but later deprecated in Mac OS X 10.11.2
2093 */
2094#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2095 #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)
2096#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2097 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2098#else
2099 #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
2100#endif
2101
2102/*
2103 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2104 *
2105 * Used on declarations introduced in Mac OS X 10.10.2,
2106 * but later deprecated in Mac OS X 10.11.2
2107 */
2108#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2109 #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)
2110#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2111 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2112#else
2113 #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
2114#endif
2115
2116/*
2117 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2118 *
2119 * Used on declarations introduced in Mac OS X 10.10.3,
2120 * but later deprecated in Mac OS X 10.11.2
2121 */
2122#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2123 #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)
2124#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2125 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2126#else
2127 #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
2128#endif
2129
2130/*
2131 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2
2132 *
2133 * Used on declarations introduced in Mac OS X 10.11,
2134 * but later deprecated in Mac OS X 10.11.2
2135 */
2136#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2137 #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)
2138#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_2
2139 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_2 DEPRECATED_ATTRIBUTE
2140#else
2141 #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
2142#endif
2143
2144/*
2145 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER
2146 *
2147 * Used on declarations introduced in Mac OS X 10.11.3
2148 */
2149#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2150 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_3, __IPHONE_COMPAT_VERSION)
2151#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_3
2152 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER UNAVAILABLE_ATTRIBUTE
2153#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_3
2154 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
2155#else
2156 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER
2157#endif
2158
2159/*
2160 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED
2161 *
2162 * Used on declarations introduced in Mac OS X 10.11.3,
2163 * and deprecated in Mac OS X 10.11.3
2164 */
2165#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2166 #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)
2167#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2168 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2169#else
2170 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER
2171#endif
2172
2173/*
2174 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2175 *
2176 * Used on declarations introduced in Mac OS X 10.0,
2177 * but later deprecated in Mac OS X 10.11.3
2178 */
2179#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2180 #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)
2181#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2182 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2183#else
2184 #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
2185#endif
2186
2187/*
2188 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2189 *
2190 * Used on declarations introduced in Mac OS X 10.1,
2191 * but later deprecated in Mac OS X 10.11.3
2192 */
2193#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2194 #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)
2195#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2196 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2197#else
2198 #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
2199#endif
2200
2201/*
2202 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2203 *
2204 * Used on declarations introduced in Mac OS X 10.2,
2205 * but later deprecated in Mac OS X 10.11.3
2206 */
2207#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2208 #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)
2209#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2210 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2211#else
2212 #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
2213#endif
2214
2215/*
2216 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2217 *
2218 * Used on declarations introduced in Mac OS X 10.3,
2219 * but later deprecated in Mac OS X 10.11.3
2220 */
2221#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2222 #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)
2223#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2224 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2225#else
2226 #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
2227#endif
2228
2229/*
2230 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2231 *
2232 * Used on declarations introduced in Mac OS X 10.4,
2233 * but later deprecated in Mac OS X 10.11.3
2234 */
2235#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2236 #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)
2237#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2238 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2239#else
2240 #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
2241#endif
2242
2243/*
2244 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2245 *
2246 * Used on declarations introduced in Mac OS X 10.5,
2247 * but later deprecated in Mac OS X 10.11.3
2248 */
2249#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2250 #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)
2251#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2252 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2253#else
2254 #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
2255#endif
2256
2257/*
2258 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2259 *
2260 * Used on declarations introduced in Mac OS X 10.6,
2261 * but later deprecated in Mac OS X 10.11.3
2262 */
2263#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2264 #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)
2265#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2266 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2267#else
2268 #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
2269#endif
2270
2271/*
2272 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2273 *
2274 * Used on declarations introduced in Mac OS X 10.7,
2275 * but later deprecated in Mac OS X 10.11.3
2276 */
2277#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2278 #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)
2279#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2280 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2281#else
2282 #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
2283#endif
2284
2285/*
2286 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2287 *
2288 * Used on declarations introduced in Mac OS X 10.8,
2289 * but later deprecated in Mac OS X 10.11.3
2290 */
2291#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2292 #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)
2293#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2294 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2295#else
2296 #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
2297#endif
2298
2299/*
2300 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2301 *
2302 * Used on declarations introduced in Mac OS X 10.9,
2303 * but later deprecated in Mac OS X 10.11.3
2304 */
2305#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2306 #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)
2307#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2308 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2309#else
2310 #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
2311#endif
2312
2313/*
2314 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2315 *
2316 * Used on declarations introduced in Mac OS X 10.10,
2317 * but later deprecated in Mac OS X 10.11.3
2318 */
2319#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2320 #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)
2321#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2322 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2323#else
2324 #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
2325#endif
2326
2327/*
2328 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2329 *
2330 * Used on declarations introduced in Mac OS X 10.10.2,
2331 * but later deprecated in Mac OS X 10.11.3
2332 */
2333#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2334 #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)
2335#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2336 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2337#else
2338 #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
2339#endif
2340
2341/*
2342 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2343 *
2344 * Used on declarations introduced in Mac OS X 10.10.3,
2345 * but later deprecated in Mac OS X 10.11.3
2346 */
2347#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2348 #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)
2349#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2350 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2351#else
2352 #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
2353#endif
2354
2355/*
2356 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2357 *
2358 * Used on declarations introduced in Mac OS X 10.11,
2359 * but later deprecated in Mac OS X 10.11.3
2360 */
2361#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2362 #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)
2363#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2364 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2365#else
2366 #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
2367#endif
2368
2369/*
2370 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3
2371 *
2372 * Used on declarations introduced in Mac OS X 10.11.2,
2373 * but later deprecated in Mac OS X 10.11.3
2374 */
2375#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2376 #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)
2377#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_3
2378 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_3 DEPRECATED_ATTRIBUTE
2379#else
2380 #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
2381#endif
2382
2383/*
2384 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER
2385 *
2386 * Used on declarations introduced in Mac OS X 10.11.4
2387 */
2388#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2389 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_11_4, __IPHONE_COMPAT_VERSION)
2390#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11_4
2391 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER UNAVAILABLE_ATTRIBUTE
2392#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11_4
2393 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
2394#else
2395 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER
2396#endif
2397
2398/*
2399 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED
2400 *
2401 * Used on declarations introduced in Mac OS X 10.11.4,
2402 * and deprecated in Mac OS X 10.11.4
2403 */
2404#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2405 #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)
2406#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2407 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2408#else
2409 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER
2410#endif
2411
2412/*
2413 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2414 *
2415 * Used on declarations introduced in Mac OS X 10.0,
2416 * but later deprecated in Mac OS X 10.11.4
2417 */
2418#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2419 #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)
2420#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2421 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2422#else
2423 #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
2424#endif
2425
2426/*
2427 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2428 *
2429 * Used on declarations introduced in Mac OS X 10.1,
2430 * but later deprecated in Mac OS X 10.11.4
2431 */
2432#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2433 #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)
2434#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2435 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2436#else
2437 #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
2438#endif
2439
2440/*
2441 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2442 *
2443 * Used on declarations introduced in Mac OS X 10.2,
2444 * but later deprecated in Mac OS X 10.11.4
2445 */
2446#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2447 #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)
2448#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2449 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2450#else
2451 #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
2452#endif
2453
2454/*
2455 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2456 *
2457 * Used on declarations introduced in Mac OS X 10.3,
2458 * but later deprecated in Mac OS X 10.11.4
2459 */
2460#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2461 #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)
2462#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2463 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2464#else
2465 #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
2466#endif
2467
2468/*
2469 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2470 *
2471 * Used on declarations introduced in Mac OS X 10.4,
2472 * but later deprecated in Mac OS X 10.11.4
2473 */
2474#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2475 #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)
2476#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2477 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2478#else
2479 #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
2480#endif
2481
2482/*
2483 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2484 *
2485 * Used on declarations introduced in Mac OS X 10.5,
2486 * but later deprecated in Mac OS X 10.11.4
2487 */
2488#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2489 #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)
2490#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2491 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2492#else
2493 #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
2494#endif
2495
2496/*
2497 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2498 *
2499 * Used on declarations introduced in Mac OS X 10.6,
2500 * but later deprecated in Mac OS X 10.11.4
2501 */
2502#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2503 #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)
2504#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2505 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2506#else
2507 #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
2508#endif
2509
2510/*
2511 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2512 *
2513 * Used on declarations introduced in Mac OS X 10.7,
2514 * but later deprecated in Mac OS X 10.11.4
2515 */
2516#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2517 #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)
2518#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2519 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2520#else
2521 #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
2522#endif
2523
2524/*
2525 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2526 *
2527 * Used on declarations introduced in Mac OS X 10.8,
2528 * but later deprecated in Mac OS X 10.11.4
2529 */
2530#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2531 #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)
2532#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2533 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2534#else
2535 #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
2536#endif
2537
2538/*
2539 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2540 *
2541 * Used on declarations introduced in Mac OS X 10.9,
2542 * but later deprecated in Mac OS X 10.11.4
2543 */
2544#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2545 #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)
2546#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2547 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2548#else
2549 #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
2550#endif
2551
2552/*
2553 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2554 *
2555 * Used on declarations introduced in Mac OS X 10.10,
2556 * but later deprecated in Mac OS X 10.11.4
2557 */
2558#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2559 #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)
2560#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2561 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2562#else
2563 #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
2564#endif
2565
2566/*
2567 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2568 *
2569 * Used on declarations introduced in Mac OS X 10.10.2,
2570 * but later deprecated in Mac OS X 10.11.4
2571 */
2572#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2573 #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)
2574#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2575 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2576#else
2577 #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
2578#endif
2579
2580/*
2581 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2582 *
2583 * Used on declarations introduced in Mac OS X 10.10.3,
2584 * but later deprecated in Mac OS X 10.11.4
2585 */
2586#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2587 #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)
2588#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2589 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2590#else
2591 #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
2592#endif
2593
2594/*
2595 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2596 *
2597 * Used on declarations introduced in Mac OS X 10.11,
2598 * but later deprecated in Mac OS X 10.11.4
2599 */
2600#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2601 #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)
2602#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2603 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2604#else
2605 #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
2606#endif
2607
2608/*
2609 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2610 *
2611 * Used on declarations introduced in Mac OS X 10.11.2,
2612 * but later deprecated in Mac OS X 10.11.4
2613 */
2614#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2615 #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)
2616#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2617 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2618#else
2619 #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
2620#endif
2621
2622/*
2623 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4
2624 *
2625 * Used on declarations introduced in Mac OS X 10.11.3,
2626 * but later deprecated in Mac OS X 10.11.4
2627 */
2628#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2629 #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)
2630#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11_4
2631 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_11_4 DEPRECATED_ATTRIBUTE
2632#else
2633 #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
2634#endif
2635
2636/*
2637 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
2638 *
2639 * Used on declarations introduced in Mac OS X 10.12
2640 */
2641#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2642 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_COMPAT_VERSION)
2643#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
2644 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER UNAVAILABLE_ATTRIBUTE
2645#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
2646 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER WEAK_IMPORT_ATTRIBUTE
2647#else
2648 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
2649#endif
2650
2651/*
2652 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED
2653 *
2654 * Used on declarations introduced in Mac OS X 10.12,
2655 * and deprecated in Mac OS X 10.12
2656 */
2657#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2658 #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)
2659#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2660 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2661#else
2662 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
2663#endif
2664
2665/*
2666 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2667 *
2668 * Used on declarations introduced in Mac OS X 10.0,
2669 * but later deprecated in Mac OS X 10.12
2670 */
2671#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2672 #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)
2673#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2674 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2675#else
2676 #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
2677#endif
2678
2679/*
2680 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2681 *
2682 * Used on declarations introduced in Mac OS X 10.1,
2683 * but later deprecated in Mac OS X 10.12
2684 */
2685#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2686 #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)
2687#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2688 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2689#else
2690 #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
2691#endif
2692
2693/*
2694 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2695 *
2696 * Used on declarations introduced in Mac OS X 10.2,
2697 * but later deprecated in Mac OS X 10.12
2698 */
2699#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2700 #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)
2701#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2702 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2703#else
2704 #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
2705#endif
2706
2707/*
2708 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2709 *
2710 * Used on declarations introduced in Mac OS X 10.3,
2711 * but later deprecated in Mac OS X 10.12
2712 */
2713#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2714 #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)
2715#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2716 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2717#else
2718 #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
2719#endif
2720
2721/*
2722 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2723 *
2724 * Used on declarations introduced in Mac OS X 10.4,
2725 * but later deprecated in Mac OS X 10.12
2726 */
2727#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2728 #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)
2729#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2730 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2731#else
2732 #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
2733#endif
2734
2735/*
2736 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2737 *
2738 * Used on declarations introduced in Mac OS X 10.5,
2739 * but later deprecated in Mac OS X 10.12
2740 */
2741#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2742 #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)
2743#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2744 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2745#else
2746 #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
2747#endif
2748
2749/*
2750 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2751 *
2752 * Used on declarations introduced in Mac OS X 10.6,
2753 * but later deprecated in Mac OS X 10.12
2754 */
2755#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2756 #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)
2757#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2758 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2759#else
2760 #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
2761#endif
2762
2763/*
2764 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2765 *
2766 * Used on declarations introduced in Mac OS X 10.7,
2767 * but later deprecated in Mac OS X 10.12
2768 */
2769#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2770 #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)
2771#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2772 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2773#else
2774 #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
2775#endif
2776
2777/*
2778 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2779 *
2780 * Used on declarations introduced in Mac OS X 10.8,
2781 * but later deprecated in Mac OS X 10.12
2782 */
2783#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2784 #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)
2785#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2786 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2787#else
2788 #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
2789#endif
2790
2791/*
2792 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2793 *
2794 * Used on declarations introduced in Mac OS X 10.9,
2795 * but later deprecated in Mac OS X 10.12
2796 */
2797#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2798 #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)
2799#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2800 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2801#else
2802 #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
2803#endif
2804
2805/*
2806 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2807 *
2808 * Used on declarations introduced in Mac OS X 10.10,
2809 * but later deprecated in Mac OS X 10.12
2810 */
2811#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2812 #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)
2813#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2814 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2815#else
2816 #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
2817#endif
2818
2819/*
2820 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2821 *
2822 * Used on declarations introduced in Mac OS X 10.10.2,
2823 * but later deprecated in Mac OS X 10.12
2824 */
2825#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2826 #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)
2827#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2828 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2829#else
2830 #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
2831#endif
2832
2833/*
2834 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2835 *
2836 * Used on declarations introduced in Mac OS X 10.10.3,
2837 * but later deprecated in Mac OS X 10.12
2838 */
2839#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2840 #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)
2841#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2842 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2843#else
2844 #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
2845#endif
2846
2847/*
2848 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2849 *
2850 * Used on declarations introduced in Mac OS X 10.11,
2851 * but later deprecated in Mac OS X 10.12
2852 */
2853#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2854 #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)
2855#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2856 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2857#else
2858 #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
2859#endif
2860
2861/*
2862 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2863 *
2864 * Used on declarations introduced in Mac OS X 10.11.2,
2865 * but later deprecated in Mac OS X 10.12
2866 */
2867#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2868 #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)
2869#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2870 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2871#else
2872 #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
2873#endif
2874
2875/*
2876 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2877 *
2878 * Used on declarations introduced in Mac OS X 10.11.3,
2879 * but later deprecated in Mac OS X 10.12
2880 */
2881#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2882 #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)
2883#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2884 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2885#else
2886 #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
2887#endif
2888
2889/*
2890 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12
2891 *
2892 * Used on declarations introduced in Mac OS X 10.11.4,
2893 * but later deprecated in Mac OS X 10.12
2894 */
2895#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2896 #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)
2897#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
2898 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12 DEPRECATED_ATTRIBUTE
2899#else
2900 #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
2901#endif
2902
2903/*
2904 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER
2905 *
2906 * Used on declarations introduced in Mac OS X 10.12.1
2907 */
2908#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2909 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_1, __IPHONE_COMPAT_VERSION)
2910#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_1
2911 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER UNAVAILABLE_ATTRIBUTE
2912#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_1
2913 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER WEAK_IMPORT_ATTRIBUTE
2914#else
2915 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER
2916#endif
2917
2918/*
2919 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED
2920 *
2921 * Used on declarations introduced in Mac OS X 10.12.1,
2922 * and deprecated in Mac OS X 10.12.1
2923 */
2924#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2925 #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)
2926#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2927 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
2928#else
2929 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER
2930#endif
2931
2932/*
2933 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2934 *
2935 * Used on declarations introduced in Mac OS X 10.0,
2936 * but later deprecated in Mac OS X 10.12.1
2937 */
2938#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2939 #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)
2940#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2941 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2942#else
2943 #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
2944#endif
2945
2946/*
2947 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2948 *
2949 * Used on declarations introduced in Mac OS X 10.1,
2950 * but later deprecated in Mac OS X 10.12.1
2951 */
2952#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2953 #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)
2954#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2955 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2956#else
2957 #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
2958#endif
2959
2960/*
2961 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2962 *
2963 * Used on declarations introduced in Mac OS X 10.2,
2964 * but later deprecated in Mac OS X 10.12.1
2965 */
2966#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2967 #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)
2968#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2969 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2970#else
2971 #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
2972#endif
2973
2974/*
2975 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2976 *
2977 * Used on declarations introduced in Mac OS X 10.3,
2978 * but later deprecated in Mac OS X 10.12.1
2979 */
2980#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2981 #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)
2982#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2983 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2984#else
2985 #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
2986#endif
2987
2988/*
2989 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
2990 *
2991 * Used on declarations introduced in Mac OS X 10.4,
2992 * but later deprecated in Mac OS X 10.12.1
2993 */
2994#if __AVAILABILITY_MACROS_USES_AVAILABILITY
2995 #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)
2996#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
2997 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
2998#else
2999 #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
3000#endif
3001
3002/*
3003 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3004 *
3005 * Used on declarations introduced in Mac OS X 10.5,
3006 * but later deprecated in Mac OS X 10.12.1
3007 */
3008#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3009 #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)
3010#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3011 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3012#else
3013 #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
3014#endif
3015
3016/*
3017 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3018 *
3019 * Used on declarations introduced in Mac OS X 10.6,
3020 * but later deprecated in Mac OS X 10.12.1
3021 */
3022#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3023 #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)
3024#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3025 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3026#else
3027 #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
3028#endif
3029
3030/*
3031 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3032 *
3033 * Used on declarations introduced in Mac OS X 10.7,
3034 * but later deprecated in Mac OS X 10.12.1
3035 */
3036#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3037 #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)
3038#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3039 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3040#else
3041 #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
3042#endif
3043
3044/*
3045 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3046 *
3047 * Used on declarations introduced in Mac OS X 10.8,
3048 * but later deprecated in Mac OS X 10.12.1
3049 */
3050#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3051 #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)
3052#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3053 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3054#else
3055 #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
3056#endif
3057
3058/*
3059 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3060 *
3061 * Used on declarations introduced in Mac OS X 10.9,
3062 * but later deprecated in Mac OS X 10.12.1
3063 */
3064#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3065 #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)
3066#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3067 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3068#else
3069 #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
3070#endif
3071
3072/*
3073 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3074 *
3075 * Used on declarations introduced in Mac OS X 10.10,
3076 * but later deprecated in Mac OS X 10.12.1
3077 */
3078#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3079 #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)
3080#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3081 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3082#else
3083 #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
3084#endif
3085
3086/*
3087 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3088 *
3089 * Used on declarations introduced in Mac OS X 10.10.2,
3090 * but later deprecated in Mac OS X 10.12.1
3091 */
3092#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3093 #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)
3094#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3095 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3096#else
3097 #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
3098#endif
3099
3100/*
3101 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3102 *
3103 * Used on declarations introduced in Mac OS X 10.10.3,
3104 * but later deprecated in Mac OS X 10.12.1
3105 */
3106#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3107 #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)
3108#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3109 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3110#else
3111 #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
3112#endif
3113
3114/*
3115 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3116 *
3117 * Used on declarations introduced in Mac OS X 10.11,
3118 * but later deprecated in Mac OS X 10.12.1
3119 */
3120#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3121 #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)
3122#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3123 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3124#else
3125 #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
3126#endif
3127
3128/*
3129 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3130 *
3131 * Used on declarations introduced in Mac OS X 10.11.2,
3132 * but later deprecated in Mac OS X 10.12.1
3133 */
3134#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3135 #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)
3136#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3137 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3138#else
3139 #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
3140#endif
3141
3142/*
3143 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3144 *
3145 * Used on declarations introduced in Mac OS X 10.11.3,
3146 * but later deprecated in Mac OS X 10.12.1
3147 */
3148#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3149 #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)
3150#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3151 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3152#else
3153 #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
3154#endif
3155
3156/*
3157 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3158 *
3159 * Used on declarations introduced in Mac OS X 10.11.4,
3160 * but later deprecated in Mac OS X 10.12.1
3161 */
3162#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3163 #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)
3164#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3165 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3166#else
3167 #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
3168#endif
3169
3170/*
3171 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1
3172 *
3173 * Used on declarations introduced in Mac OS X 10.12,
3174 * but later deprecated in Mac OS X 10.12.1
3175 */
3176#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3177 #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)
3178#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_1
3179 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_1 DEPRECATED_ATTRIBUTE
3180#else
3181 #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
3182#endif
3183
3184/*
3185 * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER
3186 *
3187 * Used on declarations introduced in Mac OS X 10.12.2
3188 */
3189#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3190 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_2, __IPHONE_COMPAT_VERSION)
3191#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_2
3192 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER UNAVAILABLE_ATTRIBUTE
3193#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_2
3194 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
3195#else
3196 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER
3197#endif
3198
3199/*
3200 * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED
3201 *
3202 * Used on declarations introduced in Mac OS X 10.12.2,
3203 * and deprecated in Mac OS X 10.12.2
3204 */
3205#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3206 #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)
3207#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3208 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
3209#else
3210 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER
3211#endif
3212
3213/*
3214 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3215 *
3216 * Used on declarations introduced in Mac OS X 10.0,
3217 * but later deprecated in Mac OS X 10.12.2
3218 */
3219#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3220 #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)
3221#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3222 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3223#else
3224 #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
3225#endif
3226
3227/*
3228 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3229 *
3230 * Used on declarations introduced in Mac OS X 10.1,
3231 * but later deprecated in Mac OS X 10.12.2
3232 */
3233#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3234 #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)
3235#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3236 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3237#else
3238 #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
3239#endif
3240
3241/*
3242 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3243 *
3244 * Used on declarations introduced in Mac OS X 10.2,
3245 * but later deprecated in Mac OS X 10.12.2
3246 */
3247#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3248 #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)
3249#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3250 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3251#else
3252 #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
3253#endif
3254
3255/*
3256 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3257 *
3258 * Used on declarations introduced in Mac OS X 10.3,
3259 * but later deprecated in Mac OS X 10.12.2
3260 */
3261#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3262 #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)
3263#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3264 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3265#else
3266 #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
3267#endif
3268
3269/*
3270 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3271 *
3272 * Used on declarations introduced in Mac OS X 10.4,
3273 * but later deprecated in Mac OS X 10.12.2
3274 */
3275#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3276 #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)
3277#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3278 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3279#else
3280 #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
3281#endif
3282
3283/*
3284 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3285 *
3286 * Used on declarations introduced in Mac OS X 10.5,
3287 * but later deprecated in Mac OS X 10.12.2
3288 */
3289#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3290 #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)
3291#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3292 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3293#else
3294 #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
3295#endif
3296
3297/*
3298 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3299 *
3300 * Used on declarations introduced in Mac OS X 10.6,
3301 * but later deprecated in Mac OS X 10.12.2
3302 */
3303#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3304 #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)
3305#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3306 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3307#else
3308 #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
3309#endif
3310
3311/*
3312 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3313 *
3314 * Used on declarations introduced in Mac OS X 10.7,
3315 * but later deprecated in Mac OS X 10.12.2
3316 */
3317#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3318 #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)
3319#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3320 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3321#else
3322 #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
3323#endif
3324
3325/*
3326 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3327 *
3328 * Used on declarations introduced in Mac OS X 10.8,
3329 * but later deprecated in Mac OS X 10.12.2
3330 */
3331#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3332 #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)
3333#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3334 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3335#else
3336 #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
3337#endif
3338
3339/*
3340 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3341 *
3342 * Used on declarations introduced in Mac OS X 10.9,
3343 * but later deprecated in Mac OS X 10.12.2
3344 */
3345#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3346 #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)
3347#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3348 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3349#else
3350 #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
3351#endif
3352
3353/*
3354 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3355 *
3356 * Used on declarations introduced in Mac OS X 10.10,
3357 * but later deprecated in Mac OS X 10.12.2
3358 */
3359#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3360 #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)
3361#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3362 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3363#else
3364 #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
3365#endif
3366
3367/*
3368 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3369 *
3370 * Used on declarations introduced in Mac OS X 10.10.2,
3371 * but later deprecated in Mac OS X 10.12.2
3372 */
3373#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3374 #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)
3375#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3376 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3377#else
3378 #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
3379#endif
3380
3381/*
3382 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3383 *
3384 * Used on declarations introduced in Mac OS X 10.10.3,
3385 * but later deprecated in Mac OS X 10.12.2
3386 */
3387#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3388 #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)
3389#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3390 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3391#else
3392 #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
3393#endif
3394
3395/*
3396 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3397 *
3398 * Used on declarations introduced in Mac OS X 10.11,
3399 * but later deprecated in Mac OS X 10.12.2
3400 */
3401#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3402 #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)
3403#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3404 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3405#else
3406 #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
3407#endif
3408
3409/*
3410 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3411 *
3412 * Used on declarations introduced in Mac OS X 10.11.2,
3413 * but later deprecated in Mac OS X 10.12.2
3414 */
3415#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3416 #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)
3417#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3418 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3419#else
3420 #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
3421#endif
3422
3423/*
3424 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3425 *
3426 * Used on declarations introduced in Mac OS X 10.11.3,
3427 * but later deprecated in Mac OS X 10.12.2
3428 */
3429#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3430 #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)
3431#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3432 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3433#else
3434 #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
3435#endif
3436
3437/*
3438 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3439 *
3440 * Used on declarations introduced in Mac OS X 10.11.4,
3441 * but later deprecated in Mac OS X 10.12.2
3442 */
3443#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3444 #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)
3445#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3446 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3447#else
3448 #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
3449#endif
3450
3451/*
3452 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3453 *
3454 * Used on declarations introduced in Mac OS X 10.12,
3455 * but later deprecated in Mac OS X 10.12.2
3456 */
3457#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3458 #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)
3459#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3460 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3461#else
3462 #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
3463#endif
3464
3465/*
3466 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2
3467 *
3468 * Used on declarations introduced in Mac OS X 10.12.1,
3469 * but later deprecated in Mac OS X 10.12.2
3470 */
3471#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3472 #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)
3473#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_2
3474 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_2 DEPRECATED_ATTRIBUTE
3475#else
3476 #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
3477#endif
3478
3479/*
3480 * AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER
3481 *
3482 * Used on declarations introduced in Mac OS X 10.12.4
3483 */
3484#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3485 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_12_4, __IPHONE_COMPAT_VERSION)
3486#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_4
3487 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER UNAVAILABLE_ATTRIBUTE
3488#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_4
3489 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
3490#else
3491 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER
3492#endif
3493
3494/*
3495 * AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED
3496 *
3497 * Used on declarations introduced in Mac OS X 10.12.4,
3498 * and deprecated in Mac OS X 10.12.4
3499 */
3500#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3501 #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)
3502#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3503 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
3504#else
3505 #define AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_12_4_AND_LATER
3506#endif
3507
3508/*
3509 * AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3510 *
3511 * Used on declarations introduced in Mac OS X 10.0,
3512 * but later deprecated in Mac OS X 10.12.4
3513 */
3514#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3515 #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)
3516#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3517 #define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3518#else
3519 #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
3520#endif
3521
3522/*
3523 * AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3524 *
3525 * Used on declarations introduced in Mac OS X 10.1,
3526 * but later deprecated in Mac OS X 10.12.4
3527 */
3528#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3529 #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)
3530#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3531 #define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3532#else
3533 #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
3534#endif
3535
3536/*
3537 * AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3538 *
3539 * Used on declarations introduced in Mac OS X 10.2,
3540 * but later deprecated in Mac OS X 10.12.4
3541 */
3542#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3543 #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)
3544#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3545 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3546#else
3547 #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
3548#endif
3549
3550/*
3551 * AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3552 *
3553 * Used on declarations introduced in Mac OS X 10.3,
3554 * but later deprecated in Mac OS X 10.12.4
3555 */
3556#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3557 #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)
3558#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3559 #define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3560#else
3561 #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
3562#endif
3563
3564/*
3565 * AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3566 *
3567 * Used on declarations introduced in Mac OS X 10.4,
3568 * but later deprecated in Mac OS X 10.12.4
3569 */
3570#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3571 #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)
3572#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3573 #define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3574#else
3575 #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
3576#endif
3577
3578/*
3579 * AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3580 *
3581 * Used on declarations introduced in Mac OS X 10.5,
3582 * but later deprecated in Mac OS X 10.12.4
3583 */
3584#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3585 #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)
3586#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3587 #define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3588#else
3589 #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
3590#endif
3591
3592/*
3593 * AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3594 *
3595 * Used on declarations introduced in Mac OS X 10.6,
3596 * but later deprecated in Mac OS X 10.12.4
3597 */
3598#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3599 #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)
3600#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3601 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3602#else
3603 #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
3604#endif
3605
3606/*
3607 * AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3608 *
3609 * Used on declarations introduced in Mac OS X 10.7,
3610 * but later deprecated in Mac OS X 10.12.4
3611 */
3612#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3613 #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)
3614#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3615 #define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3616#else
3617 #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
3618#endif
3619
3620/*
3621 * AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3622 *
3623 * Used on declarations introduced in Mac OS X 10.8,
3624 * but later deprecated in Mac OS X 10.12.4
3625 */
3626#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3627 #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)
3628#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3629 #define AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3630#else
3631 #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
3632#endif
3633
3634/*
3635 * AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3636 *
3637 * Used on declarations introduced in Mac OS X 10.9,
3638 * but later deprecated in Mac OS X 10.12.4
3639 */
3640#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3641 #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)
3642#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3643 #define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3644#else
3645 #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
3646#endif
3647
3648/*
3649 * AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3650 *
3651 * Used on declarations introduced in Mac OS X 10.10,
3652 * but later deprecated in Mac OS X 10.12.4
3653 */
3654#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3655 #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)
3656#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3657 #define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3658#else
3659 #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
3660#endif
3661
3662/*
3663 * AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3664 *
3665 * Used on declarations introduced in Mac OS X 10.10.2,
3666 * but later deprecated in Mac OS X 10.12.4
3667 */
3668#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3669 #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)
3670#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3671 #define AVAILABLE_MAC_OS_X_VERSION_10_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3672#else
3673 #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
3674#endif
3675
3676/*
3677 * AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3678 *
3679 * Used on declarations introduced in Mac OS X 10.10.3,
3680 * but later deprecated in Mac OS X 10.12.4
3681 */
3682#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3683 #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)
3684#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3685 #define AVAILABLE_MAC_OS_X_VERSION_10_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3686#else
3687 #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
3688#endif
3689
3690/*
3691 * AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3692 *
3693 * Used on declarations introduced in Mac OS X 10.11,
3694 * but later deprecated in Mac OS X 10.12.4
3695 */
3696#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3697 #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)
3698#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3699 #define AVAILABLE_MAC_OS_X_VERSION_10_11_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3700#else
3701 #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
3702#endif
3703
3704/*
3705 * AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3706 *
3707 * Used on declarations introduced in Mac OS X 10.11.2,
3708 * but later deprecated in Mac OS X 10.12.4
3709 */
3710#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3711 #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)
3712#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3713 #define AVAILABLE_MAC_OS_X_VERSION_10_11_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3714#else
3715 #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
3716#endif
3717
3718/*
3719 * AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3720 *
3721 * Used on declarations introduced in Mac OS X 10.11.3,
3722 * but later deprecated in Mac OS X 10.12.4
3723 */
3724#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3725 #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)
3726#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3727 #define AVAILABLE_MAC_OS_X_VERSION_10_11_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3728#else
3729 #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
3730#endif
3731
3732/*
3733 * AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3734 *
3735 * Used on declarations introduced in Mac OS X 10.11.4,
3736 * but later deprecated in Mac OS X 10.12.4
3737 */
3738#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3739 #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)
3740#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3741 #define AVAILABLE_MAC_OS_X_VERSION_10_11_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3742#else
3743 #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
3744#endif
3745
3746/*
3747 * AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3748 *
3749 * Used on declarations introduced in Mac OS X 10.12,
3750 * but later deprecated in Mac OS X 10.12.4
3751 */
3752#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3753 #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)
3754#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3755 #define AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3756#else
3757 #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
3758#endif
3759
3760/*
3761 * AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3762 *
3763 * Used on declarations introduced in Mac OS X 10.12.1,
3764 * but later deprecated in Mac OS X 10.12.4
3765 */
3766#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3767 #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)
3768#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3769 #define AVAILABLE_MAC_OS_X_VERSION_10_12_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3770#else
3771 #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
3772#endif
3773
3774/*
3775 * AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4
3776 *
3777 * Used on declarations introduced in Mac OS X 10.12.2,
3778 * but later deprecated in Mac OS X 10.12.4
3779 */
3780#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3781 #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)
3782#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12_4
3783 #define AVAILABLE_MAC_OS_X_VERSION_10_12_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_12_4 DEPRECATED_ATTRIBUTE
3784#else
3785 #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
3786#endif
3787
3788/*
3789 * AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
3790 *
3791 * Used on declarations introduced in Mac OS X 10.13
3792 */
3793#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3794 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_13, __IPHONE_COMPAT_VERSION)
3795#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13
3796 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER UNAVAILABLE_ATTRIBUTE
3797#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_13
3798 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER WEAK_IMPORT_ATTRIBUTE
3799#else
3800 #define AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
3801#endif
3802
3803/*
3804 * AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER
3805 *
3806 * Used on declarations introduced in Mac OS X 10.14
3807 */
3808#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3809 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_14, __IPHONE_COMPAT_VERSION)
3810#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_14
3811 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER UNAVAILABLE_ATTRIBUTE
3812#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14
3813 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER WEAK_IMPORT_ATTRIBUTE
3814#else
3815 #define AVAILABLE_MAC_OS_X_VERSION_10_14_AND_LATER
3816#endif
3817
3818/*
3819 * AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER
3820 *
3821 * Used on declarations introduced in Mac OS X 10.15
3822 */
3823#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3824 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER __OSX_AVAILABLE_STARTING(__MAC_10_15, __IPHONE_COMPAT_VERSION)
3825#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_15
3826 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER UNAVAILABLE_ATTRIBUTE
3827#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15
3828 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER WEAK_IMPORT_ATTRIBUTE
3829#else
3830 #define AVAILABLE_MAC_OS_X_VERSION_10_15_AND_LATER
3831#endif
3832
3833/*
3834 * DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER
3835 *
3836 * Used on types deprecated in Mac OS X 10.1
3837 */
3838#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3839 #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)
3840#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
3841 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER DEPRECATED_ATTRIBUTE
3842#else
3843 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER
3844#endif
3845
3846/*
3847 * DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER
3848 *
3849 * Used on types deprecated in Mac OS X 10.2
3850 */
3851#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3852 #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)
3853#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
3854 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER DEPRECATED_ATTRIBUTE
3855#else
3856 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER
3857#endif
3858
3859/*
3860 * DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER
3861 *
3862 * Used on types deprecated in Mac OS X 10.3
3863 */
3864#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3865 #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)
3866#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
3867 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER DEPRECATED_ATTRIBUTE
3868#else
3869 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER
3870#endif
3871
3872/*
3873 * DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER
3874 *
3875 * Used on types deprecated in Mac OS X 10.4
3876 */
3877#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3878 #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)
3879#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
3880 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER DEPRECATED_ATTRIBUTE
3881#else
3882 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER
3883#endif
3884
3885
3886/*
3887 * DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
3888 *
3889 * Used on types deprecated in Mac OS X 10.5
3890 */
3891#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3892 #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)
3893#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
3894 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER DEPRECATED_ATTRIBUTE
3895#else
3896 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
3897#endif
3898
3899/*
3900 * DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER
3901 *
3902 * Used on types deprecated in Mac OS X 10.6
3903 */
3904#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3905 #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)
3906#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
3907 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER DEPRECATED_ATTRIBUTE
3908#else
3909 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER
3910#endif
3911
3912/*
3913 * DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
3914 *
3915 * Used on types deprecated in Mac OS X 10.7
3916 */
3917#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3918 #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)
3919#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
3920 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER DEPRECATED_ATTRIBUTE
3921#else
3922 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
3923#endif
3924
3925/*
3926 * DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER
3927 *
3928 * Used on types deprecated in Mac OS X 10.8
3929 */
3930#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3931 #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)
3932#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
3933 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER DEPRECATED_ATTRIBUTE
3934#else
3935 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_8_AND_LATER
3936#endif
3937
3938/*
3939 * DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER
3940 *
3941 * Used on types deprecated in Mac OS X 10.9
3942 */
3943#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3944 #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)
3945#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
3946 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER DEPRECATED_ATTRIBUTE
3947#else
3948 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_9_AND_LATER
3949#endif
3950
3951/*
3952 * DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER
3953 *
3954 * Used on types deprecated in Mac OS X 10.10
3955 */
3956#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3957 #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)
3958#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
3959 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER DEPRECATED_ATTRIBUTE
3960#else
3961 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_10_AND_LATER
3962#endif
3963
3964/*
3965 * DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER
3966 *
3967 * Used on types deprecated in Mac OS X 10.11
3968 */
3969#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3970 #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)
3971#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11
3972 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER DEPRECATED_ATTRIBUTE
3973#else
3974 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_11_AND_LATER
3975#endif
3976
3977/*
3978 * DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER
3979 *
3980 * Used on types deprecated in Mac OS X 10.12
3981 */
3982#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3983 #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)
3984#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
3985 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER DEPRECATED_ATTRIBUTE
3986#else
3987 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_12_AND_LATER
3988#endif
3989
3990/*
3991 * DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER
3992 *
3993 * Used on types deprecated in Mac OS X 10.13
3994 */
3995#if __AVAILABILITY_MACROS_USES_AVAILABILITY
3996 #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)
3997#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12
3998 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER DEPRECATED_ATTRIBUTE
3999#else
4000 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_13_AND_LATER
4001#endif
4002
4003/*
4004 * DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER
4005 *
4006 * Used on types deprecated in Mac OS X 10.14.4
4007 */
4008#if __AVAILABILITY_MACROS_USES_AVAILABILITY
4009 #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)
4010#elif MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_14_4
4011 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER DEPRECATED_ATTRIBUTE
4012#else
4013 #define DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER
4014#endif
4015
4016#endif /* __AVAILABILITYMACROS__ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/dispatch/base.h created+333
......@@ -0,0 +1,333 @@
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#if defined(__cplusplus)
131# if __cplusplus >= 201703L
132# define DISPATCH_FALLTHROUGH [[fallthrough]]
133# elif __cplusplus >= 201103L
134# if defined(__clang__)
135# define DISPATCH_FALLTHROUGH [[clang::fallthrough]]
136# elif defined(__GNUC__) && __GNUC__ >= 7
137# define DISPATCH_FALLTHROUGH [[gnu::fallthrough]]
138# else
139# define DISPATCH_FALLTHROUGH
140# endif
141# else
142# define DISPATCH_FALLTHROUGH
143# endif
144#elif defined(__GNUC__) && __GNUC__ >= 7
145# define DISPATCH_FALLTHROUGH __attribute__((__fallthrough__))
146#elif defined(__clang__)
147# if __has_attribute(fallthrough) && __clang_major__ >= 5
148# define DISPATCH_FALLTHROUGH __attribute__((__fallthrough__))
149# else
150# define DISPATCH_FALLTHROUGH
151# endif
152#else
153# define DISPATCH_FALLTHROUGH
154#endif
155
156
157#define DISPATCH_LINUX_UNAVAILABLE()
158
159#ifdef __FreeBSD__
160#define DISPATCH_FREEBSD_UNAVAILABLE() \
161 DISPATCH_UNAVAILABLE_MSG( \
162 "This interface is unavailable on FreeBSD systems")
163#else
164#define DISPATCH_FREEBSD_UNAVAILABLE()
165#endif
166
167#ifndef DISPATCH_ALIAS_V2
168#if TARGET_OS_MAC
169#define DISPATCH_ALIAS_V2(sym) __asm__("_" #sym "$V2")
170#else
171#define DISPATCH_ALIAS_V2(sym)
172#endif
173#endif
174
175#if defined(_WIN32)
176#if defined(__cplusplus)
177#define DISPATCH_EXPORT extern "C" __declspec(dllimport)
178#else
179#define DISPATCH_EXPORT extern __declspec(dllimport)
180#endif
181#elif __GNUC__
182#define DISPATCH_EXPORT extern __attribute__((visibility("default")))
183#else
184#define DISPATCH_EXPORT extern
185#endif
186
187#if __GNUC__
188#define DISPATCH_INLINE static __inline__
189#else
190#define DISPATCH_INLINE static inline
191#endif
192
193#if __GNUC__
194#define DISPATCH_EXPECT(x, v) __builtin_expect((x), (v))
195#define dispatch_compiler_barrier() __asm__ __volatile__("" ::: "memory")
196#else
197#define DISPATCH_EXPECT(x, v) (x)
198#define dispatch_compiler_barrier() do { } while (0)
199#endif
200
201#if __has_attribute(not_tail_called)
202#define DISPATCH_NOT_TAIL_CALLED __attribute__((__not_tail_called__))
203#else
204#define DISPATCH_NOT_TAIL_CALLED
205#endif
206
207#if __has_builtin(__builtin_assume)
208#define DISPATCH_COMPILER_CAN_ASSUME(expr) __builtin_assume(expr)
209#else
210#define DISPATCH_COMPILER_CAN_ASSUME(expr) ((void)(expr))
211#endif
212
213#if __has_attribute(noescape)
214#define DISPATCH_NOESCAPE __attribute__((__noescape__))
215#else
216#define DISPATCH_NOESCAPE
217#endif
218
219#if __has_attribute(cold)
220#define DISPATCH_COLD __attribute__((__cold__))
221#else
222#define DISPATCH_COLD
223#endif
224
225#if __has_feature(assume_nonnull)
226#define DISPATCH_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
227#define DISPATCH_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
228#else
229#define DISPATCH_ASSUME_NONNULL_BEGIN
230#define DISPATCH_ASSUME_NONNULL_END
231#endif
232
233#if !__has_feature(nullability)
234#ifndef _Nullable
235#define _Nullable
236#endif
237#ifndef _Nonnull
238#define _Nonnull
239#endif
240#ifndef _Null_unspecified
241#define _Null_unspecified
242#endif
243#endif
244
245#ifndef DISPATCH_RETURNS_RETAINED_BLOCK
246#if __has_attribute(ns_returns_retained)
247#define DISPATCH_RETURNS_RETAINED_BLOCK __attribute__((__ns_returns_retained__))
248#else
249#define DISPATCH_RETURNS_RETAINED_BLOCK
250#endif
251#endif
252
253#if __has_attribute(enum_extensibility)
254#define __DISPATCH_ENUM_ATTR __attribute__((__enum_extensibility__(open)))
255#define __DISPATCH_ENUM_ATTR_CLOSED __attribute__((__enum_extensibility__(closed)))
256#else
257#define __DISPATCH_ENUM_ATTR
258#define __DISPATCH_ENUM_ATTR_CLOSED
259#endif // __has_attribute(enum_extensibility)
260
261#if __has_attribute(flag_enum)
262#define __DISPATCH_OPTIONS_ATTR __attribute__((__flag_enum__))
263#else
264#define __DISPATCH_OPTIONS_ATTR
265#endif // __has_attribute(flag_enum)
266
267
268#if __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums) || \
269 __has_extension(cxx_fixed_enum) || defined(_WIN32)
270#define DISPATCH_ENUM(name, type, ...) \
271 typedef enum : type { __VA_ARGS__ } __DISPATCH_ENUM_ATTR name##_t
272#define DISPATCH_OPTIONS(name, type, ...) \
273 typedef enum : type { __VA_ARGS__ } __DISPATCH_OPTIONS_ATTR __DISPATCH_ENUM_ATTR name##_t
274#else
275#define DISPATCH_ENUM(name, type, ...) \
276 enum { __VA_ARGS__ } __DISPATCH_ENUM_ATTR; typedef type name##_t
277#define DISPATCH_OPTIONS(name, type, ...) \
278 enum { __VA_ARGS__ } __DISPATCH_OPTIONS_ATTR __DISPATCH_ENUM_ATTR; typedef type name##_t
279#endif // __has_feature(objc_fixed_enum) ...
280
281
282
283#if __has_feature(enumerator_attributes)
284#define DISPATCH_ENUM_API_AVAILABLE(...) API_AVAILABLE(__VA_ARGS__)
285#define DISPATCH_ENUM_API_DEPRECATED(...) API_DEPRECATED(__VA_ARGS__)
286#define DISPATCH_ENUM_API_DEPRECATED_WITH_REPLACEMENT(...) \
287 API_DEPRECATED_WITH_REPLACEMENT(__VA_ARGS__)
288#else
289#define DISPATCH_ENUM_API_AVAILABLE(...)
290#define DISPATCH_ENUM_API_DEPRECATED(...)
291#define DISPATCH_ENUM_API_DEPRECATED_WITH_REPLACEMENT(...)
292#endif
293
294#ifdef __swift__
295#define DISPATCH_SWIFT3_OVERLAY 1
296#else // __swift__
297#define DISPATCH_SWIFT3_OVERLAY 0
298#endif // __swift__
299
300#if __has_feature(attribute_availability_swift)
301#define DISPATCH_SWIFT_UNAVAILABLE(_msg) \
302 __attribute__((__availability__(swift, unavailable, message=_msg)))
303#else
304#define DISPATCH_SWIFT_UNAVAILABLE(_msg)
305#endif
306
307#if DISPATCH_SWIFT3_OVERLAY
308#define DISPATCH_SWIFT3_UNAVAILABLE(_msg) DISPATCH_SWIFT_UNAVAILABLE(_msg)
309#else
310#define DISPATCH_SWIFT3_UNAVAILABLE(_msg)
311#endif
312
313#if __has_attribute(swift_private)
314#define DISPATCH_REFINED_FOR_SWIFT __attribute__((__swift_private__))
315#else
316#define DISPATCH_REFINED_FOR_SWIFT
317#endif
318
319#if __has_attribute(swift_name)
320#define DISPATCH_SWIFT_NAME(_name) __attribute__((__swift_name__(#_name)))
321#else
322#define DISPATCH_SWIFT_NAME(_name)
323#endif
324
325#ifndef __cplusplus
326#define DISPATCH_TRANSPARENT_UNION __attribute__((__transparent_union__))
327#else
328#define DISPATCH_TRANSPARENT_UNION
329#endif
330
331typedef void (*dispatch_function_t)(void *_Nullable);
332
333#endif
\ No newline at end of file
lib/libc/include/any-macos.12-any/libproc.h created+172
......@@ -0,0 +1,172 @@
1/*
2 * Copyright (c) 2006, 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#ifndef _LIBPROC_H_
24#define _LIBPROC_H_
25
26#include <sys/cdefs.h>
27#include <sys/param.h>
28#include <sys/types.h>
29#include <sys/stat.h>
30#include <sys/mount.h>
31#include <sys/resource.h>
32#include <stdint.h>
33#include <stdbool.h>
34#include <mach/message.h> /* for audit_token_t */
35
36#include <sys/proc_info.h>
37
38#include <Availability.h>
39#include <os/availability.h>
40
41/*
42 * This header file contains private interfaces to obtain process information.
43 * These interfaces are subject to change in future releases.
44 */
45
46/*!
47 * @define PROC_LISTPIDSPATH_PATH_IS_VOLUME
48 * @discussion This flag indicates that all processes that hold open
49 * file references on the volume associated with the specified
50 * path should be returned.
51 */
52#define PROC_LISTPIDSPATH_PATH_IS_VOLUME 1
53
54
55/*!
56 * @define PROC_LISTPIDSPATH_EXCLUDE_EVTONLY
57 * @discussion This flag indicates that file references that were opened
58 * with the O_EVTONLY flag should be excluded from the matching
59 * criteria.
60 */
61#define PROC_LISTPIDSPATH_EXCLUDE_EVTONLY 2
62
63__BEGIN_DECLS
64
65
66/*!
67 * @function proc_listpidspath
68 * @discussion A function which will search through the current
69 * processes looking for open file references which match
70 * a specified path or volume.
71 * @param type types of processes to be searched (see proc_listpids)
72 * @param typeinfo adjunct information for type
73 * @param path file or volume path
74 * @param pathflags flags to control which files should be considered
75 * during the process search.
76 * @param buffer a C array of int-sized values to be filled with
77 * process identifiers that hold an open file reference
78 * matching the specified path or volume. Pass NULL to
79 * obtain the minimum buffer size needed to hold the
80 * currently active processes.
81 * @param buffersize the size (in bytes) of the provided buffer.
82 * @result the number of bytes of data returned in the provided buffer;
83 * -1 if an error was encountered;
84 */
85int proc_listpidspath(uint32_t type,
86 uint32_t typeinfo,
87 const char *path,
88 uint32_t pathflags,
89 void *buffer,
90 int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
91
92int proc_listpids(uint32_t type, uint32_t typeinfo, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
93int proc_listallpids(void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
94int proc_listpgrppids(pid_t pgrpid, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
95int proc_listchildpids(pid_t ppid, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
96int proc_pidinfo(int pid, int flavor, uint64_t arg, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
97int proc_pidfdinfo(int pid, int fd, int flavor, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
98int proc_pidfileportinfo(int pid, uint32_t fileport, int flavor, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
99int proc_name(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
100int proc_regionfilename(int pid, uint64_t address, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
101int proc_kmsgbuf(void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
102int proc_pidpath(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
103int proc_pidpath_audittoken(audit_token_t *audittoken, void * buffer, uint32_t buffersize) API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));
104int proc_libversion(int *major, int * minor) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
105
106/*
107 * Return resource usage information for the given pid, which can be a live process or a zombie.
108 *
109 * Returns 0 on success; or -1 on failure, with errno set to indicate the specific error.
110 */
111int proc_pid_rusage(int pid, int flavor, rusage_info_t *buffer) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
112
113/*
114 * A process can use the following api to set its own process control
115 * state on resoure starvation. The argument can have one of the PROC_SETPC_XX values
116 */
117#define PROC_SETPC_NONE 0
118#define PROC_SETPC_THROTTLEMEM 1
119#define PROC_SETPC_SUSPEND 2
120#define PROC_SETPC_TERMINATE 3
121
122int proc_setpcontrol(const int control) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
123int proc_setpcontrol(const int control);
124
125int proc_track_dirty(pid_t pid, uint32_t flags);
126int proc_set_dirty(pid_t pid, bool dirty);
127int proc_get_dirty(pid_t pid, uint32_t *flags);
128int proc_clear_dirty(pid_t pid, uint32_t flags);
129
130int proc_terminate(pid_t pid, int *sig);
131
132/*
133 * NO_SMT means that on an SMT CPU, this thread must be scheduled alone,
134 * with the paired CPU idle.
135 *
136 * Set NO_SMT on the current proc (all existing and future threads)
137 * This attribute is inherited on fork and exec
138 */
139int proc_set_no_smt(void) __API_AVAILABLE(macos(11.0));
140
141/* Set NO_SMT on the current thread */
142int proc_setthread_no_smt(void) __API_AVAILABLE(macos(11.0));
143
144/*
145 * CPU Security Mitigation APIs
146 *
147 * Set CPU security mitigation on the current proc (all existing and future threads)
148 * This attribute is inherited on fork and exec
149 */
150int proc_set_csm(uint32_t flags) __API_AVAILABLE(macos(11.0));
151
152/* Set CPU security mitigation on the current thread */
153int proc_setthread_csm(uint32_t flags) __API_AVAILABLE(macos(11.0));
154
155/*
156 * flags for CPU Security Mitigation APIs
157 * PROC_CSM_ALL should be used in most cases,
158 * the individual flags are provided only for performance evaluation etc
159 */
160#define PROC_CSM_ALL 0x0001 /* Set all available mitigations */
161#define PROC_CSM_NOSMT 0x0002 /* Set NO_SMT - see above */
162#define PROC_CSM_TECS 0x0004 /* Execute VERW on every return to user mode */
163
164int proc_udata_info(int pid, int flavor, void *buffer, int buffersize);
165
166#if __has_include(<libproc_private.h>)
167#include <libproc_private.h>
168#endif
169
170__END_DECLS
171
172#endif /*_LIBPROC_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/clock.h created+246
......@@ -0,0 +1,246 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.h>
59#include <mach/mach_types.h>
60#include <mach/mach_types.h>
61
62#ifdef __BeforeMigUserHeader
63__BeforeMigUserHeader
64#endif /* __BeforeMigUserHeader */
65
66#include <sys/cdefs.h>
67__BEGIN_DECLS
68
69
70/* Routine clock_get_time */
71#ifdef mig_external
72mig_external
73#else
74extern
75#endif /* mig_external */
76kern_return_t clock_get_time
77(
78 clock_serv_t clock_serv,
79 mach_timespec_t *cur_time
80);
81
82/* Routine clock_get_attributes */
83#ifdef mig_external
84mig_external
85#else
86extern
87#endif /* mig_external */
88kern_return_t clock_get_attributes
89(
90 clock_serv_t clock_serv,
91 clock_flavor_t flavor,
92 clock_attr_t clock_attr,
93 mach_msg_type_number_t *clock_attrCnt
94);
95
96/* Routine clock_alarm */
97#ifdef mig_external
98mig_external
99#else
100extern
101#endif /* mig_external */
102kern_return_t clock_alarm
103(
104 clock_serv_t clock_serv,
105 alarm_type_t alarm_type,
106 mach_timespec_t alarm_time,
107 clock_reply_t alarm_port
108);
109
110__END_DECLS
111
112/********************** Caution **************************/
113/* The following data types should be used to calculate */
114/* maximum message sizes only. The actual message may be */
115/* smaller, and the position of the arguments within the */
116/* message layout may vary from what is presented here. */
117/* For example, if any of the arguments are variable- */
118/* sized, and less than the maximum is sent, the data */
119/* will be packed tight in the actual message to reduce */
120/* the presence of holes. */
121/********************** Caution **************************/
122
123/* typedefs for all requests */
124
125#ifndef __Request__clock_subsystem__defined
126#define __Request__clock_subsystem__defined
127
128#ifdef __MigPackStructs
129#pragma pack(push, 4)
130#endif
131 typedef struct {
132 mach_msg_header_t Head;
133 } __Request__clock_get_time_t __attribute__((unused));
134#ifdef __MigPackStructs
135#pragma pack(pop)
136#endif
137
138#ifdef __MigPackStructs
139#pragma pack(push, 4)
140#endif
141 typedef struct {
142 mach_msg_header_t Head;
143 NDR_record_t NDR;
144 clock_flavor_t flavor;
145 mach_msg_type_number_t clock_attrCnt;
146 } __Request__clock_get_attributes_t __attribute__((unused));
147#ifdef __MigPackStructs
148#pragma pack(pop)
149#endif
150
151#ifdef __MigPackStructs
152#pragma pack(push, 4)
153#endif
154 typedef struct {
155 mach_msg_header_t Head;
156 /* start of the kernel processed data */
157 mach_msg_body_t msgh_body;
158 mach_msg_port_descriptor_t alarm_port;
159 /* end of the kernel processed data */
160 NDR_record_t NDR;
161 alarm_type_t alarm_type;
162 mach_timespec_t alarm_time;
163 } __Request__clock_alarm_t __attribute__((unused));
164#ifdef __MigPackStructs
165#pragma pack(pop)
166#endif
167#endif /* !__Request__clock_subsystem__defined */
168
169/* union of all requests */
170
171#ifndef __RequestUnion__clock_subsystem__defined
172#define __RequestUnion__clock_subsystem__defined
173union __RequestUnion__clock_subsystem {
174 __Request__clock_get_time_t Request_clock_get_time;
175 __Request__clock_get_attributes_t Request_clock_get_attributes;
176 __Request__clock_alarm_t Request_clock_alarm;
177};
178#endif /* !__RequestUnion__clock_subsystem__defined */
179/* typedefs for all replies */
180
181#ifndef __Reply__clock_subsystem__defined
182#define __Reply__clock_subsystem__defined
183
184#ifdef __MigPackStructs
185#pragma pack(push, 4)
186#endif
187 typedef struct {
188 mach_msg_header_t Head;
189 NDR_record_t NDR;
190 kern_return_t RetCode;
191 mach_timespec_t cur_time;
192 } __Reply__clock_get_time_t __attribute__((unused));
193#ifdef __MigPackStructs
194#pragma pack(pop)
195#endif
196
197#ifdef __MigPackStructs
198#pragma pack(push, 4)
199#endif
200 typedef struct {
201 mach_msg_header_t Head;
202 NDR_record_t NDR;
203 kern_return_t RetCode;
204 mach_msg_type_number_t clock_attrCnt;
205 int clock_attr[1];
206 } __Reply__clock_get_attributes_t __attribute__((unused));
207#ifdef __MigPackStructs
208#pragma pack(pop)
209#endif
210
211#ifdef __MigPackStructs
212#pragma pack(push, 4)
213#endif
214 typedef struct {
215 mach_msg_header_t Head;
216 NDR_record_t NDR;
217 kern_return_t RetCode;
218 } __Reply__clock_alarm_t __attribute__((unused));
219#ifdef __MigPackStructs
220#pragma pack(pop)
221#endif
222#endif /* !__Reply__clock_subsystem__defined */
223
224/* union of all replies */
225
226#ifndef __ReplyUnion__clock_subsystem__defined
227#define __ReplyUnion__clock_subsystem__defined
228union __ReplyUnion__clock_subsystem {
229 __Reply__clock_get_time_t Reply_clock_get_time;
230 __Reply__clock_get_attributes_t Reply_clock_get_attributes;
231 __Reply__clock_alarm_t Reply_clock_alarm;
232};
233#endif /* !__RequestUnion__clock_subsystem__defined */
234
235#ifndef subsystem_to_name_map_clock
236#define subsystem_to_name_map_clock \
237 { "clock_get_time", 1000 },\
238 { "clock_get_attributes", 1001 },\
239 { "clock_alarm", 1002 }
240#endif
241
242#ifdef __AfterMigUserHeader
243__AfterMigUserHeader
244#endif /* __AfterMigUserHeader */
245
246#endif /* _clock_user_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/clock_priv.h created+200
......@@ -0,0 +1,200 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.h>
59#include <mach/mach_types.h>
60#include <mach/mach_types.h>
61
62#ifdef __BeforeMigUserHeader
63__BeforeMigUserHeader
64#endif /* __BeforeMigUserHeader */
65
66#include <sys/cdefs.h>
67__BEGIN_DECLS
68
69
70/* Routine clock_set_time */
71#ifdef mig_external
72mig_external
73#else
74extern
75#endif /* mig_external */
76kern_return_t clock_set_time
77(
78 clock_ctrl_t clock_ctrl,
79 mach_timespec_t new_time
80);
81
82/* Routine clock_set_attributes */
83#ifdef mig_external
84mig_external
85#else
86extern
87#endif /* mig_external */
88kern_return_t clock_set_attributes
89(
90 clock_ctrl_t clock_ctrl,
91 clock_flavor_t flavor,
92 clock_attr_t clock_attr,
93 mach_msg_type_number_t clock_attrCnt
94);
95
96__END_DECLS
97
98/********************** Caution **************************/
99/* The following data types should be used to calculate */
100/* maximum message sizes only. The actual message may be */
101/* smaller, and the position of the arguments within the */
102/* message layout may vary from what is presented here. */
103/* For example, if any of the arguments are variable- */
104/* sized, and less than the maximum is sent, the data */
105/* will be packed tight in the actual message to reduce */
106/* the presence of holes. */
107/********************** Caution **************************/
108
109/* typedefs for all requests */
110
111#ifndef __Request__clock_priv_subsystem__defined
112#define __Request__clock_priv_subsystem__defined
113
114#ifdef __MigPackStructs
115#pragma pack(push, 4)
116#endif
117 typedef struct {
118 mach_msg_header_t Head;
119 NDR_record_t NDR;
120 mach_timespec_t new_time;
121 } __Request__clock_set_time_t __attribute__((unused));
122#ifdef __MigPackStructs
123#pragma pack(pop)
124#endif
125
126#ifdef __MigPackStructs
127#pragma pack(push, 4)
128#endif
129 typedef struct {
130 mach_msg_header_t Head;
131 NDR_record_t NDR;
132 clock_flavor_t flavor;
133 mach_msg_type_number_t clock_attrCnt;
134 int clock_attr[1];
135 } __Request__clock_set_attributes_t __attribute__((unused));
136#ifdef __MigPackStructs
137#pragma pack(pop)
138#endif
139#endif /* !__Request__clock_priv_subsystem__defined */
140
141/* union of all requests */
142
143#ifndef __RequestUnion__clock_priv_subsystem__defined
144#define __RequestUnion__clock_priv_subsystem__defined
145union __RequestUnion__clock_priv_subsystem {
146 __Request__clock_set_time_t Request_clock_set_time;
147 __Request__clock_set_attributes_t Request_clock_set_attributes;
148};
149#endif /* !__RequestUnion__clock_priv_subsystem__defined */
150/* typedefs for all replies */
151
152#ifndef __Reply__clock_priv_subsystem__defined
153#define __Reply__clock_priv_subsystem__defined
154
155#ifdef __MigPackStructs
156#pragma pack(push, 4)
157#endif
158 typedef struct {
159 mach_msg_header_t Head;
160 NDR_record_t NDR;
161 kern_return_t RetCode;
162 } __Reply__clock_set_time_t __attribute__((unused));
163#ifdef __MigPackStructs
164#pragma pack(pop)
165#endif
166
167#ifdef __MigPackStructs
168#pragma pack(push, 4)
169#endif
170 typedef struct {
171 mach_msg_header_t Head;
172 NDR_record_t NDR;
173 kern_return_t RetCode;
174 } __Reply__clock_set_attributes_t __attribute__((unused));
175#ifdef __MigPackStructs
176#pragma pack(pop)
177#endif
178#endif /* !__Reply__clock_priv_subsystem__defined */
179
180/* union of all replies */
181
182#ifndef __ReplyUnion__clock_priv_subsystem__defined
183#define __ReplyUnion__clock_priv_subsystem__defined
184union __ReplyUnion__clock_priv_subsystem {
185 __Reply__clock_set_time_t Reply_clock_set_time;
186 __Reply__clock_set_attributes_t Reply_clock_set_attributes;
187};
188#endif /* !__RequestUnion__clock_priv_subsystem__defined */
189
190#ifndef subsystem_to_name_map_clock_priv
191#define subsystem_to_name_map_clock_priv \
192 { "clock_set_time", 1200 },\
193 { "clock_set_attributes", 1201 }
194#endif
195
196#ifdef __AfterMigUserHeader
197__AfterMigUserHeader
198#endif /* __AfterMigUserHeader */
199
200#endif /* _clock_priv_user_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/exception_types.h created+211
......@@ -0,0 +1,211 @@
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 EXCEPTION_IDENTITY_PROTECTED 4
127/* Send a catch_exception_raise message including protected task
128 * and thread identity.
129 */
130
131#define MACH_EXCEPTION_ERRORS 0x40000000
132/* include additional exception specific errors, not used yet. */
133
134#define MACH_EXCEPTION_CODES 0x80000000
135/* Send 64-bit code and subcode in the exception header */
136
137#define MACH_EXCEPTION_MASK (MACH_EXCEPTION_CODES | MACH_EXCEPTION_ERRORS)
138/*
139 * Masks for exception definitions, above
140 * bit zero is unused, therefore 1 word = 31 exception types
141 */
142
143#define EXC_MASK_BAD_ACCESS (1 << EXC_BAD_ACCESS)
144#define EXC_MASK_BAD_INSTRUCTION (1 << EXC_BAD_INSTRUCTION)
145#define EXC_MASK_ARITHMETIC (1 << EXC_ARITHMETIC)
146#define EXC_MASK_EMULATION (1 << EXC_EMULATION)
147#define EXC_MASK_SOFTWARE (1 << EXC_SOFTWARE)
148#define EXC_MASK_BREAKPOINT (1 << EXC_BREAKPOINT)
149#define EXC_MASK_SYSCALL (1 << EXC_SYSCALL)
150#define EXC_MASK_MACH_SYSCALL (1 << EXC_MACH_SYSCALL)
151#define EXC_MASK_RPC_ALERT (1 << EXC_RPC_ALERT)
152#define EXC_MASK_CRASH (1 << EXC_CRASH)
153#define EXC_MASK_RESOURCE (1 << EXC_RESOURCE)
154#define EXC_MASK_GUARD (1 << EXC_GUARD)
155#define EXC_MASK_CORPSE_NOTIFY (1 << EXC_CORPSE_NOTIFY)
156
157#define EXC_MASK_ALL (EXC_MASK_BAD_ACCESS | \
158 EXC_MASK_BAD_INSTRUCTION | \
159 EXC_MASK_ARITHMETIC | \
160 EXC_MASK_EMULATION | \
161 EXC_MASK_SOFTWARE | \
162 EXC_MASK_BREAKPOINT | \
163 EXC_MASK_SYSCALL | \
164 EXC_MASK_MACH_SYSCALL | \
165 EXC_MASK_RPC_ALERT | \
166 EXC_MASK_RESOURCE | \
167 EXC_MASK_GUARD | \
168 EXC_MASK_MACHINE)
169
170
171#define FIRST_EXCEPTION 1 /* ZERO is illegal */
172
173/*
174 * Machine independent codes for EXC_SOFTWARE
175 * Codes 0x10000 - 0x1FFFF reserved for OS emulation (Unix)
176 * 0x10000 - 0x10002 in use for unix signals
177 * 0x20000 - 0x2FFFF reserved for MACF
178 */
179#define EXC_SOFT_SIGNAL 0x10003 /* Unix signal exceptions */
180
181#define EXC_MACF_MIN 0x20000 /* MACF exceptions */
182#define EXC_MACF_MAX 0x2FFFF
183
184#ifndef ASSEMBLER
185
186#include <mach/port.h>
187#include <mach/thread_status.h>
188#include <mach/machine/vm_types.h>
189#include <mach_debug/ipc_info.h>
190/*
191 * Exported types
192 */
193
194typedef int exception_type_t;
195typedef integer_t exception_data_type_t;
196typedef int64_t mach_exception_data_type_t;
197typedef int exception_behavior_t;
198typedef exception_data_type_t *exception_data_t;
199typedef mach_exception_data_type_t *mach_exception_data_t;
200typedef unsigned int exception_mask_t;
201typedef exception_mask_t *exception_mask_array_t;
202typedef exception_behavior_t *exception_behavior_array_t;
203typedef thread_state_flavor_t *exception_flavor_array_t;
204typedef mach_port_t *exception_port_array_t;
205typedef ipc_info_port_t *exception_port_info_array_t;
206typedef mach_exception_data_type_t mach_exception_code_t;
207typedef mach_exception_data_type_t mach_exception_subcode_t;
208
209#endif /* ASSEMBLER */
210
211#endif /* _MACH_EXCEPTION_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/host_priv.h created+1164
......@@ -0,0 +1,1164 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.h>
59#include <mach/mach_types.h>
60#include <mach/mach_types.h>
61#include <mach_debug/mach_debug_types.h>
62
63#ifdef __BeforeMigUserHeader
64__BeforeMigUserHeader
65#endif /* __BeforeMigUserHeader */
66
67#include <sys/cdefs.h>
68__BEGIN_DECLS
69
70
71/* Routine host_get_boot_info */
72#ifdef mig_external
73mig_external
74#else
75extern
76#endif /* mig_external */
77kern_return_t host_get_boot_info
78(
79 host_priv_t host_priv,
80 kernel_boot_info_t boot_info
81);
82
83/* Routine host_reboot */
84#ifdef mig_external
85mig_external
86#else
87extern
88#endif /* mig_external */
89kern_return_t host_reboot
90(
91 host_priv_t host_priv,
92 int options
93);
94
95/* Routine host_priv_statistics */
96#ifdef mig_external
97mig_external
98#else
99extern
100#endif /* mig_external */
101kern_return_t host_priv_statistics
102(
103 host_priv_t host_priv,
104 host_flavor_t flavor,
105 host_info_t host_info_out,
106 mach_msg_type_number_t *host_info_outCnt
107);
108
109/* Routine host_default_memory_manager */
110#ifdef mig_external
111mig_external
112#else
113extern
114#endif /* mig_external */
115kern_return_t host_default_memory_manager
116(
117 host_priv_t host_priv,
118 memory_object_default_t *default_manager,
119 memory_object_cluster_size_t cluster_size
120);
121
122/* Routine vm_wire */
123#ifdef mig_external
124mig_external
125#else
126extern
127#endif /* mig_external */
128kern_return_t vm_wire
129(
130 host_priv_t host_priv,
131 vm_map_t task,
132 vm_address_t address,
133 vm_size_t size,
134 vm_prot_t desired_access
135);
136
137/* Routine thread_wire */
138#ifdef mig_external
139mig_external
140#else
141extern
142#endif /* mig_external */
143kern_return_t thread_wire
144(
145 host_priv_t host_priv,
146 thread_act_t thread,
147 boolean_t wired
148);
149
150/* Routine vm_allocate_cpm */
151#ifdef mig_external
152mig_external
153#else
154extern
155#endif /* mig_external */
156kern_return_t vm_allocate_cpm
157(
158 host_priv_t host_priv,
159 vm_map_t task,
160 vm_address_t *address,
161 vm_size_t size,
162 int flags
163);
164
165/* Routine host_processors */
166#ifdef mig_external
167mig_external
168#else
169extern
170#endif /* mig_external */
171kern_return_t host_processors
172(
173 host_priv_t host_priv,
174 processor_array_t *out_processor_list,
175 mach_msg_type_number_t *out_processor_listCnt
176);
177
178/* Routine host_get_clock_control */
179#ifdef mig_external
180mig_external
181#else
182extern
183#endif /* mig_external */
184kern_return_t host_get_clock_control
185(
186 host_priv_t host_priv,
187 clock_id_t clock_id,
188 clock_ctrl_t *clock_ctrl
189);
190
191/* Routine kmod_create */
192#ifdef mig_external
193mig_external
194#else
195extern
196#endif /* mig_external */
197kern_return_t kmod_create
198(
199 host_priv_t host_priv,
200 vm_address_t info,
201 kmod_t *module
202);
203
204/* Routine kmod_destroy */
205#ifdef mig_external
206mig_external
207#else
208extern
209#endif /* mig_external */
210kern_return_t kmod_destroy
211(
212 host_priv_t host_priv,
213 kmod_t module
214);
215
216/* Routine kmod_control */
217#ifdef mig_external
218mig_external
219#else
220extern
221#endif /* mig_external */
222kern_return_t kmod_control
223(
224 host_priv_t host_priv,
225 kmod_t module,
226 kmod_control_flavor_t flavor,
227 kmod_args_t *data,
228 mach_msg_type_number_t *dataCnt
229);
230
231/* Routine host_get_special_port */
232#ifdef mig_external
233mig_external
234#else
235extern
236#endif /* mig_external */
237kern_return_t host_get_special_port
238(
239 host_priv_t host_priv,
240 int node,
241 int which,
242 mach_port_t *port
243);
244
245/* Routine host_set_special_port */
246#ifdef mig_external
247mig_external
248#else
249extern
250#endif /* mig_external */
251kern_return_t host_set_special_port
252(
253 host_priv_t host_priv,
254 int which,
255 mach_port_t port
256);
257
258/* Routine host_set_exception_ports */
259#ifdef mig_external
260mig_external
261#else
262extern
263#endif /* mig_external */
264kern_return_t host_set_exception_ports
265(
266 host_priv_t host_priv,
267 exception_mask_t exception_mask,
268 mach_port_t new_port,
269 exception_behavior_t behavior,
270 thread_state_flavor_t new_flavor
271);
272
273/* Routine host_get_exception_ports */
274#ifdef mig_external
275mig_external
276#else
277extern
278#endif /* mig_external */
279kern_return_t host_get_exception_ports
280(
281 host_priv_t host_priv,
282 exception_mask_t exception_mask,
283 exception_mask_array_t masks,
284 mach_msg_type_number_t *masksCnt,
285 exception_handler_array_t old_handlers,
286 exception_behavior_array_t old_behaviors,
287 exception_flavor_array_t old_flavors
288);
289
290/* Routine host_swap_exception_ports */
291#ifdef mig_external
292mig_external
293#else
294extern
295#endif /* mig_external */
296kern_return_t host_swap_exception_ports
297(
298 host_priv_t host_priv,
299 exception_mask_t exception_mask,
300 mach_port_t new_port,
301 exception_behavior_t behavior,
302 thread_state_flavor_t new_flavor,
303 exception_mask_array_t masks,
304 mach_msg_type_number_t *masksCnt,
305 exception_handler_array_t old_handlerss,
306 exception_behavior_array_t old_behaviors,
307 exception_flavor_array_t old_flavors
308);
309
310/* Routine mach_vm_wire */
311#ifdef mig_external
312mig_external
313#else
314extern
315#endif /* mig_external */
316kern_return_t mach_vm_wire
317(
318 host_priv_t host_priv,
319 vm_map_t task,
320 mach_vm_address_t address,
321 mach_vm_size_t size,
322 vm_prot_t desired_access
323);
324
325/* Routine host_processor_sets */
326#ifdef mig_external
327mig_external
328#else
329extern
330#endif /* mig_external */
331kern_return_t host_processor_sets
332(
333 host_priv_t host_priv,
334 processor_set_name_array_t *processor_sets,
335 mach_msg_type_number_t *processor_setsCnt
336);
337
338/* Routine host_processor_set_priv */
339#ifdef mig_external
340mig_external
341#else
342extern
343#endif /* mig_external */
344kern_return_t host_processor_set_priv
345(
346 host_priv_t host_priv,
347 processor_set_name_t set_name,
348 processor_set_t *set
349);
350
351/* Routine host_set_UNDServer */
352#ifdef mig_external
353mig_external
354#else
355extern
356#endif /* mig_external */
357kern_return_t host_set_UNDServer
358(
359 host_priv_t host,
360 UNDServerRef server
361);
362
363/* Routine host_get_UNDServer */
364#ifdef mig_external
365mig_external
366#else
367extern
368#endif /* mig_external */
369kern_return_t host_get_UNDServer
370(
371 host_priv_t host,
372 UNDServerRef *server
373);
374
375/* Routine kext_request */
376#ifdef mig_external
377mig_external
378#else
379extern
380#endif /* mig_external */
381kern_return_t kext_request
382(
383 host_priv_t host_priv,
384 uint32_t user_log_flags,
385 vm_offset_t request_data,
386 mach_msg_type_number_t request_dataCnt,
387 vm_offset_t *response_data,
388 mach_msg_type_number_t *response_dataCnt,
389 vm_offset_t *log_data,
390 mach_msg_type_number_t *log_dataCnt,
391 kern_return_t *op_result
392);
393
394__END_DECLS
395
396/********************** Caution **************************/
397/* The following data types should be used to calculate */
398/* maximum message sizes only. The actual message may be */
399/* smaller, and the position of the arguments within the */
400/* message layout may vary from what is presented here. */
401/* For example, if any of the arguments are variable- */
402/* sized, and less than the maximum is sent, the data */
403/* will be packed tight in the actual message to reduce */
404/* the presence of holes. */
405/********************** Caution **************************/
406
407/* typedefs for all requests */
408
409#ifndef __Request__host_priv_subsystem__defined
410#define __Request__host_priv_subsystem__defined
411
412#ifdef __MigPackStructs
413#pragma pack(push, 4)
414#endif
415 typedef struct {
416 mach_msg_header_t Head;
417 } __Request__host_get_boot_info_t __attribute__((unused));
418#ifdef __MigPackStructs
419#pragma pack(pop)
420#endif
421
422#ifdef __MigPackStructs
423#pragma pack(push, 4)
424#endif
425 typedef struct {
426 mach_msg_header_t Head;
427 NDR_record_t NDR;
428 int options;
429 } __Request__host_reboot_t __attribute__((unused));
430#ifdef __MigPackStructs
431#pragma pack(pop)
432#endif
433
434#ifdef __MigPackStructs
435#pragma pack(push, 4)
436#endif
437 typedef struct {
438 mach_msg_header_t Head;
439 NDR_record_t NDR;
440 host_flavor_t flavor;
441 mach_msg_type_number_t host_info_outCnt;
442 } __Request__host_priv_statistics_t __attribute__((unused));
443#ifdef __MigPackStructs
444#pragma pack(pop)
445#endif
446
447#ifdef __MigPackStructs
448#pragma pack(push, 4)
449#endif
450 typedef struct {
451 mach_msg_header_t Head;
452 /* start of the kernel processed data */
453 mach_msg_body_t msgh_body;
454 mach_msg_port_descriptor_t default_manager;
455 /* end of the kernel processed data */
456 NDR_record_t NDR;
457 memory_object_cluster_size_t cluster_size;
458 } __Request__host_default_memory_manager_t __attribute__((unused));
459#ifdef __MigPackStructs
460#pragma pack(pop)
461#endif
462
463#ifdef __MigPackStructs
464#pragma pack(push, 4)
465#endif
466 typedef struct {
467 mach_msg_header_t Head;
468 /* start of the kernel processed data */
469 mach_msg_body_t msgh_body;
470 mach_msg_port_descriptor_t task;
471 /* end of the kernel processed data */
472 NDR_record_t NDR;
473 vm_address_t address;
474 vm_size_t size;
475 vm_prot_t desired_access;
476 } __Request__vm_wire_t __attribute__((unused));
477#ifdef __MigPackStructs
478#pragma pack(pop)
479#endif
480
481#ifdef __MigPackStructs
482#pragma pack(push, 4)
483#endif
484 typedef struct {
485 mach_msg_header_t Head;
486 /* start of the kernel processed data */
487 mach_msg_body_t msgh_body;
488 mach_msg_port_descriptor_t thread;
489 /* end of the kernel processed data */
490 NDR_record_t NDR;
491 boolean_t wired;
492 } __Request__thread_wire_t __attribute__((unused));
493#ifdef __MigPackStructs
494#pragma pack(pop)
495#endif
496
497#ifdef __MigPackStructs
498#pragma pack(push, 4)
499#endif
500 typedef struct {
501 mach_msg_header_t Head;
502 /* start of the kernel processed data */
503 mach_msg_body_t msgh_body;
504 mach_msg_port_descriptor_t task;
505 /* end of the kernel processed data */
506 NDR_record_t NDR;
507 vm_address_t address;
508 vm_size_t size;
509 int flags;
510 } __Request__vm_allocate_cpm_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 } __Request__host_processors_t __attribute__((unused));
521#ifdef __MigPackStructs
522#pragma pack(pop)
523#endif
524
525#ifdef __MigPackStructs
526#pragma pack(push, 4)
527#endif
528 typedef struct {
529 mach_msg_header_t Head;
530 NDR_record_t NDR;
531 clock_id_t clock_id;
532 } __Request__host_get_clock_control_t __attribute__((unused));
533#ifdef __MigPackStructs
534#pragma pack(pop)
535#endif
536
537#ifdef __MigPackStructs
538#pragma pack(push, 4)
539#endif
540 typedef struct {
541 mach_msg_header_t Head;
542 NDR_record_t NDR;
543 vm_address_t info;
544 } __Request__kmod_create_t __attribute__((unused));
545#ifdef __MigPackStructs
546#pragma pack(pop)
547#endif
548
549#ifdef __MigPackStructs
550#pragma pack(push, 4)
551#endif
552 typedef struct {
553 mach_msg_header_t Head;
554 NDR_record_t NDR;
555 kmod_t module;
556 } __Request__kmod_destroy_t __attribute__((unused));
557#ifdef __MigPackStructs
558#pragma pack(pop)
559#endif
560
561#ifdef __MigPackStructs
562#pragma pack(push, 4)
563#endif
564 typedef struct {
565 mach_msg_header_t Head;
566 /* start of the kernel processed data */
567 mach_msg_body_t msgh_body;
568 mach_msg_ool_descriptor_t data;
569 /* end of the kernel processed data */
570 NDR_record_t NDR;
571 kmod_t module;
572 kmod_control_flavor_t flavor;
573 mach_msg_type_number_t dataCnt;
574 } __Request__kmod_control_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 NDR_record_t NDR;
585 int node;
586 int which;
587 } __Request__host_get_special_port_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 port;
600 /* end of the kernel processed data */
601 NDR_record_t NDR;
602 int which;
603 } __Request__host_set_special_port_t __attribute__((unused));
604#ifdef __MigPackStructs
605#pragma pack(pop)
606#endif
607
608#ifdef __MigPackStructs
609#pragma pack(push, 4)
610#endif
611 typedef struct {
612 mach_msg_header_t Head;
613 /* start of the kernel processed data */
614 mach_msg_body_t msgh_body;
615 mach_msg_port_descriptor_t new_port;
616 /* end of the kernel processed data */
617 NDR_record_t NDR;
618 exception_mask_t exception_mask;
619 exception_behavior_t behavior;
620 thread_state_flavor_t new_flavor;
621 } __Request__host_set_exception_ports_t __attribute__((unused));
622#ifdef __MigPackStructs
623#pragma pack(pop)
624#endif
625
626#ifdef __MigPackStructs
627#pragma pack(push, 4)
628#endif
629 typedef struct {
630 mach_msg_header_t Head;
631 NDR_record_t NDR;
632 exception_mask_t exception_mask;
633 } __Request__host_get_exception_ports_t __attribute__((unused));
634#ifdef __MigPackStructs
635#pragma pack(pop)
636#endif
637
638#ifdef __MigPackStructs
639#pragma pack(push, 4)
640#endif
641 typedef struct {
642 mach_msg_header_t Head;
643 /* start of the kernel processed data */
644 mach_msg_body_t msgh_body;
645 mach_msg_port_descriptor_t new_port;
646 /* end of the kernel processed data */
647 NDR_record_t NDR;
648 exception_mask_t exception_mask;
649 exception_behavior_t behavior;
650 thread_state_flavor_t new_flavor;
651 } __Request__host_swap_exception_ports_t __attribute__((unused));
652#ifdef __MigPackStructs
653#pragma pack(pop)
654#endif
655
656#ifdef __MigPackStructs
657#pragma pack(push, 4)
658#endif
659 typedef struct {
660 mach_msg_header_t Head;
661 /* start of the kernel processed data */
662 mach_msg_body_t msgh_body;
663 mach_msg_port_descriptor_t task;
664 /* end of the kernel processed data */
665 NDR_record_t NDR;
666 mach_vm_address_t address;
667 mach_vm_size_t size;
668 vm_prot_t desired_access;
669 } __Request__mach_vm_wire_t __attribute__((unused));
670#ifdef __MigPackStructs
671#pragma pack(pop)
672#endif
673
674#ifdef __MigPackStructs
675#pragma pack(push, 4)
676#endif
677 typedef struct {
678 mach_msg_header_t Head;
679 } __Request__host_processor_sets_t __attribute__((unused));
680#ifdef __MigPackStructs
681#pragma pack(pop)
682#endif
683
684#ifdef __MigPackStructs
685#pragma pack(push, 4)
686#endif
687 typedef struct {
688 mach_msg_header_t Head;
689 /* start of the kernel processed data */
690 mach_msg_body_t msgh_body;
691 mach_msg_port_descriptor_t set_name;
692 /* end of the kernel processed data */
693 } __Request__host_processor_set_priv_t __attribute__((unused));
694#ifdef __MigPackStructs
695#pragma pack(pop)
696#endif
697
698#ifdef __MigPackStructs
699#pragma pack(push, 4)
700#endif
701 typedef struct {
702 mach_msg_header_t Head;
703 /* start of the kernel processed data */
704 mach_msg_body_t msgh_body;
705 mach_msg_port_descriptor_t server;
706 /* end of the kernel processed data */
707 } __Request__host_set_UNDServer_t __attribute__((unused));
708#ifdef __MigPackStructs
709#pragma pack(pop)
710#endif
711
712#ifdef __MigPackStructs
713#pragma pack(push, 4)
714#endif
715 typedef struct {
716 mach_msg_header_t Head;
717 } __Request__host_get_UNDServer_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_ool_descriptor_t request_data;
730 /* end of the kernel processed data */
731 NDR_record_t NDR;
732 uint32_t user_log_flags;
733 mach_msg_type_number_t request_dataCnt;
734 } __Request__kext_request_t __attribute__((unused));
735#ifdef __MigPackStructs
736#pragma pack(pop)
737#endif
738#endif /* !__Request__host_priv_subsystem__defined */
739
740/* union of all requests */
741
742#ifndef __RequestUnion__host_priv_subsystem__defined
743#define __RequestUnion__host_priv_subsystem__defined
744union __RequestUnion__host_priv_subsystem {
745 __Request__host_get_boot_info_t Request_host_get_boot_info;
746 __Request__host_reboot_t Request_host_reboot;
747 __Request__host_priv_statistics_t Request_host_priv_statistics;
748 __Request__host_default_memory_manager_t Request_host_default_memory_manager;
749 __Request__vm_wire_t Request_vm_wire;
750 __Request__thread_wire_t Request_thread_wire;
751 __Request__vm_allocate_cpm_t Request_vm_allocate_cpm;
752 __Request__host_processors_t Request_host_processors;
753 __Request__host_get_clock_control_t Request_host_get_clock_control;
754 __Request__kmod_create_t Request_kmod_create;
755 __Request__kmod_destroy_t Request_kmod_destroy;
756 __Request__kmod_control_t Request_kmod_control;
757 __Request__host_get_special_port_t Request_host_get_special_port;
758 __Request__host_set_special_port_t Request_host_set_special_port;
759 __Request__host_set_exception_ports_t Request_host_set_exception_ports;
760 __Request__host_get_exception_ports_t Request_host_get_exception_ports;
761 __Request__host_swap_exception_ports_t Request_host_swap_exception_ports;
762 __Request__mach_vm_wire_t Request_mach_vm_wire;
763 __Request__host_processor_sets_t Request_host_processor_sets;
764 __Request__host_processor_set_priv_t Request_host_processor_set_priv;
765 __Request__host_set_UNDServer_t Request_host_set_UNDServer;
766 __Request__host_get_UNDServer_t Request_host_get_UNDServer;
767 __Request__kext_request_t Request_kext_request;
768};
769#endif /* !__RequestUnion__host_priv_subsystem__defined */
770/* typedefs for all replies */
771
772#ifndef __Reply__host_priv_subsystem__defined
773#define __Reply__host_priv_subsystem__defined
774
775#ifdef __MigPackStructs
776#pragma pack(push, 4)
777#endif
778 typedef struct {
779 mach_msg_header_t Head;
780 NDR_record_t NDR;
781 kern_return_t RetCode;
782 mach_msg_type_number_t boot_infoOffset; /* MiG doesn't use it */
783 mach_msg_type_number_t boot_infoCnt;
784 char boot_info[4096];
785 } __Reply__host_get_boot_info_t __attribute__((unused));
786#ifdef __MigPackStructs
787#pragma pack(pop)
788#endif
789
790#ifdef __MigPackStructs
791#pragma pack(push, 4)
792#endif
793 typedef struct {
794 mach_msg_header_t Head;
795 NDR_record_t NDR;
796 kern_return_t RetCode;
797 } __Reply__host_reboot_t __attribute__((unused));
798#ifdef __MigPackStructs
799#pragma pack(pop)
800#endif
801
802#ifdef __MigPackStructs
803#pragma pack(push, 4)
804#endif
805 typedef struct {
806 mach_msg_header_t Head;
807 NDR_record_t NDR;
808 kern_return_t RetCode;
809 mach_msg_type_number_t host_info_outCnt;
810 integer_t host_info_out[68];
811 } __Reply__host_priv_statistics_t __attribute__((unused));
812#ifdef __MigPackStructs
813#pragma pack(pop)
814#endif
815
816#ifdef __MigPackStructs
817#pragma pack(push, 4)
818#endif
819 typedef struct {
820 mach_msg_header_t Head;
821 /* start of the kernel processed data */
822 mach_msg_body_t msgh_body;
823 mach_msg_port_descriptor_t default_manager;
824 /* end of the kernel processed data */
825 } __Reply__host_default_memory_manager_t __attribute__((unused));
826#ifdef __MigPackStructs
827#pragma pack(pop)
828#endif
829
830#ifdef __MigPackStructs
831#pragma pack(push, 4)
832#endif
833 typedef struct {
834 mach_msg_header_t Head;
835 NDR_record_t NDR;
836 kern_return_t RetCode;
837 } __Reply__vm_wire_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 kern_return_t RetCode;
849 } __Reply__thread_wire_t __attribute__((unused));
850#ifdef __MigPackStructs
851#pragma pack(pop)
852#endif
853
854#ifdef __MigPackStructs
855#pragma pack(push, 4)
856#endif
857 typedef struct {
858 mach_msg_header_t Head;
859 NDR_record_t NDR;
860 kern_return_t RetCode;
861 vm_address_t address;
862 } __Reply__vm_allocate_cpm_t __attribute__((unused));
863#ifdef __MigPackStructs
864#pragma pack(pop)
865#endif
866
867#ifdef __MigPackStructs
868#pragma pack(push, 4)
869#endif
870 typedef struct {
871 mach_msg_header_t Head;
872 /* start of the kernel processed data */
873 mach_msg_body_t msgh_body;
874 mach_msg_ool_ports_descriptor_t out_processor_list;
875 /* end of the kernel processed data */
876 NDR_record_t NDR;
877 mach_msg_type_number_t out_processor_listCnt;
878 } __Reply__host_processors_t __attribute__((unused));
879#ifdef __MigPackStructs
880#pragma pack(pop)
881#endif
882
883#ifdef __MigPackStructs
884#pragma pack(push, 4)
885#endif
886 typedef struct {
887 mach_msg_header_t Head;
888 /* start of the kernel processed data */
889 mach_msg_body_t msgh_body;
890 mach_msg_port_descriptor_t clock_ctrl;
891 /* end of the kernel processed data */
892 } __Reply__host_get_clock_control_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 NDR_record_t NDR;
903 kern_return_t RetCode;
904 kmod_t module;
905 } __Reply__kmod_create_t __attribute__((unused));
906#ifdef __MigPackStructs
907#pragma pack(pop)
908#endif
909
910#ifdef __MigPackStructs
911#pragma pack(push, 4)
912#endif
913 typedef struct {
914 mach_msg_header_t Head;
915 NDR_record_t NDR;
916 kern_return_t RetCode;
917 } __Reply__kmod_destroy_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 /* start of the kernel processed data */
928 mach_msg_body_t msgh_body;
929 mach_msg_ool_descriptor_t data;
930 /* end of the kernel processed data */
931 NDR_record_t NDR;
932 mach_msg_type_number_t dataCnt;
933 } __Reply__kmod_control_t __attribute__((unused));
934#ifdef __MigPackStructs
935#pragma pack(pop)
936#endif
937
938#ifdef __MigPackStructs
939#pragma pack(push, 4)
940#endif
941 typedef struct {
942 mach_msg_header_t Head;
943 /* start of the kernel processed data */
944 mach_msg_body_t msgh_body;
945 mach_msg_port_descriptor_t port;
946 /* end of the kernel processed data */
947 } __Reply__host_get_special_port_t __attribute__((unused));
948#ifdef __MigPackStructs
949#pragma pack(pop)
950#endif
951
952#ifdef __MigPackStructs
953#pragma pack(push, 4)
954#endif
955 typedef struct {
956 mach_msg_header_t Head;
957 NDR_record_t NDR;
958 kern_return_t RetCode;
959 } __Reply__host_set_special_port_t __attribute__((unused));
960#ifdef __MigPackStructs
961#pragma pack(pop)
962#endif
963
964#ifdef __MigPackStructs
965#pragma pack(push, 4)
966#endif
967 typedef struct {
968 mach_msg_header_t Head;
969 NDR_record_t NDR;
970 kern_return_t RetCode;
971 } __Reply__host_set_exception_ports_t __attribute__((unused));
972#ifdef __MigPackStructs
973#pragma pack(pop)
974#endif
975
976#ifdef __MigPackStructs
977#pragma pack(push, 4)
978#endif
979 typedef struct {
980 mach_msg_header_t Head;
981 /* start of the kernel processed data */
982 mach_msg_body_t msgh_body;
983 mach_msg_port_descriptor_t old_handlers[32];
984 /* end of the kernel processed data */
985 NDR_record_t NDR;
986 mach_msg_type_number_t masksCnt;
987 exception_mask_t masks[32];
988 exception_behavior_t old_behaviors[32];
989 thread_state_flavor_t old_flavors[32];
990 } __Reply__host_get_exception_ports_t __attribute__((unused));
991#ifdef __MigPackStructs
992#pragma pack(pop)
993#endif
994
995#ifdef __MigPackStructs
996#pragma pack(push, 4)
997#endif
998 typedef struct {
999 mach_msg_header_t Head;
1000 /* start of the kernel processed data */
1001 mach_msg_body_t msgh_body;
1002 mach_msg_port_descriptor_t old_handlerss[32];
1003 /* end of the kernel processed data */
1004 NDR_record_t NDR;
1005 mach_msg_type_number_t masksCnt;
1006 exception_mask_t masks[32];
1007 exception_behavior_t old_behaviors[32];
1008 thread_state_flavor_t old_flavors[32];
1009 } __Reply__host_swap_exception_ports_t __attribute__((unused));
1010#ifdef __MigPackStructs
1011#pragma pack(pop)
1012#endif
1013
1014#ifdef __MigPackStructs
1015#pragma pack(push, 4)
1016#endif
1017 typedef struct {
1018 mach_msg_header_t Head;
1019 NDR_record_t NDR;
1020 kern_return_t RetCode;
1021 } __Reply__mach_vm_wire_t __attribute__((unused));
1022#ifdef __MigPackStructs
1023#pragma pack(pop)
1024#endif
1025
1026#ifdef __MigPackStructs
1027#pragma pack(push, 4)
1028#endif
1029 typedef struct {
1030 mach_msg_header_t Head;
1031 /* start of the kernel processed data */
1032 mach_msg_body_t msgh_body;
1033 mach_msg_ool_ports_descriptor_t processor_sets;
1034 /* end of the kernel processed data */
1035 NDR_record_t NDR;
1036 mach_msg_type_number_t processor_setsCnt;
1037 } __Reply__host_processor_sets_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 /* start of the kernel processed data */
1048 mach_msg_body_t msgh_body;
1049 mach_msg_port_descriptor_t set;
1050 /* end of the kernel processed data */
1051 } __Reply__host_processor_set_priv_t __attribute__((unused));
1052#ifdef __MigPackStructs
1053#pragma pack(pop)
1054#endif
1055
1056#ifdef __MigPackStructs
1057#pragma pack(push, 4)
1058#endif
1059 typedef struct {
1060 mach_msg_header_t Head;
1061 NDR_record_t NDR;
1062 kern_return_t RetCode;
1063 } __Reply__host_set_UNDServer_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 /* start of the kernel processed data */
1074 mach_msg_body_t msgh_body;
1075 mach_msg_port_descriptor_t server;
1076 /* end of the kernel processed data */
1077 } __Reply__host_get_UNDServer_t __attribute__((unused));
1078#ifdef __MigPackStructs
1079#pragma pack(pop)
1080#endif
1081
1082#ifdef __MigPackStructs
1083#pragma pack(push, 4)
1084#endif
1085 typedef struct {
1086 mach_msg_header_t Head;
1087 /* start of the kernel processed data */
1088 mach_msg_body_t msgh_body;
1089 mach_msg_ool_descriptor_t response_data;
1090 mach_msg_ool_descriptor_t log_data;
1091 /* end of the kernel processed data */
1092 NDR_record_t NDR;
1093 mach_msg_type_number_t response_dataCnt;
1094 mach_msg_type_number_t log_dataCnt;
1095 kern_return_t op_result;
1096 } __Reply__kext_request_t __attribute__((unused));
1097#ifdef __MigPackStructs
1098#pragma pack(pop)
1099#endif
1100#endif /* !__Reply__host_priv_subsystem__defined */
1101
1102/* union of all replies */
1103
1104#ifndef __ReplyUnion__host_priv_subsystem__defined
1105#define __ReplyUnion__host_priv_subsystem__defined
1106union __ReplyUnion__host_priv_subsystem {
1107 __Reply__host_get_boot_info_t Reply_host_get_boot_info;
1108 __Reply__host_reboot_t Reply_host_reboot;
1109 __Reply__host_priv_statistics_t Reply_host_priv_statistics;
1110 __Reply__host_default_memory_manager_t Reply_host_default_memory_manager;
1111 __Reply__vm_wire_t Reply_vm_wire;
1112 __Reply__thread_wire_t Reply_thread_wire;
1113 __Reply__vm_allocate_cpm_t Reply_vm_allocate_cpm;
1114 __Reply__host_processors_t Reply_host_processors;
1115 __Reply__host_get_clock_control_t Reply_host_get_clock_control;
1116 __Reply__kmod_create_t Reply_kmod_create;
1117 __Reply__kmod_destroy_t Reply_kmod_destroy;
1118 __Reply__kmod_control_t Reply_kmod_control;
1119 __Reply__host_get_special_port_t Reply_host_get_special_port;
1120 __Reply__host_set_special_port_t Reply_host_set_special_port;
1121 __Reply__host_set_exception_ports_t Reply_host_set_exception_ports;
1122 __Reply__host_get_exception_ports_t Reply_host_get_exception_ports;
1123 __Reply__host_swap_exception_ports_t Reply_host_swap_exception_ports;
1124 __Reply__mach_vm_wire_t Reply_mach_vm_wire;
1125 __Reply__host_processor_sets_t Reply_host_processor_sets;
1126 __Reply__host_processor_set_priv_t Reply_host_processor_set_priv;
1127 __Reply__host_set_UNDServer_t Reply_host_set_UNDServer;
1128 __Reply__host_get_UNDServer_t Reply_host_get_UNDServer;
1129 __Reply__kext_request_t Reply_kext_request;
1130};
1131#endif /* !__RequestUnion__host_priv_subsystem__defined */
1132
1133#ifndef subsystem_to_name_map_host_priv
1134#define subsystem_to_name_map_host_priv \
1135 { "host_get_boot_info", 400 },\
1136 { "host_reboot", 401 },\
1137 { "host_priv_statistics", 402 },\
1138 { "host_default_memory_manager", 403 },\
1139 { "vm_wire", 404 },\
1140 { "thread_wire", 405 },\
1141 { "vm_allocate_cpm", 406 },\
1142 { "host_processors", 407 },\
1143 { "host_get_clock_control", 408 },\
1144 { "kmod_create", 409 },\
1145 { "kmod_destroy", 410 },\
1146 { "kmod_control", 411 },\
1147 { "host_get_special_port", 412 },\
1148 { "host_set_special_port", 413 },\
1149 { "host_set_exception_ports", 414 },\
1150 { "host_get_exception_ports", 415 },\
1151 { "host_swap_exception_ports", 416 },\
1152 { "mach_vm_wire", 418 },\
1153 { "host_processor_sets", 419 },\
1154 { "host_processor_set_priv", 420 },\
1155 { "host_set_UNDServer", 423 },\
1156 { "host_get_UNDServer", 424 },\
1157 { "kext_request", 425 }
1158#endif
1159
1160#ifdef __AfterMigUserHeader
1161__AfterMigUserHeader
1162#endif /* __AfterMigUserHeader */
1163
1164#endif /* _host_priv_user_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/host_security.h created+222
......@@ -0,0 +1,222 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 host_security_create_task_token */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t host_security_create_task_token
76(
77 host_security_t host_security,
78 task_t parent_task,
79 security_token_t sec_token,
80 audit_token_t audit_token,
81 host_t host,
82 ledger_array_t ledgers,
83 mach_msg_type_number_t ledgersCnt,
84 boolean_t inherit_memory,
85 task_t *child_task
86);
87
88/* Routine host_security_set_task_token */
89#ifdef mig_external
90mig_external
91#else
92extern
93#endif /* mig_external */
94kern_return_t host_security_set_task_token
95(
96 host_security_t host_security,
97 task_t target_task,
98 security_token_t sec_token,
99 audit_token_t audit_token,
100 host_t host
101);
102
103__END_DECLS
104
105/********************** Caution **************************/
106/* The following data types should be used to calculate */
107/* maximum message sizes only. The actual message may be */
108/* smaller, and the position of the arguments within the */
109/* message layout may vary from what is presented here. */
110/* For example, if any of the arguments are variable- */
111/* sized, and less than the maximum is sent, the data */
112/* will be packed tight in the actual message to reduce */
113/* the presence of holes. */
114/********************** Caution **************************/
115
116/* typedefs for all requests */
117
118#ifndef __Request__host_security_subsystem__defined
119#define __Request__host_security_subsystem__defined
120
121#ifdef __MigPackStructs
122#pragma pack(push, 4)
123#endif
124 typedef struct {
125 mach_msg_header_t Head;
126 /* start of the kernel processed data */
127 mach_msg_body_t msgh_body;
128 mach_msg_port_descriptor_t parent_task;
129 mach_msg_port_descriptor_t host;
130 mach_msg_ool_ports_descriptor_t ledgers;
131 /* end of the kernel processed data */
132 NDR_record_t NDR;
133 security_token_t sec_token;
134 audit_token_t audit_token;
135 mach_msg_type_number_t ledgersCnt;
136 boolean_t inherit_memory;
137 } __Request__host_security_create_task_token_t __attribute__((unused));
138#ifdef __MigPackStructs
139#pragma pack(pop)
140#endif
141
142#ifdef __MigPackStructs
143#pragma pack(push, 4)
144#endif
145 typedef struct {
146 mach_msg_header_t Head;
147 /* start of the kernel processed data */
148 mach_msg_body_t msgh_body;
149 mach_msg_port_descriptor_t target_task;
150 mach_msg_port_descriptor_t host;
151 /* end of the kernel processed data */
152 NDR_record_t NDR;
153 security_token_t sec_token;
154 audit_token_t audit_token;
155 } __Request__host_security_set_task_token_t __attribute__((unused));
156#ifdef __MigPackStructs
157#pragma pack(pop)
158#endif
159#endif /* !__Request__host_security_subsystem__defined */
160
161/* union of all requests */
162
163#ifndef __RequestUnion__host_security_subsystem__defined
164#define __RequestUnion__host_security_subsystem__defined
165union __RequestUnion__host_security_subsystem {
166 __Request__host_security_create_task_token_t Request_host_security_create_task_token;
167 __Request__host_security_set_task_token_t Request_host_security_set_task_token;
168};
169#endif /* !__RequestUnion__host_security_subsystem__defined */
170/* typedefs for all replies */
171
172#ifndef __Reply__host_security_subsystem__defined
173#define __Reply__host_security_subsystem__defined
174
175#ifdef __MigPackStructs
176#pragma pack(push, 4)
177#endif
178 typedef struct {
179 mach_msg_header_t Head;
180 /* start of the kernel processed data */
181 mach_msg_body_t msgh_body;
182 mach_msg_port_descriptor_t child_task;
183 /* end of the kernel processed data */
184 } __Reply__host_security_create_task_token_t __attribute__((unused));
185#ifdef __MigPackStructs
186#pragma pack(pop)
187#endif
188
189#ifdef __MigPackStructs
190#pragma pack(push, 4)
191#endif
192 typedef struct {
193 mach_msg_header_t Head;
194 NDR_record_t NDR;
195 kern_return_t RetCode;
196 } __Reply__host_security_set_task_token_t __attribute__((unused));
197#ifdef __MigPackStructs
198#pragma pack(pop)
199#endif
200#endif /* !__Reply__host_security_subsystem__defined */
201
202/* union of all replies */
203
204#ifndef __ReplyUnion__host_security_subsystem__defined
205#define __ReplyUnion__host_security_subsystem__defined
206union __ReplyUnion__host_security_subsystem {
207 __Reply__host_security_create_task_token_t Reply_host_security_create_task_token;
208 __Reply__host_security_set_task_token_t Reply_host_security_set_task_token;
209};
210#endif /* !__RequestUnion__host_security_subsystem__defined */
211
212#ifndef subsystem_to_name_map_host_security
213#define subsystem_to_name_map_host_security \
214 { "host_security_create_task_token", 600 },\
215 { "host_security_set_task_token", 601 }
216#endif
217
218#ifdef __AfterMigUserHeader
219__AfterMigUserHeader
220#endif /* __AfterMigUserHeader */
221
222#endif /* _host_security_user_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/lock_set.h created+351
......@@ -0,0 +1,351 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 lock_acquire */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t lock_acquire
76(
77 lock_set_t lock_set,
78 int lock_id
79);
80
81/* Routine lock_release */
82#ifdef mig_external
83mig_external
84#else
85extern
86#endif /* mig_external */
87kern_return_t lock_release
88(
89 lock_set_t lock_set,
90 int lock_id
91);
92
93/* Routine lock_try */
94#ifdef mig_external
95mig_external
96#else
97extern
98#endif /* mig_external */
99kern_return_t lock_try
100(
101 lock_set_t lock_set,
102 int lock_id
103);
104
105/* Routine lock_make_stable */
106#ifdef mig_external
107mig_external
108#else
109extern
110#endif /* mig_external */
111kern_return_t lock_make_stable
112(
113 lock_set_t lock_set,
114 int lock_id
115);
116
117/* Routine lock_handoff */
118#ifdef mig_external
119mig_external
120#else
121extern
122#endif /* mig_external */
123kern_return_t lock_handoff
124(
125 lock_set_t lock_set,
126 int lock_id
127);
128
129/* Routine lock_handoff_accept */
130#ifdef mig_external
131mig_external
132#else
133extern
134#endif /* mig_external */
135kern_return_t lock_handoff_accept
136(
137 lock_set_t lock_set,
138 int lock_id
139);
140
141__END_DECLS
142
143/********************** Caution **************************/
144/* The following data types should be used to calculate */
145/* maximum message sizes only. The actual message may be */
146/* smaller, and the position of the arguments within the */
147/* message layout may vary from what is presented here. */
148/* For example, if any of the arguments are variable- */
149/* sized, and less than the maximum is sent, the data */
150/* will be packed tight in the actual message to reduce */
151/* the presence of holes. */
152/********************** Caution **************************/
153
154/* typedefs for all requests */
155
156#ifndef __Request__lock_set_subsystem__defined
157#define __Request__lock_set_subsystem__defined
158
159#ifdef __MigPackStructs
160#pragma pack(push, 4)
161#endif
162 typedef struct {
163 mach_msg_header_t Head;
164 NDR_record_t NDR;
165 int lock_id;
166 } __Request__lock_acquire_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 NDR_record_t NDR;
177 int lock_id;
178 } __Request__lock_release_t __attribute__((unused));
179#ifdef __MigPackStructs
180#pragma pack(pop)
181#endif
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 int lock_id;
190 } __Request__lock_try_t __attribute__((unused));
191#ifdef __MigPackStructs
192#pragma pack(pop)
193#endif
194
195#ifdef __MigPackStructs
196#pragma pack(push, 4)
197#endif
198 typedef struct {
199 mach_msg_header_t Head;
200 NDR_record_t NDR;
201 int lock_id;
202 } __Request__lock_make_stable_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 NDR_record_t NDR;
213 int lock_id;
214 } __Request__lock_handoff_t __attribute__((unused));
215#ifdef __MigPackStructs
216#pragma pack(pop)
217#endif
218
219#ifdef __MigPackStructs
220#pragma pack(push, 4)
221#endif
222 typedef struct {
223 mach_msg_header_t Head;
224 NDR_record_t NDR;
225 int lock_id;
226 } __Request__lock_handoff_accept_t __attribute__((unused));
227#ifdef __MigPackStructs
228#pragma pack(pop)
229#endif
230#endif /* !__Request__lock_set_subsystem__defined */
231
232/* union of all requests */
233
234#ifndef __RequestUnion__lock_set_subsystem__defined
235#define __RequestUnion__lock_set_subsystem__defined
236union __RequestUnion__lock_set_subsystem {
237 __Request__lock_acquire_t Request_lock_acquire;
238 __Request__lock_release_t Request_lock_release;
239 __Request__lock_try_t Request_lock_try;
240 __Request__lock_make_stable_t Request_lock_make_stable;
241 __Request__lock_handoff_t Request_lock_handoff;
242 __Request__lock_handoff_accept_t Request_lock_handoff_accept;
243};
244#endif /* !__RequestUnion__lock_set_subsystem__defined */
245/* typedefs for all replies */
246
247#ifndef __Reply__lock_set_subsystem__defined
248#define __Reply__lock_set_subsystem__defined
249
250#ifdef __MigPackStructs
251#pragma pack(push, 4)
252#endif
253 typedef struct {
254 mach_msg_header_t Head;
255 NDR_record_t NDR;
256 kern_return_t RetCode;
257 } __Reply__lock_acquire_t __attribute__((unused));
258#ifdef __MigPackStructs
259#pragma pack(pop)
260#endif
261
262#ifdef __MigPackStructs
263#pragma pack(push, 4)
264#endif
265 typedef struct {
266 mach_msg_header_t Head;
267 NDR_record_t NDR;
268 kern_return_t RetCode;
269 } __Reply__lock_release_t __attribute__((unused));
270#ifdef __MigPackStructs
271#pragma pack(pop)
272#endif
273
274#ifdef __MigPackStructs
275#pragma pack(push, 4)
276#endif
277 typedef struct {
278 mach_msg_header_t Head;
279 NDR_record_t NDR;
280 kern_return_t RetCode;
281 } __Reply__lock_try_t __attribute__((unused));
282#ifdef __MigPackStructs
283#pragma pack(pop)
284#endif
285
286#ifdef __MigPackStructs
287#pragma pack(push, 4)
288#endif
289 typedef struct {
290 mach_msg_header_t Head;
291 NDR_record_t NDR;
292 kern_return_t RetCode;
293 } __Reply__lock_make_stable_t __attribute__((unused));
294#ifdef __MigPackStructs
295#pragma pack(pop)
296#endif
297
298#ifdef __MigPackStructs
299#pragma pack(push, 4)
300#endif
301 typedef struct {
302 mach_msg_header_t Head;
303 NDR_record_t NDR;
304 kern_return_t RetCode;
305 } __Reply__lock_handoff_t __attribute__((unused));
306#ifdef __MigPackStructs
307#pragma pack(pop)
308#endif
309
310#ifdef __MigPackStructs
311#pragma pack(push, 4)
312#endif
313 typedef struct {
314 mach_msg_header_t Head;
315 NDR_record_t NDR;
316 kern_return_t RetCode;
317 } __Reply__lock_handoff_accept_t __attribute__((unused));
318#ifdef __MigPackStructs
319#pragma pack(pop)
320#endif
321#endif /* !__Reply__lock_set_subsystem__defined */
322
323/* union of all replies */
324
325#ifndef __ReplyUnion__lock_set_subsystem__defined
326#define __ReplyUnion__lock_set_subsystem__defined
327union __ReplyUnion__lock_set_subsystem {
328 __Reply__lock_acquire_t Reply_lock_acquire;
329 __Reply__lock_release_t Reply_lock_release;
330 __Reply__lock_try_t Reply_lock_try;
331 __Reply__lock_make_stable_t Reply_lock_make_stable;
332 __Reply__lock_handoff_t Reply_lock_handoff;
333 __Reply__lock_handoff_accept_t Reply_lock_handoff_accept;
334};
335#endif /* !__RequestUnion__lock_set_subsystem__defined */
336
337#ifndef subsystem_to_name_map_lock_set
338#define subsystem_to_name_map_lock_set \
339 { "lock_acquire", 617000 },\
340 { "lock_release", 617001 },\
341 { "lock_try", 617002 },\
342 { "lock_make_stable", 617003 },\
343 { "lock_handoff", 617004 },\
344 { "lock_handoff_accept", 617005 }
345#endif
346
347#ifdef __AfterMigUserHeader
348__AfterMigUserHeader
349#endif /* __AfterMigUserHeader */
350
351#endif /* _lock_set_user_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/mach.h created+241
......@@ -0,0 +1,241 @@
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 slot_name(cpu_type_t,
89 cpu_subtype_t,
90 char **,
91 char **);
92
93extern void mig_reply_setup(mach_msg_header_t *,
94 mach_msg_header_t *);
95
96__WATCHOS_PROHIBITED __TVOS_PROHIBITED
97extern void mach_msg_destroy(mach_msg_header_t *);
98
99__WATCHOS_PROHIBITED __TVOS_PROHIBITED
100extern mach_msg_return_t mach_msg_receive(mach_msg_header_t *);
101
102__WATCHOS_PROHIBITED __TVOS_PROHIBITED
103extern mach_msg_return_t mach_msg_send(mach_msg_header_t *);
104
105__WATCHOS_PROHIBITED __TVOS_PROHIBITED
106extern mach_msg_return_t mach_msg_server_once(boolean_t (*)
107 (mach_msg_header_t *,
108 mach_msg_header_t *),
109 mach_msg_size_t,
110 mach_port_t,
111 mach_msg_options_t);
112
113__WATCHOS_PROHIBITED __TVOS_PROHIBITED
114extern mach_msg_return_t mach_msg_server(boolean_t (*)
115 (mach_msg_header_t *,
116 mach_msg_header_t *),
117 mach_msg_size_t,
118 mach_port_t,
119 mach_msg_options_t);
120
121__WATCHOS_PROHIBITED __TVOS_PROHIBITED
122extern mach_msg_return_t mach_msg_server_importance(boolean_t (*)
123 (mach_msg_header_t *,
124 mach_msg_header_t *),
125 mach_msg_size_t,
126 mach_port_t,
127 mach_msg_options_t);
128
129/*
130 * Prototypes for compatibility
131 */
132extern kern_return_t clock_get_res(mach_port_t,
133 clock_res_t *);
134extern kern_return_t clock_set_res(mach_port_t,
135 clock_res_t);
136
137extern kern_return_t clock_sleep(mach_port_t,
138 int,
139 mach_timespec_t,
140 mach_timespec_t *);
141
142/*!
143 * @group voucher_mach_msg Prototypes
144 */
145
146#define VOUCHER_MACH_MSG_API_VERSION 20140205
147
148/*!
149 * @typedef voucher_mach_msg_state_t
150 *
151 * @abstract
152 * Opaque object encapsulating state changed by voucher_mach_msg_adopt().
153 */
154typedef struct voucher_mach_msg_state_s *voucher_mach_msg_state_t;
155
156/*!
157 * @const VOUCHER_MACH_MSG_STATE_UNCHANGED
158 *
159 * @discussion
160 * Constant indicating no state change occurred.
161 */
162#define VOUCHER_MACH_MSG_STATE_UNCHANGED ((voucher_mach_msg_state_t)~0ul)
163
164/*!
165 * @function voucher_mach_msg_set
166 *
167 * @abstract
168 * Change specified message header to contain current mach voucher with a
169 * COPY_SEND disposition.
170 * Does not change message if it already has non-zero MACH_MSGH_BITS_VOUCHER.
171 *
172 * @discussion
173 * Borrows reference to current thread voucher so message should be sent
174 * immediately (without intervening calls that might change that voucher).
175 *
176 * @param msg
177 * The message to modify.
178 *
179 * @result
180 * True if header was changed.
181 */
182extern boolean_t voucher_mach_msg_set(mach_msg_header_t *msg);
183
184/*!
185 * @function voucher_mach_msg_clear
186 *
187 * @abstract
188 * Removes changes made to specified message header by voucher_mach_msg_set()
189 * and any mach_msg() send operations (successful or not).
190 * If the message is not needed further, mach_msg_destroy() should be called
191 * instead.
192 *
193 * @discussion
194 * Not intended to be called if voucher_mach_msg_set() returned false.
195 * Releases reference to message mach voucher if an extra reference was
196 * acquired due to an unsuccessful send operation (pseudo-receive).
197 *
198 * @param msg
199 * The message to modify.
200 */
201extern void voucher_mach_msg_clear(mach_msg_header_t *msg);
202
203/*!
204 * @function voucher_mach_msg_adopt
205 *
206 * @abstract
207 * Adopt the voucher contained in the specified message on the current thread
208 * and return the previous thread voucher state.
209 *
210 * @discussion
211 * Ownership of the mach voucher in the message is transferred to the current
212 * thread and the message header voucher fields are cleared.
213 *
214 * @param msg
215 * The message to query and modify.
216 *
217 * @result
218 * The previous thread voucher state or VOUCHER_MACH_MSG_STATE_UNCHANGED if no
219 * state change occurred.
220 */
221extern voucher_mach_msg_state_t voucher_mach_msg_adopt(mach_msg_header_t *msg);
222
223/*!
224 * @function voucher_mach_msg_revert
225 *
226 * @abstract
227 * Restore thread voucher state previously modified by voucher_mach_msg_adopt().
228 *
229 * @discussion
230 * Current thread voucher reference is released.
231 * No change to thread voucher state if passed VOUCHER_MACH_MSG_STATE_UNCHANGED.
232 *
233 * @param state
234 * The thread voucher state to restore.
235 */
236
237extern void voucher_mach_msg_revert(voucher_mach_msg_state_t state);
238
239__END_DECLS
240
241#endif /* _MACH_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/mach_host.h created+1289
......@@ -0,0 +1,1289 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.h>
59#include <mach/mach_types.h>
60#include <mach/mach_types.h>
61#include <mach_debug/mach_debug_types.h>
62#include <mach/mach_init.h>
63
64#ifdef __BeforeMigUserHeader
65__BeforeMigUserHeader
66#endif /* __BeforeMigUserHeader */
67
68#include <sys/cdefs.h>
69__BEGIN_DECLS
70
71
72/* Routine host_info */
73#ifdef mig_external
74mig_external
75#else
76extern
77#endif /* mig_external */
78__TVOS_PROHIBITED __WATCHOS_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__TVOS_PROHIBITED __WATCHOS_PROHIBITED
255kern_return_t host_request_notification
256(
257 host_t host,
258 host_flavor_t notify_type,
259 mach_port_t notify_port
260);
261
262/* Routine host_lockgroup_info */
263#ifdef mig_external
264mig_external
265#else
266extern
267#endif /* mig_external */
268kern_return_t host_lockgroup_info
269(
270 host_t host,
271 lockgroup_info_array_t *lockgroup_info,
272 mach_msg_type_number_t *lockgroup_infoCnt
273);
274
275/* Routine host_statistics64 */
276#ifdef mig_external
277mig_external
278#else
279extern
280#endif /* mig_external */
281kern_return_t host_statistics64
282(
283 host_t host_priv,
284 host_flavor_t flavor,
285 host_info64_t host_info64_out,
286 mach_msg_type_number_t *host_info64_outCnt
287);
288
289/* Routine mach_zone_info */
290#ifdef mig_external
291mig_external
292#else
293extern
294#endif /* mig_external */
295kern_return_t mach_zone_info
296(
297 host_priv_t host,
298 mach_zone_name_array_t *names,
299 mach_msg_type_number_t *namesCnt,
300 mach_zone_info_array_t *info,
301 mach_msg_type_number_t *infoCnt
302);
303
304/* Routine host_create_mach_voucher */
305#ifdef mig_external
306mig_external
307#else
308extern
309#endif /* mig_external */
310__TVOS_PROHIBITED __WATCHOS_PROHIBITED
311kern_return_t host_create_mach_voucher
312(
313 host_t host,
314 mach_voucher_attr_raw_recipe_array_t recipes,
315 mach_msg_type_number_t recipesCnt,
316 ipc_voucher_t *voucher
317);
318
319/* Routine host_register_mach_voucher_attr_manager */
320#ifdef mig_external
321mig_external
322#else
323extern
324#endif /* mig_external */
325__TVOS_PROHIBITED __WATCHOS_PROHIBITED
326kern_return_t host_register_mach_voucher_attr_manager
327(
328 host_t host,
329 mach_voucher_attr_manager_t attr_manager,
330 mach_voucher_attr_value_handle_t default_value,
331 mach_voucher_attr_key_t *new_key,
332 ipc_voucher_attr_control_t *new_attr_control
333);
334
335/* Routine host_register_well_known_mach_voucher_attr_manager */
336#ifdef mig_external
337mig_external
338#else
339extern
340#endif /* mig_external */
341__TVOS_PROHIBITED __WATCHOS_PROHIBITED
342kern_return_t host_register_well_known_mach_voucher_attr_manager
343(
344 host_t host,
345 mach_voucher_attr_manager_t attr_manager,
346 mach_voucher_attr_value_handle_t default_value,
347 mach_voucher_attr_key_t key,
348 ipc_voucher_attr_control_t *new_attr_control
349);
350
351/* Routine host_set_atm_diagnostic_flag */
352#ifdef mig_external
353mig_external
354#else
355extern
356#endif /* mig_external */
357__TVOS_PROHIBITED __WATCHOS_PROHIBITED
358kern_return_t host_set_atm_diagnostic_flag
359(
360 host_t host,
361 uint32_t diagnostic_flag
362);
363
364/* Routine host_get_atm_diagnostic_flag */
365#ifdef mig_external
366mig_external
367#else
368extern
369#endif /* mig_external */
370__TVOS_PROHIBITED __WATCHOS_PROHIBITED
371kern_return_t host_get_atm_diagnostic_flag
372(
373 host_t host,
374 uint32_t *diagnostic_flag
375);
376
377/* Routine mach_memory_info */
378#ifdef mig_external
379mig_external
380#else
381extern
382#endif /* mig_external */
383kern_return_t mach_memory_info
384(
385 host_priv_t host,
386 mach_zone_name_array_t *names,
387 mach_msg_type_number_t *namesCnt,
388 mach_zone_info_array_t *info,
389 mach_msg_type_number_t *infoCnt,
390 mach_memory_info_array_t *memory_info,
391 mach_msg_type_number_t *memory_infoCnt
392);
393
394/* Routine host_set_multiuser_config_flags */
395#ifdef mig_external
396mig_external
397#else
398extern
399#endif /* mig_external */
400kern_return_t host_set_multiuser_config_flags
401(
402 host_priv_t host_priv,
403 uint32_t multiuser_flags
404);
405
406/* Routine host_get_multiuser_config_flags */
407#ifdef mig_external
408mig_external
409#else
410extern
411#endif /* mig_external */
412kern_return_t host_get_multiuser_config_flags
413(
414 host_t host,
415 uint32_t *multiuser_flags
416);
417
418/* Routine host_check_multiuser_mode */
419#ifdef mig_external
420mig_external
421#else
422extern
423#endif /* mig_external */
424kern_return_t host_check_multiuser_mode
425(
426 host_t host,
427 uint32_t *multiuser_mode
428);
429
430/* Routine mach_zone_info_for_zone */
431#ifdef mig_external
432mig_external
433#else
434extern
435#endif /* mig_external */
436kern_return_t mach_zone_info_for_zone
437(
438 host_priv_t host,
439 mach_zone_name_t name,
440 mach_zone_info_t *info
441);
442
443__END_DECLS
444
445/********************** Caution **************************/
446/* The following data types should be used to calculate */
447/* maximum message sizes only. The actual message may be */
448/* smaller, and the position of the arguments within the */
449/* message layout may vary from what is presented here. */
450/* For example, if any of the arguments are variable- */
451/* sized, and less than the maximum is sent, the data */
452/* will be packed tight in the actual message to reduce */
453/* the presence of holes. */
454/********************** Caution **************************/
455
456/* typedefs for all requests */
457
458#ifndef __Request__mach_host_subsystem__defined
459#define __Request__mach_host_subsystem__defined
460
461#ifdef __MigPackStructs
462#pragma pack(push, 4)
463#endif
464 typedef struct {
465 mach_msg_header_t Head;
466 NDR_record_t NDR;
467 host_flavor_t flavor;
468 mach_msg_type_number_t host_info_outCnt;
469 } __Request__host_info_t __attribute__((unused));
470#ifdef __MigPackStructs
471#pragma pack(pop)
472#endif
473
474#ifdef __MigPackStructs
475#pragma pack(push, 4)
476#endif
477 typedef struct {
478 mach_msg_header_t Head;
479 } __Request__host_kernel_version_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 } __Request___host_page_size_t __attribute__((unused));
490#ifdef __MigPackStructs
491#pragma pack(pop)
492#endif
493
494#ifdef __MigPackStructs
495#pragma pack(push, 4)
496#endif
497 typedef struct {
498 mach_msg_header_t Head;
499 /* start of the kernel processed data */
500 mach_msg_body_t msgh_body;
501 mach_msg_port_descriptor_t pager;
502 /* end of the kernel processed data */
503 NDR_record_t NDR;
504 boolean_t internal;
505 vm_size_t size;
506 vm_prot_t permission;
507 } __Request__mach_memory_object_memory_entry_t __attribute__((unused));
508#ifdef __MigPackStructs
509#pragma pack(pop)
510#endif
511
512#ifdef __MigPackStructs
513#pragma pack(push, 4)
514#endif
515 typedef struct {
516 mach_msg_header_t Head;
517 NDR_record_t NDR;
518 processor_flavor_t flavor;
519 } __Request__host_processor_info_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 } __Request__host_get_io_master_t __attribute__((unused));
530#ifdef __MigPackStructs
531#pragma pack(pop)
532#endif
533
534#ifdef __MigPackStructs
535#pragma pack(push, 4)
536#endif
537 typedef struct {
538 mach_msg_header_t Head;
539 NDR_record_t NDR;
540 clock_id_t clock_id;
541 } __Request__host_get_clock_service_t __attribute__((unused));
542#ifdef __MigPackStructs
543#pragma pack(pop)
544#endif
545
546#ifdef __MigPackStructs
547#pragma pack(push, 4)
548#endif
549 typedef struct {
550 mach_msg_header_t Head;
551 } __Request__kmod_get_info_t __attribute__((unused));
552#ifdef __MigPackStructs
553#pragma pack(pop)
554#endif
555
556#ifdef __MigPackStructs
557#pragma pack(push, 4)
558#endif
559 typedef struct {
560 mach_msg_header_t Head;
561 } __Request__host_virtual_physical_table_info_t __attribute__((unused));
562#ifdef __MigPackStructs
563#pragma pack(pop)
564#endif
565
566#ifdef __MigPackStructs
567#pragma pack(push, 4)
568#endif
569 typedef struct {
570 mach_msg_header_t Head;
571 } __Request__processor_set_default_t __attribute__((unused));
572#ifdef __MigPackStructs
573#pragma pack(pop)
574#endif
575
576#ifdef __MigPackStructs
577#pragma pack(push, 4)
578#endif
579 typedef struct {
580 mach_msg_header_t Head;
581 } __Request__processor_set_create_t __attribute__((unused));
582#ifdef __MigPackStructs
583#pragma pack(pop)
584#endif
585
586#ifdef __MigPackStructs
587#pragma pack(push, 4)
588#endif
589 typedef struct {
590 mach_msg_header_t Head;
591 /* start of the kernel processed data */
592 mach_msg_body_t msgh_body;
593 mach_msg_port_descriptor_t pager;
594 /* end of the kernel processed data */
595 NDR_record_t NDR;
596 boolean_t internal;
597 memory_object_size_t size;
598 vm_prot_t permission;
599 } __Request__mach_memory_object_memory_entry_64_t __attribute__((unused));
600#ifdef __MigPackStructs
601#pragma pack(pop)
602#endif
603
604#ifdef __MigPackStructs
605#pragma pack(push, 4)
606#endif
607 typedef struct {
608 mach_msg_header_t Head;
609 NDR_record_t NDR;
610 host_flavor_t flavor;
611 mach_msg_type_number_t host_info_outCnt;
612 } __Request__host_statistics_t __attribute__((unused));
613#ifdef __MigPackStructs
614#pragma pack(pop)
615#endif
616
617#ifdef __MigPackStructs
618#pragma pack(push, 4)
619#endif
620 typedef struct {
621 mach_msg_header_t Head;
622 /* start of the kernel processed data */
623 mach_msg_body_t msgh_body;
624 mach_msg_port_descriptor_t notify_port;
625 /* end of the kernel processed data */
626 NDR_record_t NDR;
627 host_flavor_t notify_type;
628 } __Request__host_request_notification_t __attribute__((unused));
629#ifdef __MigPackStructs
630#pragma pack(pop)
631#endif
632
633#ifdef __MigPackStructs
634#pragma pack(push, 4)
635#endif
636 typedef struct {
637 mach_msg_header_t Head;
638 } __Request__host_lockgroup_info_t __attribute__((unused));
639#ifdef __MigPackStructs
640#pragma pack(pop)
641#endif
642
643#ifdef __MigPackStructs
644#pragma pack(push, 4)
645#endif
646 typedef struct {
647 mach_msg_header_t Head;
648 NDR_record_t NDR;
649 host_flavor_t flavor;
650 mach_msg_type_number_t host_info64_outCnt;
651 } __Request__host_statistics64_t __attribute__((unused));
652#ifdef __MigPackStructs
653#pragma pack(pop)
654#endif
655
656#ifdef __MigPackStructs
657#pragma pack(push, 4)
658#endif
659 typedef struct {
660 mach_msg_header_t Head;
661 } __Request__mach_zone_info_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_msg_type_number_t recipesCnt;
673 uint8_t recipes[5120];
674 } __Request__host_create_mach_voucher_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 /* start of the kernel processed data */
685 mach_msg_body_t msgh_body;
686 mach_msg_port_descriptor_t attr_manager;
687 /* end of the kernel processed data */
688 NDR_record_t NDR;
689 mach_voucher_attr_value_handle_t default_value;
690 } __Request__host_register_mach_voucher_attr_manager_t __attribute__((unused));
691#ifdef __MigPackStructs
692#pragma pack(pop)
693#endif
694
695#ifdef __MigPackStructs
696#pragma pack(push, 4)
697#endif
698 typedef struct {
699 mach_msg_header_t Head;
700 /* start of the kernel processed data */
701 mach_msg_body_t msgh_body;
702 mach_msg_port_descriptor_t attr_manager;
703 /* end of the kernel processed data */
704 NDR_record_t NDR;
705 mach_voucher_attr_value_handle_t default_value;
706 mach_voucher_attr_key_t key;
707 } __Request__host_register_well_known_mach_voucher_attr_manager_t __attribute__((unused));
708#ifdef __MigPackStructs
709#pragma pack(pop)
710#endif
711
712#ifdef __MigPackStructs
713#pragma pack(push, 4)
714#endif
715 typedef struct {
716 mach_msg_header_t Head;
717 NDR_record_t NDR;
718 uint32_t diagnostic_flag;
719 } __Request__host_set_atm_diagnostic_flag_t __attribute__((unused));
720#ifdef __MigPackStructs
721#pragma pack(pop)
722#endif
723
724#ifdef __MigPackStructs
725#pragma pack(push, 4)
726#endif
727 typedef struct {
728 mach_msg_header_t Head;
729 } __Request__host_get_atm_diagnostic_flag_t __attribute__((unused));
730#ifdef __MigPackStructs
731#pragma pack(pop)
732#endif
733
734#ifdef __MigPackStructs
735#pragma pack(push, 4)
736#endif
737 typedef struct {
738 mach_msg_header_t Head;
739 } __Request__mach_memory_info_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 uint32_t multiuser_flags;
751 } __Request__host_set_multiuser_config_flags_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 } __Request__host_get_multiuser_config_flags_t __attribute__((unused));
762#ifdef __MigPackStructs
763#pragma pack(pop)
764#endif
765
766#ifdef __MigPackStructs
767#pragma pack(push, 4)
768#endif
769 typedef struct {
770 mach_msg_header_t Head;
771 } __Request__host_check_multiuser_mode_t __attribute__((unused));
772#ifdef __MigPackStructs
773#pragma pack(pop)
774#endif
775
776#ifdef __MigPackStructs
777#pragma pack(push, 4)
778#endif
779 typedef struct {
780 mach_msg_header_t Head;
781 NDR_record_t NDR;
782 mach_zone_name_t name;
783 } __Request__mach_zone_info_for_zone_t __attribute__((unused));
784#ifdef __MigPackStructs
785#pragma pack(pop)
786#endif
787#endif /* !__Request__mach_host_subsystem__defined */
788
789/* union of all requests */
790
791#ifndef __RequestUnion__mach_host_subsystem__defined
792#define __RequestUnion__mach_host_subsystem__defined
793union __RequestUnion__mach_host_subsystem {
794 __Request__host_info_t Request_host_info;
795 __Request__host_kernel_version_t Request_host_kernel_version;
796 __Request___host_page_size_t Request__host_page_size;
797 __Request__mach_memory_object_memory_entry_t Request_mach_memory_object_memory_entry;
798 __Request__host_processor_info_t Request_host_processor_info;
799 __Request__host_get_io_master_t Request_host_get_io_master;
800 __Request__host_get_clock_service_t Request_host_get_clock_service;
801 __Request__kmod_get_info_t Request_kmod_get_info;
802 __Request__host_virtual_physical_table_info_t Request_host_virtual_physical_table_info;
803 __Request__processor_set_default_t Request_processor_set_default;
804 __Request__processor_set_create_t Request_processor_set_create;
805 __Request__mach_memory_object_memory_entry_64_t Request_mach_memory_object_memory_entry_64;
806 __Request__host_statistics_t Request_host_statistics;
807 __Request__host_request_notification_t Request_host_request_notification;
808 __Request__host_lockgroup_info_t Request_host_lockgroup_info;
809 __Request__host_statistics64_t Request_host_statistics64;
810 __Request__mach_zone_info_t Request_mach_zone_info;
811 __Request__host_create_mach_voucher_t Request_host_create_mach_voucher;
812 __Request__host_register_mach_voucher_attr_manager_t Request_host_register_mach_voucher_attr_manager;
813 __Request__host_register_well_known_mach_voucher_attr_manager_t Request_host_register_well_known_mach_voucher_attr_manager;
814 __Request__host_set_atm_diagnostic_flag_t Request_host_set_atm_diagnostic_flag;
815 __Request__host_get_atm_diagnostic_flag_t Request_host_get_atm_diagnostic_flag;
816 __Request__mach_memory_info_t Request_mach_memory_info;
817 __Request__host_set_multiuser_config_flags_t Request_host_set_multiuser_config_flags;
818 __Request__host_get_multiuser_config_flags_t Request_host_get_multiuser_config_flags;
819 __Request__host_check_multiuser_mode_t Request_host_check_multiuser_mode;
820 __Request__mach_zone_info_for_zone_t Request_mach_zone_info_for_zone;
821};
822#endif /* !__RequestUnion__mach_host_subsystem__defined */
823/* typedefs for all replies */
824
825#ifndef __Reply__mach_host_subsystem__defined
826#define __Reply__mach_host_subsystem__defined
827
828#ifdef __MigPackStructs
829#pragma pack(push, 4)
830#endif
831 typedef struct {
832 mach_msg_header_t Head;
833 NDR_record_t NDR;
834 kern_return_t RetCode;
835 mach_msg_type_number_t host_info_outCnt;
836 integer_t host_info_out[68];
837 } __Reply__host_info_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 kern_return_t RetCode;
849 mach_msg_type_number_t kernel_versionOffset; /* MiG doesn't use it */
850 mach_msg_type_number_t kernel_versionCnt;
851 char kernel_version[512];
852 } __Reply__host_kernel_version_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 NDR_record_t NDR;
863 kern_return_t RetCode;
864 vm_size_t out_page_size;
865 } __Reply___host_page_size_t __attribute__((unused));
866#ifdef __MigPackStructs
867#pragma pack(pop)
868#endif
869
870#ifdef __MigPackStructs
871#pragma pack(push, 4)
872#endif
873 typedef struct {
874 mach_msg_header_t Head;
875 /* start of the kernel processed data */
876 mach_msg_body_t msgh_body;
877 mach_msg_port_descriptor_t entry_handle;
878 /* end of the kernel processed data */
879 } __Reply__mach_memory_object_memory_entry_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 /* start of the kernel processed data */
890 mach_msg_body_t msgh_body;
891 mach_msg_ool_descriptor_t out_processor_info;
892 /* end of the kernel processed data */
893 NDR_record_t NDR;
894 natural_t out_processor_count;
895 mach_msg_type_number_t out_processor_infoCnt;
896 } __Reply__host_processor_info_t __attribute__((unused));
897#ifdef __MigPackStructs
898#pragma pack(pop)
899#endif
900
901#ifdef __MigPackStructs
902#pragma pack(push, 4)
903#endif
904 typedef struct {
905 mach_msg_header_t Head;
906 /* start of the kernel processed data */
907 mach_msg_body_t msgh_body;
908 mach_msg_port_descriptor_t io_master;
909 /* end of the kernel processed data */
910 } __Reply__host_get_io_master_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 /* start of the kernel processed data */
921 mach_msg_body_t msgh_body;
922 mach_msg_port_descriptor_t clock_serv;
923 /* end of the kernel processed data */
924 } __Reply__host_get_clock_service_t __attribute__((unused));
925#ifdef __MigPackStructs
926#pragma pack(pop)
927#endif
928
929#ifdef __MigPackStructs
930#pragma pack(push, 4)
931#endif
932 typedef struct {
933 mach_msg_header_t Head;
934 /* start of the kernel processed data */
935 mach_msg_body_t msgh_body;
936 mach_msg_ool_descriptor_t modules;
937 /* end of the kernel processed data */
938 NDR_record_t NDR;
939 mach_msg_type_number_t modulesCnt;
940 } __Reply__kmod_get_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 /* start of the kernel processed data */
951 mach_msg_body_t msgh_body;
952 mach_msg_ool_descriptor_t info;
953 /* end of the kernel processed data */
954 NDR_record_t NDR;
955 mach_msg_type_number_t infoCnt;
956 } __Reply__host_virtual_physical_table_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 /* start of the kernel processed data */
967 mach_msg_body_t msgh_body;
968 mach_msg_port_descriptor_t default_set;
969 /* end of the kernel processed data */
970 } __Reply__processor_set_default_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 new_set;
983 mach_msg_port_descriptor_t new_name;
984 /* end of the kernel processed data */
985 } __Reply__processor_set_create_t __attribute__((unused));
986#ifdef __MigPackStructs
987#pragma pack(pop)
988#endif
989
990#ifdef __MigPackStructs
991#pragma pack(push, 4)
992#endif
993 typedef struct {
994 mach_msg_header_t Head;
995 /* start of the kernel processed data */
996 mach_msg_body_t msgh_body;
997 mach_msg_port_descriptor_t entry_handle;
998 /* end of the kernel processed data */
999 } __Reply__mach_memory_object_memory_entry_64_t __attribute__((unused));
1000#ifdef __MigPackStructs
1001#pragma pack(pop)
1002#endif
1003
1004#ifdef __MigPackStructs
1005#pragma pack(push, 4)
1006#endif
1007 typedef struct {
1008 mach_msg_header_t Head;
1009 NDR_record_t NDR;
1010 kern_return_t RetCode;
1011 mach_msg_type_number_t host_info_outCnt;
1012 integer_t host_info_out[68];
1013 } __Reply__host_statistics_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__host_request_notification_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 /* start of the kernel processed data */
1036 mach_msg_body_t msgh_body;
1037 mach_msg_ool_descriptor_t lockgroup_info;
1038 /* end of the kernel processed data */
1039 NDR_record_t NDR;
1040 mach_msg_type_number_t lockgroup_infoCnt;
1041 } __Reply__host_lockgroup_info_t __attribute__((unused));
1042#ifdef __MigPackStructs
1043#pragma pack(pop)
1044#endif
1045
1046#ifdef __MigPackStructs
1047#pragma pack(push, 4)
1048#endif
1049 typedef struct {
1050 mach_msg_header_t Head;
1051 NDR_record_t NDR;
1052 kern_return_t RetCode;
1053 mach_msg_type_number_t host_info64_outCnt;
1054 integer_t host_info64_out[256];
1055 } __Reply__host_statistics64_t __attribute__((unused));
1056#ifdef __MigPackStructs
1057#pragma pack(pop)
1058#endif
1059
1060#ifdef __MigPackStructs
1061#pragma pack(push, 4)
1062#endif
1063 typedef struct {
1064 mach_msg_header_t Head;
1065 /* start of the kernel processed data */
1066 mach_msg_body_t msgh_body;
1067 mach_msg_ool_descriptor_t names;
1068 mach_msg_ool_descriptor_t info;
1069 /* end of the kernel processed data */
1070 NDR_record_t NDR;
1071 mach_msg_type_number_t namesCnt;
1072 mach_msg_type_number_t infoCnt;
1073 } __Reply__mach_zone_info_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 /* start of the kernel processed data */
1084 mach_msg_body_t msgh_body;
1085 mach_msg_port_descriptor_t voucher;
1086 /* end of the kernel processed data */
1087 } __Reply__host_create_mach_voucher_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 new_attr_control;
1100 /* end of the kernel processed data */
1101 NDR_record_t NDR;
1102 mach_voucher_attr_key_t new_key;
1103 } __Reply__host_register_mach_voucher_attr_manager_t __attribute__((unused));
1104#ifdef __MigPackStructs
1105#pragma pack(pop)
1106#endif
1107
1108#ifdef __MigPackStructs
1109#pragma pack(push, 4)
1110#endif
1111 typedef struct {
1112 mach_msg_header_t Head;
1113 /* start of the kernel processed data */
1114 mach_msg_body_t msgh_body;
1115 mach_msg_port_descriptor_t new_attr_control;
1116 /* end of the kernel processed data */
1117 } __Reply__host_register_well_known_mach_voucher_attr_manager_t __attribute__((unused));
1118#ifdef __MigPackStructs
1119#pragma pack(pop)
1120#endif
1121
1122#ifdef __MigPackStructs
1123#pragma pack(push, 4)
1124#endif
1125 typedef struct {
1126 mach_msg_header_t Head;
1127 NDR_record_t NDR;
1128 kern_return_t RetCode;
1129 } __Reply__host_set_atm_diagnostic_flag_t __attribute__((unused));
1130#ifdef __MigPackStructs
1131#pragma pack(pop)
1132#endif
1133
1134#ifdef __MigPackStructs
1135#pragma pack(push, 4)
1136#endif
1137 typedef struct {
1138 mach_msg_header_t Head;
1139 NDR_record_t NDR;
1140 kern_return_t RetCode;
1141 uint32_t diagnostic_flag;
1142 } __Reply__host_get_atm_diagnostic_flag_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 /* start of the kernel processed data */
1153 mach_msg_body_t msgh_body;
1154 mach_msg_ool_descriptor_t names;
1155 mach_msg_ool_descriptor_t info;
1156 mach_msg_ool_descriptor_t memory_info;
1157 /* end of the kernel processed data */
1158 NDR_record_t NDR;
1159 mach_msg_type_number_t namesCnt;
1160 mach_msg_type_number_t infoCnt;
1161 mach_msg_type_number_t memory_infoCnt;
1162 } __Reply__mach_memory_info_t __attribute__((unused));
1163#ifdef __MigPackStructs
1164#pragma pack(pop)
1165#endif
1166
1167#ifdef __MigPackStructs
1168#pragma pack(push, 4)
1169#endif
1170 typedef struct {
1171 mach_msg_header_t Head;
1172 NDR_record_t NDR;
1173 kern_return_t RetCode;
1174 } __Reply__host_set_multiuser_config_flags_t __attribute__((unused));
1175#ifdef __MigPackStructs
1176#pragma pack(pop)
1177#endif
1178
1179#ifdef __MigPackStructs
1180#pragma pack(push, 4)
1181#endif
1182 typedef struct {
1183 mach_msg_header_t Head;
1184 NDR_record_t NDR;
1185 kern_return_t RetCode;
1186 uint32_t multiuser_flags;
1187 } __Reply__host_get_multiuser_config_flags_t __attribute__((unused));
1188#ifdef __MigPackStructs
1189#pragma pack(pop)
1190#endif
1191
1192#ifdef __MigPackStructs
1193#pragma pack(push, 4)
1194#endif
1195 typedef struct {
1196 mach_msg_header_t Head;
1197 NDR_record_t NDR;
1198 kern_return_t RetCode;
1199 uint32_t multiuser_mode;
1200 } __Reply__host_check_multiuser_mode_t __attribute__((unused));
1201#ifdef __MigPackStructs
1202#pragma pack(pop)
1203#endif
1204
1205#ifdef __MigPackStructs
1206#pragma pack(push, 4)
1207#endif
1208 typedef struct {
1209 mach_msg_header_t Head;
1210 NDR_record_t NDR;
1211 kern_return_t RetCode;
1212 mach_zone_info_t info;
1213 } __Reply__mach_zone_info_for_zone_t __attribute__((unused));
1214#ifdef __MigPackStructs
1215#pragma pack(pop)
1216#endif
1217#endif /* !__Reply__mach_host_subsystem__defined */
1218
1219/* union of all replies */
1220
1221#ifndef __ReplyUnion__mach_host_subsystem__defined
1222#define __ReplyUnion__mach_host_subsystem__defined
1223union __ReplyUnion__mach_host_subsystem {
1224 __Reply__host_info_t Reply_host_info;
1225 __Reply__host_kernel_version_t Reply_host_kernel_version;
1226 __Reply___host_page_size_t Reply__host_page_size;
1227 __Reply__mach_memory_object_memory_entry_t Reply_mach_memory_object_memory_entry;
1228 __Reply__host_processor_info_t Reply_host_processor_info;
1229 __Reply__host_get_io_master_t Reply_host_get_io_master;
1230 __Reply__host_get_clock_service_t Reply_host_get_clock_service;
1231 __Reply__kmod_get_info_t Reply_kmod_get_info;
1232 __Reply__host_virtual_physical_table_info_t Reply_host_virtual_physical_table_info;
1233 __Reply__processor_set_default_t Reply_processor_set_default;
1234 __Reply__processor_set_create_t Reply_processor_set_create;
1235 __Reply__mach_memory_object_memory_entry_64_t Reply_mach_memory_object_memory_entry_64;
1236 __Reply__host_statistics_t Reply_host_statistics;
1237 __Reply__host_request_notification_t Reply_host_request_notification;
1238 __Reply__host_lockgroup_info_t Reply_host_lockgroup_info;
1239 __Reply__host_statistics64_t Reply_host_statistics64;
1240 __Reply__mach_zone_info_t Reply_mach_zone_info;
1241 __Reply__host_create_mach_voucher_t Reply_host_create_mach_voucher;
1242 __Reply__host_register_mach_voucher_attr_manager_t Reply_host_register_mach_voucher_attr_manager;
1243 __Reply__host_register_well_known_mach_voucher_attr_manager_t Reply_host_register_well_known_mach_voucher_attr_manager;
1244 __Reply__host_set_atm_diagnostic_flag_t Reply_host_set_atm_diagnostic_flag;
1245 __Reply__host_get_atm_diagnostic_flag_t Reply_host_get_atm_diagnostic_flag;
1246 __Reply__mach_memory_info_t Reply_mach_memory_info;
1247 __Reply__host_set_multiuser_config_flags_t Reply_host_set_multiuser_config_flags;
1248 __Reply__host_get_multiuser_config_flags_t Reply_host_get_multiuser_config_flags;
1249 __Reply__host_check_multiuser_mode_t Reply_host_check_multiuser_mode;
1250 __Reply__mach_zone_info_for_zone_t Reply_mach_zone_info_for_zone;
1251};
1252#endif /* !__RequestUnion__mach_host_subsystem__defined */
1253
1254#ifndef subsystem_to_name_map_mach_host
1255#define subsystem_to_name_map_mach_host \
1256 { "host_info", 200 },\
1257 { "host_kernel_version", 201 },\
1258 { "_host_page_size", 202 },\
1259 { "mach_memory_object_memory_entry", 203 },\
1260 { "host_processor_info", 204 },\
1261 { "host_get_io_master", 205 },\
1262 { "host_get_clock_service", 206 },\
1263 { "kmod_get_info", 207 },\
1264 { "host_virtual_physical_table_info", 209 },\
1265 { "processor_set_default", 213 },\
1266 { "processor_set_create", 214 },\
1267 { "mach_memory_object_memory_entry_64", 215 },\
1268 { "host_statistics", 216 },\
1269 { "host_request_notification", 217 },\
1270 { "host_lockgroup_info", 218 },\
1271 { "host_statistics64", 219 },\
1272 { "mach_zone_info", 220 },\
1273 { "host_create_mach_voucher", 222 },\
1274 { "host_register_mach_voucher_attr_manager", 223 },\
1275 { "host_register_well_known_mach_voucher_attr_manager", 224 },\
1276 { "host_set_atm_diagnostic_flag", 225 },\
1277 { "host_get_atm_diagnostic_flag", 226 },\
1278 { "mach_memory_info", 227 },\
1279 { "host_set_multiuser_config_flags", 228 },\
1280 { "host_get_multiuser_config_flags", 229 },\
1281 { "host_check_multiuser_mode", 230 },\
1282 { "mach_zone_info_for_zone", 231 }
1283#endif
1284
1285#ifdef __AfterMigUserHeader
1286__AfterMigUserHeader
1287#endif /* __AfterMigUserHeader */
1288
1289#endif /* _mach_host_user_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/mach_port.h created+1939
......@@ -0,0 +1,1939 @@
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 43
53#endif /* mach_port_MSG_COUNT */
54
55#include <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 mach_port_names */
71#ifdef mig_external
72mig_external
73#else
74extern
75#endif /* mig_external */
76kern_return_t mach_port_names
77(
78 ipc_space_t task,
79 mach_port_name_array_t *names,
80 mach_msg_type_number_t *namesCnt,
81 mach_port_type_array_t *types,
82 mach_msg_type_number_t *typesCnt
83);
84
85/* Routine mach_port_type */
86#ifdef mig_external
87mig_external
88#else
89extern
90#endif /* mig_external */
91kern_return_t mach_port_type
92(
93 ipc_space_t task,
94 mach_port_name_t name,
95 mach_port_type_t *ptype
96);
97
98/* Routine mach_port_rename */
99#ifdef mig_external
100mig_external
101#else
102extern
103#endif /* mig_external */
104kern_return_t mach_port_rename
105(
106 ipc_space_t task,
107 mach_port_name_t old_name,
108 mach_port_name_t new_name
109);
110
111/* Routine mach_port_allocate_name */
112#ifdef mig_external
113mig_external
114#else
115extern
116#endif /* mig_external */
117__TVOS_PROHIBITED __WATCHOS_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 */
144__API_DEPRECATED("Inherently unsafe API: instead manage rights with "
145 "mach_port_destruct(), mach_port_deallocate() or mach_port_mod_refs()",
146 macos(10.0, 12.0), ios(2.0, 15.0), tvos(9.0, 15.0), watchos(2.0, 8.0))
147kern_return_t mach_port_destroy
148(
149 ipc_space_t task,
150 mach_port_name_t name
151);
152
153/* Routine mach_port_deallocate */
154#ifdef mig_external
155mig_external
156#else
157extern
158#endif /* mig_external */
159kern_return_t mach_port_deallocate
160(
161 ipc_space_t task,
162 mach_port_name_t name
163);
164
165/* Routine mach_port_get_refs */
166#ifdef mig_external
167mig_external
168#else
169extern
170#endif /* mig_external */
171kern_return_t mach_port_get_refs
172(
173 ipc_space_t task,
174 mach_port_name_t name,
175 mach_port_right_t right,
176 mach_port_urefs_t *refs
177);
178
179/* Routine mach_port_mod_refs */
180#ifdef mig_external
181mig_external
182#else
183extern
184#endif /* mig_external */
185kern_return_t mach_port_mod_refs
186(
187 ipc_space_t task,
188 mach_port_name_t name,
189 mach_port_right_t right,
190 mach_port_delta_t delta
191);
192
193/* Routine mach_port_peek */
194#ifdef mig_external
195mig_external
196#else
197extern
198#endif /* mig_external */
199kern_return_t mach_port_peek
200(
201 ipc_space_t task,
202 mach_port_name_t name,
203 mach_msg_trailer_type_t trailer_type,
204 mach_port_seqno_t *request_seqnop,
205 mach_msg_size_t *msg_sizep,
206 mach_msg_id_t *msg_idp,
207 mach_msg_trailer_info_t trailer_infop,
208 mach_msg_type_number_t *trailer_infopCnt
209);
210
211/* Routine mach_port_set_mscount */
212#ifdef mig_external
213mig_external
214#else
215extern
216#endif /* mig_external */
217kern_return_t mach_port_set_mscount
218(
219 ipc_space_t task,
220 mach_port_name_t name,
221 mach_port_mscount_t mscount
222);
223
224/* Routine mach_port_get_set_status */
225#ifdef mig_external
226mig_external
227#else
228extern
229#endif /* mig_external */
230kern_return_t mach_port_get_set_status
231(
232 ipc_space_read_t task,
233 mach_port_name_t name,
234 mach_port_name_array_t *members,
235 mach_msg_type_number_t *membersCnt
236);
237
238/* Routine mach_port_move_member */
239#ifdef mig_external
240mig_external
241#else
242extern
243#endif /* mig_external */
244kern_return_t mach_port_move_member
245(
246 ipc_space_t task,
247 mach_port_name_t member,
248 mach_port_name_t after
249);
250
251/* Routine mach_port_request_notification */
252#ifdef mig_external
253mig_external
254#else
255extern
256#endif /* mig_external */
257kern_return_t mach_port_request_notification
258(
259 ipc_space_t task,
260 mach_port_name_t name,
261 mach_msg_id_t msgid,
262 mach_port_mscount_t sync,
263 mach_port_t notify,
264 mach_msg_type_name_t notifyPoly,
265 mach_port_t *previous
266);
267
268/* Routine mach_port_insert_right */
269#ifdef mig_external
270mig_external
271#else
272extern
273#endif /* mig_external */
274kern_return_t mach_port_insert_right
275(
276 ipc_space_t task,
277 mach_port_name_t name,
278 mach_port_t poly,
279 mach_msg_type_name_t polyPoly
280);
281
282/* Routine mach_port_extract_right */
283#ifdef mig_external
284mig_external
285#else
286extern
287#endif /* mig_external */
288kern_return_t mach_port_extract_right
289(
290 ipc_space_t task,
291 mach_port_name_t name,
292 mach_msg_type_name_t msgt_name,
293 mach_port_t *poly,
294 mach_msg_type_name_t *polyPoly
295);
296
297/* Routine mach_port_set_seqno */
298#ifdef mig_external
299mig_external
300#else
301extern
302#endif /* mig_external */
303kern_return_t mach_port_set_seqno
304(
305 ipc_space_t task,
306 mach_port_name_t name,
307 mach_port_seqno_t seqno
308);
309
310/* Routine mach_port_get_attributes */
311#ifdef mig_external
312mig_external
313#else
314extern
315#endif /* mig_external */
316kern_return_t mach_port_get_attributes
317(
318 ipc_space_read_t task,
319 mach_port_name_t name,
320 mach_port_flavor_t flavor,
321 mach_port_info_t port_info_out,
322 mach_msg_type_number_t *port_info_outCnt
323);
324
325/* Routine mach_port_set_attributes */
326#ifdef mig_external
327mig_external
328#else
329extern
330#endif /* mig_external */
331kern_return_t mach_port_set_attributes
332(
333 ipc_space_t task,
334 mach_port_name_t name,
335 mach_port_flavor_t flavor,
336 mach_port_info_t port_info,
337 mach_msg_type_number_t port_infoCnt
338);
339
340/* Routine mach_port_allocate_qos */
341#ifdef mig_external
342mig_external
343#else
344extern
345#endif /* mig_external */
346kern_return_t mach_port_allocate_qos
347(
348 ipc_space_t task,
349 mach_port_right_t right,
350 mach_port_qos_t *qos,
351 mach_port_name_t *name
352);
353
354/* Routine mach_port_allocate_full */
355#ifdef mig_external
356mig_external
357#else
358extern
359#endif /* mig_external */
360kern_return_t mach_port_allocate_full
361(
362 ipc_space_t task,
363 mach_port_right_t right,
364 mach_port_t proto,
365 mach_port_qos_t *qos,
366 mach_port_name_t *name
367);
368
369/* Routine task_set_port_space */
370#ifdef mig_external
371mig_external
372#else
373extern
374#endif /* mig_external */
375__TVOS_PROHIBITED __WATCHOS_PROHIBITED
376kern_return_t task_set_port_space
377(
378 ipc_space_t task,
379 int table_entries
380);
381
382/* Routine mach_port_get_srights */
383#ifdef mig_external
384mig_external
385#else
386extern
387#endif /* mig_external */
388kern_return_t mach_port_get_srights
389(
390 ipc_space_t task,
391 mach_port_name_t name,
392 mach_port_rights_t *srights
393);
394
395/* Routine mach_port_space_info */
396#ifdef mig_external
397mig_external
398#else
399extern
400#endif /* mig_external */
401kern_return_t mach_port_space_info
402(
403 ipc_space_read_t space,
404 ipc_info_space_t *space_info,
405 ipc_info_name_array_t *table_info,
406 mach_msg_type_number_t *table_infoCnt,
407 ipc_info_tree_name_array_t *tree_info,
408 mach_msg_type_number_t *tree_infoCnt
409);
410
411/* Routine mach_port_dnrequest_info */
412#ifdef mig_external
413mig_external
414#else
415extern
416#endif /* mig_external */
417kern_return_t mach_port_dnrequest_info
418(
419 ipc_space_t task,
420 mach_port_name_t name,
421 unsigned *dnr_total,
422 unsigned *dnr_used
423);
424
425/* Routine mach_port_kernel_object */
426#ifdef mig_external
427mig_external
428#else
429extern
430#endif /* mig_external */
431kern_return_t mach_port_kernel_object
432(
433 ipc_space_read_t task,
434 mach_port_name_t name,
435 unsigned *object_type,
436 unsigned *object_addr
437);
438
439/* Routine mach_port_insert_member */
440#ifdef mig_external
441mig_external
442#else
443extern
444#endif /* mig_external */
445kern_return_t mach_port_insert_member
446(
447 ipc_space_t task,
448 mach_port_name_t name,
449 mach_port_name_t pset
450);
451
452/* Routine mach_port_extract_member */
453#ifdef mig_external
454mig_external
455#else
456extern
457#endif /* mig_external */
458kern_return_t mach_port_extract_member
459(
460 ipc_space_t task,
461 mach_port_name_t name,
462 mach_port_name_t pset
463);
464
465/* Routine mach_port_get_context */
466#ifdef mig_external
467mig_external
468#else
469extern
470#endif /* mig_external */
471kern_return_t mach_port_get_context
472(
473 ipc_space_read_t task,
474 mach_port_name_t name,
475 mach_port_context_t *context
476);
477
478/* Routine mach_port_set_context */
479#ifdef mig_external
480mig_external
481#else
482extern
483#endif /* mig_external */
484kern_return_t mach_port_set_context
485(
486 ipc_space_t task,
487 mach_port_name_t name,
488 mach_port_context_t context
489);
490
491/* Routine mach_port_kobject */
492#ifdef mig_external
493mig_external
494#else
495extern
496#endif /* mig_external */
497kern_return_t mach_port_kobject
498(
499 ipc_space_read_t task,
500 mach_port_name_t name,
501 natural_t *object_type,
502 mach_vm_address_t *object_addr
503);
504
505/* Routine mach_port_construct */
506#ifdef mig_external
507mig_external
508#else
509extern
510#endif /* mig_external */
511kern_return_t mach_port_construct
512(
513 ipc_space_t task,
514 mach_port_options_ptr_t options,
515 mach_port_context_t context,
516 mach_port_name_t *name
517);
518
519/* Routine mach_port_destruct */
520#ifdef mig_external
521mig_external
522#else
523extern
524#endif /* mig_external */
525kern_return_t mach_port_destruct
526(
527 ipc_space_t task,
528 mach_port_name_t name,
529 mach_port_delta_t srdelta,
530 mach_port_context_t guard
531);
532
533/* Routine mach_port_guard */
534#ifdef mig_external
535mig_external
536#else
537extern
538#endif /* mig_external */
539kern_return_t mach_port_guard
540(
541 ipc_space_t task,
542 mach_port_name_t name,
543 mach_port_context_t guard,
544 boolean_t strict
545);
546
547/* Routine mach_port_unguard */
548#ifdef mig_external
549mig_external
550#else
551extern
552#endif /* mig_external */
553kern_return_t mach_port_unguard
554(
555 ipc_space_t task,
556 mach_port_name_t name,
557 mach_port_context_t guard
558);
559
560/* Routine mach_port_space_basic_info */
561#ifdef mig_external
562mig_external
563#else
564extern
565#endif /* mig_external */
566kern_return_t mach_port_space_basic_info
567(
568 ipc_space_inspect_t task,
569 ipc_info_space_basic_t *basic_info
570);
571
572/* Routine mach_port_guard_with_flags */
573#ifdef mig_external
574mig_external
575#else
576extern
577#endif /* mig_external */
578kern_return_t mach_port_guard_with_flags
579(
580 ipc_space_t task,
581 mach_port_name_t name,
582 mach_port_context_t guard,
583 uint64_t flags
584);
585
586/* Routine mach_port_swap_guard */
587#ifdef mig_external
588mig_external
589#else
590extern
591#endif /* mig_external */
592kern_return_t mach_port_swap_guard
593(
594 ipc_space_t task,
595 mach_port_name_t name,
596 mach_port_context_t old_guard,
597 mach_port_context_t new_guard
598);
599
600/* Routine mach_port_kobject_description */
601#ifdef mig_external
602mig_external
603#else
604extern
605#endif /* mig_external */
606kern_return_t mach_port_kobject_description
607(
608 ipc_space_read_t task,
609 mach_port_name_t name,
610 natural_t *object_type,
611 mach_vm_address_t *object_addr,
612 kobject_description_t description
613);
614
615/* Routine mach_port_is_connection_for_service */
616#ifdef mig_external
617mig_external
618#else
619extern
620#endif /* mig_external */
621kern_return_t mach_port_is_connection_for_service
622(
623 ipc_space_t task,
624 mach_port_name_t connection_port,
625 mach_port_name_t service_port,
626 uint64_t *filter_policy_id
627);
628
629/* Routine mach_port_get_service_port_info */
630#ifdef mig_external
631mig_external
632#else
633extern
634#endif /* mig_external */
635kern_return_t mach_port_get_service_port_info
636(
637 ipc_space_read_t task,
638 mach_port_name_t name,
639 mach_service_port_info_data_t *sp_info_out
640);
641
642/* Routine mach_port_assert_attributes */
643#ifdef mig_external
644mig_external
645#else
646extern
647#endif /* mig_external */
648kern_return_t mach_port_assert_attributes
649(
650 ipc_space_t task,
651 mach_port_name_t name,
652 mach_port_flavor_t flavor,
653 mach_port_info_t info,
654 mach_msg_type_number_t infoCnt
655);
656
657__END_DECLS
658
659/********************** Caution **************************/
660/* The following data types should be used to calculate */
661/* maximum message sizes only. The actual message may be */
662/* smaller, and the position of the arguments within the */
663/* message layout may vary from what is presented here. */
664/* For example, if any of the arguments are variable- */
665/* sized, and less than the maximum is sent, the data */
666/* will be packed tight in the actual message to reduce */
667/* the presence of holes. */
668/********************** Caution **************************/
669
670/* typedefs for all requests */
671
672#ifndef __Request__mach_port_subsystem__defined
673#define __Request__mach_port_subsystem__defined
674
675#ifdef __MigPackStructs
676#pragma pack(push, 4)
677#endif
678 typedef struct {
679 mach_msg_header_t Head;
680 } __Request__mach_port_names_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 NDR_record_t NDR;
691 mach_port_name_t name;
692 } __Request__mach_port_type_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 NDR_record_t NDR;
703 mach_port_name_t old_name;
704 mach_port_name_t new_name;
705 } __Request__mach_port_rename_t __attribute__((unused));
706#ifdef __MigPackStructs
707#pragma pack(pop)
708#endif
709
710#ifdef __MigPackStructs
711#pragma pack(push, 4)
712#endif
713 typedef struct {
714 mach_msg_header_t Head;
715 NDR_record_t NDR;
716 mach_port_right_t right;
717 mach_port_name_t name;
718 } __Request__mach_port_allocate_name_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 mach_port_right_t right;
730 } __Request__mach_port_allocate_t __attribute__((unused));
731#ifdef __MigPackStructs
732#pragma pack(pop)
733#endif
734
735#ifdef __MigPackStructs
736#pragma pack(push, 4)
737#endif
738 typedef struct {
739 mach_msg_header_t Head;
740 NDR_record_t NDR;
741 mach_port_name_t name;
742 } __Request__mach_port_destroy_t __attribute__((unused));
743#ifdef __MigPackStructs
744#pragma pack(pop)
745#endif
746
747#ifdef __MigPackStructs
748#pragma pack(push, 4)
749#endif
750 typedef struct {
751 mach_msg_header_t Head;
752 NDR_record_t NDR;
753 mach_port_name_t name;
754 } __Request__mach_port_deallocate_t __attribute__((unused));
755#ifdef __MigPackStructs
756#pragma pack(pop)
757#endif
758
759#ifdef __MigPackStructs
760#pragma pack(push, 4)
761#endif
762 typedef struct {
763 mach_msg_header_t Head;
764 NDR_record_t NDR;
765 mach_port_name_t name;
766 mach_port_right_t right;
767 } __Request__mach_port_get_refs_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 NDR_record_t NDR;
778 mach_port_name_t name;
779 mach_port_right_t right;
780 mach_port_delta_t delta;
781 } __Request__mach_port_mod_refs_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 mach_port_name_t name;
793 mach_msg_trailer_type_t trailer_type;
794 mach_port_seqno_t request_seqnop;
795 mach_msg_type_number_t trailer_infopCnt;
796 } __Request__mach_port_peek_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 mach_port_name_t name;
808 mach_port_mscount_t mscount;
809 } __Request__mach_port_set_mscount_t __attribute__((unused));
810#ifdef __MigPackStructs
811#pragma pack(pop)
812#endif
813
814#ifdef __MigPackStructs
815#pragma pack(push, 4)
816#endif
817 typedef struct {
818 mach_msg_header_t Head;
819 NDR_record_t NDR;
820 mach_port_name_t name;
821 } __Request__mach_port_get_set_status_t __attribute__((unused));
822#ifdef __MigPackStructs
823#pragma pack(pop)
824#endif
825
826#ifdef __MigPackStructs
827#pragma pack(push, 4)
828#endif
829 typedef struct {
830 mach_msg_header_t Head;
831 NDR_record_t NDR;
832 mach_port_name_t member;
833 mach_port_name_t after;
834 } __Request__mach_port_move_member_t __attribute__((unused));
835#ifdef __MigPackStructs
836#pragma pack(pop)
837#endif
838
839#ifdef __MigPackStructs
840#pragma pack(push, 4)
841#endif
842 typedef struct {
843 mach_msg_header_t Head;
844 /* start of the kernel processed data */
845 mach_msg_body_t msgh_body;
846 mach_msg_port_descriptor_t notify;
847 /* end of the kernel processed data */
848 NDR_record_t NDR;
849 mach_port_name_t name;
850 mach_msg_id_t msgid;
851 mach_port_mscount_t sync;
852 } __Request__mach_port_request_notification_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 poly;
865 /* end of the kernel processed data */
866 NDR_record_t NDR;
867 mach_port_name_t name;
868 } __Request__mach_port_insert_right_t __attribute__((unused));
869#ifdef __MigPackStructs
870#pragma pack(pop)
871#endif
872
873#ifdef __MigPackStructs
874#pragma pack(push, 4)
875#endif
876 typedef struct {
877 mach_msg_header_t Head;
878 NDR_record_t NDR;
879 mach_port_name_t name;
880 mach_msg_type_name_t msgt_name;
881 } __Request__mach_port_extract_right_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 NDR_record_t NDR;
892 mach_port_name_t name;
893 mach_port_seqno_t seqno;
894 } __Request__mach_port_set_seqno_t __attribute__((unused));
895#ifdef __MigPackStructs
896#pragma pack(pop)
897#endif
898
899#ifdef __MigPackStructs
900#pragma pack(push, 4)
901#endif
902 typedef struct {
903 mach_msg_header_t Head;
904 NDR_record_t NDR;
905 mach_port_name_t name;
906 mach_port_flavor_t flavor;
907 mach_msg_type_number_t port_info_outCnt;
908 } __Request__mach_port_get_attributes_t __attribute__((unused));
909#ifdef __MigPackStructs
910#pragma pack(pop)
911#endif
912
913#ifdef __MigPackStructs
914#pragma pack(push, 4)
915#endif
916 typedef struct {
917 mach_msg_header_t Head;
918 NDR_record_t NDR;
919 mach_port_name_t name;
920 mach_port_flavor_t flavor;
921 mach_msg_type_number_t port_infoCnt;
922 integer_t port_info[17];
923 } __Request__mach_port_set_attributes_t __attribute__((unused));
924#ifdef __MigPackStructs
925#pragma pack(pop)
926#endif
927
928#ifdef __MigPackStructs
929#pragma pack(push, 4)
930#endif
931 typedef struct {
932 mach_msg_header_t Head;
933 NDR_record_t NDR;
934 mach_port_right_t right;
935 mach_port_qos_t qos;
936 } __Request__mach_port_allocate_qos_t __attribute__((unused));
937#ifdef __MigPackStructs
938#pragma pack(pop)
939#endif
940
941#ifdef __MigPackStructs
942#pragma pack(push, 4)
943#endif
944 typedef struct {
945 mach_msg_header_t Head;
946 /* start of the kernel processed data */
947 mach_msg_body_t msgh_body;
948 mach_msg_port_descriptor_t proto;
949 /* end of the kernel processed data */
950 NDR_record_t NDR;
951 mach_port_right_t right;
952 mach_port_qos_t qos;
953 mach_port_name_t name;
954 } __Request__mach_port_allocate_full_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 NDR_record_t NDR;
965 int table_entries;
966 } __Request__task_set_port_space_t __attribute__((unused));
967#ifdef __MigPackStructs
968#pragma pack(pop)
969#endif
970
971#ifdef __MigPackStructs
972#pragma pack(push, 4)
973#endif
974 typedef struct {
975 mach_msg_header_t Head;
976 NDR_record_t NDR;
977 mach_port_name_t name;
978 } __Request__mach_port_get_srights_t __attribute__((unused));
979#ifdef __MigPackStructs
980#pragma pack(pop)
981#endif
982
983#ifdef __MigPackStructs
984#pragma pack(push, 4)
985#endif
986 typedef struct {
987 mach_msg_header_t Head;
988 } __Request__mach_port_space_info_t __attribute__((unused));
989#ifdef __MigPackStructs
990#pragma pack(pop)
991#endif
992
993#ifdef __MigPackStructs
994#pragma pack(push, 4)
995#endif
996 typedef struct {
997 mach_msg_header_t Head;
998 NDR_record_t NDR;
999 mach_port_name_t name;
1000 } __Request__mach_port_dnrequest_info_t __attribute__((unused));
1001#ifdef __MigPackStructs
1002#pragma pack(pop)
1003#endif
1004
1005#ifdef __MigPackStructs
1006#pragma pack(push, 4)
1007#endif
1008 typedef struct {
1009 mach_msg_header_t Head;
1010 NDR_record_t NDR;
1011 mach_port_name_t name;
1012 } __Request__mach_port_kernel_object_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 mach_port_name_t name;
1024 mach_port_name_t pset;
1025 } __Request__mach_port_insert_member_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 mach_port_name_t name;
1037 mach_port_name_t pset;
1038 } __Request__mach_port_extract_member_t __attribute__((unused));
1039#ifdef __MigPackStructs
1040#pragma pack(pop)
1041#endif
1042
1043#ifdef __MigPackStructs
1044#pragma pack(push, 4)
1045#endif
1046 typedef struct {
1047 mach_msg_header_t Head;
1048 NDR_record_t NDR;
1049 mach_port_name_t name;
1050 } __Request__mach_port_get_context_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 mach_port_name_t name;
1062 mach_port_context_t context;
1063 } __Request__mach_port_set_context_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 mach_port_name_t name;
1075 } __Request__mach_port_kobject_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 /* start of the kernel processed data */
1086 mach_msg_body_t msgh_body;
1087 mach_msg_ool_descriptor_t options;
1088 /* end of the kernel processed data */
1089 NDR_record_t NDR;
1090 mach_port_context_t context;
1091 } __Request__mach_port_construct_t __attribute__((unused));
1092#ifdef __MigPackStructs
1093#pragma pack(pop)
1094#endif
1095
1096#ifdef __MigPackStructs
1097#pragma pack(push, 4)
1098#endif
1099 typedef struct {
1100 mach_msg_header_t Head;
1101 NDR_record_t NDR;
1102 mach_port_name_t name;
1103 mach_port_delta_t srdelta;
1104 mach_port_context_t guard;
1105 } __Request__mach_port_destruct_t __attribute__((unused));
1106#ifdef __MigPackStructs
1107#pragma pack(pop)
1108#endif
1109
1110#ifdef __MigPackStructs
1111#pragma pack(push, 4)
1112#endif
1113 typedef struct {
1114 mach_msg_header_t Head;
1115 NDR_record_t NDR;
1116 mach_port_name_t name;
1117 mach_port_context_t guard;
1118 boolean_t strict;
1119 } __Request__mach_port_guard_t __attribute__((unused));
1120#ifdef __MigPackStructs
1121#pragma pack(pop)
1122#endif
1123
1124#ifdef __MigPackStructs
1125#pragma pack(push, 4)
1126#endif
1127 typedef struct {
1128 mach_msg_header_t Head;
1129 NDR_record_t NDR;
1130 mach_port_name_t name;
1131 mach_port_context_t guard;
1132 } __Request__mach_port_unguard_t __attribute__((unused));
1133#ifdef __MigPackStructs
1134#pragma pack(pop)
1135#endif
1136
1137#ifdef __MigPackStructs
1138#pragma pack(push, 4)
1139#endif
1140 typedef struct {
1141 mach_msg_header_t Head;
1142 } __Request__mach_port_space_basic_info_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 mach_port_name_t name;
1154 mach_port_context_t guard;
1155 uint64_t flags;
1156 } __Request__mach_port_guard_with_flags_t __attribute__((unused));
1157#ifdef __MigPackStructs
1158#pragma pack(pop)
1159#endif
1160
1161#ifdef __MigPackStructs
1162#pragma pack(push, 4)
1163#endif
1164 typedef struct {
1165 mach_msg_header_t Head;
1166 NDR_record_t NDR;
1167 mach_port_name_t name;
1168 mach_port_context_t old_guard;
1169 mach_port_context_t new_guard;
1170 } __Request__mach_port_swap_guard_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 mach_port_name_t name;
1182 } __Request__mach_port_kobject_description_t __attribute__((unused));
1183#ifdef __MigPackStructs
1184#pragma pack(pop)
1185#endif
1186
1187#ifdef __MigPackStructs
1188#pragma pack(push, 4)
1189#endif
1190 typedef struct {
1191 mach_msg_header_t Head;
1192 NDR_record_t NDR;
1193 mach_port_name_t connection_port;
1194 mach_port_name_t service_port;
1195 } __Request__mach_port_is_connection_for_service_t __attribute__((unused));
1196#ifdef __MigPackStructs
1197#pragma pack(pop)
1198#endif
1199
1200#ifdef __MigPackStructs
1201#pragma pack(push, 4)
1202#endif
1203 typedef struct {
1204 mach_msg_header_t Head;
1205 NDR_record_t NDR;
1206 mach_port_name_t name;
1207 } __Request__mach_port_get_service_port_info_t __attribute__((unused));
1208#ifdef __MigPackStructs
1209#pragma pack(pop)
1210#endif
1211
1212#ifdef __MigPackStructs
1213#pragma pack(push, 4)
1214#endif
1215 typedef struct {
1216 mach_msg_header_t Head;
1217 NDR_record_t NDR;
1218 mach_port_name_t name;
1219 mach_port_flavor_t flavor;
1220 mach_msg_type_number_t infoCnt;
1221 integer_t info[17];
1222 } __Request__mach_port_assert_attributes_t __attribute__((unused));
1223#ifdef __MigPackStructs
1224#pragma pack(pop)
1225#endif
1226#endif /* !__Request__mach_port_subsystem__defined */
1227
1228/* union of all requests */
1229
1230#ifndef __RequestUnion__mach_port_subsystem__defined
1231#define __RequestUnion__mach_port_subsystem__defined
1232union __RequestUnion__mach_port_subsystem {
1233 __Request__mach_port_names_t Request_mach_port_names;
1234 __Request__mach_port_type_t Request_mach_port_type;
1235 __Request__mach_port_rename_t Request_mach_port_rename;
1236 __Request__mach_port_allocate_name_t Request_mach_port_allocate_name;
1237 __Request__mach_port_allocate_t Request_mach_port_allocate;
1238 __Request__mach_port_destroy_t Request_mach_port_destroy;
1239 __Request__mach_port_deallocate_t Request_mach_port_deallocate;
1240 __Request__mach_port_get_refs_t Request_mach_port_get_refs;
1241 __Request__mach_port_mod_refs_t Request_mach_port_mod_refs;
1242 __Request__mach_port_peek_t Request_mach_port_peek;
1243 __Request__mach_port_set_mscount_t Request_mach_port_set_mscount;
1244 __Request__mach_port_get_set_status_t Request_mach_port_get_set_status;
1245 __Request__mach_port_move_member_t Request_mach_port_move_member;
1246 __Request__mach_port_request_notification_t Request_mach_port_request_notification;
1247 __Request__mach_port_insert_right_t Request_mach_port_insert_right;
1248 __Request__mach_port_extract_right_t Request_mach_port_extract_right;
1249 __Request__mach_port_set_seqno_t Request_mach_port_set_seqno;
1250 __Request__mach_port_get_attributes_t Request_mach_port_get_attributes;
1251 __Request__mach_port_set_attributes_t Request_mach_port_set_attributes;
1252 __Request__mach_port_allocate_qos_t Request_mach_port_allocate_qos;
1253 __Request__mach_port_allocate_full_t Request_mach_port_allocate_full;
1254 __Request__task_set_port_space_t Request_task_set_port_space;
1255 __Request__mach_port_get_srights_t Request_mach_port_get_srights;
1256 __Request__mach_port_space_info_t Request_mach_port_space_info;
1257 __Request__mach_port_dnrequest_info_t Request_mach_port_dnrequest_info;
1258 __Request__mach_port_kernel_object_t Request_mach_port_kernel_object;
1259 __Request__mach_port_insert_member_t Request_mach_port_insert_member;
1260 __Request__mach_port_extract_member_t Request_mach_port_extract_member;
1261 __Request__mach_port_get_context_t Request_mach_port_get_context;
1262 __Request__mach_port_set_context_t Request_mach_port_set_context;
1263 __Request__mach_port_kobject_t Request_mach_port_kobject;
1264 __Request__mach_port_construct_t Request_mach_port_construct;
1265 __Request__mach_port_destruct_t Request_mach_port_destruct;
1266 __Request__mach_port_guard_t Request_mach_port_guard;
1267 __Request__mach_port_unguard_t Request_mach_port_unguard;
1268 __Request__mach_port_space_basic_info_t Request_mach_port_space_basic_info;
1269 __Request__mach_port_guard_with_flags_t Request_mach_port_guard_with_flags;
1270 __Request__mach_port_swap_guard_t Request_mach_port_swap_guard;
1271 __Request__mach_port_kobject_description_t Request_mach_port_kobject_description;
1272 __Request__mach_port_is_connection_for_service_t Request_mach_port_is_connection_for_service;
1273 __Request__mach_port_get_service_port_info_t Request_mach_port_get_service_port_info;
1274 __Request__mach_port_assert_attributes_t Request_mach_port_assert_attributes;
1275};
1276#endif /* !__RequestUnion__mach_port_subsystem__defined */
1277/* typedefs for all replies */
1278
1279#ifndef __Reply__mach_port_subsystem__defined
1280#define __Reply__mach_port_subsystem__defined
1281
1282#ifdef __MigPackStructs
1283#pragma pack(push, 4)
1284#endif
1285 typedef struct {
1286 mach_msg_header_t Head;
1287 /* start of the kernel processed data */
1288 mach_msg_body_t msgh_body;
1289 mach_msg_ool_descriptor_t names;
1290 mach_msg_ool_descriptor_t types;
1291 /* end of the kernel processed data */
1292 NDR_record_t NDR;
1293 mach_msg_type_number_t namesCnt;
1294 mach_msg_type_number_t typesCnt;
1295 } __Reply__mach_port_names_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 mach_port_type_t ptype;
1308 } __Reply__mach_port_type_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 kern_return_t RetCode;
1320 } __Reply__mach_port_rename_t __attribute__((unused));
1321#ifdef __MigPackStructs
1322#pragma pack(pop)
1323#endif
1324
1325#ifdef __MigPackStructs
1326#pragma pack(push, 4)
1327#endif
1328 typedef struct {
1329 mach_msg_header_t Head;
1330 NDR_record_t NDR;
1331 kern_return_t RetCode;
1332 } __Reply__mach_port_allocate_name_t __attribute__((unused));
1333#ifdef __MigPackStructs
1334#pragma pack(pop)
1335#endif
1336
1337#ifdef __MigPackStructs
1338#pragma pack(push, 4)
1339#endif
1340 typedef struct {
1341 mach_msg_header_t Head;
1342 NDR_record_t NDR;
1343 kern_return_t RetCode;
1344 mach_port_name_t name;
1345 } __Reply__mach_port_allocate_t __attribute__((unused));
1346#ifdef __MigPackStructs
1347#pragma pack(pop)
1348#endif
1349
1350#ifdef __MigPackStructs
1351#pragma pack(push, 4)
1352#endif
1353 typedef struct {
1354 mach_msg_header_t Head;
1355 NDR_record_t NDR;
1356 kern_return_t RetCode;
1357 } __Reply__mach_port_destroy_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 NDR_record_t NDR;
1368 kern_return_t RetCode;
1369 } __Reply__mach_port_deallocate_t __attribute__((unused));
1370#ifdef __MigPackStructs
1371#pragma pack(pop)
1372#endif
1373
1374#ifdef __MigPackStructs
1375#pragma pack(push, 4)
1376#endif
1377 typedef struct {
1378 mach_msg_header_t Head;
1379 NDR_record_t NDR;
1380 kern_return_t RetCode;
1381 mach_port_urefs_t refs;
1382 } __Reply__mach_port_get_refs_t __attribute__((unused));
1383#ifdef __MigPackStructs
1384#pragma pack(pop)
1385#endif
1386
1387#ifdef __MigPackStructs
1388#pragma pack(push, 4)
1389#endif
1390 typedef struct {
1391 mach_msg_header_t Head;
1392 NDR_record_t NDR;
1393 kern_return_t RetCode;
1394 } __Reply__mach_port_mod_refs_t __attribute__((unused));
1395#ifdef __MigPackStructs
1396#pragma pack(pop)
1397#endif
1398
1399#ifdef __MigPackStructs
1400#pragma pack(push, 4)
1401#endif
1402 typedef struct {
1403 mach_msg_header_t Head;
1404 NDR_record_t NDR;
1405 kern_return_t RetCode;
1406 mach_port_seqno_t request_seqnop;
1407 mach_msg_size_t msg_sizep;
1408 mach_msg_id_t msg_idp;
1409 mach_msg_type_number_t trailer_infopCnt;
1410 char trailer_infop[68];
1411 } __Reply__mach_port_peek_t __attribute__((unused));
1412#ifdef __MigPackStructs
1413#pragma pack(pop)
1414#endif
1415
1416#ifdef __MigPackStructs
1417#pragma pack(push, 4)
1418#endif
1419 typedef struct {
1420 mach_msg_header_t Head;
1421 NDR_record_t NDR;
1422 kern_return_t RetCode;
1423 } __Reply__mach_port_set_mscount_t __attribute__((unused));
1424#ifdef __MigPackStructs
1425#pragma pack(pop)
1426#endif
1427
1428#ifdef __MigPackStructs
1429#pragma pack(push, 4)
1430#endif
1431 typedef struct {
1432 mach_msg_header_t Head;
1433 /* start of the kernel processed data */
1434 mach_msg_body_t msgh_body;
1435 mach_msg_ool_descriptor_t members;
1436 /* end of the kernel processed data */
1437 NDR_record_t NDR;
1438 mach_msg_type_number_t membersCnt;
1439 } __Reply__mach_port_get_set_status_t __attribute__((unused));
1440#ifdef __MigPackStructs
1441#pragma pack(pop)
1442#endif
1443
1444#ifdef __MigPackStructs
1445#pragma pack(push, 4)
1446#endif
1447 typedef struct {
1448 mach_msg_header_t Head;
1449 NDR_record_t NDR;
1450 kern_return_t RetCode;
1451 } __Reply__mach_port_move_member_t __attribute__((unused));
1452#ifdef __MigPackStructs
1453#pragma pack(pop)
1454#endif
1455
1456#ifdef __MigPackStructs
1457#pragma pack(push, 4)
1458#endif
1459 typedef struct {
1460 mach_msg_header_t Head;
1461 /* start of the kernel processed data */
1462 mach_msg_body_t msgh_body;
1463 mach_msg_port_descriptor_t previous;
1464 /* end of the kernel processed data */
1465 } __Reply__mach_port_request_notification_t __attribute__((unused));
1466#ifdef __MigPackStructs
1467#pragma pack(pop)
1468#endif
1469
1470#ifdef __MigPackStructs
1471#pragma pack(push, 4)
1472#endif
1473 typedef struct {
1474 mach_msg_header_t Head;
1475 NDR_record_t NDR;
1476 kern_return_t RetCode;
1477 } __Reply__mach_port_insert_right_t __attribute__((unused));
1478#ifdef __MigPackStructs
1479#pragma pack(pop)
1480#endif
1481
1482#ifdef __MigPackStructs
1483#pragma pack(push, 4)
1484#endif
1485 typedef struct {
1486 mach_msg_header_t Head;
1487 /* start of the kernel processed data */
1488 mach_msg_body_t msgh_body;
1489 mach_msg_port_descriptor_t poly;
1490 /* end of the kernel processed data */
1491 } __Reply__mach_port_extract_right_t __attribute__((unused));
1492#ifdef __MigPackStructs
1493#pragma pack(pop)
1494#endif
1495
1496#ifdef __MigPackStructs
1497#pragma pack(push, 4)
1498#endif
1499 typedef struct {
1500 mach_msg_header_t Head;
1501 NDR_record_t NDR;
1502 kern_return_t RetCode;
1503 } __Reply__mach_port_set_seqno_t __attribute__((unused));
1504#ifdef __MigPackStructs
1505#pragma pack(pop)
1506#endif
1507
1508#ifdef __MigPackStructs
1509#pragma pack(push, 4)
1510#endif
1511 typedef struct {
1512 mach_msg_header_t Head;
1513 NDR_record_t NDR;
1514 kern_return_t RetCode;
1515 mach_msg_type_number_t port_info_outCnt;
1516 integer_t port_info_out[17];
1517 } __Reply__mach_port_get_attributes_t __attribute__((unused));
1518#ifdef __MigPackStructs
1519#pragma pack(pop)
1520#endif
1521
1522#ifdef __MigPackStructs
1523#pragma pack(push, 4)
1524#endif
1525 typedef struct {
1526 mach_msg_header_t Head;
1527 NDR_record_t NDR;
1528 kern_return_t RetCode;
1529 } __Reply__mach_port_set_attributes_t __attribute__((unused));
1530#ifdef __MigPackStructs
1531#pragma pack(pop)
1532#endif
1533
1534#ifdef __MigPackStructs
1535#pragma pack(push, 4)
1536#endif
1537 typedef struct {
1538 mach_msg_header_t Head;
1539 NDR_record_t NDR;
1540 kern_return_t RetCode;
1541 mach_port_qos_t qos;
1542 mach_port_name_t name;
1543 } __Reply__mach_port_allocate_qos_t __attribute__((unused));
1544#ifdef __MigPackStructs
1545#pragma pack(pop)
1546#endif
1547
1548#ifdef __MigPackStructs
1549#pragma pack(push, 4)
1550#endif
1551 typedef struct {
1552 mach_msg_header_t Head;
1553 NDR_record_t NDR;
1554 kern_return_t RetCode;
1555 mach_port_qos_t qos;
1556 mach_port_name_t name;
1557 } __Reply__mach_port_allocate_full_t __attribute__((unused));
1558#ifdef __MigPackStructs
1559#pragma pack(pop)
1560#endif
1561
1562#ifdef __MigPackStructs
1563#pragma pack(push, 4)
1564#endif
1565 typedef struct {
1566 mach_msg_header_t Head;
1567 NDR_record_t NDR;
1568 kern_return_t RetCode;
1569 } __Reply__task_set_port_space_t __attribute__((unused));
1570#ifdef __MigPackStructs
1571#pragma pack(pop)
1572#endif
1573
1574#ifdef __MigPackStructs
1575#pragma pack(push, 4)
1576#endif
1577 typedef struct {
1578 mach_msg_header_t Head;
1579 NDR_record_t NDR;
1580 kern_return_t RetCode;
1581 mach_port_rights_t srights;
1582 } __Reply__mach_port_get_srights_t __attribute__((unused));
1583#ifdef __MigPackStructs
1584#pragma pack(pop)
1585#endif
1586
1587#ifdef __MigPackStructs
1588#pragma pack(push, 4)
1589#endif
1590 typedef struct {
1591 mach_msg_header_t Head;
1592 /* start of the kernel processed data */
1593 mach_msg_body_t msgh_body;
1594 mach_msg_ool_descriptor_t table_info;
1595 mach_msg_ool_descriptor_t tree_info;
1596 /* end of the kernel processed data */
1597 NDR_record_t NDR;
1598 ipc_info_space_t space_info;
1599 mach_msg_type_number_t table_infoCnt;
1600 mach_msg_type_number_t tree_infoCnt;
1601 } __Reply__mach_port_space_info_t __attribute__((unused));
1602#ifdef __MigPackStructs
1603#pragma pack(pop)
1604#endif
1605
1606#ifdef __MigPackStructs
1607#pragma pack(push, 4)
1608#endif
1609 typedef struct {
1610 mach_msg_header_t Head;
1611 NDR_record_t NDR;
1612 kern_return_t RetCode;
1613 unsigned dnr_total;
1614 unsigned dnr_used;
1615 } __Reply__mach_port_dnrequest_info_t __attribute__((unused));
1616#ifdef __MigPackStructs
1617#pragma pack(pop)
1618#endif
1619
1620#ifdef __MigPackStructs
1621#pragma pack(push, 4)
1622#endif
1623 typedef struct {
1624 mach_msg_header_t Head;
1625 NDR_record_t NDR;
1626 kern_return_t RetCode;
1627 unsigned object_type;
1628 unsigned object_addr;
1629 } __Reply__mach_port_kernel_object_t __attribute__((unused));
1630#ifdef __MigPackStructs
1631#pragma pack(pop)
1632#endif
1633
1634#ifdef __MigPackStructs
1635#pragma pack(push, 4)
1636#endif
1637 typedef struct {
1638 mach_msg_header_t Head;
1639 NDR_record_t NDR;
1640 kern_return_t RetCode;
1641 } __Reply__mach_port_insert_member_t __attribute__((unused));
1642#ifdef __MigPackStructs
1643#pragma pack(pop)
1644#endif
1645
1646#ifdef __MigPackStructs
1647#pragma pack(push, 4)
1648#endif
1649 typedef struct {
1650 mach_msg_header_t Head;
1651 NDR_record_t NDR;
1652 kern_return_t RetCode;
1653 } __Reply__mach_port_extract_member_t __attribute__((unused));
1654#ifdef __MigPackStructs
1655#pragma pack(pop)
1656#endif
1657
1658#ifdef __MigPackStructs
1659#pragma pack(push, 4)
1660#endif
1661 typedef struct {
1662 mach_msg_header_t Head;
1663 NDR_record_t NDR;
1664 kern_return_t RetCode;
1665 mach_port_context_t context;
1666 } __Reply__mach_port_get_context_t __attribute__((unused));
1667#ifdef __MigPackStructs
1668#pragma pack(pop)
1669#endif
1670
1671#ifdef __MigPackStructs
1672#pragma pack(push, 4)
1673#endif
1674 typedef struct {
1675 mach_msg_header_t Head;
1676 NDR_record_t NDR;
1677 kern_return_t RetCode;
1678 } __Reply__mach_port_set_context_t __attribute__((unused));
1679#ifdef __MigPackStructs
1680#pragma pack(pop)
1681#endif
1682
1683#ifdef __MigPackStructs
1684#pragma pack(push, 4)
1685#endif
1686 typedef struct {
1687 mach_msg_header_t Head;
1688 NDR_record_t NDR;
1689 kern_return_t RetCode;
1690 natural_t object_type;
1691 mach_vm_address_t object_addr;
1692 } __Reply__mach_port_kobject_t __attribute__((unused));
1693#ifdef __MigPackStructs
1694#pragma pack(pop)
1695#endif
1696
1697#ifdef __MigPackStructs
1698#pragma pack(push, 4)
1699#endif
1700 typedef struct {
1701 mach_msg_header_t Head;
1702 NDR_record_t NDR;
1703 kern_return_t RetCode;
1704 mach_port_name_t name;
1705 } __Reply__mach_port_construct_t __attribute__((unused));
1706#ifdef __MigPackStructs
1707#pragma pack(pop)
1708#endif
1709
1710#ifdef __MigPackStructs
1711#pragma pack(push, 4)
1712#endif
1713 typedef struct {
1714 mach_msg_header_t Head;
1715 NDR_record_t NDR;
1716 kern_return_t RetCode;
1717 } __Reply__mach_port_destruct_t __attribute__((unused));
1718#ifdef __MigPackStructs
1719#pragma pack(pop)
1720#endif
1721
1722#ifdef __MigPackStructs
1723#pragma pack(push, 4)
1724#endif
1725 typedef struct {
1726 mach_msg_header_t Head;
1727 NDR_record_t NDR;
1728 kern_return_t RetCode;
1729 } __Reply__mach_port_guard_t __attribute__((unused));
1730#ifdef __MigPackStructs
1731#pragma pack(pop)
1732#endif
1733
1734#ifdef __MigPackStructs
1735#pragma pack(push, 4)
1736#endif
1737 typedef struct {
1738 mach_msg_header_t Head;
1739 NDR_record_t NDR;
1740 kern_return_t RetCode;
1741 } __Reply__mach_port_unguard_t __attribute__((unused));
1742#ifdef __MigPackStructs
1743#pragma pack(pop)
1744#endif
1745
1746#ifdef __MigPackStructs
1747#pragma pack(push, 4)
1748#endif
1749 typedef struct {
1750 mach_msg_header_t Head;
1751 NDR_record_t NDR;
1752 kern_return_t RetCode;
1753 ipc_info_space_basic_t basic_info;
1754 } __Reply__mach_port_space_basic_info_t __attribute__((unused));
1755#ifdef __MigPackStructs
1756#pragma pack(pop)
1757#endif
1758
1759#ifdef __MigPackStructs
1760#pragma pack(push, 4)
1761#endif
1762 typedef struct {
1763 mach_msg_header_t Head;
1764 NDR_record_t NDR;
1765 kern_return_t RetCode;
1766 } __Reply__mach_port_guard_with_flags_t __attribute__((unused));
1767#ifdef __MigPackStructs
1768#pragma pack(pop)
1769#endif
1770
1771#ifdef __MigPackStructs
1772#pragma pack(push, 4)
1773#endif
1774 typedef struct {
1775 mach_msg_header_t Head;
1776 NDR_record_t NDR;
1777 kern_return_t RetCode;
1778 } __Reply__mach_port_swap_guard_t __attribute__((unused));
1779#ifdef __MigPackStructs
1780#pragma pack(pop)
1781#endif
1782
1783#ifdef __MigPackStructs
1784#pragma pack(push, 4)
1785#endif
1786 typedef struct {
1787 mach_msg_header_t Head;
1788 NDR_record_t NDR;
1789 kern_return_t RetCode;
1790 natural_t object_type;
1791 mach_vm_address_t object_addr;
1792 mach_msg_type_number_t descriptionOffset; /* MiG doesn't use it */
1793 mach_msg_type_number_t descriptionCnt;
1794 char description[512];
1795 } __Reply__mach_port_kobject_description_t __attribute__((unused));
1796#ifdef __MigPackStructs
1797#pragma pack(pop)
1798#endif
1799
1800#ifdef __MigPackStructs
1801#pragma pack(push, 4)
1802#endif
1803 typedef struct {
1804 mach_msg_header_t Head;
1805 NDR_record_t NDR;
1806 kern_return_t RetCode;
1807 uint64_t filter_policy_id;
1808 } __Reply__mach_port_is_connection_for_service_t __attribute__((unused));
1809#ifdef __MigPackStructs
1810#pragma pack(pop)
1811#endif
1812
1813#ifdef __MigPackStructs
1814#pragma pack(push, 4)
1815#endif
1816 typedef struct {
1817 mach_msg_header_t Head;
1818 NDR_record_t NDR;
1819 kern_return_t RetCode;
1820 mach_service_port_info_data_t sp_info_out;
1821 } __Reply__mach_port_get_service_port_info_t __attribute__((unused));
1822#ifdef __MigPackStructs
1823#pragma pack(pop)
1824#endif
1825
1826#ifdef __MigPackStructs
1827#pragma pack(push, 4)
1828#endif
1829 typedef struct {
1830 mach_msg_header_t Head;
1831 NDR_record_t NDR;
1832 kern_return_t RetCode;
1833 } __Reply__mach_port_assert_attributes_t __attribute__((unused));
1834#ifdef __MigPackStructs
1835#pragma pack(pop)
1836#endif
1837#endif /* !__Reply__mach_port_subsystem__defined */
1838
1839/* union of all replies */
1840
1841#ifndef __ReplyUnion__mach_port_subsystem__defined
1842#define __ReplyUnion__mach_port_subsystem__defined
1843union __ReplyUnion__mach_port_subsystem {
1844 __Reply__mach_port_names_t Reply_mach_port_names;
1845 __Reply__mach_port_type_t Reply_mach_port_type;
1846 __Reply__mach_port_rename_t Reply_mach_port_rename;
1847 __Reply__mach_port_allocate_name_t Reply_mach_port_allocate_name;
1848 __Reply__mach_port_allocate_t Reply_mach_port_allocate;
1849 __Reply__mach_port_destroy_t Reply_mach_port_destroy;
1850 __Reply__mach_port_deallocate_t Reply_mach_port_deallocate;
1851 __Reply__mach_port_get_refs_t Reply_mach_port_get_refs;
1852 __Reply__mach_port_mod_refs_t Reply_mach_port_mod_refs;
1853 __Reply__mach_port_peek_t Reply_mach_port_peek;
1854 __Reply__mach_port_set_mscount_t Reply_mach_port_set_mscount;
1855 __Reply__mach_port_get_set_status_t Reply_mach_port_get_set_status;
1856 __Reply__mach_port_move_member_t Reply_mach_port_move_member;
1857 __Reply__mach_port_request_notification_t Reply_mach_port_request_notification;
1858 __Reply__mach_port_insert_right_t Reply_mach_port_insert_right;
1859 __Reply__mach_port_extract_right_t Reply_mach_port_extract_right;
1860 __Reply__mach_port_set_seqno_t Reply_mach_port_set_seqno;
1861 __Reply__mach_port_get_attributes_t Reply_mach_port_get_attributes;
1862 __Reply__mach_port_set_attributes_t Reply_mach_port_set_attributes;
1863 __Reply__mach_port_allocate_qos_t Reply_mach_port_allocate_qos;
1864 __Reply__mach_port_allocate_full_t Reply_mach_port_allocate_full;
1865 __Reply__task_set_port_space_t Reply_task_set_port_space;
1866 __Reply__mach_port_get_srights_t Reply_mach_port_get_srights;
1867 __Reply__mach_port_space_info_t Reply_mach_port_space_info;
1868 __Reply__mach_port_dnrequest_info_t Reply_mach_port_dnrequest_info;
1869 __Reply__mach_port_kernel_object_t Reply_mach_port_kernel_object;
1870 __Reply__mach_port_insert_member_t Reply_mach_port_insert_member;
1871 __Reply__mach_port_extract_member_t Reply_mach_port_extract_member;
1872 __Reply__mach_port_get_context_t Reply_mach_port_get_context;
1873 __Reply__mach_port_set_context_t Reply_mach_port_set_context;
1874 __Reply__mach_port_kobject_t Reply_mach_port_kobject;
1875 __Reply__mach_port_construct_t Reply_mach_port_construct;
1876 __Reply__mach_port_destruct_t Reply_mach_port_destruct;
1877 __Reply__mach_port_guard_t Reply_mach_port_guard;
1878 __Reply__mach_port_unguard_t Reply_mach_port_unguard;
1879 __Reply__mach_port_space_basic_info_t Reply_mach_port_space_basic_info;
1880 __Reply__mach_port_guard_with_flags_t Reply_mach_port_guard_with_flags;
1881 __Reply__mach_port_swap_guard_t Reply_mach_port_swap_guard;
1882 __Reply__mach_port_kobject_description_t Reply_mach_port_kobject_description;
1883 __Reply__mach_port_is_connection_for_service_t Reply_mach_port_is_connection_for_service;
1884 __Reply__mach_port_get_service_port_info_t Reply_mach_port_get_service_port_info;
1885 __Reply__mach_port_assert_attributes_t Reply_mach_port_assert_attributes;
1886};
1887#endif /* !__RequestUnion__mach_port_subsystem__defined */
1888
1889#ifndef subsystem_to_name_map_mach_port
1890#define subsystem_to_name_map_mach_port \
1891 { "mach_port_names", 3200 },\
1892 { "mach_port_type", 3201 },\
1893 { "mach_port_rename", 3202 },\
1894 { "mach_port_allocate_name", 3203 },\
1895 { "mach_port_allocate", 3204 },\
1896 { "mach_port_destroy", 3205 },\
1897 { "mach_port_deallocate", 3206 },\
1898 { "mach_port_get_refs", 3207 },\
1899 { "mach_port_mod_refs", 3208 },\
1900 { "mach_port_peek", 3209 },\
1901 { "mach_port_set_mscount", 3210 },\
1902 { "mach_port_get_set_status", 3211 },\
1903 { "mach_port_move_member", 3212 },\
1904 { "mach_port_request_notification", 3213 },\
1905 { "mach_port_insert_right", 3214 },\
1906 { "mach_port_extract_right", 3215 },\
1907 { "mach_port_set_seqno", 3216 },\
1908 { "mach_port_get_attributes", 3217 },\
1909 { "mach_port_set_attributes", 3218 },\
1910 { "mach_port_allocate_qos", 3219 },\
1911 { "mach_port_allocate_full", 3220 },\
1912 { "task_set_port_space", 3221 },\
1913 { "mach_port_get_srights", 3222 },\
1914 { "mach_port_space_info", 3223 },\
1915 { "mach_port_dnrequest_info", 3224 },\
1916 { "mach_port_kernel_object", 3225 },\
1917 { "mach_port_insert_member", 3226 },\
1918 { "mach_port_extract_member", 3227 },\
1919 { "mach_port_get_context", 3228 },\
1920 { "mach_port_set_context", 3229 },\
1921 { "mach_port_kobject", 3230 },\
1922 { "mach_port_construct", 3231 },\
1923 { "mach_port_destruct", 3232 },\
1924 { "mach_port_guard", 3233 },\
1925 { "mach_port_unguard", 3234 },\
1926 { "mach_port_space_basic_info", 3235 },\
1927 { "mach_port_guard_with_flags", 3237 },\
1928 { "mach_port_swap_guard", 3238 },\
1929 { "mach_port_kobject_description", 3239 },\
1930 { "mach_port_is_connection_for_service", 3240 },\
1931 { "mach_port_get_service_port_info", 3241 },\
1932 { "mach_port_assert_attributes", 3242 }
1933#endif
1934
1935#ifdef __AfterMigUserHeader
1936__AfterMigUserHeader
1937#endif /* __AfterMigUserHeader */
1938
1939#endif /* _mach_port_user_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/mach_voucher_types.h created+246
......@@ -0,0 +1,246 @@
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#include <mach/message.h>
35
36/*
37 * Mach Voucher - an immutable collection of attribute value handles.
38 *
39 * The mach voucher is such that it can be passed between processes
40 * as a Mach port send right (by convention in the mach_msg_header_t’s
41 * msgh_voucher field).
42 *
43 * You may construct a new mach voucher by passing a construction
44 * recipe to host_create_mach_voucher(). The construction recipe supports
45 * generic commands for copying, removing, and redeeming attribute value
46 * handles from previous vouchers, or running attribute-mananger-specific
47 * commands within the recipe.
48 *
49 * Once the set of attribute value handles is constructed and returned,
50 * that set will not change for the life of the voucher (just because the
51 * attribute value handle itself doesn't change, the value the handle refers
52 * to is free to change at will).
53 */
54typedef mach_port_t mach_voucher_t;
55#define MACH_VOUCHER_NULL ((mach_voucher_t) 0)
56
57typedef mach_port_name_t mach_voucher_name_t;
58#define MACH_VOUCHER_NAME_NULL ((mach_voucher_name_t) 0)
59
60typedef mach_voucher_name_t *mach_voucher_name_array_t;
61#define MACH_VOUCHER_NAME_ARRAY_NULL ((mach_voucher_name_array_t) 0)
62
63/*
64 * This type changes appearance between user-space and kernel. It is
65 * a port at user-space and a reference to an ipc_voucher structure in-kernel.
66 */
67typedef mach_voucher_t ipc_voucher_t;
68#define IPC_VOUCHER_NULL ((ipc_voucher_t) 0)
69
70/*
71 * mach_voucher_selector_t - A means of specifying which thread/task value to extract -
72 * the current voucher set at this level, or a voucher representing
73 * the full [layered] effective value for the task/thread.
74 */
75typedef uint32_t mach_voucher_selector_t;
76#define MACH_VOUCHER_SELECTOR_CURRENT ((mach_voucher_selector_t)0)
77#define MACH_VOUCHER_SELECTOR_EFFECTIVE ((mach_voucher_selector_t)1)
78
79
80/*
81 * mach_voucher_attr_key_t - The key used to identify a particular managed resource or
82 * to select the specific resource manager’s data associated
83 * with a given voucher.
84 */
85typedef uint32_t mach_voucher_attr_key_t;
86typedef mach_voucher_attr_key_t *mach_voucher_attr_key_array_t;
87
88#define MACH_VOUCHER_ATTR_KEY_ALL ((mach_voucher_attr_key_t)~0)
89#define MACH_VOUCHER_ATTR_KEY_NONE ((mach_voucher_attr_key_t)0)
90
91/* other well-known-keys will be added here */
92#define MACH_VOUCHER_ATTR_KEY_ATM ((mach_voucher_attr_key_t)1)
93#define MACH_VOUCHER_ATTR_KEY_IMPORTANCE ((mach_voucher_attr_key_t)2)
94#define MACH_VOUCHER_ATTR_KEY_BANK ((mach_voucher_attr_key_t)3)
95#define MACH_VOUCHER_ATTR_KEY_PTHPRIORITY ((mach_voucher_attr_key_t)4)
96
97#define MACH_VOUCHER_ATTR_KEY_USER_DATA ((mach_voucher_attr_key_t)7)
98#define MACH_VOUCHER_ATTR_KEY_BITS MACH_VOUCHER_ATTR_KEY_USER_DATA /* deprecated */
99#define MACH_VOUCHER_ATTR_KEY_TEST ((mach_voucher_attr_key_t)8)
100
101#define MACH_VOUCHER_ATTR_KEY_NUM_WELL_KNOWN MACH_VOUCHER_ATTR_KEY_TEST
102
103/*
104 * mach_voucher_attr_content_t
105 *
106 * Data passed to a resource manager for modifying an attribute
107 * value or returned from the resource manager in response to a
108 * request to externalize the current value for that attribute.
109 */
110typedef uint8_t *mach_voucher_attr_content_t;
111typedef uint32_t mach_voucher_attr_content_size_t;
112
113/*
114 * mach_voucher_attr_command_t - The private verbs implemented by each voucher
115 * attribute manager via mach_voucher_attr_command().
116 */
117typedef uint32_t mach_voucher_attr_command_t;
118
119/*
120 * mach_voucher_attr_recipe_command_t
121 *
122 * The verbs used to create/morph a voucher attribute value.
123 * We define some system-wide commands here - related to creation, and transport of
124 * vouchers and attributes. Additional commands can be defined by, and supported by,
125 * individual attribute resource managers.
126 */
127typedef uint32_t mach_voucher_attr_recipe_command_t;
128typedef mach_voucher_attr_recipe_command_t *mach_voucher_attr_recipe_command_array_t;
129
130#define MACH_VOUCHER_ATTR_NOOP ((mach_voucher_attr_recipe_command_t)0)
131#define MACH_VOUCHER_ATTR_COPY ((mach_voucher_attr_recipe_command_t)1)
132#define MACH_VOUCHER_ATTR_REMOVE ((mach_voucher_attr_recipe_command_t)2)
133#define MACH_VOUCHER_ATTR_SET_VALUE_HANDLE ((mach_voucher_attr_recipe_command_t)3)
134#define MACH_VOUCHER_ATTR_AUTO_REDEEM ((mach_voucher_attr_recipe_command_t)4)
135#define MACH_VOUCHER_ATTR_SEND_PREPROCESS ((mach_voucher_attr_recipe_command_t)5)
136
137/* redeem is on its way out? */
138#define MACH_VOUCHER_ATTR_REDEEM ((mach_voucher_attr_recipe_command_t)10)
139
140/* recipe command(s) for importance attribute manager */
141#define MACH_VOUCHER_ATTR_IMPORTANCE_SELF ((mach_voucher_attr_recipe_command_t)200)
142
143/* recipe command(s) for bit-store attribute manager */
144#define MACH_VOUCHER_ATTR_USER_DATA_STORE ((mach_voucher_attr_recipe_command_t)211)
145#define MACH_VOUCHER_ATTR_BITS_STORE MACH_VOUCHER_ATTR_USER_DATA_STORE /* deprecated */
146
147/* recipe command(s) for test attribute manager */
148#define MACH_VOUCHER_ATTR_TEST_STORE MACH_VOUCHER_ATTR_USER_DATA_STORE
149
150/*
151 * mach_voucher_attr_recipe_t
152 *
153 * An element in a recipe list to create a voucher.
154 */
155#pragma pack(push, 1)
156
157typedef struct mach_voucher_attr_recipe_data {
158 mach_voucher_attr_key_t key;
159 mach_voucher_attr_recipe_command_t command;
160 mach_voucher_name_t previous_voucher;
161 mach_voucher_attr_content_size_t content_size;
162 uint8_t content[];
163} mach_voucher_attr_recipe_data_t;
164typedef mach_voucher_attr_recipe_data_t *mach_voucher_attr_recipe_t;
165typedef mach_msg_type_number_t mach_voucher_attr_recipe_size_t;
166
167/* Make the above palatable to MIG */
168typedef uint8_t *mach_voucher_attr_raw_recipe_t;
169typedef mach_voucher_attr_raw_recipe_t mach_voucher_attr_raw_recipe_array_t;
170typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_size_t;
171typedef mach_msg_type_number_t mach_voucher_attr_raw_recipe_array_size_t;
172
173#define MACH_VOUCHER_ATTR_MAX_RAW_RECIPE_ARRAY_SIZE 5120
174#define MACH_VOUCHER_TRAP_STACK_LIMIT 256
175
176#pragma pack(pop)
177
178/*
179 * VOUCHER ATTRIBUTE MANAGER Writer types
180 */
181
182/*
183 * mach_voucher_attr_manager_t
184 *
185 * A handle through which the mach voucher mechanism communicates with the voucher
186 * attribute manager for a given attribute key.
187 */
188typedef mach_port_t mach_voucher_attr_manager_t;
189#define MACH_VOUCHER_ATTR_MANAGER_NULL ((mach_voucher_attr_manager_t) 0)
190
191/*
192 * mach_voucher_attr_control_t
193 *
194 * A handle provided to the voucher attribute manager for a given attribute key
195 * through which it makes inquiries or control operations of the mach voucher mechanism.
196 */
197typedef mach_port_t mach_voucher_attr_control_t;
198#define MACH_VOUCHER_ATTR_CONTROL_NULL ((mach_voucher_attr_control_t) 0)
199
200/*
201 * These types are different in-kernel vs user-space. They are ports in user-space,
202 * pointers to opaque structs in most of the kernel, and pointers to known struct
203 * types in the Mach portion of the kernel.
204 */
205typedef mach_port_t ipc_voucher_attr_manager_t;
206typedef mach_port_t ipc_voucher_attr_control_t;
207#define IPC_VOUCHER_ATTR_MANAGER_NULL ((ipc_voucher_attr_manager_t) 0)
208#define IPC_VOUCHER_ATTR_CONTROL_NULL ((ipc_voucher_attr_control_t) 0)
209
210/*
211 * mach_voucher_attr_value_handle_t
212 *
213 * The private handle that the voucher attribute manager provides to
214 * the mach voucher mechanism to represent a given attr content/value.
215 */
216typedef uint64_t mach_voucher_attr_value_handle_t __kernel_ptr_semantics;
217typedef mach_voucher_attr_value_handle_t *mach_voucher_attr_value_handle_array_t;
218
219typedef mach_msg_type_number_t mach_voucher_attr_value_handle_array_size_t;
220#define MACH_VOUCHER_ATTR_VALUE_MAX_NESTED ((mach_voucher_attr_value_handle_array_size_t)4)
221
222typedef uint32_t mach_voucher_attr_value_reference_t;
223typedef uint32_t mach_voucher_attr_value_flags_t;
224#define MACH_VOUCHER_ATTR_VALUE_FLAGS_NONE ((mach_voucher_attr_value_flags_t)0)
225#define MACH_VOUCHER_ATTR_VALUE_FLAGS_PERSIST ((mach_voucher_attr_value_flags_t)1)
226
227/* USE - TBD */
228typedef uint32_t mach_voucher_attr_control_flags_t;
229#define MACH_VOUCHER_ATTR_CONTROL_FLAGS_NONE ((mach_voucher_attr_control_flags_t)0)
230
231/*
232 * Commands and types for the IPC Importance Attribute Manager
233 *
234 * These are the valid mach_voucher_attr_command() options with the
235 * MACH_VOUCHER_ATTR_KEY_IMPORTANCE key.
236 */
237#define MACH_VOUCHER_IMPORTANCE_ATTR_ADD_EXTERNAL 1 /* Add some number of external refs (not supported) */
238#define MACH_VOUCHER_IMPORTANCE_ATTR_DROP_EXTERNAL 2 /* Drop some number of external refs */
239typedef uint32_t mach_voucher_attr_importance_refs;
240
241/*
242 * Activity id Generation defines
243 */
244#define MACH_ACTIVITY_ID_COUNT_MAX 16
245
246#endif /* _MACH_VOUCHER_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/machine.h created+410
......@@ -0,0 +1,410 @@
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#define CPUFAMILY_INTEL_COMETLAKE 0x1cf8a03e
380#define CPUFAMILY_ARM_9 0xe73283ae
381#define CPUFAMILY_ARM_11 0x8ff620d8
382#define CPUFAMILY_ARM_XSCALE 0x53b005f5
383#define CPUFAMILY_ARM_12 0xbd1b0ae9
384#define CPUFAMILY_ARM_13 0x0cc90e64
385#define CPUFAMILY_ARM_14 0x96077ef1
386#define CPUFAMILY_ARM_15 0xa8511bca
387#define CPUFAMILY_ARM_SWIFT 0x1e2d6381
388#define CPUFAMILY_ARM_CYCLONE 0x37a09642
389#define CPUFAMILY_ARM_TYPHOON 0x2c91a47e
390#define CPUFAMILY_ARM_TWISTER 0x92fb37c8
391#define CPUFAMILY_ARM_HURRICANE 0x67ceee93
392#define CPUFAMILY_ARM_MONSOON_MISTRAL 0xe81e7ef6
393#define CPUFAMILY_ARM_VORTEX_TEMPEST 0x07d34b9f
394#define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504d2
395#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3
396#define CPUFAMILY_ARM_BLIZZARD_AVALANCHE 0xda33d83d
397
398#define CPUSUBFAMILY_UNKNOWN 0
399#define CPUSUBFAMILY_ARM_HP 1
400#define CPUSUBFAMILY_ARM_HG 2
401#define CPUSUBFAMILY_ARM_M 3
402#define CPUSUBFAMILY_ARM_HS 4
403#define CPUSUBFAMILY_ARM_HC_HD 5
404
405/* The following synonyms are deprecated: */
406#define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN
407#define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM
408
409
410#endif /* _MACH_MACHINE_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/message.h created+911
......@@ -0,0 +1,911 @@
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
299
300typedef struct{
301 uint32_t address;
302 mach_msg_size_t size;
303 boolean_t deallocate: 8;
304 mach_msg_copy_options_t copy: 8;
305 unsigned int pad1: 8;
306 mach_msg_descriptor_type_t type: 8;
307} mach_msg_ool_descriptor32_t;
308
309typedef struct{
310 uint64_t address;
311 boolean_t deallocate: 8;
312 mach_msg_copy_options_t copy: 8;
313 unsigned int pad1: 8;
314 mach_msg_descriptor_type_t type: 8;
315 mach_msg_size_t size;
316} mach_msg_ool_descriptor64_t;
317
318typedef struct{
319 void* address;
320#if !defined(__LP64__)
321 mach_msg_size_t size;
322#endif
323 boolean_t deallocate: 8;
324 mach_msg_copy_options_t copy: 8;
325 unsigned int pad1: 8;
326 mach_msg_descriptor_type_t type: 8;
327#if defined(__LP64__)
328 mach_msg_size_t size;
329#endif
330} mach_msg_ool_descriptor_t;
331
332typedef struct{
333 uint32_t address;
334 mach_msg_size_t count;
335 boolean_t deallocate: 8;
336 mach_msg_copy_options_t copy: 8;
337 mach_msg_type_name_t disposition : 8;
338 mach_msg_descriptor_type_t type : 8;
339} mach_msg_ool_ports_descriptor32_t;
340
341typedef struct{
342 uint64_t address;
343 boolean_t deallocate: 8;
344 mach_msg_copy_options_t copy: 8;
345 mach_msg_type_name_t disposition : 8;
346 mach_msg_descriptor_type_t type : 8;
347 mach_msg_size_t count;
348} mach_msg_ool_ports_descriptor64_t;
349
350typedef struct{
351 void* address;
352#if !defined(__LP64__)
353 mach_msg_size_t count;
354#endif
355 boolean_t deallocate: 8;
356 mach_msg_copy_options_t copy: 8;
357 mach_msg_type_name_t disposition : 8;
358 mach_msg_descriptor_type_t type : 8;
359#if defined(__LP64__)
360 mach_msg_size_t count;
361#endif
362} mach_msg_ool_ports_descriptor_t;
363
364typedef struct{
365 uint32_t context;
366 mach_port_name_t name;
367 mach_msg_guard_flags_t flags : 16;
368 mach_msg_type_name_t disposition : 8;
369 mach_msg_descriptor_type_t type : 8;
370} mach_msg_guarded_port_descriptor32_t;
371
372typedef struct{
373 uint64_t context;
374 mach_msg_guard_flags_t flags : 16;
375 mach_msg_type_name_t disposition : 8;
376 mach_msg_descriptor_type_t type : 8;
377 mach_port_name_t name;
378} mach_msg_guarded_port_descriptor64_t;
379
380typedef struct{
381 mach_port_context_t context;
382#if !defined(__LP64__)
383 mach_port_name_t name;
384#endif
385 mach_msg_guard_flags_t flags : 16;
386 mach_msg_type_name_t disposition : 8;
387 mach_msg_descriptor_type_t type : 8;
388#if defined(__LP64__)
389 mach_port_name_t name;
390#endif /* defined(__LP64__) */
391} mach_msg_guarded_port_descriptor_t;
392
393/*
394 * LP64support - This union definition is not really
395 * appropriate in LP64 mode because not all descriptors
396 * are of the same size in that environment.
397 */
398typedef union{
399 mach_msg_port_descriptor_t port;
400 mach_msg_ool_descriptor_t out_of_line;
401 mach_msg_ool_ports_descriptor_t ool_ports;
402 mach_msg_type_descriptor_t type;
403 mach_msg_guarded_port_descriptor_t guarded_port;
404} mach_msg_descriptor_t;
405
406typedef struct{
407 mach_msg_size_t msgh_descriptor_count;
408} mach_msg_body_t;
409
410#define MACH_MSG_BODY_NULL ((mach_msg_body_t *) 0)
411#define MACH_MSG_DESCRIPTOR_NULL ((mach_msg_descriptor_t *) 0)
412
413typedef struct{
414 mach_msg_bits_t msgh_bits;
415 mach_msg_size_t msgh_size;
416 mach_port_t msgh_remote_port;
417 mach_port_t msgh_local_port;
418 mach_port_name_t msgh_voucher_port;
419 mach_msg_id_t msgh_id;
420} mach_msg_header_t;
421
422#define msgh_reserved msgh_voucher_port
423#define MACH_MSG_NULL ((mach_msg_header_t *) 0)
424
425typedef struct{
426 mach_msg_header_t header;
427 mach_msg_body_t body;
428} mach_msg_base_t;
429
430
431typedef unsigned int mach_msg_trailer_type_t;
432
433#define MACH_MSG_TRAILER_FORMAT_0 0
434
435typedef unsigned int mach_msg_trailer_size_t;
436typedef char *mach_msg_trailer_info_t;
437
438typedef struct{
439 mach_msg_trailer_type_t msgh_trailer_type;
440 mach_msg_trailer_size_t msgh_trailer_size;
441} mach_msg_trailer_t;
442
443/*
444 * The msgh_seqno field carries a sequence number
445 * associated with the received-from port. A port's
446 * sequence number is incremented every time a message
447 * is received from it and included in the received
448 * trailer to help put messages back in sequence if
449 * multiple threads receive and/or process received
450 * messages.
451 */
452typedef struct{
453 mach_msg_trailer_type_t msgh_trailer_type;
454 mach_msg_trailer_size_t msgh_trailer_size;
455 mach_port_seqno_t msgh_seqno;
456} mach_msg_seqno_trailer_t;
457
458typedef struct{
459 unsigned int val[2];
460} security_token_t;
461
462typedef struct{
463 mach_msg_trailer_type_t msgh_trailer_type;
464 mach_msg_trailer_size_t msgh_trailer_size;
465 mach_port_seqno_t msgh_seqno;
466 security_token_t msgh_sender;
467} mach_msg_security_trailer_t;
468
469/*
470 * The audit token is an opaque token which identifies
471 * Mach tasks and senders of Mach messages as subjects
472 * to the BSM audit system. Only the appropriate BSM
473 * library routines should be used to interpret the
474 * contents of the audit token as the representation
475 * of the subject identity within the token may change
476 * over time.
477 */
478typedef struct{
479 unsigned int val[8];
480} audit_token_t;
481
482typedef struct{
483 mach_msg_trailer_type_t msgh_trailer_type;
484 mach_msg_trailer_size_t msgh_trailer_size;
485 mach_port_seqno_t msgh_seqno;
486 security_token_t msgh_sender;
487 audit_token_t msgh_audit;
488} mach_msg_audit_trailer_t;
489
490typedef struct{
491 mach_msg_trailer_type_t msgh_trailer_type;
492 mach_msg_trailer_size_t msgh_trailer_size;
493 mach_port_seqno_t msgh_seqno;
494 security_token_t msgh_sender;
495 audit_token_t msgh_audit;
496 mach_port_context_t msgh_context;
497} mach_msg_context_trailer_t;
498
499
500
501typedef struct{
502 mach_port_name_t sender;
503} msg_labels_t;
504
505typedef int mach_msg_filter_id;
506#define MACH_MSG_FILTER_POLICY_ALLOW (mach_msg_filter_id)0
507
508/*
509 * Trailer type to pass MAC policy label info as a mach message trailer.
510 *
511 */
512
513typedef struct{
514 mach_msg_trailer_type_t msgh_trailer_type;
515 mach_msg_trailer_size_t msgh_trailer_size;
516 mach_port_seqno_t msgh_seqno;
517 security_token_t msgh_sender;
518 audit_token_t msgh_audit;
519 mach_port_context_t msgh_context;
520 mach_msg_filter_id msgh_ad;
521 msg_labels_t msgh_labels;
522} mach_msg_mac_trailer_t;
523
524
525#define MACH_MSG_TRAILER_MINIMUM_SIZE sizeof(mach_msg_trailer_t)
526
527/*
528 * These values can change from release to release - but clearly
529 * code cannot request additional trailer elements one was not
530 * compiled to understand. Therefore, it is safe to use this
531 * constant when the same module specified the receive options.
532 * Otherwise, you run the risk that the options requested by
533 * another module may exceed the local modules notion of
534 * MAX_TRAILER_SIZE.
535 */
536
537typedef mach_msg_mac_trailer_t mach_msg_max_trailer_t;
538#define MAX_TRAILER_SIZE ((mach_msg_size_t)sizeof(mach_msg_max_trailer_t))
539
540/*
541 * Legacy requirements keep us from ever updating these defines (even
542 * when the format_0 trailers gain new option data fields in the future).
543 * Therefore, they shouldn't be used going forward. Instead, the sizes
544 * should be compared against the specific element size requested using
545 * REQUESTED_TRAILER_SIZE.
546 */
547typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t;
548
549/*typedef mach_msg_mac_trailer_t mach_msg_format_0_trailer_t;
550 */
551
552#define MACH_MSG_TRAILER_FORMAT_0_SIZE sizeof(mach_msg_format_0_trailer_t)
553
554#define KERNEL_SECURITY_TOKEN_VALUE { {0, 1} }
555extern const security_token_t KERNEL_SECURITY_TOKEN;
556
557#define KERNEL_AUDIT_TOKEN_VALUE { {0, 0, 0, 0, 0, 0, 0, 0} }
558extern const audit_token_t KERNEL_AUDIT_TOKEN;
559
560typedef integer_t mach_msg_options_t;
561
562typedef struct{
563 mach_msg_header_t header;
564} mach_msg_empty_send_t;
565
566typedef struct{
567 mach_msg_header_t header;
568 mach_msg_trailer_t trailer;
569} mach_msg_empty_rcv_t;
570
571typedef union{
572 mach_msg_empty_send_t send;
573 mach_msg_empty_rcv_t rcv;
574} mach_msg_empty_t;
575
576#pragma pack(pop)
577
578/* utility to round the message size - will become machine dependent */
579#define round_msg(x) (((mach_msg_size_t)(x) + sizeof (natural_t) - 1) & \
580 ~(sizeof (natural_t) - 1))
581
582
583/*
584 * There is no fixed upper bound to the size of Mach messages.
585 */
586#define MACH_MSG_SIZE_MAX ((mach_msg_size_t) ~0)
587
588#if defined(__APPLE_API_PRIVATE)
589/*
590 * But architectural limits of a given implementation, or
591 * temporal conditions may cause unpredictable send failures
592 * for messages larger than MACH_MSG_SIZE_RELIABLE.
593 *
594 * In either case, waiting for memory is [currently] outside
595 * the scope of send timeout values provided to IPC.
596 */
597#define MACH_MSG_SIZE_RELIABLE ((mach_msg_size_t) 256 * 1024)
598#endif
599/*
600 * Compatibility definitions, for code written
601 * when there was a msgh_kind instead of msgh_seqno.
602 */
603#define MACH_MSGH_KIND_NORMAL 0x00000000
604#define MACH_MSGH_KIND_NOTIFICATION 0x00000001
605#define msgh_kind msgh_seqno
606#define mach_msg_kind_t mach_port_seqno_t
607
608typedef natural_t mach_msg_type_size_t;
609typedef natural_t mach_msg_type_number_t;
610
611/*
612 * Values received/carried in messages. Tells the receiver what
613 * sort of port right he now has.
614 *
615 * MACH_MSG_TYPE_PORT_NAME is used to transfer a port name
616 * which should remain uninterpreted by the kernel. (Port rights
617 * are not transferred, just the port name.)
618 */
619
620#define MACH_MSG_TYPE_PORT_NONE 0
621
622#define MACH_MSG_TYPE_PORT_NAME 15
623#define MACH_MSG_TYPE_PORT_RECEIVE MACH_MSG_TYPE_MOVE_RECEIVE
624#define MACH_MSG_TYPE_PORT_SEND MACH_MSG_TYPE_MOVE_SEND
625#define MACH_MSG_TYPE_PORT_SEND_ONCE MACH_MSG_TYPE_MOVE_SEND_ONCE
626
627#define MACH_MSG_TYPE_LAST 22 /* Last assigned */
628
629/*
630 * A dummy value. Mostly used to indicate that the actual value
631 * will be filled in later, dynamically.
632 */
633
634#define MACH_MSG_TYPE_POLYMORPHIC ((mach_msg_type_name_t) -1)
635
636/*
637 * Is a given item a port type?
638 */
639
640#define MACH_MSG_TYPE_PORT_ANY(x) \
641 (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \
642 ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
643
644#define MACH_MSG_TYPE_PORT_ANY_SEND(x) \
645 (((x) >= MACH_MSG_TYPE_MOVE_SEND) && \
646 ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
647
648#define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \
649 (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \
650 ((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE))
651
652typedef integer_t mach_msg_option_t;
653
654#define MACH_MSG_OPTION_NONE 0x00000000
655
656#define MACH_SEND_MSG 0x00000001
657#define MACH_RCV_MSG 0x00000002
658
659#define MACH_RCV_LARGE 0x00000004 /* report large message sizes */
660#define MACH_RCV_LARGE_IDENTITY 0x00000008 /* identify source of large messages */
661
662#define MACH_SEND_TIMEOUT 0x00000010 /* timeout value applies to send */
663#define MACH_SEND_OVERRIDE 0x00000020 /* priority override for send */
664#define MACH_SEND_INTERRUPT 0x00000040 /* don't restart interrupted sends */
665#define MACH_SEND_NOTIFY 0x00000080 /* arm send-possible notify */
666#define MACH_SEND_ALWAYS 0x00010000 /* ignore qlimits - kernel only */
667#define MACH_SEND_FILTER_NONFATAL 0x00010000 /* rejection by message filter should return failure - user only */
668#define MACH_SEND_TRAILER 0x00020000 /* sender-provided trailer */
669#define MACH_SEND_NOIMPORTANCE 0x00040000 /* msg won't carry importance */
670#define MACH_SEND_NODENAP MACH_SEND_NOIMPORTANCE
671#define MACH_SEND_IMPORTANCE 0x00080000 /* msg carries importance - kernel only */
672#define MACH_SEND_SYNC_OVERRIDE 0x00100000 /* msg should do sync IPC override (on legacy kernels) */
673#define MACH_SEND_PROPAGATE_QOS 0x00200000 /* IPC should propagate the caller's QoS */
674#define MACH_SEND_SYNC_USE_THRPRI MACH_SEND_PROPAGATE_QOS /* obsolete name */
675#define MACH_SEND_KERNEL 0x00400000 /* full send from kernel space - kernel only */
676#define MACH_SEND_SYNC_BOOTSTRAP_CHECKIN 0x00800000 /* special reply port should boost thread doing sync bootstrap checkin */
677
678#define MACH_RCV_TIMEOUT 0x00000100 /* timeout value applies to receive */
679#define MACH_RCV_NOTIFY 0x00000000 /* legacy name (value was: 0x00000200) */
680#define MACH_RCV_INTERRUPT 0x00000400 /* don't restart interrupted receive */
681#define MACH_RCV_VOUCHER 0x00000800 /* willing to receive voucher port */
682#define MACH_RCV_OVERWRITE 0x00000000 /* scatter receive (deprecated) */
683#define MACH_RCV_GUARDED_DESC 0x00001000 /* Can receive new guarded descriptor */
684#define MACH_RCV_SYNC_WAIT 0x00004000 /* sync waiter waiting for rcv */
685#define MACH_RCV_SYNC_PEEK 0x00008000 /* sync waiter waiting to peek */
686
687#define MACH_MSG_STRICT_REPLY 0x00000200 /* Enforce specific properties about the reply port, and
688 * the context in which a thread replies to a message.
689 * This flag must be passed on both the SEND and RCV */
690
691
692/*
693 * NOTE: a 0x00------ RCV mask implies to ask for
694 * a MACH_MSG_TRAILER_FORMAT_0 with 0 Elements,
695 * which is equivalent to a mach_msg_trailer_t.
696 *
697 * XXXMAC: unlike the rest of the MACH_RCV_* flags, MACH_RCV_TRAILER_LABELS
698 * needs its own private bit since we only calculate its fields when absolutely
699 * required.
700 */
701#define MACH_RCV_TRAILER_NULL 0
702#define MACH_RCV_TRAILER_SEQNO 1
703#define MACH_RCV_TRAILER_SENDER 2
704#define MACH_RCV_TRAILER_AUDIT 3
705#define MACH_RCV_TRAILER_CTX 4
706#define MACH_RCV_TRAILER_AV 7
707#define MACH_RCV_TRAILER_LABELS 8
708
709#define MACH_RCV_TRAILER_TYPE(x) (((x) & 0xf) << 28)
710#define MACH_RCV_TRAILER_ELEMENTS(x) (((x) & 0xf) << 24)
711#define MACH_RCV_TRAILER_MASK ((0xf << 24))
712
713#define GET_RCV_ELEMENTS(y) (((y) >> 24) & 0xf)
714
715
716/*
717 * XXXMAC: note that in the case of MACH_RCV_TRAILER_LABELS,
718 * we just fall through to mach_msg_max_trailer_t.
719 * This is correct behavior since mach_msg_max_trailer_t is defined as
720 * mac_msg_mac_trailer_t which is used for the LABELS trailer.
721 * It also makes things work properly if MACH_RCV_TRAILER_LABELS is ORed
722 * with one of the other options.
723 */
724
725#define REQUESTED_TRAILER_SIZE_NATIVE(y) \
726 ((mach_msg_trailer_size_t) \
727 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_NULL) ? \
728 sizeof(mach_msg_trailer_t) : \
729 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SEQNO) ? \
730 sizeof(mach_msg_seqno_trailer_t) : \
731 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SENDER) ? \
732 sizeof(mach_msg_security_trailer_t) : \
733 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AUDIT) ? \
734 sizeof(mach_msg_audit_trailer_t) : \
735 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_CTX) ? \
736 sizeof(mach_msg_context_trailer_t) : \
737 ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AV) ? \
738 sizeof(mach_msg_mac_trailer_t) : \
739 sizeof(mach_msg_max_trailer_t))))))))
740
741
742#define REQUESTED_TRAILER_SIZE(y) REQUESTED_TRAILER_SIZE_NATIVE(y)
743
744/*
745 * Much code assumes that mach_msg_return_t == kern_return_t.
746 * This definition is useful for descriptive purposes.
747 *
748 * See <mach/error.h> for the format of error codes.
749 * IPC errors are system 4. Send errors are subsystem 0;
750 * receive errors are subsystem 1. The code field is always non-zero.
751 * The high bits of the code field communicate extra information
752 * for some error codes. MACH_MSG_MASK masks off these special bits.
753 */
754
755typedef kern_return_t mach_msg_return_t;
756
757#define MACH_MSG_SUCCESS 0x00000000
758
759
760#define MACH_MSG_MASK 0x00003e00
761/* All special error code bits defined below. */
762#define MACH_MSG_IPC_SPACE 0x00002000
763/* No room in IPC name space for another capability name. */
764#define MACH_MSG_VM_SPACE 0x00001000
765/* No room in VM address space for out-of-line memory. */
766#define MACH_MSG_IPC_KERNEL 0x00000800
767/* Kernel resource shortage handling an IPC capability. */
768#define MACH_MSG_VM_KERNEL 0x00000400
769/* Kernel resource shortage handling out-of-line memory. */
770
771#define MACH_SEND_IN_PROGRESS 0x10000001
772/* Thread is waiting to send. (Internal use only.) */
773#define MACH_SEND_INVALID_DATA 0x10000002
774/* Bogus in-line data. */
775#define MACH_SEND_INVALID_DEST 0x10000003
776/* Bogus destination port. */
777#define MACH_SEND_TIMED_OUT 0x10000004
778/* Message not sent before timeout expired. */
779#define MACH_SEND_INVALID_VOUCHER 0x10000005
780/* Bogus voucher port. */
781#define MACH_SEND_INTERRUPTED 0x10000007
782/* Software interrupt. */
783#define MACH_SEND_MSG_TOO_SMALL 0x10000008
784/* Data doesn't contain a complete message. */
785#define MACH_SEND_INVALID_REPLY 0x10000009
786/* Bogus reply port. */
787#define MACH_SEND_INVALID_RIGHT 0x1000000a
788/* Bogus port rights in the message body. */
789#define MACH_SEND_INVALID_NOTIFY 0x1000000b
790/* Bogus notify port argument. */
791#define MACH_SEND_INVALID_MEMORY 0x1000000c
792/* Invalid out-of-line memory pointer. */
793#define MACH_SEND_NO_BUFFER 0x1000000d
794/* No message buffer is available. */
795#define MACH_SEND_TOO_LARGE 0x1000000e
796/* Send is too large for port */
797#define MACH_SEND_INVALID_TYPE 0x1000000f
798/* Invalid msg-type specification. */
799#define MACH_SEND_INVALID_HEADER 0x10000010
800/* A field in the header had a bad value. */
801#define MACH_SEND_INVALID_TRAILER 0x10000011
802/* The trailer to be sent does not match kernel format. */
803#define MACH_SEND_INVALID_CONTEXT 0x10000012
804/* The sending thread context did not match the context on the dest port */
805#define MACH_SEND_INVALID_RT_OOL_SIZE 0x10000015
806/* compatibility: no longer a returned error */
807#define MACH_SEND_NO_GRANT_DEST 0x10000016
808/* The destination port doesn't accept ports in body */
809#define MACH_SEND_MSG_FILTERED 0x10000017
810/* Message send was rejected by message filter */
811
812#define MACH_RCV_IN_PROGRESS 0x10004001
813/* Thread is waiting for receive. (Internal use only.) */
814#define MACH_RCV_INVALID_NAME 0x10004002
815/* Bogus name for receive port/port-set. */
816#define MACH_RCV_TIMED_OUT 0x10004003
817/* Didn't get a message within the timeout value. */
818#define MACH_RCV_TOO_LARGE 0x10004004
819/* Message buffer is not large enough for inline data. */
820#define MACH_RCV_INTERRUPTED 0x10004005
821/* Software interrupt. */
822#define MACH_RCV_PORT_CHANGED 0x10004006
823/* compatibility: no longer a returned error */
824#define MACH_RCV_INVALID_NOTIFY 0x10004007
825/* Bogus notify port argument. */
826#define MACH_RCV_INVALID_DATA 0x10004008
827/* Bogus message buffer for inline data. */
828#define MACH_RCV_PORT_DIED 0x10004009
829/* Port/set was sent away/died during receive. */
830#define MACH_RCV_IN_SET 0x1000400a
831/* compatibility: no longer a returned error */
832#define MACH_RCV_HEADER_ERROR 0x1000400b
833/* Error receiving message header. See special bits. */
834#define MACH_RCV_BODY_ERROR 0x1000400c
835/* Error receiving message body. See special bits. */
836#define MACH_RCV_INVALID_TYPE 0x1000400d
837/* Invalid msg-type specification in scatter list. */
838#define MACH_RCV_SCATTER_SMALL 0x1000400e
839/* Out-of-line overwrite region is not large enough */
840#define MACH_RCV_INVALID_TRAILER 0x1000400f
841/* trailer type or number of trailer elements not supported */
842#define MACH_RCV_IN_PROGRESS_TIMED 0x10004011
843/* Waiting for receive with timeout. (Internal use only.) */
844#define MACH_RCV_INVALID_REPLY 0x10004012
845/* invalid reply port used in a STRICT_REPLY message */
846
847
848
849__BEGIN_DECLS
850
851/*
852 * Routine: mach_msg_overwrite
853 * Purpose:
854 * Send and/or receive a message. If the message operation
855 * is interrupted, and the user did not request an indication
856 * of that fact, then restart the appropriate parts of the
857 * operation silently (trap version does not restart).
858 *
859 * Distinct send and receive buffers may be specified. If
860 * no separate receive buffer is specified, the msg parameter
861 * will be used for both send and receive operations.
862 *
863 * In addition to a distinct receive buffer, that buffer may
864 * already contain scatter control information to direct the
865 * receiving of the message.
866 */
867__WATCHOS_PROHIBITED __TVOS_PROHIBITED
868extern mach_msg_return_t mach_msg_overwrite(
869 mach_msg_header_t *msg,
870 mach_msg_option_t option,
871 mach_msg_size_t send_size,
872 mach_msg_size_t rcv_size,
873 mach_port_name_t rcv_name,
874 mach_msg_timeout_t timeout,
875 mach_port_name_t notify,
876 mach_msg_header_t *rcv_msg,
877 mach_msg_size_t rcv_limit);
878
879
880/*
881 * Routine: mach_msg
882 * Purpose:
883 * Send and/or receive a message. If the message operation
884 * is interrupted, and the user did not request an indication
885 * of that fact, then restart the appropriate parts of the
886 * operation silently (trap version does not restart).
887 */
888__WATCHOS_PROHIBITED __TVOS_PROHIBITED
889extern mach_msg_return_t mach_msg(
890 mach_msg_header_t *msg,
891 mach_msg_option_t option,
892 mach_msg_size_t send_size,
893 mach_msg_size_t rcv_size,
894 mach_port_name_t rcv_name,
895 mach_msg_timeout_t timeout,
896 mach_port_name_t notify);
897
898/*
899 * Routine: mach_voucher_deallocate
900 * Purpose:
901 * Deallocate a mach voucher created or received in a message. Drops
902 * one (send right) reference to the voucher.
903 */
904__WATCHOS_PROHIBITED __TVOS_PROHIBITED
905extern kern_return_t mach_voucher_deallocate(
906 mach_port_name_t voucher);
907
908
909__END_DECLS
910
911#endif /* _MACH_MESSAGE_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/port.h created+477
......@@ -0,0 +1,477 @@
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/* Convenient combinations. */
215
216#define MACH_PORT_TYPE_SEND_RECEIVE \
217 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE)
218#define MACH_PORT_TYPE_SEND_RIGHTS \
219 (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE)
220#define MACH_PORT_TYPE_PORT_RIGHTS \
221 (MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE)
222#define MACH_PORT_TYPE_PORT_OR_DEAD \
223 (MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME)
224#define MACH_PORT_TYPE_ALL_RIGHTS \
225 (MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET)
226
227/* Dummy type bits that mach_port_type/mach_port_names can return. */
228
229#define MACH_PORT_TYPE_DNREQUEST 0x80000000
230#define MACH_PORT_TYPE_SPREQUEST 0x40000000
231#define MACH_PORT_TYPE_SPREQUEST_DELAYED 0x20000000
232
233/* User-references for capabilities. */
234
235typedef natural_t mach_port_urefs_t;
236typedef integer_t mach_port_delta_t; /* change in urefs */
237
238/* Attributes of ports. (See mach_port_get_receive_status.) */
239
240typedef natural_t mach_port_seqno_t; /* sequence number */
241typedef natural_t mach_port_mscount_t; /* make-send count */
242typedef natural_t mach_port_msgcount_t; /* number of msgs */
243typedef natural_t mach_port_rights_t; /* number of rights */
244
245/*
246 * Are there outstanding send rights for a given port?
247 */
248#define MACH_PORT_SRIGHTS_NONE 0 /* no srights */
249#define MACH_PORT_SRIGHTS_PRESENT 1 /* srights */
250typedef unsigned int mach_port_srights_t; /* status of send rights */
251
252typedef struct mach_port_status {
253 mach_port_rights_t mps_pset; /* count of containing port sets */
254 mach_port_seqno_t mps_seqno; /* sequence number */
255 mach_port_mscount_t mps_mscount; /* make-send count */
256 mach_port_msgcount_t mps_qlimit; /* queue limit */
257 mach_port_msgcount_t mps_msgcount; /* number in the queue */
258 mach_port_rights_t mps_sorights; /* how many send-once rights */
259 boolean_t mps_srights; /* do send rights exist? */
260 boolean_t mps_pdrequest; /* port-deleted requested? */
261 boolean_t mps_nsrequest; /* no-senders requested? */
262 natural_t mps_flags; /* port flags */
263} mach_port_status_t;
264
265/* System-wide values for setting queue limits on a port */
266#define MACH_PORT_QLIMIT_ZERO (0)
267#define MACH_PORT_QLIMIT_BASIC (5)
268#define MACH_PORT_QLIMIT_SMALL (16)
269#define MACH_PORT_QLIMIT_LARGE (1024)
270#define MACH_PORT_QLIMIT_KERNEL (65534)
271#define MACH_PORT_QLIMIT_MIN MACH_PORT_QLIMIT_ZERO
272#define MACH_PORT_QLIMIT_DEFAULT MACH_PORT_QLIMIT_BASIC
273#define MACH_PORT_QLIMIT_MAX MACH_PORT_QLIMIT_LARGE
274
275typedef struct mach_port_limits {
276 mach_port_msgcount_t mpl_qlimit; /* number of msgs */
277} mach_port_limits_t;
278
279/* Possible values for mps_flags (part of mach_port_status_t) */
280#define MACH_PORT_STATUS_FLAG_TEMPOWNER 0x01
281#define MACH_PORT_STATUS_FLAG_GUARDED 0x02
282#define MACH_PORT_STATUS_FLAG_STRICT_GUARD 0x04
283#define MACH_PORT_STATUS_FLAG_IMP_DONATION 0x08
284#define MACH_PORT_STATUS_FLAG_REVIVE 0x10
285#define MACH_PORT_STATUS_FLAG_TASKPTR 0x20
286#define MACH_PORT_STATUS_FLAG_GUARD_IMMOVABLE_RECEIVE 0x40
287#define MACH_PORT_STATUS_FLAG_NO_GRANT 0x80
288
289typedef struct mach_port_info_ext {
290 mach_port_status_t mpie_status;
291 mach_port_msgcount_t mpie_boost_cnt;
292 uint32_t reserved[6];
293} mach_port_info_ext_t;
294
295typedef struct mach_port_guard_info {
296 uint64_t mpgi_guard; /* guard value */
297} mach_port_guard_info_t;
298
299typedef integer_t *mach_port_info_t; /* varying array of natural_t */
300
301/* Flavors for mach_port_get/set/assert_attributes() */
302typedef int mach_port_flavor_t;
303#define MACH_PORT_LIMITS_INFO 1 /* uses mach_port_limits_t */
304#define MACH_PORT_RECEIVE_STATUS 2 /* uses mach_port_status_t */
305#define MACH_PORT_DNREQUESTS_SIZE 3 /* info is int */
306#define MACH_PORT_TEMPOWNER 4 /* indicates receive right will be reassigned to another task */
307#define MACH_PORT_IMPORTANCE_RECEIVER 5 /* indicates recieve right accepts priority donation */
308#define MACH_PORT_DENAP_RECEIVER 6 /* indicates receive right accepts de-nap donation */
309#define MACH_PORT_INFO_EXT 7 /* uses mach_port_info_ext_t */
310#define MACH_PORT_GUARD_INFO 8 /* asserts if the strict guard value is correct */
311
312#define MACH_PORT_LIMITS_INFO_COUNT ((natural_t) \
313 (sizeof(mach_port_limits_t)/sizeof(natural_t)))
314#define MACH_PORT_RECEIVE_STATUS_COUNT ((natural_t) \
315 (sizeof(mach_port_status_t)/sizeof(natural_t)))
316#define MACH_PORT_DNREQUESTS_SIZE_COUNT 1
317#define MACH_PORT_INFO_EXT_COUNT ((natural_t) \
318 (sizeof(mach_port_info_ext_t)/sizeof(natural_t)))
319#define MACH_PORT_GUARD_INFO_COUNT ((natural_t) \
320 (sizeof(mach_port_guard_info_t)/sizeof(natural_t)))
321
322/*
323 * Structure used to pass information about port allocation requests.
324 * Must be padded to 64-bits total length.
325 */
326typedef struct mach_port_qos {
327 unsigned int name:1; /* name given */
328 unsigned int prealloc:1; /* prealloced message */
329 boolean_t pad1:30;
330 natural_t len;
331} mach_port_qos_t;
332
333/*
334 * Structure used to pass information about the service port
335 */
336#define MACH_SERVICE_PORT_INFO_STRING_NAME_MAX_BUF_LEN 255 /* Maximum length of the port string name buffer */
337
338typedef struct mach_service_port_info {
339 char mspi_string_name[MACH_SERVICE_PORT_INFO_STRING_NAME_MAX_BUF_LEN]; /* Service port's string name */
340 uint8_t mspi_domain_type; /* Service port domain */
341} mach_service_port_info_data_t;
342
343#define MACH_SERVICE_PORT_INFO_COUNT ((char) \
344 (sizeof(mach_service_port_info_data_t)/sizeof(char)))
345
346typedef struct mach_service_port_info * mach_service_port_info_t;
347
348/*
349 * Flags for mach_port_options (used for
350 * invocation of mach_port_construct).
351 * Indicates attributes to be set for the newly
352 * allocated port.
353 */
354#define MPO_CONTEXT_AS_GUARD 0x01 /* Add guard to the port */
355#define MPO_QLIMIT 0x02 /* Set qlimit for the port msg queue */
356#define MPO_TEMPOWNER 0x04 /* Set the tempowner bit of the port */
357#define MPO_IMPORTANCE_RECEIVER 0x08 /* Mark the port as importance receiver */
358#define MPO_INSERT_SEND_RIGHT 0x10 /* Insert a send right for the port */
359#define MPO_STRICT 0x20 /* Apply strict guarding for port */
360#define MPO_DENAP_RECEIVER 0x40 /* Mark the port as App de-nap receiver */
361#define MPO_IMMOVABLE_RECEIVE 0x80 /* Mark the port as immovable; protected by the guard context */
362#define MPO_FILTER_MSG 0x100 /* Allow message filtering */
363#define MPO_TG_BLOCK_TRACKING 0x200 /* Track blocking relationship for thread group during sync IPC */
364#define MPO_SERVICE_PORT 0x400 /* Create a service port with the given name; should be used only by launchd */
365#define MPO_CONNECTION_PORT 0x800 /* Derive new peer connection port from a given service port */
366
367/*
368 * Structure to define optional attributes for a newly
369 * constructed port.
370 */
371typedef struct mach_port_options {
372 uint32_t flags; /* Flags defining attributes for port */
373 mach_port_limits_t mpl; /* Message queue limit for port */
374 union {
375 uint64_t reserved[2]; /* Reserved */
376 mach_port_name_t work_interval_port; /* Work interval port */
377 mach_service_port_info_t service_port_info; /* Service port (MPO_SERVICE_PORT) */
378 mach_port_name_t service_port_name; /* Service port (MPO_CONNECTION_PORT) */
379 };
380}mach_port_options_t;
381
382typedef mach_port_options_t *mach_port_options_ptr_t;
383
384/* Mach Port Guarding definitions */
385
386/*
387 * EXC_GUARD represents a guard violation for both
388 * mach ports and file descriptors. GUARD_TYPE_ is used
389 * to differentiate among them.
390 */
391#define GUARD_TYPE_MACH_PORT 0x1
392
393/* Reasons for exception for a guarded mach port */
394enum mach_port_guard_exception_codes {
395 kGUARD_EXC_DESTROY = 1u << 0,
396 kGUARD_EXC_MOD_REFS = 1u << 1,
397 kGUARD_EXC_SET_CONTEXT = 1u << 2,
398 kGUARD_EXC_UNGUARDED = 1u << 3,
399 kGUARD_EXC_INCORRECT_GUARD = 1u << 4,
400 kGUARD_EXC_IMMOVABLE = 1u << 5,
401 kGUARD_EXC_STRICT_REPLY = 1u << 6,
402 kGUARD_EXC_MSG_FILTERED = 1u << 7,
403 /* start of [optionally] non-fatal guards */
404 kGUARD_EXC_INVALID_RIGHT = 1u << 8,
405 kGUARD_EXC_INVALID_NAME = 1u << 9,
406 kGUARD_EXC_INVALID_VALUE = 1u << 10,
407 kGUARD_EXC_INVALID_ARGUMENT = 1u << 11,
408 kGUARD_EXC_RIGHT_EXISTS = 1u << 12,
409 kGUARD_EXC_KERN_NO_SPACE = 1u << 13,
410 kGUARD_EXC_KERN_FAILURE = 1u << 14,
411 kGUARD_EXC_KERN_RESOURCE = 1u << 15,
412 kGUARD_EXC_SEND_INVALID_REPLY = 1u << 16,
413 kGUARD_EXC_SEND_INVALID_VOUCHER = 1u << 17,
414 kGUARD_EXC_SEND_INVALID_RIGHT = 1u << 18,
415 kGUARD_EXC_RCV_INVALID_NAME = 1u << 19,
416 /* start of always non-fatal guards */
417 kGUARD_EXC_RCV_GUARDED_DESC = 1u << 20, /* for development only */
418 kGUARD_EXC_MOD_REFS_NON_FATAL = 1u << 21,
419 kGUARD_EXC_IMMOVABLE_NON_FATAL = 1u << 22,
420};
421
422#define MAX_FATAL_kGUARD_EXC_CODE (1u << 7)
423
424/*
425 * Mach port guard flags.
426 */
427#define MPG_FLAGS_NONE (0x00ull)
428
429#define MAX_OPTIONAL_kGUARD_EXC_CODE (1u << 19)
430
431/*
432 * These flags are used as bits in the subcode of kGUARD_EXC_STRICT_REPLY exceptions.
433 */
434#define MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_DISP (0x01ull << 56)
435#define MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_PORT (0x02ull << 56)
436#define MPG_FLAGS_STRICT_REPLY_INVALID_VOUCHER (0x04ull << 56)
437#define MPG_FLAGS_STRICT_REPLY_NO_BANK_ATTR (0x08ull << 56)
438#define MPG_FLAGS_STRICT_REPLY_MISMATCHED_PERSONA (0x10ull << 56)
439#define MPG_FLAGS_STRICT_REPLY_MASK (0xffull << 56)
440
441/*
442 * These flags are used as bits in the subcode of kGUARD_EXC_MOD_REFS exceptions.
443 */
444#define MPG_FLAGS_MOD_REFS_PINNED_DEALLOC (0x01ull << 56)
445#define MPG_FLAGS_MOD_REFS_PINNED_DESTROY (0x02ull << 56)
446#define MPG_FLAGS_MOD_REFS_PINNED_COPYIN (0x04ull << 56)
447
448/*
449 * These flags are used as bits in the subcode of kGUARD_EXC_IMMOVABLE exceptions.
450 */
451#define MPG_FLAGS_IMMOVABLE_PINNED (0x01ull << 56)
452
453/*
454 * Flags for mach_port_guard_with_flags. These flags extend
455 * the attributes associated with a guarded port.
456 */
457#define MPG_STRICT 0x01 /* Apply strict guarding for a port */
458#define MPG_IMMOVABLE_RECEIVE 0x02 /* Receive right cannot be moved out of the space */
459
460#if !__DARWIN_UNIX03 && !defined(_NO_PORT_T_FROM_MACH)
461/*
462 * Mach 3.0 renamed everything to have mach_ in front of it.
463 * These types and macros are provided for backward compatibility
464 * but are deprecated.
465 */
466typedef mach_port_t port_t;
467typedef mach_port_name_t port_name_t;
468typedef mach_port_name_t *port_name_array_t;
469
470#define PORT_NULL ((port_t) 0)
471#define PORT_DEAD ((port_t) ~0)
472#define PORT_VALID(name) \
473 ((port_t)(name) != PORT_NULL && (port_t)(name) != PORT_DEAD)
474
475#endif /* !__DARWIN_UNIX03 && !_NO_PORT_T_FROM_MACH */
476
477#endif /* _MACH_PORT_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/processor.h created+361
......@@ -0,0 +1,361 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 processor_start */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t processor_start
76(
77 processor_t processor
78);
79
80/* Routine processor_exit */
81#ifdef mig_external
82mig_external
83#else
84extern
85#endif /* mig_external */
86kern_return_t processor_exit
87(
88 processor_t processor
89);
90
91/* Routine processor_info */
92#ifdef mig_external
93mig_external
94#else
95extern
96#endif /* mig_external */
97kern_return_t processor_info
98(
99 processor_t processor,
100 processor_flavor_t flavor,
101 host_t *host,
102 processor_info_t processor_info_out,
103 mach_msg_type_number_t *processor_info_outCnt
104);
105
106/* Routine processor_control */
107#ifdef mig_external
108mig_external
109#else
110extern
111#endif /* mig_external */
112kern_return_t processor_control
113(
114 processor_t processor,
115 processor_info_t processor_cmd,
116 mach_msg_type_number_t processor_cmdCnt
117);
118
119/* Routine processor_assign */
120#ifdef mig_external
121mig_external
122#else
123extern
124#endif /* mig_external */
125kern_return_t processor_assign
126(
127 processor_t processor,
128 processor_set_t new_set,
129 boolean_t wait
130);
131
132/* Routine processor_get_assignment */
133#ifdef mig_external
134mig_external
135#else
136extern
137#endif /* mig_external */
138kern_return_t processor_get_assignment
139(
140 processor_t processor,
141 processor_set_name_t *assigned_set
142);
143
144__END_DECLS
145
146/********************** Caution **************************/
147/* The following data types should be used to calculate */
148/* maximum message sizes only. The actual message may be */
149/* smaller, and the position of the arguments within the */
150/* message layout may vary from what is presented here. */
151/* For example, if any of the arguments are variable- */
152/* sized, and less than the maximum is sent, the data */
153/* will be packed tight in the actual message to reduce */
154/* the presence of holes. */
155/********************** Caution **************************/
156
157/* typedefs for all requests */
158
159#ifndef __Request__processor_subsystem__defined
160#define __Request__processor_subsystem__defined
161
162#ifdef __MigPackStructs
163#pragma pack(push, 4)
164#endif
165 typedef struct {
166 mach_msg_header_t Head;
167 } __Request__processor_start_t __attribute__((unused));
168#ifdef __MigPackStructs
169#pragma pack(pop)
170#endif
171
172#ifdef __MigPackStructs
173#pragma pack(push, 4)
174#endif
175 typedef struct {
176 mach_msg_header_t Head;
177 } __Request__processor_exit_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 processor_flavor_t flavor;
189 mach_msg_type_number_t processor_info_outCnt;
190 } __Request__processor_info_t __attribute__((unused));
191#ifdef __MigPackStructs
192#pragma pack(pop)
193#endif
194
195#ifdef __MigPackStructs
196#pragma pack(push, 4)
197#endif
198 typedef struct {
199 mach_msg_header_t Head;
200 NDR_record_t NDR;
201 mach_msg_type_number_t processor_cmdCnt;
202 integer_t processor_cmd[20];
203 } __Request__processor_control_t __attribute__((unused));
204#ifdef __MigPackStructs
205#pragma pack(pop)
206#endif
207
208#ifdef __MigPackStructs
209#pragma pack(push, 4)
210#endif
211 typedef struct {
212 mach_msg_header_t Head;
213 /* start of the kernel processed data */
214 mach_msg_body_t msgh_body;
215 mach_msg_port_descriptor_t new_set;
216 /* end of the kernel processed data */
217 NDR_record_t NDR;
218 boolean_t wait;
219 } __Request__processor_assign_t __attribute__((unused));
220#ifdef __MigPackStructs
221#pragma pack(pop)
222#endif
223
224#ifdef __MigPackStructs
225#pragma pack(push, 4)
226#endif
227 typedef struct {
228 mach_msg_header_t Head;
229 } __Request__processor_get_assignment_t __attribute__((unused));
230#ifdef __MigPackStructs
231#pragma pack(pop)
232#endif
233#endif /* !__Request__processor_subsystem__defined */
234
235/* union of all requests */
236
237#ifndef __RequestUnion__processor_subsystem__defined
238#define __RequestUnion__processor_subsystem__defined
239union __RequestUnion__processor_subsystem {
240 __Request__processor_start_t Request_processor_start;
241 __Request__processor_exit_t Request_processor_exit;
242 __Request__processor_info_t Request_processor_info;
243 __Request__processor_control_t Request_processor_control;
244 __Request__processor_assign_t Request_processor_assign;
245 __Request__processor_get_assignment_t Request_processor_get_assignment;
246};
247#endif /* !__RequestUnion__processor_subsystem__defined */
248/* typedefs for all replies */
249
250#ifndef __Reply__processor_subsystem__defined
251#define __Reply__processor_subsystem__defined
252
253#ifdef __MigPackStructs
254#pragma pack(push, 4)
255#endif
256 typedef struct {
257 mach_msg_header_t Head;
258 NDR_record_t NDR;
259 kern_return_t RetCode;
260 } __Reply__processor_start_t __attribute__((unused));
261#ifdef __MigPackStructs
262#pragma pack(pop)
263#endif
264
265#ifdef __MigPackStructs
266#pragma pack(push, 4)
267#endif
268 typedef struct {
269 mach_msg_header_t Head;
270 NDR_record_t NDR;
271 kern_return_t RetCode;
272 } __Reply__processor_exit_t __attribute__((unused));
273#ifdef __MigPackStructs
274#pragma pack(pop)
275#endif
276
277#ifdef __MigPackStructs
278#pragma pack(push, 4)
279#endif
280 typedef struct {
281 mach_msg_header_t Head;
282 /* start of the kernel processed data */
283 mach_msg_body_t msgh_body;
284 mach_msg_port_descriptor_t host;
285 /* end of the kernel processed data */
286 NDR_record_t NDR;
287 mach_msg_type_number_t processor_info_outCnt;
288 integer_t processor_info_out[20];
289 } __Reply__processor_info_t __attribute__((unused));
290#ifdef __MigPackStructs
291#pragma pack(pop)
292#endif
293
294#ifdef __MigPackStructs
295#pragma pack(push, 4)
296#endif
297 typedef struct {
298 mach_msg_header_t Head;
299 NDR_record_t NDR;
300 kern_return_t RetCode;
301 } __Reply__processor_control_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 NDR_record_t NDR;
312 kern_return_t RetCode;
313 } __Reply__processor_assign_t __attribute__((unused));
314#ifdef __MigPackStructs
315#pragma pack(pop)
316#endif
317
318#ifdef __MigPackStructs
319#pragma pack(push, 4)
320#endif
321 typedef struct {
322 mach_msg_header_t Head;
323 /* start of the kernel processed data */
324 mach_msg_body_t msgh_body;
325 mach_msg_port_descriptor_t assigned_set;
326 /* end of the kernel processed data */
327 } __Reply__processor_get_assignment_t __attribute__((unused));
328#ifdef __MigPackStructs
329#pragma pack(pop)
330#endif
331#endif /* !__Reply__processor_subsystem__defined */
332
333/* union of all replies */
334
335#ifndef __ReplyUnion__processor_subsystem__defined
336#define __ReplyUnion__processor_subsystem__defined
337union __ReplyUnion__processor_subsystem {
338 __Reply__processor_start_t Reply_processor_start;
339 __Reply__processor_exit_t Reply_processor_exit;
340 __Reply__processor_info_t Reply_processor_info;
341 __Reply__processor_control_t Reply_processor_control;
342 __Reply__processor_assign_t Reply_processor_assign;
343 __Reply__processor_get_assignment_t Reply_processor_get_assignment;
344};
345#endif /* !__RequestUnion__processor_subsystem__defined */
346
347#ifndef subsystem_to_name_map_processor
348#define subsystem_to_name_map_processor \
349 { "processor_start", 3000 },\
350 { "processor_exit", 3001 },\
351 { "processor_info", 3002 },\
352 { "processor_control", 3003 },\
353 { "processor_assign", 3004 },\
354 { "processor_get_assignment", 3005 }
355#endif
356
357#ifdef __AfterMigUserHeader
358__AfterMigUserHeader
359#endif /* __AfterMigUserHeader */
360
361#endif /* _processor_user_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/processor_set.h created+586
......@@ -0,0 +1,586 @@
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 <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 processor_set_statistics */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75kern_return_t processor_set_statistics
76(
77 processor_set_name_t pset,
78 processor_set_flavor_t flavor,
79 processor_set_info_t info_out,
80 mach_msg_type_number_t *info_outCnt
81);
82
83/* Routine processor_set_destroy */
84#ifdef mig_external
85mig_external
86#else
87extern
88#endif /* mig_external */
89kern_return_t processor_set_destroy
90(
91 processor_set_t set
92);
93
94/* Routine processor_set_max_priority */
95#ifdef mig_external
96mig_external
97#else
98extern
99#endif /* mig_external */
100kern_return_t processor_set_max_priority
101(
102 processor_set_t processor_set,
103 int max_priority,
104 boolean_t change_threads
105);
106
107/* Routine processor_set_policy_enable */
108#ifdef mig_external
109mig_external
110#else
111extern
112#endif /* mig_external */
113kern_return_t processor_set_policy_enable
114(
115 processor_set_t processor_set,
116 int policy
117);
118
119/* Routine processor_set_policy_disable */
120#ifdef mig_external
121mig_external
122#else
123extern
124#endif /* mig_external */
125kern_return_t processor_set_policy_disable
126(
127 processor_set_t processor_set,
128 int policy,
129 boolean_t change_threads
130);
131
132/* Routine processor_set_tasks */
133#ifdef mig_external
134mig_external
135#else
136extern
137#endif /* mig_external */
138kern_return_t processor_set_tasks
139(
140 processor_set_t processor_set,
141 task_array_t *task_list,
142 mach_msg_type_number_t *task_listCnt
143);
144
145/* Routine processor_set_threads */
146#ifdef mig_external
147mig_external
148#else
149extern
150#endif /* mig_external */
151kern_return_t processor_set_threads
152(
153 processor_set_t processor_set,
154 thread_act_array_t *thread_list,
155 mach_msg_type_number_t *thread_listCnt
156);
157
158/* Routine processor_set_policy_control */
159#ifdef mig_external
160mig_external
161#else
162extern
163#endif /* mig_external */
164kern_return_t processor_set_policy_control
165(
166 processor_set_t pset,
167 processor_set_flavor_t flavor,
168 processor_set_info_t policy_info,
169 mach_msg_type_number_t policy_infoCnt,
170 boolean_t change
171);
172
173/* Routine processor_set_stack_usage */
174#ifdef mig_external
175mig_external
176#else
177extern
178#endif /* mig_external */
179kern_return_t processor_set_stack_usage
180(
181 processor_set_t pset,
182 unsigned *ltotal,
183 vm_size_t *space,
184 vm_size_t *resident,
185 vm_size_t *maxusage,
186 vm_offset_t *maxstack
187);
188
189/* Routine processor_set_info */
190#ifdef mig_external
191mig_external
192#else
193extern
194#endif /* mig_external */
195kern_return_t processor_set_info
196(
197 processor_set_name_t set_name,
198 int flavor,
199 host_t *host,
200 processor_set_info_t info_out,
201 mach_msg_type_number_t *info_outCnt
202);
203
204/* Routine processor_set_tasks_with_flavor */
205#ifdef mig_external
206mig_external
207#else
208extern
209#endif /* mig_external */
210kern_return_t processor_set_tasks_with_flavor
211(
212 processor_set_t processor_set,
213 mach_task_flavor_t flavor,
214 task_array_t *task_list,
215 mach_msg_type_number_t *task_listCnt
216);
217
218__END_DECLS
219
220/********************** Caution **************************/
221/* The following data types should be used to calculate */
222/* maximum message sizes only. The actual message may be */
223/* smaller, and the position of the arguments within the */
224/* message layout may vary from what is presented here. */
225/* For example, if any of the arguments are variable- */
226/* sized, and less than the maximum is sent, the data */
227/* will be packed tight in the actual message to reduce */
228/* the presence of holes. */
229/********************** Caution **************************/
230
231/* typedefs for all requests */
232
233#ifndef __Request__processor_set_subsystem__defined
234#define __Request__processor_set_subsystem__defined
235
236#ifdef __MigPackStructs
237#pragma pack(push, 4)
238#endif
239 typedef struct {
240 mach_msg_header_t Head;
241 NDR_record_t NDR;
242 processor_set_flavor_t flavor;
243 mach_msg_type_number_t info_outCnt;
244 } __Request__processor_set_statistics_t __attribute__((unused));
245#ifdef __MigPackStructs
246#pragma pack(pop)
247#endif
248
249#ifdef __MigPackStructs
250#pragma pack(push, 4)
251#endif
252 typedef struct {
253 mach_msg_header_t Head;
254 } __Request__processor_set_destroy_t __attribute__((unused));
255#ifdef __MigPackStructs
256#pragma pack(pop)
257#endif
258
259#ifdef __MigPackStructs
260#pragma pack(push, 4)
261#endif
262 typedef struct {
263 mach_msg_header_t Head;
264 NDR_record_t NDR;
265 int max_priority;
266 boolean_t change_threads;
267 } __Request__processor_set_max_priority_t __attribute__((unused));
268#ifdef __MigPackStructs
269#pragma pack(pop)
270#endif
271
272#ifdef __MigPackStructs
273#pragma pack(push, 4)
274#endif
275 typedef struct {
276 mach_msg_header_t Head;
277 NDR_record_t NDR;
278 int policy;
279 } __Request__processor_set_policy_enable_t __attribute__((unused));
280#ifdef __MigPackStructs
281#pragma pack(pop)
282#endif
283
284#ifdef __MigPackStructs
285#pragma pack(push, 4)
286#endif
287 typedef struct {
288 mach_msg_header_t Head;
289 NDR_record_t NDR;
290 int policy;
291 boolean_t change_threads;
292 } __Request__processor_set_policy_disable_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 } __Request__processor_set_tasks_t __attribute__((unused));
303#ifdef __MigPackStructs
304#pragma pack(pop)
305#endif
306
307#ifdef __MigPackStructs
308#pragma pack(push, 4)
309#endif
310 typedef struct {
311 mach_msg_header_t Head;
312 } __Request__processor_set_threads_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 NDR_record_t NDR;
323 processor_set_flavor_t flavor;
324 mach_msg_type_number_t policy_infoCnt;
325 integer_t policy_info[5];
326 boolean_t change;
327 } __Request__processor_set_policy_control_t __attribute__((unused));
328#ifdef __MigPackStructs
329#pragma pack(pop)
330#endif
331
332#ifdef __MigPackStructs
333#pragma pack(push, 4)
334#endif
335 typedef struct {
336 mach_msg_header_t Head;
337 } __Request__processor_set_stack_usage_t __attribute__((unused));
338#ifdef __MigPackStructs
339#pragma pack(pop)
340#endif
341
342#ifdef __MigPackStructs
343#pragma pack(push, 4)
344#endif
345 typedef struct {
346 mach_msg_header_t Head;
347 NDR_record_t NDR;
348 int flavor;
349 mach_msg_type_number_t info_outCnt;
350 } __Request__processor_set_info_t __attribute__((unused));
351#ifdef __MigPackStructs
352#pragma pack(pop)
353#endif
354
355#ifdef __MigPackStructs
356#pragma pack(push, 4)
357#endif
358 typedef struct {
359 mach_msg_header_t Head;
360 NDR_record_t NDR;
361 mach_task_flavor_t flavor;
362 } __Request__processor_set_tasks_with_flavor_t __attribute__((unused));
363#ifdef __MigPackStructs
364#pragma pack(pop)
365#endif
366#endif /* !__Request__processor_set_subsystem__defined */
367
368/* union of all requests */
369
370#ifndef __RequestUnion__processor_set_subsystem__defined
371#define __RequestUnion__processor_set_subsystem__defined
372union __RequestUnion__processor_set_subsystem {
373 __Request__processor_set_statistics_t Request_processor_set_statistics;
374 __Request__processor_set_destroy_t Request_processor_set_destroy;
375 __Request__processor_set_max_priority_t Request_processor_set_max_priority;
376 __Request__processor_set_policy_enable_t Request_processor_set_policy_enable;
377 __Request__processor_set_policy_disable_t Request_processor_set_policy_disable;
378 __Request__processor_set_tasks_t Request_processor_set_tasks;
379 __Request__processor_set_threads_t Request_processor_set_threads;
380 __Request__processor_set_policy_control_t Request_processor_set_policy_control;
381 __Request__processor_set_stack_usage_t Request_processor_set_stack_usage;
382 __Request__processor_set_info_t Request_processor_set_info;
383 __Request__processor_set_tasks_with_flavor_t Request_processor_set_tasks_with_flavor;
384};
385#endif /* !__RequestUnion__processor_set_subsystem__defined */
386/* typedefs for all replies */
387
388#ifndef __Reply__processor_set_subsystem__defined
389#define __Reply__processor_set_subsystem__defined
390
391#ifdef __MigPackStructs
392#pragma pack(push, 4)
393#endif
394 typedef struct {
395 mach_msg_header_t Head;
396 NDR_record_t NDR;
397 kern_return_t RetCode;
398 mach_msg_type_number_t info_outCnt;
399 integer_t info_out[5];
400 } __Reply__processor_set_statistics_t __attribute__((unused));
401#ifdef __MigPackStructs
402#pragma pack(pop)
403#endif
404
405#ifdef __MigPackStructs
406#pragma pack(push, 4)
407#endif
408 typedef struct {
409 mach_msg_header_t Head;
410 NDR_record_t NDR;
411 kern_return_t RetCode;
412 } __Reply__processor_set_destroy_t __attribute__((unused));
413#ifdef __MigPackStructs
414#pragma pack(pop)
415#endif
416
417#ifdef __MigPackStructs
418#pragma pack(push, 4)
419#endif
420 typedef struct {
421 mach_msg_header_t Head;
422 NDR_record_t NDR;
423 kern_return_t RetCode;
424 } __Reply__processor_set_max_priority_t __attribute__((unused));
425#ifdef __MigPackStructs
426#pragma pack(pop)
427#endif
428
429#ifdef __MigPackStructs
430#pragma pack(push, 4)
431#endif
432 typedef struct {
433 mach_msg_header_t Head;
434 NDR_record_t NDR;
435 kern_return_t RetCode;
436 } __Reply__processor_set_policy_enable_t __attribute__((unused));
437#ifdef __MigPackStructs
438#pragma pack(pop)
439#endif
440
441#ifdef __MigPackStructs
442#pragma pack(push, 4)
443#endif
444 typedef struct {
445 mach_msg_header_t Head;
446 NDR_record_t NDR;
447 kern_return_t RetCode;
448 } __Reply__processor_set_policy_disable_t __attribute__((unused));
449#ifdef __MigPackStructs
450#pragma pack(pop)
451#endif
452
453#ifdef __MigPackStructs
454#pragma pack(push, 4)
455#endif
456 typedef struct {
457 mach_msg_header_t Head;
458 /* start of the kernel processed data */
459 mach_msg_body_t msgh_body;
460 mach_msg_ool_ports_descriptor_t task_list;
461 /* end of the kernel processed data */
462 NDR_record_t NDR;
463 mach_msg_type_number_t task_listCnt;
464 } __Reply__processor_set_tasks_t __attribute__((unused));
465#ifdef __MigPackStructs
466#pragma pack(pop)
467#endif
468
469#ifdef __MigPackStructs
470#pragma pack(push, 4)
471#endif
472 typedef struct {
473 mach_msg_header_t Head;
474 /* start of the kernel processed data */
475 mach_msg_body_t msgh_body;
476 mach_msg_ool_ports_descriptor_t thread_list;
477 /* end of the kernel processed data */
478 NDR_record_t NDR;
479 mach_msg_type_number_t thread_listCnt;
480 } __Reply__processor_set_threads_t __attribute__((unused));
481#ifdef __MigPackStructs
482#pragma pack(pop)
483#endif
484
485#ifdef __MigPackStructs
486#pragma pack(push, 4)
487#endif
488 typedef struct {
489 mach_msg_header_t Head;
490 NDR_record_t NDR;
491 kern_return_t RetCode;
492 } __Reply__processor_set_policy_control_t __attribute__((unused));
493#ifdef __MigPackStructs
494#pragma pack(pop)
495#endif
496
497#ifdef __MigPackStructs
498#pragma pack(push, 4)
499#endif
500 typedef struct {
501 mach_msg_header_t Head;
502 NDR_record_t NDR;
503 kern_return_t RetCode;
504 unsigned ltotal;
505 vm_size_t space;
506 vm_size_t resident;
507 vm_size_t maxusage;
508 vm_offset_t maxstack;
509 } __Reply__processor_set_stack_usage_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 /* start of the kernel processed data */
520 mach_msg_body_t msgh_body;
521 mach_msg_port_descriptor_t host;
522 /* end of the kernel processed data */
523 NDR_record_t NDR;
524 mach_msg_type_number_t info_outCnt;
525 integer_t info_out[5];
526 } __Reply__processor_set_info_t __attribute__((unused));
527#ifdef __MigPackStructs
528#pragma pack(pop)
529#endif
530
531#ifdef __MigPackStructs
532#pragma pack(push, 4)
533#endif
534 typedef struct {
535 mach_msg_header_t Head;
536 /* start of the kernel processed data */
537 mach_msg_body_t msgh_body;
538 mach_msg_ool_ports_descriptor_t task_list;
539 /* end of the kernel processed data */
540 NDR_record_t NDR;
541 mach_msg_type_number_t task_listCnt;
542 } __Reply__processor_set_tasks_with_flavor_t __attribute__((unused));
543#ifdef __MigPackStructs
544#pragma pack(pop)
545#endif
546#endif /* !__Reply__processor_set_subsystem__defined */
547
548/* union of all replies */
549
550#ifndef __ReplyUnion__processor_set_subsystem__defined
551#define __ReplyUnion__processor_set_subsystem__defined
552union __ReplyUnion__processor_set_subsystem {
553 __Reply__processor_set_statistics_t Reply_processor_set_statistics;
554 __Reply__processor_set_destroy_t Reply_processor_set_destroy;
555 __Reply__processor_set_max_priority_t Reply_processor_set_max_priority;
556 __Reply__processor_set_policy_enable_t Reply_processor_set_policy_enable;
557 __Reply__processor_set_policy_disable_t Reply_processor_set_policy_disable;
558 __Reply__processor_set_tasks_t Reply_processor_set_tasks;
559 __Reply__processor_set_threads_t Reply_processor_set_threads;
560 __Reply__processor_set_policy_control_t Reply_processor_set_policy_control;
561 __Reply__processor_set_stack_usage_t Reply_processor_set_stack_usage;
562 __Reply__processor_set_info_t Reply_processor_set_info;
563 __Reply__processor_set_tasks_with_flavor_t Reply_processor_set_tasks_with_flavor;
564};
565#endif /* !__RequestUnion__processor_set_subsystem__defined */
566
567#ifndef subsystem_to_name_map_processor_set
568#define subsystem_to_name_map_processor_set \
569 { "processor_set_statistics", 4000 },\
570 { "processor_set_destroy", 4001 },\
571 { "processor_set_max_priority", 4002 },\
572 { "processor_set_policy_enable", 4003 },\
573 { "processor_set_policy_disable", 4004 },\
574 { "processor_set_tasks", 4005 },\
575 { "processor_set_threads", 4006 },\
576 { "processor_set_policy_control", 4007 },\
577 { "processor_set_stack_usage", 4008 },\
578 { "processor_set_info", 4009 },\
579 { "processor_set_tasks_with_flavor", 4010 }
580#endif
581
582#ifdef __AfterMigUserHeader
583__AfterMigUserHeader
584#endif /* __AfterMigUserHeader */
585
586#endif /* _processor_set_user_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/thread_act.h created+1424
......@@ -0,0 +1,1424 @@
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 31
53#endif /* thread_act_MSG_COUNT */
54
55#include <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 thread_terminate */
70#ifdef mig_external
71mig_external
72#else
73extern
74#endif /* mig_external */
75__TVOS_PROHIBITED __WATCHOS_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__TVOS_PROHIBITED __WATCHOS_PROHIBITED
88kern_return_t act_get_state
89(
90 thread_read_t target_act,
91 int flavor,
92 thread_state_t old_state,
93 mach_msg_type_number_t *old_stateCnt
94);
95
96/* Routine act_set_state */
97#ifdef mig_external
98mig_external
99#else
100extern
101#endif /* mig_external */
102__TVOS_PROHIBITED __WATCHOS_PROHIBITED
103kern_return_t act_set_state
104(
105 thread_act_t target_act,
106 int flavor,
107 thread_state_t new_state,
108 mach_msg_type_number_t new_stateCnt
109);
110
111/* Routine thread_get_state */
112#ifdef mig_external
113mig_external
114#else
115extern
116#endif /* mig_external */
117__WATCHOS_PROHIBITED
118kern_return_t thread_get_state
119(
120 thread_read_t target_act,
121 thread_state_flavor_t flavor,
122 thread_state_t old_state,
123 mach_msg_type_number_t *old_stateCnt
124);
125
126/* Routine thread_set_state */
127#ifdef mig_external
128mig_external
129#else
130extern
131#endif /* mig_external */
132__WATCHOS_PROHIBITED
133kern_return_t thread_set_state
134(
135 thread_act_t target_act,
136 thread_state_flavor_t flavor,
137 thread_state_t new_state,
138 mach_msg_type_number_t new_stateCnt
139);
140
141/* Routine thread_suspend */
142#ifdef mig_external
143mig_external
144#else
145extern
146#endif /* mig_external */
147__WATCHOS_PROHIBITED
148kern_return_t thread_suspend
149(
150 thread_read_t target_act
151);
152
153/* Routine thread_resume */
154#ifdef mig_external
155mig_external
156#else
157extern
158#endif /* mig_external */
159__WATCHOS_PROHIBITED
160kern_return_t thread_resume
161(
162 thread_read_t target_act
163);
164
165/* Routine thread_abort */
166#ifdef mig_external
167mig_external
168#else
169extern
170#endif /* mig_external */
171__WATCHOS_PROHIBITED
172kern_return_t thread_abort
173(
174 thread_act_t target_act
175);
176
177/* Routine thread_abort_safely */
178#ifdef mig_external
179mig_external
180#else
181extern
182#endif /* mig_external */
183__WATCHOS_PROHIBITED
184kern_return_t thread_abort_safely
185(
186 thread_act_t target_act
187);
188
189/* Routine thread_depress_abort */
190#ifdef mig_external
191mig_external
192#else
193extern
194#endif /* mig_external */
195__TVOS_PROHIBITED __WATCHOS_PROHIBITED
196kern_return_t thread_depress_abort
197(
198 thread_act_t thread
199);
200
201/* Routine thread_get_special_port */
202#ifdef mig_external
203mig_external
204#else
205extern
206#endif /* mig_external */
207__TVOS_PROHIBITED __WATCHOS_PROHIBITED
208kern_return_t thread_get_special_port
209(
210 thread_inspect_t thr_act,
211 int which_port,
212 mach_port_t *special_port
213);
214
215/* Routine thread_set_special_port */
216#ifdef mig_external
217mig_external
218#else
219extern
220#endif /* mig_external */
221__TVOS_PROHIBITED __WATCHOS_PROHIBITED
222kern_return_t thread_set_special_port
223(
224 thread_act_t thr_act,
225 int which_port,
226 mach_port_t special_port
227);
228
229/* Routine thread_info */
230#ifdef mig_external
231mig_external
232#else
233extern
234#endif /* mig_external */
235kern_return_t thread_info
236(
237 thread_inspect_t target_act,
238 thread_flavor_t flavor,
239 thread_info_t thread_info_out,
240 mach_msg_type_number_t *thread_info_outCnt
241);
242
243/* Routine thread_set_exception_ports */
244#ifdef mig_external
245mig_external
246#else
247extern
248#endif /* mig_external */
249__TVOS_PROHIBITED __WATCHOS_PROHIBITED
250kern_return_t thread_set_exception_ports
251(
252 thread_act_t thread,
253 exception_mask_t exception_mask,
254 mach_port_t new_port,
255 exception_behavior_t behavior,
256 thread_state_flavor_t new_flavor
257);
258
259/* Routine thread_get_exception_ports */
260#ifdef mig_external
261mig_external
262#else
263extern
264#endif /* mig_external */
265__TVOS_PROHIBITED __WATCHOS_PROHIBITED
266kern_return_t thread_get_exception_ports
267(
268 thread_act_t thread,
269 exception_mask_t exception_mask,
270 exception_mask_array_t masks,
271 mach_msg_type_number_t *masksCnt,
272 exception_handler_array_t old_handlers,
273 exception_behavior_array_t old_behaviors,
274 exception_flavor_array_t old_flavors
275);
276
277/* Routine thread_swap_exception_ports */
278#ifdef mig_external
279mig_external
280#else
281extern
282#endif /* mig_external */
283__TVOS_PROHIBITED __WATCHOS_PROHIBITED
284kern_return_t thread_swap_exception_ports
285(
286 thread_act_t thread,
287 exception_mask_t exception_mask,
288 mach_port_t new_port,
289 exception_behavior_t behavior,
290 thread_state_flavor_t new_flavor,
291 exception_mask_array_t masks,
292 mach_msg_type_number_t *masksCnt,
293 exception_handler_array_t old_handlers,
294 exception_behavior_array_t old_behaviors,
295 exception_flavor_array_t old_flavors
296);
297
298/* Routine thread_policy */
299#ifdef mig_external
300mig_external
301#else
302extern
303#endif /* mig_external */
304kern_return_t thread_policy
305(
306 thread_act_t thr_act,
307 policy_t policy,
308 policy_base_t base,
309 mach_msg_type_number_t baseCnt,
310 boolean_t set_limit
311);
312
313/* Routine thread_policy_set */
314#ifdef mig_external
315mig_external
316#else
317extern
318#endif /* mig_external */
319kern_return_t thread_policy_set
320(
321 thread_act_t thread,
322 thread_policy_flavor_t flavor,
323 thread_policy_t policy_info,
324 mach_msg_type_number_t policy_infoCnt
325);
326
327/* Routine thread_policy_get */
328#ifdef mig_external
329mig_external
330#else
331extern
332#endif /* mig_external */
333kern_return_t thread_policy_get
334(
335 thread_inspect_t thread,
336 thread_policy_flavor_t flavor,
337 thread_policy_t policy_info,
338 mach_msg_type_number_t *policy_infoCnt,
339 boolean_t *get_default
340);
341
342/* Routine thread_sample */
343#ifdef mig_external
344mig_external
345#else
346extern
347#endif /* mig_external */
348kern_return_t thread_sample
349(
350 thread_act_t thread,
351 mach_port_t reply
352);
353
354/* Routine etap_trace_thread */
355#ifdef mig_external
356mig_external
357#else
358extern
359#endif /* mig_external */
360kern_return_t etap_trace_thread
361(
362 thread_act_t target_act,
363 boolean_t trace_status
364);
365
366/* Routine thread_assign */
367#ifdef mig_external
368mig_external
369#else
370extern
371#endif /* mig_external */
372kern_return_t thread_assign
373(
374 thread_act_t thread,
375 processor_set_t new_set
376);
377
378/* Routine thread_assign_default */
379#ifdef mig_external
380mig_external
381#else
382extern
383#endif /* mig_external */
384kern_return_t thread_assign_default
385(
386 thread_act_t thread
387);
388
389/* Routine thread_get_assignment */
390#ifdef mig_external
391mig_external
392#else
393extern
394#endif /* mig_external */
395kern_return_t thread_get_assignment
396(
397 thread_inspect_t thread,
398 processor_set_name_t *assigned_set
399);
400
401/* Routine thread_set_policy */
402#ifdef mig_external
403mig_external
404#else
405extern
406#endif /* mig_external */
407kern_return_t thread_set_policy
408(
409 thread_act_t thr_act,
410 processor_set_t pset,
411 policy_t policy,
412 policy_base_t base,
413 mach_msg_type_number_t baseCnt,
414 policy_limit_t limit,
415 mach_msg_type_number_t limitCnt
416);
417
418/* Routine thread_get_mach_voucher */
419#ifdef mig_external
420mig_external
421#else
422extern
423#endif /* mig_external */
424__TVOS_PROHIBITED __WATCHOS_PROHIBITED
425kern_return_t thread_get_mach_voucher
426(
427 thread_read_t thr_act,
428 mach_voucher_selector_t which,
429 ipc_voucher_t *voucher
430);
431
432/* Routine thread_set_mach_voucher */
433#ifdef mig_external
434mig_external
435#else
436extern
437#endif /* mig_external */
438__TVOS_PROHIBITED __WATCHOS_PROHIBITED
439kern_return_t thread_set_mach_voucher
440(
441 thread_act_t thr_act,
442 ipc_voucher_t voucher
443);
444
445/* Routine thread_swap_mach_voucher */
446#ifdef mig_external
447mig_external
448#else
449extern
450#endif /* mig_external */
451__TVOS_PROHIBITED __WATCHOS_PROHIBITED
452kern_return_t thread_swap_mach_voucher
453(
454 thread_act_t thr_act,
455 ipc_voucher_t new_voucher,
456 ipc_voucher_t *old_voucher
457);
458
459/* Routine thread_convert_thread_state */
460#ifdef mig_external
461mig_external
462#else
463extern
464#endif /* mig_external */
465kern_return_t thread_convert_thread_state
466(
467 thread_act_t thread,
468 int direction,
469 thread_state_flavor_t flavor,
470 thread_state_t in_state,
471 mach_msg_type_number_t in_stateCnt,
472 thread_state_t out_state,
473 mach_msg_type_number_t *out_stateCnt
474);
475
476/* Routine thread_get_exception_ports_info */
477#ifdef mig_external
478mig_external
479#else
480extern
481#endif /* mig_external */
482kern_return_t thread_get_exception_ports_info
483(
484 mach_port_t port,
485 exception_mask_t exception_mask,
486 exception_mask_array_t masks,
487 mach_msg_type_number_t *masksCnt,
488 exception_handler_info_array_t old_handlers_info,
489 exception_behavior_array_t old_behaviors,
490 exception_flavor_array_t old_flavors
491);
492
493__END_DECLS
494
495/********************** Caution **************************/
496/* The following data types should be used to calculate */
497/* maximum message sizes only. The actual message may be */
498/* smaller, and the position of the arguments within the */
499/* message layout may vary from what is presented here. */
500/* For example, if any of the arguments are variable- */
501/* sized, and less than the maximum is sent, the data */
502/* will be packed tight in the actual message to reduce */
503/* the presence of holes. */
504/********************** Caution **************************/
505
506/* typedefs for all requests */
507
508#ifndef __Request__thread_act_subsystem__defined
509#define __Request__thread_act_subsystem__defined
510
511#ifdef __MigPackStructs
512#pragma pack(push, 4)
513#endif
514 typedef struct {
515 mach_msg_header_t Head;
516 } __Request__thread_terminate_t __attribute__((unused));
517#ifdef __MigPackStructs
518#pragma pack(pop)
519#endif
520
521#ifdef __MigPackStructs
522#pragma pack(push, 4)
523#endif
524 typedef struct {
525 mach_msg_header_t Head;
526 NDR_record_t NDR;
527 int flavor;
528 mach_msg_type_number_t old_stateCnt;
529 } __Request__act_get_state_t __attribute__((unused));
530#ifdef __MigPackStructs
531#pragma pack(pop)
532#endif
533
534#ifdef __MigPackStructs
535#pragma pack(push, 4)
536#endif
537 typedef struct {
538 mach_msg_header_t Head;
539 NDR_record_t NDR;
540 int flavor;
541 mach_msg_type_number_t new_stateCnt;
542 natural_t new_state[1296];
543 } __Request__act_set_state_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 thread_state_flavor_t flavor;
555 mach_msg_type_number_t old_stateCnt;
556 } __Request__thread_get_state_t __attribute__((unused));
557#ifdef __MigPackStructs
558#pragma pack(pop)
559#endif
560
561#ifdef __MigPackStructs
562#pragma pack(push, 4)
563#endif
564 typedef struct {
565 mach_msg_header_t Head;
566 NDR_record_t NDR;
567 thread_state_flavor_t flavor;
568 mach_msg_type_number_t new_stateCnt;
569 natural_t new_state[1296];
570 } __Request__thread_set_state_t __attribute__((unused));
571#ifdef __MigPackStructs
572#pragma pack(pop)
573#endif
574
575#ifdef __MigPackStructs
576#pragma pack(push, 4)
577#endif
578 typedef struct {
579 mach_msg_header_t Head;
580 } __Request__thread_suspend_t __attribute__((unused));
581#ifdef __MigPackStructs
582#pragma pack(pop)
583#endif
584
585#ifdef __MigPackStructs
586#pragma pack(push, 4)
587#endif
588 typedef struct {
589 mach_msg_header_t Head;
590 } __Request__thread_resume_t __attribute__((unused));
591#ifdef __MigPackStructs
592#pragma pack(pop)
593#endif
594
595#ifdef __MigPackStructs
596#pragma pack(push, 4)
597#endif
598 typedef struct {
599 mach_msg_header_t Head;
600 } __Request__thread_abort_t __attribute__((unused));
601#ifdef __MigPackStructs
602#pragma pack(pop)
603#endif
604
605#ifdef __MigPackStructs
606#pragma pack(push, 4)
607#endif
608 typedef struct {
609 mach_msg_header_t Head;
610 } __Request__thread_abort_safely_t __attribute__((unused));
611#ifdef __MigPackStructs
612#pragma pack(pop)
613#endif
614
615#ifdef __MigPackStructs
616#pragma pack(push, 4)
617#endif
618 typedef struct {
619 mach_msg_header_t Head;
620 } __Request__thread_depress_abort_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 int which_port;
632 } __Request__thread_get_special_port_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 special_port;
645 /* end of the kernel processed data */
646 NDR_record_t NDR;
647 int which_port;
648 } __Request__thread_set_special_port_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 thread_flavor_t flavor;
660 mach_msg_type_number_t thread_info_outCnt;
661 } __Request__thread_info_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 /* start of the kernel processed data */
672 mach_msg_body_t msgh_body;
673 mach_msg_port_descriptor_t new_port;
674 /* end of the kernel processed data */
675 NDR_record_t NDR;
676 exception_mask_t exception_mask;
677 exception_behavior_t behavior;
678 thread_state_flavor_t new_flavor;
679 } __Request__thread_set_exception_ports_t __attribute__((unused));
680#ifdef __MigPackStructs
681#pragma pack(pop)
682#endif
683
684#ifdef __MigPackStructs
685#pragma pack(push, 4)
686#endif
687 typedef struct {
688 mach_msg_header_t Head;
689 NDR_record_t NDR;
690 exception_mask_t exception_mask;
691 } __Request__thread_get_exception_ports_t __attribute__((unused));
692#ifdef __MigPackStructs
693#pragma pack(pop)
694#endif
695
696#ifdef __MigPackStructs
697#pragma pack(push, 4)
698#endif
699 typedef struct {
700 mach_msg_header_t Head;
701 /* start of the kernel processed data */
702 mach_msg_body_t msgh_body;
703 mach_msg_port_descriptor_t new_port;
704 /* end of the kernel processed data */
705 NDR_record_t NDR;
706 exception_mask_t exception_mask;
707 exception_behavior_t behavior;
708 thread_state_flavor_t new_flavor;
709 } __Request__thread_swap_exception_ports_t __attribute__((unused));
710#ifdef __MigPackStructs
711#pragma pack(pop)
712#endif
713
714#ifdef __MigPackStructs
715#pragma pack(push, 4)
716#endif
717 typedef struct {
718 mach_msg_header_t Head;
719 NDR_record_t NDR;
720 policy_t policy;
721 mach_msg_type_number_t baseCnt;
722 integer_t base[5];
723 boolean_t set_limit;
724 } __Request__thread_policy_t __attribute__((unused));
725#ifdef __MigPackStructs
726#pragma pack(pop)
727#endif
728
729#ifdef __MigPackStructs
730#pragma pack(push, 4)
731#endif
732 typedef struct {
733 mach_msg_header_t Head;
734 NDR_record_t NDR;
735 thread_policy_flavor_t flavor;
736 mach_msg_type_number_t policy_infoCnt;
737 integer_t policy_info[16];
738 } __Request__thread_policy_set_t __attribute__((unused));
739#ifdef __MigPackStructs
740#pragma pack(pop)
741#endif
742
743#ifdef __MigPackStructs
744#pragma pack(push, 4)
745#endif
746 typedef struct {
747 mach_msg_header_t Head;
748 NDR_record_t NDR;
749 thread_policy_flavor_t flavor;
750 mach_msg_type_number_t policy_infoCnt;
751 boolean_t get_default;
752 } __Request__thread_policy_get_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 /* start of the kernel processed data */
763 mach_msg_body_t msgh_body;
764 mach_msg_port_descriptor_t reply;
765 /* end of the kernel processed data */
766 } __Request__thread_sample_t __attribute__((unused));
767#ifdef __MigPackStructs
768#pragma pack(pop)
769#endif
770
771#ifdef __MigPackStructs
772#pragma pack(push, 4)
773#endif
774 typedef struct {
775 mach_msg_header_t Head;
776 NDR_record_t NDR;
777 boolean_t trace_status;
778 } __Request__etap_trace_thread_t __attribute__((unused));
779#ifdef __MigPackStructs
780#pragma pack(pop)
781#endif
782
783#ifdef __MigPackStructs
784#pragma pack(push, 4)
785#endif
786 typedef struct {
787 mach_msg_header_t Head;
788 /* start of the kernel processed data */
789 mach_msg_body_t msgh_body;
790 mach_msg_port_descriptor_t new_set;
791 /* end of the kernel processed data */
792 } __Request__thread_assign_t __attribute__((unused));
793#ifdef __MigPackStructs
794#pragma pack(pop)
795#endif
796
797#ifdef __MigPackStructs
798#pragma pack(push, 4)
799#endif
800 typedef struct {
801 mach_msg_header_t Head;
802 } __Request__thread_assign_default_t __attribute__((unused));
803#ifdef __MigPackStructs
804#pragma pack(pop)
805#endif
806
807#ifdef __MigPackStructs
808#pragma pack(push, 4)
809#endif
810 typedef struct {
811 mach_msg_header_t Head;
812 } __Request__thread_get_assignment_t __attribute__((unused));
813#ifdef __MigPackStructs
814#pragma pack(pop)
815#endif
816
817#ifdef __MigPackStructs
818#pragma pack(push, 4)
819#endif
820 typedef struct {
821 mach_msg_header_t Head;
822 /* start of the kernel processed data */
823 mach_msg_body_t msgh_body;
824 mach_msg_port_descriptor_t pset;
825 /* end of the kernel processed data */
826 NDR_record_t NDR;
827 policy_t policy;
828 mach_msg_type_number_t baseCnt;
829 integer_t base[5];
830 mach_msg_type_number_t limitCnt;
831 integer_t limit[1];
832 } __Request__thread_set_policy_t __attribute__((unused));
833#ifdef __MigPackStructs
834#pragma pack(pop)
835#endif
836
837#ifdef __MigPackStructs
838#pragma pack(push, 4)
839#endif
840 typedef struct {
841 mach_msg_header_t Head;
842 NDR_record_t NDR;
843 mach_voucher_selector_t which;
844 } __Request__thread_get_mach_voucher_t __attribute__((unused));
845#ifdef __MigPackStructs
846#pragma pack(pop)
847#endif
848
849#ifdef __MigPackStructs
850#pragma pack(push, 4)
851#endif
852 typedef struct {
853 mach_msg_header_t Head;
854 /* start of the kernel processed data */
855 mach_msg_body_t msgh_body;
856 mach_msg_port_descriptor_t voucher;
857 /* end of the kernel processed data */
858 } __Request__thread_set_mach_voucher_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 /* start of the kernel processed data */
869 mach_msg_body_t msgh_body;
870 mach_msg_port_descriptor_t new_voucher;
871 mach_msg_port_descriptor_t old_voucher;
872 /* end of the kernel processed data */
873 } __Request__thread_swap_mach_voucher_t __attribute__((unused));
874#ifdef __MigPackStructs
875#pragma pack(pop)
876#endif
877
878#ifdef __MigPackStructs
879#pragma pack(push, 4)
880#endif
881 typedef struct {
882 mach_msg_header_t Head;
883 NDR_record_t NDR;
884 int direction;
885 thread_state_flavor_t flavor;
886 mach_msg_type_number_t in_stateCnt;
887 natural_t in_state[1296];
888 mach_msg_type_number_t out_stateCnt;
889 } __Request__thread_convert_thread_state_t __attribute__((unused));
890#ifdef __MigPackStructs
891#pragma pack(pop)
892#endif
893
894#ifdef __MigPackStructs
895#pragma pack(push, 4)
896#endif
897 typedef struct {
898 mach_msg_header_t Head;
899 NDR_record_t NDR;
900 exception_mask_t exception_mask;
901 } __Request__thread_get_exception_ports_info_t __attribute__((unused));
902#ifdef __MigPackStructs
903#pragma pack(pop)
904#endif
905#endif /* !__Request__thread_act_subsystem__defined */
906
907/* union of all requests */
908
909#ifndef __RequestUnion__thread_act_subsystem__defined
910#define __RequestUnion__thread_act_subsystem__defined
911union __RequestUnion__thread_act_subsystem {
912 __Request__thread_terminate_t Request_thread_terminate;
913 __Request__act_get_state_t Request_act_get_state;
914 __Request__act_set_state_t Request_act_set_state;
915 __Request__thread_get_state_t Request_thread_get_state;
916 __Request__thread_set_state_t Request_thread_set_state;
917 __Request__thread_suspend_t Request_thread_suspend;
918 __Request__thread_resume_t Request_thread_resume;
919 __Request__thread_abort_t Request_thread_abort;
920 __Request__thread_abort_safely_t Request_thread_abort_safely;
921 __Request__thread_depress_abort_t Request_thread_depress_abort;
922 __Request__thread_get_special_port_t Request_thread_get_special_port;
923 __Request__thread_set_special_port_t Request_thread_set_special_port;
924 __Request__thread_info_t Request_thread_info;
925 __Request__thread_set_exception_ports_t Request_thread_set_exception_ports;
926 __Request__thread_get_exception_ports_t Request_thread_get_exception_ports;
927 __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports;
928 __Request__thread_policy_t Request_thread_policy;
929 __Request__thread_policy_set_t Request_thread_policy_set;
930 __Request__thread_policy_get_t Request_thread_policy_get;
931 __Request__thread_sample_t Request_thread_sample;
932 __Request__etap_trace_thread_t Request_etap_trace_thread;
933 __Request__thread_assign_t Request_thread_assign;
934 __Request__thread_assign_default_t Request_thread_assign_default;
935 __Request__thread_get_assignment_t Request_thread_get_assignment;
936 __Request__thread_set_policy_t Request_thread_set_policy;
937 __Request__thread_get_mach_voucher_t Request_thread_get_mach_voucher;
938 __Request__thread_set_mach_voucher_t Request_thread_set_mach_voucher;
939 __Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher;
940 __Request__thread_convert_thread_state_t Request_thread_convert_thread_state;
941 __Request__thread_get_exception_ports_info_t Request_thread_get_exception_ports_info;
942};
943#endif /* !__RequestUnion__thread_act_subsystem__defined */
944/* typedefs for all replies */
945
946#ifndef __Reply__thread_act_subsystem__defined
947#define __Reply__thread_act_subsystem__defined
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 kern_return_t RetCode;
956 } __Reply__thread_terminate_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 kern_return_t RetCode;
968 mach_msg_type_number_t old_stateCnt;
969 natural_t old_state[1296];
970 } __Reply__act_get_state_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 NDR_record_t NDR;
981 kern_return_t RetCode;
982 } __Reply__act_set_state_t __attribute__((unused));
983#ifdef __MigPackStructs
984#pragma pack(pop)
985#endif
986
987#ifdef __MigPackStructs
988#pragma pack(push, 4)
989#endif
990 typedef struct {
991 mach_msg_header_t Head;
992 NDR_record_t NDR;
993 kern_return_t RetCode;
994 mach_msg_type_number_t old_stateCnt;
995 natural_t old_state[1296];
996 } __Reply__thread_get_state_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__thread_set_state_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__thread_suspend_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__thread_resume_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 NDR_record_t NDR;
1043 kern_return_t RetCode;
1044 } __Reply__thread_abort_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 kern_return_t RetCode;
1056 } __Reply__thread_abort_safely_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 NDR_record_t NDR;
1067 kern_return_t RetCode;
1068 } __Reply__thread_depress_abort_t __attribute__((unused));
1069#ifdef __MigPackStructs
1070#pragma pack(pop)
1071#endif
1072
1073#ifdef __MigPackStructs
1074#pragma pack(push, 4)
1075#endif
1076 typedef struct {
1077 mach_msg_header_t Head;
1078 /* start of the kernel processed data */
1079 mach_msg_body_t msgh_body;
1080 mach_msg_port_descriptor_t special_port;
1081 /* end of the kernel processed data */
1082 } __Reply__thread_get_special_port_t __attribute__((unused));
1083#ifdef __MigPackStructs
1084#pragma pack(pop)
1085#endif
1086
1087#ifdef __MigPackStructs
1088#pragma pack(push, 4)
1089#endif
1090 typedef struct {
1091 mach_msg_header_t Head;
1092 NDR_record_t NDR;
1093 kern_return_t RetCode;
1094 } __Reply__thread_set_special_port_t __attribute__((unused));
1095#ifdef __MigPackStructs
1096#pragma pack(pop)
1097#endif
1098
1099#ifdef __MigPackStructs
1100#pragma pack(push, 4)
1101#endif
1102 typedef struct {
1103 mach_msg_header_t Head;
1104 NDR_record_t NDR;
1105 kern_return_t RetCode;
1106 mach_msg_type_number_t thread_info_outCnt;
1107 integer_t thread_info_out[32];
1108 } __Reply__thread_info_t __attribute__((unused));
1109#ifdef __MigPackStructs
1110#pragma pack(pop)
1111#endif
1112
1113#ifdef __MigPackStructs
1114#pragma pack(push, 4)
1115#endif
1116 typedef struct {
1117 mach_msg_header_t Head;
1118 NDR_record_t NDR;
1119 kern_return_t RetCode;
1120 } __Reply__thread_set_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_get_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 /* start of the kernel processed data */
1150 mach_msg_body_t msgh_body;
1151 mach_msg_port_descriptor_t old_handlers[32];
1152 /* end of the kernel processed data */
1153 NDR_record_t NDR;
1154 mach_msg_type_number_t masksCnt;
1155 exception_mask_t masks[32];
1156 exception_behavior_t old_behaviors[32];
1157 thread_state_flavor_t old_flavors[32];
1158 } __Reply__thread_swap_exception_ports_t __attribute__((unused));
1159#ifdef __MigPackStructs
1160#pragma pack(pop)
1161#endif
1162
1163#ifdef __MigPackStructs
1164#pragma pack(push, 4)
1165#endif
1166 typedef struct {
1167 mach_msg_header_t Head;
1168 NDR_record_t NDR;
1169 kern_return_t RetCode;
1170 } __Reply__thread_policy_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 kern_return_t RetCode;
1182 } __Reply__thread_policy_set_t __attribute__((unused));
1183#ifdef __MigPackStructs
1184#pragma pack(pop)
1185#endif
1186
1187#ifdef __MigPackStructs
1188#pragma pack(push, 4)
1189#endif
1190 typedef struct {
1191 mach_msg_header_t Head;
1192 NDR_record_t NDR;
1193 kern_return_t RetCode;
1194 mach_msg_type_number_t policy_infoCnt;
1195 integer_t policy_info[16];
1196 boolean_t get_default;
1197 } __Reply__thread_policy_get_t __attribute__((unused));
1198#ifdef __MigPackStructs
1199#pragma pack(pop)
1200#endif
1201
1202#ifdef __MigPackStructs
1203#pragma pack(push, 4)
1204#endif
1205 typedef struct {
1206 mach_msg_header_t Head;
1207 NDR_record_t NDR;
1208 kern_return_t RetCode;
1209 } __Reply__thread_sample_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 NDR_record_t NDR;
1220 kern_return_t RetCode;
1221 } __Reply__etap_trace_thread_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__thread_assign_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__thread_assign_default_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 /* start of the kernel processed data */
1256 mach_msg_body_t msgh_body;
1257 mach_msg_port_descriptor_t assigned_set;
1258 /* end of the kernel processed data */
1259 } __Reply__thread_get_assignment_t __attribute__((unused));
1260#ifdef __MigPackStructs
1261#pragma pack(pop)
1262#endif
1263
1264#ifdef __MigPackStructs
1265#pragma pack(push, 4)
1266#endif
1267 typedef struct {
1268 mach_msg_header_t Head;
1269 NDR_record_t NDR;
1270 kern_return_t RetCode;
1271 } __Reply__thread_set_policy_t __attribute__((unused));
1272#ifdef __MigPackStructs
1273#pragma pack(pop)
1274#endif
1275
1276#ifdef __MigPackStructs
1277#pragma pack(push, 4)
1278#endif
1279 typedef struct {
1280 mach_msg_header_t Head;
1281 /* start of the kernel processed data */
1282 mach_msg_body_t msgh_body;
1283 mach_msg_port_descriptor_t voucher;
1284 /* end of the kernel processed data */
1285 } __Reply__thread_get_mach_voucher_t __attribute__((unused));
1286#ifdef __MigPackStructs
1287#pragma pack(pop)
1288#endif
1289
1290#ifdef __MigPackStructs
1291#pragma pack(push, 4)
1292#endif
1293 typedef struct {
1294 mach_msg_header_t Head;
1295 NDR_record_t NDR;
1296 kern_return_t RetCode;
1297 } __Reply__thread_set_mach_voucher_t __attribute__((unused));
1298#ifdef __MigPackStructs
1299#pragma pack(pop)
1300#endif
1301
1302#ifdef __MigPackStructs
1303#pragma pack(push, 4)
1304#endif
1305 typedef struct {
1306 mach_msg_header_t Head;
1307 /* start of the kernel processed data */
1308 mach_msg_body_t msgh_body;
1309 mach_msg_port_descriptor_t old_voucher;
1310 /* end of the kernel processed data */
1311 } __Reply__thread_swap_mach_voucher_t __attribute__((unused));
1312#ifdef __MigPackStructs
1313#pragma pack(pop)
1314#endif
1315
1316#ifdef __MigPackStructs
1317#pragma pack(push, 4)
1318#endif
1319 typedef struct {
1320 mach_msg_header_t Head;
1321 NDR_record_t NDR;
1322 kern_return_t RetCode;
1323 mach_msg_type_number_t out_stateCnt;
1324 natural_t out_state[1296];
1325 } __Reply__thread_convert_thread_state_t __attribute__((unused));
1326#ifdef __MigPackStructs
1327#pragma pack(pop)
1328#endif
1329
1330#ifdef __MigPackStructs
1331#pragma pack(push, 4)
1332#endif
1333 typedef struct {
1334 mach_msg_header_t Head;
1335 NDR_record_t NDR;
1336 kern_return_t RetCode;
1337 mach_msg_type_number_t masksCnt;
1338 exception_mask_t masks[32];
1339 exception_handler_info_t old_handlers_info[32];
1340 exception_behavior_t old_behaviors[32];
1341 thread_state_flavor_t old_flavors[32];
1342 } __Reply__thread_get_exception_ports_info_t __attribute__((unused));
1343#ifdef __MigPackStructs
1344#pragma pack(pop)
1345#endif
1346#endif /* !__Reply__thread_act_subsystem__defined */
1347
1348/* union of all replies */
1349
1350#ifndef __ReplyUnion__thread_act_subsystem__defined
1351#define __ReplyUnion__thread_act_subsystem__defined
1352union __ReplyUnion__thread_act_subsystem {
1353 __Reply__thread_terminate_t Reply_thread_terminate;
1354 __Reply__act_get_state_t Reply_act_get_state;
1355 __Reply__act_set_state_t Reply_act_set_state;
1356 __Reply__thread_get_state_t Reply_thread_get_state;
1357 __Reply__thread_set_state_t Reply_thread_set_state;
1358 __Reply__thread_suspend_t Reply_thread_suspend;
1359 __Reply__thread_resume_t Reply_thread_resume;
1360 __Reply__thread_abort_t Reply_thread_abort;
1361 __Reply__thread_abort_safely_t Reply_thread_abort_safely;
1362 __Reply__thread_depress_abort_t Reply_thread_depress_abort;
1363 __Reply__thread_get_special_port_t Reply_thread_get_special_port;
1364 __Reply__thread_set_special_port_t Reply_thread_set_special_port;
1365 __Reply__thread_info_t Reply_thread_info;
1366 __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports;
1367 __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports;
1368 __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports;
1369 __Reply__thread_policy_t Reply_thread_policy;
1370 __Reply__thread_policy_set_t Reply_thread_policy_set;
1371 __Reply__thread_policy_get_t Reply_thread_policy_get;
1372 __Reply__thread_sample_t Reply_thread_sample;
1373 __Reply__etap_trace_thread_t Reply_etap_trace_thread;
1374 __Reply__thread_assign_t Reply_thread_assign;
1375 __Reply__thread_assign_default_t Reply_thread_assign_default;
1376 __Reply__thread_get_assignment_t Reply_thread_get_assignment;
1377 __Reply__thread_set_policy_t Reply_thread_set_policy;
1378 __Reply__thread_get_mach_voucher_t Reply_thread_get_mach_voucher;
1379 __Reply__thread_set_mach_voucher_t Reply_thread_set_mach_voucher;
1380 __Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher;
1381 __Reply__thread_convert_thread_state_t Reply_thread_convert_thread_state;
1382 __Reply__thread_get_exception_ports_info_t Reply_thread_get_exception_ports_info;
1383};
1384#endif /* !__RequestUnion__thread_act_subsystem__defined */
1385
1386#ifndef subsystem_to_name_map_thread_act
1387#define subsystem_to_name_map_thread_act \
1388 { "thread_terminate", 3600 },\
1389 { "act_get_state", 3601 },\
1390 { "act_set_state", 3602 },\
1391 { "thread_get_state", 3603 },\
1392 { "thread_set_state", 3604 },\
1393 { "thread_suspend", 3605 },\
1394 { "thread_resume", 3606 },\
1395 { "thread_abort", 3607 },\
1396 { "thread_abort_safely", 3608 },\
1397 { "thread_depress_abort", 3609 },\
1398 { "thread_get_special_port", 3610 },\
1399 { "thread_set_special_port", 3611 },\
1400 { "thread_info", 3612 },\
1401 { "thread_set_exception_ports", 3613 },\
1402 { "thread_get_exception_ports", 3614 },\
1403 { "thread_swap_exception_ports", 3615 },\
1404 { "thread_policy", 3616 },\
1405 { "thread_policy_set", 3617 },\
1406 { "thread_policy_get", 3618 },\
1407 { "thread_sample", 3619 },\
1408 { "etap_trace_thread", 3620 },\
1409 { "thread_assign", 3621 },\
1410 { "thread_assign_default", 3622 },\
1411 { "thread_get_assignment", 3623 },\
1412 { "thread_set_policy", 3624 },\
1413 { "thread_get_mach_voucher", 3625 },\
1414 { "thread_set_mach_voucher", 3626 },\
1415 { "thread_swap_mach_voucher", 3627 },\
1416 { "thread_convert_thread_state", 3628 },\
1417 { "thread_get_exception_ports_info", 3630 }
1418#endif
1419
1420#ifdef __AfterMigUserHeader
1421__AfterMigUserHeader
1422#endif /* __AfterMigUserHeader */
1423
1424#endif /* _thread_act_user_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/thread_policy.h created+270
......@@ -0,0 +1,270 @@
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. The thread may be preempted after
135 * the computation time has elapsed.
136 * If (computation < constraint/2) it will be forced to
137 * constraint/2 to avoid unintended preemption and associated
138 * timer interrupts.
139 *
140 * constraint: This is the maximum amount of real time that
141 * may elapse from the start of a separate processing arrival
142 * to the end of computation for logically correct functioning,
143 * specified in absolute time units. Must be (>= computation).
144 * Note that latency = (constraint - computation).
145 *
146 * preemptible: IGNORED (This indicates that the computation may be
147 * interrupted, subject to the constraint specified above.)
148 */
149
150#define THREAD_TIME_CONSTRAINT_POLICY 2
151
152struct thread_time_constraint_policy {
153 uint32_t period;
154 uint32_t computation;
155 uint32_t constraint;
156 boolean_t preemptible;
157};
158
159typedef struct thread_time_constraint_policy \
160 thread_time_constraint_policy_data_t;
161typedef struct thread_time_constraint_policy \
162 *thread_time_constraint_policy_t;
163
164#define THREAD_TIME_CONSTRAINT_POLICY_COUNT ((mach_msg_type_number_t) \
165 (sizeof (thread_time_constraint_policy_data_t) / sizeof (integer_t)))
166
167/*
168 * THREAD_PRECEDENCE_POLICY:
169 *
170 * This may be used to indicate the relative value of the
171 * computation compared to the other threads in the task.
172 *
173 * Parameters:
174 *
175 * importance: The importance is specified as a signed value.
176 */
177
178#define THREAD_PRECEDENCE_POLICY 3
179
180struct thread_precedence_policy {
181 integer_t importance;
182};
183
184typedef struct thread_precedence_policy thread_precedence_policy_data_t;
185typedef struct thread_precedence_policy *thread_precedence_policy_t;
186
187#define THREAD_PRECEDENCE_POLICY_COUNT ((mach_msg_type_number_t) \
188 (sizeof (thread_precedence_policy_data_t) / sizeof (integer_t)))
189
190/*
191 * THREAD_AFFINITY_POLICY:
192 *
193 * This policy is experimental.
194 * This may be used to express affinity relationships
195 * between threads in the task. Threads with the same affinity tag will
196 * be scheduled to share an L2 cache if possible. That is, affinity tags
197 * are a hint to the scheduler for thread placement.
198 *
199 * The namespace of affinity tags is generally local to one task. However,
200 * a child task created after the assignment of affinity tags by its parent
201 * will share that namespace. In particular, a family of forked processes
202 * may be created with a shared affinity namespace.
203 *
204 * Parameters:
205 * tag: The affinity set identifier.
206 */
207
208#define THREAD_AFFINITY_POLICY 4
209
210struct thread_affinity_policy {
211 integer_t affinity_tag;
212};
213
214#define THREAD_AFFINITY_TAG_NULL 0
215
216typedef struct thread_affinity_policy thread_affinity_policy_data_t;
217typedef struct thread_affinity_policy *thread_affinity_policy_t;
218
219#define THREAD_AFFINITY_POLICY_COUNT ((mach_msg_type_number_t) \
220 (sizeof (thread_affinity_policy_data_t) / sizeof (integer_t)))
221
222/*
223 * THREAD_BACKGROUND_POLICY:
224 */
225
226#define THREAD_BACKGROUND_POLICY 5
227
228struct thread_background_policy {
229 integer_t priority;
230};
231
232#define THREAD_BACKGROUND_POLICY_DARWIN_BG 0x1000
233
234typedef struct thread_background_policy thread_background_policy_data_t;
235typedef struct thread_background_policy *thread_background_policy_t;
236
237#define THREAD_BACKGROUND_POLICY_COUNT ((mach_msg_type_number_t) \
238 (sizeof (thread_background_policy_data_t) / sizeof (integer_t)))
239
240
241#define THREAD_LATENCY_QOS_POLICY 7
242typedef integer_t thread_latency_qos_t;
243
244struct thread_latency_qos_policy {
245 thread_latency_qos_t thread_latency_qos_tier;
246};
247
248typedef struct thread_latency_qos_policy thread_latency_qos_policy_data_t;
249typedef struct thread_latency_qos_policy *thread_latency_qos_policy_t;
250
251#define THREAD_LATENCY_QOS_POLICY_COUNT ((mach_msg_type_number_t) \
252 (sizeof (thread_latency_qos_policy_data_t) / sizeof (integer_t)))
253
254#define THREAD_THROUGHPUT_QOS_POLICY 8
255typedef integer_t thread_throughput_qos_t;
256
257struct thread_throughput_qos_policy {
258 thread_throughput_qos_t thread_throughput_qos_tier;
259};
260
261typedef struct thread_throughput_qos_policy thread_throughput_qos_policy_data_t;
262typedef struct thread_throughput_qos_policy *thread_throughput_qos_policy_t;
263
264#define THREAD_THROUGHPUT_QOS_POLICY_COUNT ((mach_msg_type_number_t) \
265 (sizeof (thread_throughput_qos_policy_data_t) / sizeof (integer_t)))
266
267
268
269
270#endif /* _MACH_THREAD_POLICY_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/vm_map.h created+1503
......@@ -0,0 +1,1503 @@
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 33
53#endif /* vm_map_MSG_COUNT */
54
55#include <Availability.h>
56#include <mach/std_types.h>
57#include <mach/mig.h>
58#include <mach/mig.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 vm_region */
71#ifdef mig_external
72mig_external
73#else
74extern
75#endif /* mig_external */
76kern_return_t vm_region
77(
78 vm_map_read_t target_task,
79 vm_address_t *address,
80 vm_size_t *size,
81 vm_region_flavor_t flavor,
82 vm_region_info_t info,
83 mach_msg_type_number_t *infoCnt,
84 mach_port_t *object_name
85);
86
87/* Routine vm_allocate */
88#ifdef mig_external
89mig_external
90#else
91extern
92#endif /* mig_external */
93kern_return_t vm_allocate
94(
95 vm_map_t target_task,
96 vm_address_t *address,
97 vm_size_t size,
98 int flags
99);
100
101/* Routine vm_deallocate */
102#ifdef mig_external
103mig_external
104#else
105extern
106#endif /* mig_external */
107kern_return_t vm_deallocate
108(
109 vm_map_t target_task,
110 vm_address_t address,
111 vm_size_t size
112);
113
114/* Routine vm_protect */
115#ifdef mig_external
116mig_external
117#else
118extern
119#endif /* mig_external */
120kern_return_t vm_protect
121(
122 vm_map_t target_task,
123 vm_address_t address,
124 vm_size_t size,
125 boolean_t set_maximum,
126 vm_prot_t new_protection
127);
128
129/* Routine vm_inherit */
130#ifdef mig_external
131mig_external
132#else
133extern
134#endif /* mig_external */
135kern_return_t vm_inherit
136(
137 vm_map_t target_task,
138 vm_address_t address,
139 vm_size_t size,
140 vm_inherit_t new_inheritance
141);
142
143/* Routine vm_read */
144#ifdef mig_external
145mig_external
146#else
147extern
148#endif /* mig_external */
149kern_return_t vm_read
150(
151 vm_map_read_t target_task,
152 vm_address_t address,
153 vm_size_t size,
154 vm_offset_t *data,
155 mach_msg_type_number_t *dataCnt
156);
157
158/* Routine vm_read_list */
159#ifdef mig_external
160mig_external
161#else
162extern
163#endif /* mig_external */
164kern_return_t vm_read_list
165(
166 vm_map_read_t target_task,
167 vm_read_entry_t data_list,
168 natural_t count
169);
170
171/* Routine vm_write */
172#ifdef mig_external
173mig_external
174#else
175extern
176#endif /* mig_external */
177kern_return_t vm_write
178(
179 vm_map_t target_task,
180 vm_address_t address,
181 vm_offset_t data,
182 mach_msg_type_number_t dataCnt
183);
184
185/* Routine vm_copy */
186#ifdef mig_external
187mig_external
188#else
189extern
190#endif /* mig_external */
191kern_return_t vm_copy
192(
193 vm_map_t target_task,
194 vm_address_t source_address,
195 vm_size_t size,
196 vm_address_t dest_address
197);
198
199/* Routine vm_read_overwrite */
200#ifdef mig_external
201mig_external
202#else
203extern
204#endif /* mig_external */
205kern_return_t vm_read_overwrite
206(
207 vm_map_read_t target_task,
208 vm_address_t address,
209 vm_size_t size,
210 vm_address_t data,
211 vm_size_t *outsize
212);
213
214/* Routine vm_msync */
215#ifdef mig_external
216mig_external
217#else
218extern
219#endif /* mig_external */
220kern_return_t vm_msync
221(
222 vm_map_t target_task,
223 vm_address_t address,
224 vm_size_t size,
225 vm_sync_t sync_flags
226);
227
228/* Routine vm_behavior_set */
229#ifdef mig_external
230mig_external
231#else
232extern
233#endif /* mig_external */
234kern_return_t vm_behavior_set
235(
236 vm_map_t target_task,
237 vm_address_t address,
238 vm_size_t size,
239 vm_behavior_t new_behavior
240);
241
242/* Routine vm_map */
243#ifdef mig_external
244mig_external
245#else
246extern
247#endif /* mig_external */
248kern_return_t vm_map
249(
250 vm_map_t target_task,
251 vm_address_t *address,
252 vm_size_t size,
253 vm_address_t mask,
254 int flags,
255 mem_entry_name_port_t object,
256 vm_offset_t offset,
257 boolean_t copy,
258 vm_prot_t cur_protection,
259 vm_prot_t max_protection,
260 vm_inherit_t inheritance
261);
262
263/* Routine vm_machine_attribute */
264#ifdef mig_external
265mig_external
266#else
267extern
268#endif /* mig_external */
269kern_return_t vm_machine_attribute
270(
271 vm_map_t target_task,
272 vm_address_t address,
273 vm_size_t size,
274 vm_machine_attribute_t attribute,
275 vm_machine_attribute_val_t *value
276);
277
278/* Routine vm_remap */
279#ifdef mig_external
280mig_external
281#else
282extern
283#endif /* mig_external */
284kern_return_t vm_remap
285(
286 vm_map_t target_task,
287 vm_address_t *target_address,
288 vm_size_t size,
289 vm_address_t mask,
290 int flags,
291 vm_map_t src_task,
292 vm_address_t src_address,
293 boolean_t copy,
294 vm_prot_t *cur_protection,
295 vm_prot_t *max_protection,
296 vm_inherit_t inheritance
297);
298
299/* Routine task_wire */
300#ifdef mig_external
301mig_external
302#else
303extern
304#endif /* mig_external */
305__TVOS_PROHIBITED __WATCHOS_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_read_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_read_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_read_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_read_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_read_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_read_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_read_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/* Routine vm_remap_new */
497#ifdef mig_external
498mig_external
499#else
500extern
501#endif /* mig_external */
502kern_return_t vm_remap_new
503(
504 vm_map_t target_task,
505 vm_address_t *target_address,
506 vm_size_t size,
507 vm_address_t mask,
508 int flags,
509 vm_map_read_t src_task,
510 vm_address_t src_address,
511 boolean_t copy,
512 vm_prot_t *cur_protection,
513 vm_prot_t *max_protection,
514 vm_inherit_t inheritance
515);
516
517__END_DECLS
518
519/********************** Caution **************************/
520/* The following data types should be used to calculate */
521/* maximum message sizes only. The actual message may be */
522/* smaller, and the position of the arguments within the */
523/* message layout may vary from what is presented here. */
524/* For example, if any of the arguments are variable- */
525/* sized, and less than the maximum is sent, the data */
526/* will be packed tight in the actual message to reduce */
527/* the presence of holes. */
528/********************** Caution **************************/
529
530/* typedefs for all requests */
531
532#ifndef __Request__vm_map_subsystem__defined
533#define __Request__vm_map_subsystem__defined
534
535#ifdef __MigPackStructs
536#pragma pack(push, 4)
537#endif
538 typedef struct {
539 mach_msg_header_t Head;
540 NDR_record_t NDR;
541 vm_address_t address;
542 vm_region_flavor_t flavor;
543 mach_msg_type_number_t infoCnt;
544 } __Request__vm_region_t __attribute__((unused));
545#ifdef __MigPackStructs
546#pragma pack(pop)
547#endif
548
549#ifdef __MigPackStructs
550#pragma pack(push, 4)
551#endif
552 typedef struct {
553 mach_msg_header_t Head;
554 NDR_record_t NDR;
555 vm_address_t address;
556 vm_size_t size;
557 int flags;
558 } __Request__vm_allocate_t __attribute__((unused));
559#ifdef __MigPackStructs
560#pragma pack(pop)
561#endif
562
563#ifdef __MigPackStructs
564#pragma pack(push, 4)
565#endif
566 typedef struct {
567 mach_msg_header_t Head;
568 NDR_record_t NDR;
569 vm_address_t address;
570 vm_size_t size;
571 } __Request__vm_deallocate_t __attribute__((unused));
572#ifdef __MigPackStructs
573#pragma pack(pop)
574#endif
575
576#ifdef __MigPackStructs
577#pragma pack(push, 4)
578#endif
579 typedef struct {
580 mach_msg_header_t Head;
581 NDR_record_t NDR;
582 vm_address_t address;
583 vm_size_t size;
584 boolean_t set_maximum;
585 vm_prot_t new_protection;
586 } __Request__vm_protect_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 NDR_record_t NDR;
597 vm_address_t address;
598 vm_size_t size;
599 vm_inherit_t new_inheritance;
600 } __Request__vm_inherit_t __attribute__((unused));
601#ifdef __MigPackStructs
602#pragma pack(pop)
603#endif
604
605#ifdef __MigPackStructs
606#pragma pack(push, 4)
607#endif
608 typedef struct {
609 mach_msg_header_t Head;
610 NDR_record_t NDR;
611 vm_address_t address;
612 vm_size_t size;
613 } __Request__vm_read_t __attribute__((unused));
614#ifdef __MigPackStructs
615#pragma pack(pop)
616#endif
617
618#ifdef __MigPackStructs
619#pragma pack(push, 4)
620#endif
621 typedef struct {
622 mach_msg_header_t Head;
623 NDR_record_t NDR;
624 vm_read_entry_t data_list;
625 natural_t count;
626 } __Request__vm_read_list_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_ool_descriptor_t data;
639 /* end of the kernel processed data */
640 NDR_record_t NDR;
641 vm_address_t address;
642 mach_msg_type_number_t dataCnt;
643 } __Request__vm_write_t __attribute__((unused));
644#ifdef __MigPackStructs
645#pragma pack(pop)
646#endif
647
648#ifdef __MigPackStructs
649#pragma pack(push, 4)
650#endif
651 typedef struct {
652 mach_msg_header_t Head;
653 NDR_record_t NDR;
654 vm_address_t source_address;
655 vm_size_t size;
656 vm_address_t dest_address;
657 } __Request__vm_copy_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 NDR_record_t NDR;
668 vm_address_t address;
669 vm_size_t size;
670 vm_address_t data;
671 } __Request__vm_read_overwrite_t __attribute__((unused));
672#ifdef __MigPackStructs
673#pragma pack(pop)
674#endif
675
676#ifdef __MigPackStructs
677#pragma pack(push, 4)
678#endif
679 typedef struct {
680 mach_msg_header_t Head;
681 NDR_record_t NDR;
682 vm_address_t address;
683 vm_size_t size;
684 vm_sync_t sync_flags;
685 } __Request__vm_msync_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 NDR_record_t NDR;
696 vm_address_t address;
697 vm_size_t size;
698 vm_behavior_t new_behavior;
699 } __Request__vm_behavior_set_t __attribute__((unused));
700#ifdef __MigPackStructs
701#pragma pack(pop)
702#endif
703
704#ifdef __MigPackStructs
705#pragma pack(push, 4)
706#endif
707 typedef struct {
708 mach_msg_header_t Head;
709 /* start of the kernel processed data */
710 mach_msg_body_t msgh_body;
711 mach_msg_port_descriptor_t object;
712 /* end of the kernel processed data */
713 NDR_record_t NDR;
714 vm_address_t address;
715 vm_size_t size;
716 vm_address_t mask;
717 int flags;
718 vm_offset_t offset;
719 boolean_t copy;
720 vm_prot_t cur_protection;
721 vm_prot_t max_protection;
722 vm_inherit_t inheritance;
723 } __Request__vm_map_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 vm_address_t address;
735 vm_size_t size;
736 vm_machine_attribute_t attribute;
737 vm_machine_attribute_val_t value;
738 } __Request__vm_machine_attribute_t __attribute__((unused));
739#ifdef __MigPackStructs
740#pragma pack(pop)
741#endif
742
743#ifdef __MigPackStructs
744#pragma pack(push, 4)
745#endif
746 typedef struct {
747 mach_msg_header_t Head;
748 /* start of the kernel processed data */
749 mach_msg_body_t msgh_body;
750 mach_msg_port_descriptor_t src_task;
751 /* end of the kernel processed data */
752 NDR_record_t NDR;
753 vm_address_t target_address;
754 vm_size_t size;
755 vm_address_t mask;
756 int flags;
757 vm_address_t src_address;
758 boolean_t copy;
759 vm_inherit_t inheritance;
760 } __Request__vm_remap_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 must_wire;
772 } __Request__task_wire_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 parent_entry;
785 /* end of the kernel processed data */
786 NDR_record_t NDR;
787 vm_size_t size;
788 vm_offset_t offset;
789 vm_prot_t permission;
790 } __Request__mach_make_memory_entry_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 NDR_record_t NDR;
801 vm_offset_t offset;
802 } __Request__vm_map_page_query_t __attribute__((unused));
803#ifdef __MigPackStructs
804#pragma pack(pop)
805#endif
806
807#ifdef __MigPackStructs
808#pragma pack(push, 4)
809#endif
810 typedef struct {
811 mach_msg_header_t Head;
812 NDR_record_t NDR;
813 vm_address_t address;
814 } __Request__mach_vm_region_info_t __attribute__((unused));
815#ifdef __MigPackStructs
816#pragma pack(pop)
817#endif
818
819#ifdef __MigPackStructs
820#pragma pack(push, 4)
821#endif
822 typedef struct {
823 mach_msg_header_t Head;
824 } __Request__vm_mapped_pages_info_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 vm_address_t address;
836 natural_t nesting_depth;
837 mach_msg_type_number_t infoCnt;
838 } __Request__vm_region_recurse_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 NDR_record_t NDR;
849 vm_address_t address;
850 natural_t nesting_depth;
851 mach_msg_type_number_t infoCnt;
852 } __Request__vm_region_recurse_64_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 NDR_record_t NDR;
863 vm_address_t address;
864 } __Request__mach_vm_region_info_64_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 vm_address_t address;
876 vm_region_flavor_t flavor;
877 mach_msg_type_number_t infoCnt;
878 } __Request__vm_region_64_t __attribute__((unused));
879#ifdef __MigPackStructs
880#pragma pack(pop)
881#endif
882
883#ifdef __MigPackStructs
884#pragma pack(push, 4)
885#endif
886 typedef struct {
887 mach_msg_header_t Head;
888 /* start of the kernel processed data */
889 mach_msg_body_t msgh_body;
890 mach_msg_port_descriptor_t parent_entry;
891 /* end of the kernel processed data */
892 NDR_record_t NDR;
893 memory_object_size_t size;
894 memory_object_offset_t offset;
895 vm_prot_t permission;
896 } __Request__mach_make_memory_entry_64_t __attribute__((unused));
897#ifdef __MigPackStructs
898#pragma pack(pop)
899#endif
900
901#ifdef __MigPackStructs
902#pragma pack(push, 4)
903#endif
904 typedef struct {
905 mach_msg_header_t Head;
906 /* start of the kernel processed data */
907 mach_msg_body_t msgh_body;
908 mach_msg_port_descriptor_t object;
909 /* end of the kernel processed data */
910 NDR_record_t NDR;
911 vm_address_t address;
912 vm_size_t size;
913 vm_address_t mask;
914 int flags;
915 memory_object_offset_t offset;
916 boolean_t copy;
917 vm_prot_t cur_protection;
918 vm_prot_t max_protection;
919 vm_inherit_t inheritance;
920 } __Request__vm_map_64_t __attribute__((unused));
921#ifdef __MigPackStructs
922#pragma pack(pop)
923#endif
924
925#ifdef __MigPackStructs
926#pragma pack(push, 4)
927#endif
928 typedef struct {
929 mach_msg_header_t Head;
930 NDR_record_t NDR;
931 vm_address_t address;
932 vm_purgable_t control;
933 int state;
934 } __Request__vm_purgable_control_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__vm_map_exec_lockdown_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 /* start of the kernel processed data */
955 mach_msg_body_t msgh_body;
956 mach_msg_port_descriptor_t src_task;
957 /* end of the kernel processed data */
958 NDR_record_t NDR;
959 vm_address_t target_address;
960 vm_size_t size;
961 vm_address_t mask;
962 int flags;
963 vm_address_t src_address;
964 boolean_t copy;
965 vm_prot_t cur_protection;
966 vm_prot_t max_protection;
967 vm_inherit_t inheritance;
968 } __Request__vm_remap_new_t __attribute__((unused));
969#ifdef __MigPackStructs
970#pragma pack(pop)
971#endif
972#endif /* !__Request__vm_map_subsystem__defined */
973
974/* union of all requests */
975
976#ifndef __RequestUnion__vm_map_subsystem__defined
977#define __RequestUnion__vm_map_subsystem__defined
978union __RequestUnion__vm_map_subsystem {
979 __Request__vm_region_t Request_vm_region;
980 __Request__vm_allocate_t Request_vm_allocate;
981 __Request__vm_deallocate_t Request_vm_deallocate;
982 __Request__vm_protect_t Request_vm_protect;
983 __Request__vm_inherit_t Request_vm_inherit;
984 __Request__vm_read_t Request_vm_read;
985 __Request__vm_read_list_t Request_vm_read_list;
986 __Request__vm_write_t Request_vm_write;
987 __Request__vm_copy_t Request_vm_copy;
988 __Request__vm_read_overwrite_t Request_vm_read_overwrite;
989 __Request__vm_msync_t Request_vm_msync;
990 __Request__vm_behavior_set_t Request_vm_behavior_set;
991 __Request__vm_map_t Request_vm_map;
992 __Request__vm_machine_attribute_t Request_vm_machine_attribute;
993 __Request__vm_remap_t Request_vm_remap;
994 __Request__task_wire_t Request_task_wire;
995 __Request__mach_make_memory_entry_t Request_mach_make_memory_entry;
996 __Request__vm_map_page_query_t Request_vm_map_page_query;
997 __Request__mach_vm_region_info_t Request_mach_vm_region_info;
998 __Request__vm_mapped_pages_info_t Request_vm_mapped_pages_info;
999 __Request__vm_region_recurse_t Request_vm_region_recurse;
1000 __Request__vm_region_recurse_64_t Request_vm_region_recurse_64;
1001 __Request__mach_vm_region_info_64_t Request_mach_vm_region_info_64;
1002 __Request__vm_region_64_t Request_vm_region_64;
1003 __Request__mach_make_memory_entry_64_t Request_mach_make_memory_entry_64;
1004 __Request__vm_map_64_t Request_vm_map_64;
1005 __Request__vm_purgable_control_t Request_vm_purgable_control;
1006 __Request__vm_map_exec_lockdown_t Request_vm_map_exec_lockdown;
1007 __Request__vm_remap_new_t Request_vm_remap_new;
1008};
1009#endif /* !__RequestUnion__vm_map_subsystem__defined */
1010/* typedefs for all replies */
1011
1012#ifndef __Reply__vm_map_subsystem__defined
1013#define __Reply__vm_map_subsystem__defined
1014
1015#ifdef __MigPackStructs
1016#pragma pack(push, 4)
1017#endif
1018 typedef struct {
1019 mach_msg_header_t Head;
1020 /* start of the kernel processed data */
1021 mach_msg_body_t msgh_body;
1022 mach_msg_port_descriptor_t object_name;
1023 /* end of the kernel processed data */
1024 NDR_record_t NDR;
1025 vm_address_t address;
1026 vm_size_t size;
1027 mach_msg_type_number_t infoCnt;
1028 int info[10];
1029 } __Reply__vm_region_t __attribute__((unused));
1030#ifdef __MigPackStructs
1031#pragma pack(pop)
1032#endif
1033
1034#ifdef __MigPackStructs
1035#pragma pack(push, 4)
1036#endif
1037 typedef struct {
1038 mach_msg_header_t Head;
1039 NDR_record_t NDR;
1040 kern_return_t RetCode;
1041 vm_address_t address;
1042 } __Reply__vm_allocate_t __attribute__((unused));
1043#ifdef __MigPackStructs
1044#pragma pack(pop)
1045#endif
1046
1047#ifdef __MigPackStructs
1048#pragma pack(push, 4)
1049#endif
1050 typedef struct {
1051 mach_msg_header_t Head;
1052 NDR_record_t NDR;
1053 kern_return_t RetCode;
1054 } __Reply__vm_deallocate_t __attribute__((unused));
1055#ifdef __MigPackStructs
1056#pragma pack(pop)
1057#endif
1058
1059#ifdef __MigPackStructs
1060#pragma pack(push, 4)
1061#endif
1062 typedef struct {
1063 mach_msg_header_t Head;
1064 NDR_record_t NDR;
1065 kern_return_t RetCode;
1066 } __Reply__vm_protect_t __attribute__((unused));
1067#ifdef __MigPackStructs
1068#pragma pack(pop)
1069#endif
1070
1071#ifdef __MigPackStructs
1072#pragma pack(push, 4)
1073#endif
1074 typedef struct {
1075 mach_msg_header_t Head;
1076 NDR_record_t NDR;
1077 kern_return_t RetCode;
1078 } __Reply__vm_inherit_t __attribute__((unused));
1079#ifdef __MigPackStructs
1080#pragma pack(pop)
1081#endif
1082
1083#ifdef __MigPackStructs
1084#pragma pack(push, 4)
1085#endif
1086 typedef struct {
1087 mach_msg_header_t Head;
1088 /* start of the kernel processed data */
1089 mach_msg_body_t msgh_body;
1090 mach_msg_ool_descriptor_t data;
1091 /* end of the kernel processed data */
1092 NDR_record_t NDR;
1093 mach_msg_type_number_t dataCnt;
1094 } __Reply__vm_read_t __attribute__((unused));
1095#ifdef __MigPackStructs
1096#pragma pack(pop)
1097#endif
1098
1099#ifdef __MigPackStructs
1100#pragma pack(push, 4)
1101#endif
1102 typedef struct {
1103 mach_msg_header_t Head;
1104 NDR_record_t NDR;
1105 kern_return_t RetCode;
1106 vm_read_entry_t data_list;
1107 } __Reply__vm_read_list_t __attribute__((unused));
1108#ifdef __MigPackStructs
1109#pragma pack(pop)
1110#endif
1111
1112#ifdef __MigPackStructs
1113#pragma pack(push, 4)
1114#endif
1115 typedef struct {
1116 mach_msg_header_t Head;
1117 NDR_record_t NDR;
1118 kern_return_t RetCode;
1119 } __Reply__vm_write_t __attribute__((unused));
1120#ifdef __MigPackStructs
1121#pragma pack(pop)
1122#endif
1123
1124#ifdef __MigPackStructs
1125#pragma pack(push, 4)
1126#endif
1127 typedef struct {
1128 mach_msg_header_t Head;
1129 NDR_record_t NDR;
1130 kern_return_t RetCode;
1131 } __Reply__vm_copy_t __attribute__((unused));
1132#ifdef __MigPackStructs
1133#pragma pack(pop)
1134#endif
1135
1136#ifdef __MigPackStructs
1137#pragma pack(push, 4)
1138#endif
1139 typedef struct {
1140 mach_msg_header_t Head;
1141 NDR_record_t NDR;
1142 kern_return_t RetCode;
1143 vm_size_t outsize;
1144 } __Reply__vm_read_overwrite_t __attribute__((unused));
1145#ifdef __MigPackStructs
1146#pragma pack(pop)
1147#endif
1148
1149#ifdef __MigPackStructs
1150#pragma pack(push, 4)
1151#endif
1152 typedef struct {
1153 mach_msg_header_t Head;
1154 NDR_record_t NDR;
1155 kern_return_t RetCode;
1156 } __Reply__vm_msync_t __attribute__((unused));
1157#ifdef __MigPackStructs
1158#pragma pack(pop)
1159#endif
1160
1161#ifdef __MigPackStructs
1162#pragma pack(push, 4)
1163#endif
1164 typedef struct {
1165 mach_msg_header_t Head;
1166 NDR_record_t NDR;
1167 kern_return_t RetCode;
1168 } __Reply__vm_behavior_set_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 vm_address_t address;
1181 } __Reply__vm_map_t __attribute__((unused));
1182#ifdef __MigPackStructs
1183#pragma pack(pop)
1184#endif
1185
1186#ifdef __MigPackStructs
1187#pragma pack(push, 4)
1188#endif
1189 typedef struct {
1190 mach_msg_header_t Head;
1191 NDR_record_t NDR;
1192 kern_return_t RetCode;
1193 vm_machine_attribute_val_t value;
1194 } __Reply__vm_machine_attribute_t __attribute__((unused));
1195#ifdef __MigPackStructs
1196#pragma pack(pop)
1197#endif
1198
1199#ifdef __MigPackStructs
1200#pragma pack(push, 4)
1201#endif
1202 typedef struct {
1203 mach_msg_header_t Head;
1204 NDR_record_t NDR;
1205 kern_return_t RetCode;
1206 vm_address_t target_address;
1207 vm_prot_t cur_protection;
1208 vm_prot_t max_protection;
1209 } __Reply__vm_remap_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 NDR_record_t NDR;
1220 kern_return_t RetCode;
1221 } __Reply__task_wire_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 /* start of the kernel processed data */
1232 mach_msg_body_t msgh_body;
1233 mach_msg_port_descriptor_t object_handle;
1234 /* end of the kernel processed data */
1235 NDR_record_t NDR;
1236 vm_size_t size;
1237 } __Reply__mach_make_memory_entry_t __attribute__((unused));
1238#ifdef __MigPackStructs
1239#pragma pack(pop)
1240#endif
1241
1242#ifdef __MigPackStructs
1243#pragma pack(push, 4)
1244#endif
1245 typedef struct {
1246 mach_msg_header_t Head;
1247 NDR_record_t NDR;
1248 kern_return_t RetCode;
1249 integer_t disposition;
1250 integer_t ref_count;
1251 } __Reply__vm_map_page_query_t __attribute__((unused));
1252#ifdef __MigPackStructs
1253#pragma pack(pop)
1254#endif
1255
1256#ifdef __MigPackStructs
1257#pragma pack(push, 4)
1258#endif
1259 typedef struct {
1260 mach_msg_header_t Head;
1261 /* start of the kernel processed data */
1262 mach_msg_body_t msgh_body;
1263 mach_msg_ool_descriptor_t objects;
1264 /* end of the kernel processed data */
1265 NDR_record_t NDR;
1266 vm_info_region_t region;
1267 mach_msg_type_number_t objectsCnt;
1268 } __Reply__mach_vm_region_info_t __attribute__((unused));
1269#ifdef __MigPackStructs
1270#pragma pack(pop)
1271#endif
1272
1273#ifdef __MigPackStructs
1274#pragma pack(push, 4)
1275#endif
1276 typedef struct {
1277 mach_msg_header_t Head;
1278 /* start of the kernel processed data */
1279 mach_msg_body_t msgh_body;
1280 mach_msg_ool_descriptor_t pages;
1281 /* end of the kernel processed data */
1282 NDR_record_t NDR;
1283 mach_msg_type_number_t pagesCnt;
1284 } __Reply__vm_mapped_pages_info_t __attribute__((unused));
1285#ifdef __MigPackStructs
1286#pragma pack(pop)
1287#endif
1288
1289#ifdef __MigPackStructs
1290#pragma pack(push, 4)
1291#endif
1292 typedef struct {
1293 mach_msg_header_t Head;
1294 NDR_record_t NDR;
1295 kern_return_t RetCode;
1296 vm_address_t address;
1297 vm_size_t size;
1298 natural_t nesting_depth;
1299 mach_msg_type_number_t infoCnt;
1300 int info[19];
1301 } __Reply__vm_region_recurse_t __attribute__((unused));
1302#ifdef __MigPackStructs
1303#pragma pack(pop)
1304#endif
1305
1306#ifdef __MigPackStructs
1307#pragma pack(push, 4)
1308#endif
1309 typedef struct {
1310 mach_msg_header_t Head;
1311 NDR_record_t NDR;
1312 kern_return_t RetCode;
1313 vm_address_t address;
1314 vm_size_t size;
1315 natural_t nesting_depth;
1316 mach_msg_type_number_t infoCnt;
1317 int info[19];
1318 } __Reply__vm_region_recurse_64_t __attribute__((unused));
1319#ifdef __MigPackStructs
1320#pragma pack(pop)
1321#endif
1322
1323#ifdef __MigPackStructs
1324#pragma pack(push, 4)
1325#endif
1326 typedef struct {
1327 mach_msg_header_t Head;
1328 /* start of the kernel processed data */
1329 mach_msg_body_t msgh_body;
1330 mach_msg_ool_descriptor_t objects;
1331 /* end of the kernel processed data */
1332 NDR_record_t NDR;
1333 vm_info_region_64_t region;
1334 mach_msg_type_number_t objectsCnt;
1335 } __Reply__mach_vm_region_info_64_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 /* start of the kernel processed data */
1346 mach_msg_body_t msgh_body;
1347 mach_msg_port_descriptor_t object_name;
1348 /* end of the kernel processed data */
1349 NDR_record_t NDR;
1350 vm_address_t address;
1351 vm_size_t size;
1352 mach_msg_type_number_t infoCnt;
1353 int info[10];
1354 } __Reply__vm_region_64_t __attribute__((unused));
1355#ifdef __MigPackStructs
1356#pragma pack(pop)
1357#endif
1358
1359#ifdef __MigPackStructs
1360#pragma pack(push, 4)
1361#endif
1362 typedef struct {
1363 mach_msg_header_t Head;
1364 /* start of the kernel processed data */
1365 mach_msg_body_t msgh_body;
1366 mach_msg_port_descriptor_t object_handle;
1367 /* end of the kernel processed data */
1368 NDR_record_t NDR;
1369 memory_object_size_t size;
1370 } __Reply__mach_make_memory_entry_64_t __attribute__((unused));
1371#ifdef __MigPackStructs
1372#pragma pack(pop)
1373#endif
1374
1375#ifdef __MigPackStructs
1376#pragma pack(push, 4)
1377#endif
1378 typedef struct {
1379 mach_msg_header_t Head;
1380 NDR_record_t NDR;
1381 kern_return_t RetCode;
1382 vm_address_t address;
1383 } __Reply__vm_map_64_t __attribute__((unused));
1384#ifdef __MigPackStructs
1385#pragma pack(pop)
1386#endif
1387
1388#ifdef __MigPackStructs
1389#pragma pack(push, 4)
1390#endif
1391 typedef struct {
1392 mach_msg_header_t Head;
1393 NDR_record_t NDR;
1394 kern_return_t RetCode;
1395 int state;
1396 } __Reply__vm_purgable_control_t __attribute__((unused));
1397#ifdef __MigPackStructs
1398#pragma pack(pop)
1399#endif
1400
1401#ifdef __MigPackStructs
1402#pragma pack(push, 4)
1403#endif
1404 typedef struct {
1405 mach_msg_header_t Head;
1406 NDR_record_t NDR;
1407 kern_return_t RetCode;
1408 } __Reply__vm_map_exec_lockdown_t __attribute__((unused));
1409#ifdef __MigPackStructs
1410#pragma pack(pop)
1411#endif
1412
1413#ifdef __MigPackStructs
1414#pragma pack(push, 4)
1415#endif
1416 typedef struct {
1417 mach_msg_header_t Head;
1418 NDR_record_t NDR;
1419 kern_return_t RetCode;
1420 vm_address_t target_address;
1421 vm_prot_t cur_protection;
1422 vm_prot_t max_protection;
1423 } __Reply__vm_remap_new_t __attribute__((unused));
1424#ifdef __MigPackStructs
1425#pragma pack(pop)
1426#endif
1427#endif /* !__Reply__vm_map_subsystem__defined */
1428
1429/* union of all replies */
1430
1431#ifndef __ReplyUnion__vm_map_subsystem__defined
1432#define __ReplyUnion__vm_map_subsystem__defined
1433union __ReplyUnion__vm_map_subsystem {
1434 __Reply__vm_region_t Reply_vm_region;
1435 __Reply__vm_allocate_t Reply_vm_allocate;
1436 __Reply__vm_deallocate_t Reply_vm_deallocate;
1437 __Reply__vm_protect_t Reply_vm_protect;
1438 __Reply__vm_inherit_t Reply_vm_inherit;
1439 __Reply__vm_read_t Reply_vm_read;
1440 __Reply__vm_read_list_t Reply_vm_read_list;
1441 __Reply__vm_write_t Reply_vm_write;
1442 __Reply__vm_copy_t Reply_vm_copy;
1443 __Reply__vm_read_overwrite_t Reply_vm_read_overwrite;
1444 __Reply__vm_msync_t Reply_vm_msync;
1445 __Reply__vm_behavior_set_t Reply_vm_behavior_set;
1446 __Reply__vm_map_t Reply_vm_map;
1447 __Reply__vm_machine_attribute_t Reply_vm_machine_attribute;
1448 __Reply__vm_remap_t Reply_vm_remap;
1449 __Reply__task_wire_t Reply_task_wire;
1450 __Reply__mach_make_memory_entry_t Reply_mach_make_memory_entry;
1451 __Reply__vm_map_page_query_t Reply_vm_map_page_query;
1452 __Reply__mach_vm_region_info_t Reply_mach_vm_region_info;
1453 __Reply__vm_mapped_pages_info_t Reply_vm_mapped_pages_info;
1454 __Reply__vm_region_recurse_t Reply_vm_region_recurse;
1455 __Reply__vm_region_recurse_64_t Reply_vm_region_recurse_64;
1456 __Reply__mach_vm_region_info_64_t Reply_mach_vm_region_info_64;
1457 __Reply__vm_region_64_t Reply_vm_region_64;
1458 __Reply__mach_make_memory_entry_64_t Reply_mach_make_memory_entry_64;
1459 __Reply__vm_map_64_t Reply_vm_map_64;
1460 __Reply__vm_purgable_control_t Reply_vm_purgable_control;
1461 __Reply__vm_map_exec_lockdown_t Reply_vm_map_exec_lockdown;
1462 __Reply__vm_remap_new_t Reply_vm_remap_new;
1463};
1464#endif /* !__RequestUnion__vm_map_subsystem__defined */
1465
1466#ifndef subsystem_to_name_map_vm_map
1467#define subsystem_to_name_map_vm_map \
1468 { "vm_region", 3800 },\
1469 { "vm_allocate", 3801 },\
1470 { "vm_deallocate", 3802 },\
1471 { "vm_protect", 3803 },\
1472 { "vm_inherit", 3804 },\
1473 { "vm_read", 3805 },\
1474 { "vm_read_list", 3806 },\
1475 { "vm_write", 3807 },\
1476 { "vm_copy", 3808 },\
1477 { "vm_read_overwrite", 3809 },\
1478 { "vm_msync", 3810 },\
1479 { "vm_behavior_set", 3811 },\
1480 { "vm_map", 3812 },\
1481 { "vm_machine_attribute", 3813 },\
1482 { "vm_remap", 3814 },\
1483 { "task_wire", 3815 },\
1484 { "mach_make_memory_entry", 3816 },\
1485 { "vm_map_page_query", 3817 },\
1486 { "mach_vm_region_info", 3818 },\
1487 { "vm_mapped_pages_info", 3819 },\
1488 { "vm_region_recurse", 3821 },\
1489 { "vm_region_recurse_64", 3822 },\
1490 { "mach_vm_region_info_64", 3823 },\
1491 { "vm_region_64", 3824 },\
1492 { "mach_make_memory_entry_64", 3825 },\
1493 { "vm_map_64", 3826 },\
1494 { "vm_purgable_control", 3830 },\
1495 { "vm_map_exec_lockdown", 3831 },\
1496 { "vm_remap_new", 3832 }
1497#endif
1498
1499#ifdef __AfterMigUserHeader
1500__AfterMigUserHeader
1501#endif /* __AfterMigUserHeader */
1502
1503#endif /* _vm_map_user_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/vm_prot.h created+171
......@@ -0,0 +1,171 @@
1/*
2 * Copyright (c) 2000-2021 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_LEGACY ((vm_prot_t) 0x08)
107#define VM_PROT_NO_CHANGE ((vm_prot_t) 0x01000000)
108
109/*
110 * When a caller finds that he cannot obtain write permission on a
111 * mapped entry, the following flag can be used. The entry will
112 * be made "needs copy" effectively copying the object (using COW),
113 * and write permission will be added to the maximum protections
114 * for the associated entry.
115 */
116
117#define VM_PROT_COPY ((vm_prot_t) 0x10)
118
119
120/*
121 * Another invalid protection value.
122 * Used only by memory_object_data_request upon an object
123 * which has specified a copy_call copy strategy. It is used
124 * when the kernel wants a page belonging to a copy of the
125 * object, and is only asking the object as a result of
126 * following a shadow chain. This solves the race between pages
127 * being pushed up by the memory manager and the kernel
128 * walking down the shadow chain.
129 */
130
131#define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10)
132
133
134/*
135 * Another invalid protection value.
136 * Indicates that the other protection bits are to be applied as a mask
137 * against the actual protection bits of the map entry.
138 */
139#define VM_PROT_IS_MASK ((vm_prot_t) 0x40)
140
141/*
142 * Another invalid protection value to support execute-only protection.
143 * VM_PROT_STRIP_READ is a special marker that tells mprotect to not
144 * set VM_PROT_READ. We have to do it this way because existing code
145 * expects the system to set VM_PROT_READ if VM_PROT_EXECUTE is set.
146 * VM_PROT_EXECUTE_ONLY is just a convenience value to indicate that
147 * the memory should be executable and explicitly not readable. It will
148 * be ignored on platforms that do not support this type of protection.
149 */
150#define VM_PROT_STRIP_READ ((vm_prot_t) 0x80)
151#define VM_PROT_EXECUTE_ONLY (VM_PROT_EXECUTE|VM_PROT_STRIP_READ)
152
153
154#if defined(__x86_64__)
155/*
156 * Another invalid protection value to support specifying different
157 * execute permissions for user- and supervisor- modes. When
158 * MBE is enabled in a VM, VM_PROT_EXECUTE is used to indicate
159 * supervisor-mode execute permission, and VM_PROT_UEXEC specifies
160 * user-mode execute permission. Currently only used by the
161 * x86 Hypervisor kext.
162 */
163#define VM_PROT_UEXEC ((vm_prot_t) 0x8) /* User-mode Execute Permission */
164
165#define VM_PROT_ALLEXEC (VM_PROT_EXECUTE | VM_PROT_UEXEC)
166#else
167#define VM_PROT_ALLEXEC (VM_PROT_EXECUTE)
168#endif /* defined(__x86_64__) */
169
170
171#endif /* _MACH_VM_PROT_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/vm_statistics.h created+556
......@@ -0,0 +1,556 @@
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 * VM allocation flags:
236 *
237 * VM_FLAGS_FIXED
238 * (really the absence of VM_FLAGS_ANYWHERE)
239 * Allocate new VM region at the specified virtual address, if possible.
240 *
241 * VM_FLAGS_ANYWHERE
242 * Allocate new VM region anywhere it would fit in the address space.
243 *
244 * VM_FLAGS_PURGABLE
245 * Create a purgable VM object for that new VM region.
246 *
247 * VM_FLAGS_4GB_CHUNK
248 * The new VM region will be chunked up into 4GB sized pieces.
249 *
250 * VM_FLAGS_NO_PMAP_CHECK
251 * (for DEBUG kernel config only, ignored for other configs)
252 * Do not check that there is no stale pmap mapping for the new VM region.
253 * This is useful for kernel memory allocations at bootstrap when building
254 * the initial kernel address space while some memory is already in use.
255 *
256 * VM_FLAGS_OVERWRITE
257 * The new VM region can replace existing VM regions if necessary
258 * (to be used in combination with VM_FLAGS_FIXED).
259 *
260 * VM_FLAGS_NO_CACHE
261 * Pages brought in to this VM region are placed on the speculative
262 * queue instead of the active queue. In other words, they are not
263 * cached so that they will be stolen first if memory runs low.
264 */
265
266#define VM_FLAGS_FIXED 0x0000
267#define VM_FLAGS_ANYWHERE 0x0001
268#define VM_FLAGS_PURGABLE 0x0002
269#define VM_FLAGS_4GB_CHUNK 0x0004
270#define VM_FLAGS_RANDOM_ADDR 0x0008
271#define VM_FLAGS_NO_CACHE 0x0010
272#define VM_FLAGS_RESILIENT_CODESIGN 0x0020
273#define VM_FLAGS_RESILIENT_MEDIA 0x0040
274#define VM_FLAGS_PERMANENT 0x0080
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_PERMANENT | \
299 VM_FLAGS_OVERWRITE | \
300 VM_FLAGS_SUPERPAGE_MASK | \
301 VM_FLAGS_ALIAS_MASK)
302#define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | \
303 VM_FLAGS_RETURN_4K_DATA_ADDR | \
304 VM_FLAGS_RETURN_DATA_ADDR)
305#define VM_FLAGS_USER_REMAP (VM_FLAGS_FIXED | \
306 VM_FLAGS_ANYWHERE | \
307 VM_FLAGS_RANDOM_ADDR | \
308 VM_FLAGS_OVERWRITE| \
309 VM_FLAGS_RETURN_DATA_ADDR | \
310 VM_FLAGS_RESILIENT_CODESIGN | \
311 VM_FLAGS_RESILIENT_MEDIA)
312
313#define VM_FLAGS_SUPERPAGE_SHIFT 16
314#define SUPERPAGE_NONE 0 /* no superpages, if all bits are 0 */
315#define SUPERPAGE_SIZE_ANY 1
316#define VM_FLAGS_SUPERPAGE_NONE (SUPERPAGE_NONE << VM_FLAGS_SUPERPAGE_SHIFT)
317#define VM_FLAGS_SUPERPAGE_SIZE_ANY (SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT)
318#define SUPERPAGE_SIZE_2MB 2
319#define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<<VM_FLAGS_SUPERPAGE_SHIFT)
320
321/*
322 * EXC_GUARD definitions for virtual memory.
323 */
324#define GUARD_TYPE_VIRT_MEMORY 0x5
325
326/* Reasons for exception for virtual memory */
327enum virtual_memory_guard_exception_codes {
328 kGUARD_EXC_DEALLOC_GAP = 1u << 0
329};
330
331
332/* current accounting postmark */
333#define __VM_LEDGER_ACCOUNTING_POSTMARK 2019032600
334
335/* discrete values: */
336#define VM_LEDGER_TAG_NONE 0x00000000
337#define VM_LEDGER_TAG_DEFAULT 0x00000001
338#define VM_LEDGER_TAG_NETWORK 0x00000002
339#define VM_LEDGER_TAG_MEDIA 0x00000003
340#define VM_LEDGER_TAG_GRAPHICS 0x00000004
341#define VM_LEDGER_TAG_NEURAL 0x00000005
342#define VM_LEDGER_TAG_MAX 0x00000005
343/* individual bits: */
344#define VM_LEDGER_FLAG_NO_FOOTPRINT (1 << 0)
345#define VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG (1 << 1)
346#define VM_LEDGER_FLAGS (VM_LEDGER_FLAG_NO_FOOTPRINT | VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG)
347
348
349#define VM_MEMORY_MALLOC 1
350#define VM_MEMORY_MALLOC_SMALL 2
351#define VM_MEMORY_MALLOC_LARGE 3
352#define VM_MEMORY_MALLOC_HUGE 4
353#define VM_MEMORY_SBRK 5// uninteresting -- no one should call
354#define VM_MEMORY_REALLOC 6
355#define VM_MEMORY_MALLOC_TINY 7
356#define VM_MEMORY_MALLOC_LARGE_REUSABLE 8
357#define VM_MEMORY_MALLOC_LARGE_REUSED 9
358
359#define VM_MEMORY_ANALYSIS_TOOL 10
360
361#define VM_MEMORY_MALLOC_NANO 11
362#define VM_MEMORY_MALLOC_MEDIUM 12
363#define VM_MEMORY_MALLOC_PGUARD 13 // Will be removed
364#define VM_MEMORY_MALLOC_PROB_GUARD 13
365
366#define VM_MEMORY_MACH_MSG 20
367#define VM_MEMORY_IOKIT 21
368#define VM_MEMORY_STACK 30
369#define VM_MEMORY_GUARD 31
370#define VM_MEMORY_SHARED_PMAP 32
371/* memory containing a dylib */
372#define VM_MEMORY_DYLIB 33
373#define VM_MEMORY_OBJC_DISPATCHERS 34
374
375/* Was a nested pmap (VM_MEMORY_SHARED_PMAP) which has now been unnested */
376#define VM_MEMORY_UNSHARED_PMAP 35
377
378
379// Placeholders for now -- as we analyze the libraries and find how they
380// use memory, we can make these labels more specific.
381#define VM_MEMORY_APPKIT 40
382#define VM_MEMORY_FOUNDATION 41
383#define VM_MEMORY_COREGRAPHICS 42
384#define VM_MEMORY_CORESERVICES 43
385#define VM_MEMORY_CARBON VM_MEMORY_CORESERVICES
386#define VM_MEMORY_JAVA 44
387#define VM_MEMORY_COREDATA 45
388#define VM_MEMORY_COREDATA_OBJECTIDS 46
389#define VM_MEMORY_ATS 50
390#define VM_MEMORY_LAYERKIT 51
391#define VM_MEMORY_CGIMAGE 52
392#define VM_MEMORY_TCMALLOC 53
393
394/* private raster data (i.e. layers, some images, QGL allocator) */
395#define VM_MEMORY_COREGRAPHICS_DATA 54
396
397/* shared image and font caches */
398#define VM_MEMORY_COREGRAPHICS_SHARED 55
399
400/* Memory used for virtual framebuffers, shadowing buffers, etc... */
401#define VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS 56
402
403/* Window backing stores, custom shadow data, and compressed backing stores */
404#define VM_MEMORY_COREGRAPHICS_BACKINGSTORES 57
405
406/* x-alloc'd memory */
407#define VM_MEMORY_COREGRAPHICS_XALLOC 58
408
409/* catch-all for other uses, such as the read-only shared data page */
410#define VM_MEMORY_COREGRAPHICS_MISC VM_MEMORY_COREGRAPHICS
411
412/* memory allocated by the dynamic loader for itself */
413#define VM_MEMORY_DYLD 60
414/* malloc'd memory created by dyld */
415#define VM_MEMORY_DYLD_MALLOC 61
416
417/* Used for sqlite page cache */
418#define VM_MEMORY_SQLITE 62
419
420/* JavaScriptCore heaps */
421#define VM_MEMORY_JAVASCRIPT_CORE 63
422#define VM_MEMORY_WEBASSEMBLY VM_MEMORY_JAVASCRIPT_CORE
423/* memory allocated for the JIT */
424#define VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR 64
425#define VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE 65
426
427/* memory allocated for GLSL */
428#define VM_MEMORY_GLSL 66
429
430/* memory allocated for OpenCL.framework */
431#define VM_MEMORY_OPENCL 67
432
433/* memory allocated for QuartzCore.framework */
434#define VM_MEMORY_COREIMAGE 68
435
436/* memory allocated for WebCore Purgeable Buffers */
437#define VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS 69
438
439/* ImageIO memory */
440#define VM_MEMORY_IMAGEIO 70
441
442/* CoreProfile memory */
443#define VM_MEMORY_COREPROFILE 71
444
445/* assetsd / MobileSlideShow memory */
446#define VM_MEMORY_ASSETSD 72
447
448/* libsystem_kernel os_once_alloc */
449#define VM_MEMORY_OS_ALLOC_ONCE 73
450
451/* libdispatch internal allocator */
452#define VM_MEMORY_LIBDISPATCH 74
453
454/* Accelerate.framework image backing stores */
455#define VM_MEMORY_ACCELERATE 75
456
457/* CoreUI image block data */
458#define VM_MEMORY_COREUI 76
459
460/* CoreUI image file */
461#define VM_MEMORY_COREUIFILE 77
462
463/* Genealogy buffers */
464#define VM_MEMORY_GENEALOGY 78
465
466/* RawCamera VM allocated memory */
467#define VM_MEMORY_RAWCAMERA 79
468
469/* corpse info for dead process */
470#define VM_MEMORY_CORPSEINFO 80
471
472/* Apple System Logger (ASL) messages */
473#define VM_MEMORY_ASL 81
474
475/* Swift runtime */
476#define VM_MEMORY_SWIFT_RUNTIME 82
477
478/* Swift metadata */
479#define VM_MEMORY_SWIFT_METADATA 83
480
481/* DHMM data */
482#define VM_MEMORY_DHMM 84
483
484
485/* memory allocated by SceneKit.framework */
486#define VM_MEMORY_SCENEKIT 86
487
488/* memory allocated by skywalk networking */
489#define VM_MEMORY_SKYWALK 87
490
491#define VM_MEMORY_IOSURFACE 88
492
493#define VM_MEMORY_LIBNETWORK 89
494
495#define VM_MEMORY_AUDIO 90
496
497#define VM_MEMORY_VIDEOBITSTREAM 91
498
499/* memory allocated by CoreMedia */
500#define VM_MEMORY_CM_XPC 92
501
502#define VM_MEMORY_CM_RPC 93
503
504#define VM_MEMORY_CM_MEMORYPOOL 94
505
506#define VM_MEMORY_CM_READCACHE 95
507
508#define VM_MEMORY_CM_CRABS 96
509
510/* memory allocated for QuickLookThumbnailing */
511#define VM_MEMORY_QUICKLOOK_THUMBNAILS 97
512
513/* memory allocated by Accounts framework */
514#define VM_MEMORY_ACCOUNTS 98
515
516/* memory allocated by Sanitizer runtime libraries */
517#define VM_MEMORY_SANITIZER 99
518
519/* Differentiate memory needed by GPU drivers and frameworks from generic IOKit allocations */
520#define VM_MEMORY_IOACCELERATOR 100
521
522/* memory allocated by CoreMedia for global image registration of frames */
523#define VM_MEMORY_CM_REGWARP 101
524
525/* memory allocated by EmbeddedAcousticRecognition for speech decoder */
526#define VM_MEMORY_EAR_DECODER 102
527
528/* CoreUI cached image data */
529#define VM_MEMORY_COREUI_CACHED_IMAGE_DATA 103
530
531/* ColorSync is using mmap for read-only copies of ICC profile data */
532#define VM_MEMORY_COLORSYNC 104
533
534/* Reserve 230-239 for Rosetta */
535#define VM_MEMORY_ROSETTA 230
536#define VM_MEMORY_ROSETTA_THREAD_CONTEXT 231
537#define VM_MEMORY_ROSETTA_INDIRECT_BRANCH_MAP 232
538#define VM_MEMORY_ROSETTA_RETURN_STACK 233
539#define VM_MEMORY_ROSETTA_EXECUTABLE_HEAP 234
540#define VM_MEMORY_ROSETTA_USER_LDT 235
541#define VM_MEMORY_ROSETTA_ARENA 236
542#define VM_MEMORY_ROSETTA_10 239
543
544/* Reserve 240-255 for application */
545#define VM_MEMORY_APPLICATION_SPECIFIC_1 240
546#define VM_MEMORY_APPLICATION_SPECIFIC_16 255
547
548#define VM_MAKE_TAG(tag) ((tag) << 24)
549
550
551
552#ifdef __cplusplus
553}
554#endif
555
556#endif /* _MACH_VM_STATISTICS_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach/vm_types.h created+98
......@@ -0,0 +1,98 @@
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#include <sys/cdefs.h>
40
41typedef vm_offset_t pointer_t __kernel_ptr_semantics;
42typedef vm_offset_t vm_address_t __kernel_ptr_semantics;
43
44/*
45 * We use addr64_t for 64-bit addresses that are used on both
46 * 32 and 64-bit machines. On PPC, they are passed and returned as
47 * two adjacent 32-bit GPRs. We use addr64_t in places where
48 * common code must be useable both on 32 and 64-bit machines.
49 */
50typedef uint64_t addr64_t; /* Basic effective address */
51
52/*
53 * We use reg64_t for addresses that are 32 bits on a 32-bit
54 * machine, and 64 bits on a 64-bit machine, but are always
55 * passed and returned in a single GPR on PPC. This type
56 * cannot be used in generic 32-bit c, since on a 64-bit
57 * machine the upper half of the register will be ignored
58 * by the c compiler in 32-bit mode. In c, we can only use the
59 * type in prototypes of functions that are written in and called
60 * from assembly language. This type is basically a comment.
61 */
62typedef uint32_t reg64_t;
63
64/*
65 * To minimize the use of 64-bit fields, we keep some physical
66 * addresses (that are page aligned) as 32-bit page numbers.
67 * This limits the physical address space to 16TB of RAM.
68 */
69typedef uint32_t ppnum_t; /* Physical page number */
70#define PPNUM_MAX UINT32_MAX
71
72
73
74typedef mach_port_t vm_map_t, vm_map_read_t, vm_map_inspect_t;
75
76
77#define VM_MAP_NULL ((vm_map_t) 0)
78#define VM_MAP_INSPECT_NULL ((vm_map_inspect_t) 0)
79#define VM_MAP_READ_NULL ((vm_map_read_t) 0)
80
81/*
82 * Evolving definitions, likely to change.
83 */
84
85typedef uint64_t vm_object_offset_t;
86typedef uint64_t vm_object_size_t;
87
88
89
90
91typedef mach_port_t upl_t;
92typedef mach_port_t vm_named_entry_t;
93
94
95#define UPL_NULL ((upl_t) 0)
96#define VM_NAMED_ENTRY_NULL ((vm_named_entry_t) 0)
97
98#endif /* _MACH_VM_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/mach_debug/mach_debug_types.h created+199
......@@ -0,0 +1,199 @@
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_V2_SIGNATURE 0x63614d2073736f42ULL
74#define MACH_CORE_FILEHEADER_MAXFILES 16
75#define MACH_CORE_FILEHEADER_NAMELEN 16
76
77/* The following are defined for mach_core_fileheader_v2 */
78#define MACH_CORE_FILEHEADER_V2_FLAG_LOG_ENCRYPTED_AEA (1ULL << 0) /* The log is encrypted using AEA */
79#define MACH_CORE_FILEHEADER_V2_FLAG_EXISTING_COREFILE_KEY_FORMAT_NIST_P256 (1ULL << 8) /* The public key is an NIST-P256 ECC key */
80#define MACH_CORE_FILEHEADER_V2_FLAG_NEXT_COREFILE_KEY_FORMAT_NIST_P256 (1ULL << 16) /* The next public key is an NIST-P256 ECC key */
81
82#define MACH_CORE_FILEHEADER_V2_FLAGS_EXISTING_COREFILE_KEY_FORMAT_MASK (0x1ULL << 8) /* A bit-mask for all supported key formats */
83#define MACH_CORE_FILEHEADER_V2_FLAGS_NEXT_COREFILE_KEY_FORMAT_MASK (0x1ULL << 16) /* A bit-mask for all supported next key formats */
84
85#define MACH_CORE_FILEHEADER_V2_FLAGS_NEXT_KEY_FORMAT_TO_KEY_FORMAT(x) (((x) >> 8) & MACH_CORE_FILEHEADER_V2_FLAGS_EXISTING_COREFILE_KEY_FORMAT_MASK)
86
87/* The following are defined for mach_core_details_v2 */
88#define MACH_CORE_DETAILS_V2_FLAG_ENCRYPTED_AEA (1ULL << 0) /* This core is encrypted using AEA */
89#define MACH_CORE_DETAILS_V2_FLAG_COMPRESSED_ZLIB (1ULL << 8) /* This core is compressed using ZLib */
90
91typedef char symtab_name_t[32];
92
93/*
94 ***********************
95 *
96 * Mach corefile layout
97 *
98 ***********************
99 *
100 * uint64_t signature
101 * uint64_t log_offset >---+
102 * uint64_t log_length |
103 * mach_core_details files[MACH_CORE_FILEHEADER_MAXFILES] |
104 * |--> uint64_t gzip_offset >---+ |
105 * | uint64_t gzip_length | |
106 * | char core_name[] | |
107 * |--> uint64_t gzip_offset >---+ | |
108 * | uint64_t gzip_length | | |
109 * | char core_name[] | | |
110 * |--> [...] | | |
111 * [log data. Plain-text] | | <---+
112 * [core #1 data. Zlib compressed] | <---+
113 * [core #2 data. Zlib compressed] <---+
114 * [core #x data...]
115 */
116
117struct mach_core_details {
118 uint64_t gzip_offset;
119 uint64_t gzip_length;
120 char core_name[MACH_CORE_FILEHEADER_NAMELEN];
121};
122
123struct mach_core_fileheader {
124 uint64_t signature; /* MACH_CORE_FILEHEADER_SIGNATURE */
125 uint64_t log_offset;
126 uint64_t log_length;
127 uint64_t num_files;
128 struct mach_core_details files[MACH_CORE_FILEHEADER_MAXFILES];
129};
130
131/*
132 * Mach corefile V2 headers are denoted with MACH_CORE_FILEHEADER_V2_SIGNATURE.
133 * Note that the V2 headers contain a version field that further indicates the version of the
134 * header's contents. For example, if a V2 header's 'version' field indicates version 5, then
135 * the header follows the format of the 'mach_core_fileheader_v5' structure.
136 *
137 * Further note that 'mach_core_details_' structures are not bound to the same versioning scheme
138 * as the header itself. This means that it's perfectly acceptable for a 'mach_core_fileheader_v5' header
139 * to make use of 'mach_core_details_v2'
140 *
141 **************************
142 *
143 * Mach corefile layout V2 (using a version 2 header struct as an example)
144 *
145 **************************
146 *
147 * uint64_t signature
148 * uint32_t version
149 * uint64_t flags
150 * uint64_t pub_key_offset >---+
151 * uint16_t pub_key_length |
152 * uint64_t log_offset >---+ |
153 * uint64_t log_length | |
154 * uint64_t num_files | |
155 * mach_core_details_v2 files[] | |
156 * |--> uint64_t flags | |
157 * | uint64_t offset >---+ | |
158 * | uint64_t length | | |
159 * | char core_name[] | | |
160 * |--> uint64_t flags | | |
161 * | uint64_t offset >---+ | | |
162 * | uint64_t length | | | |
163 * | char core_name[] | | | |
164 * |--> [...] | | | |
165 * [public key data] | | | <---+
166 * [log data. Plain-text or an AEA container] | | <---+
167 * [core #1 data. Zlib compressed. Possibly in an AEA container] | <---+
168 * [core #2 data. Zlib compressed. Possibly in an AEA container] <---+
169 * [core #x data...]
170 */
171
172struct mach_core_details_v2 {
173 uint64_t flags; /* See the MACH_CORE_DETAILS_V2_FLAG_* definitions */
174 uint64_t offset;
175 uint64_t length;
176 char core_name[MACH_CORE_FILEHEADER_NAMELEN];
177};
178
179struct mach_core_fileheader_base {
180 uint64_t signature; /* MACH_CORE_FILEHEADER_V2_SIGNATURE */
181 uint32_t version;
182};
183
184struct mach_core_fileheader_v2 {
185 uint64_t signature; /* MACH_CORE_FILEHEADER_V2_SIGNATURE */
186 uint32_t version; /* 2 */
187 uint64_t flags; /* See the MACH_CORE_FILEHEADER_V2_FLAG_* definitions */
188 uint64_t pub_key_offset; /* Offset of the public key */
189 uint16_t pub_key_length; /* Length of the public key */
190 uint64_t log_offset;
191 uint64_t log_length;
192 uint64_t num_files;
193 struct mach_core_details_v2 files[];
194};
195
196#define KOBJECT_DESCRIPTION_LENGTH 512
197typedef char kobject_description_t[KOBJECT_DESCRIPTION_LENGTH];
198
199#endif /* _MACH_DEBUG_MACH_DEBUG_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/malloc/malloc.h created+341
......@@ -0,0 +1,341 @@
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/********* Zone version summary ************/
313// Version 0, but optional:
314// malloc_zone_t::batch_malloc
315// malloc_zone_t::batch_free
316// Version 5:
317// malloc_zone_t::memalign
318// Version 6:
319// malloc_zone_t::free_definite_size
320// Version 7:
321// malloc_introspection_t::enable_discharge_checking
322// malloc_introspection_t::disable_discharge_checking
323// malloc_introspection_t::discharge
324// Version 8:
325// malloc_zone_t::pressure_relief
326// Version 9:
327// malloc_introspection_t::reinit_lock
328// Version 10:
329// malloc_zone_t::claimed_address
330// Version 11:
331// malloc_introspection_t::print_task
332// Version 12:
333// malloc_introspection_t::task_statistics
334
335// These functions are optional and calling them requires two checks:
336// * Check zone version to ensure zone struct is large enough to include the member.
337// * Check that the function pointer is not null.
338
339__END_DECLS
340
341#endif /* _MALLOC_MALLOC_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/netinet6/in6.h created+683
......@@ -0,0 +1,683 @@
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#define IPV6CTL_ULA_USETEMPADDR 51
631
632
633/* New entries should be added here from current IPV6CTL_MAXID value. */
634/* to define items, should talk with KAME guys first, for *BSD compatibility */
635#define IPV6CTL_MAXID 51
636
637
638
639
640
641__BEGIN_DECLS
642struct cmsghdr;
643
644extern int inet6_option_space(int);
645extern int inet6_option_init(void *, struct cmsghdr **, int);
646extern int inet6_option_append(struct cmsghdr *, const __uint8_t *, int, int);
647extern __uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int);
648extern int inet6_option_next(const struct cmsghdr *, __uint8_t **);
649extern int inet6_option_find(const struct cmsghdr *, __uint8_t **, int);
650
651extern size_t inet6_rthdr_space(int, int);
652extern struct cmsghdr *inet6_rthdr_init(void *, int);
653extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *,
654 unsigned int);
655extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int);
656#if 0 /* not implemented yet */
657extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *);
658#endif
659extern int inet6_rthdr_segments(const struct cmsghdr *);
660extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int);
661extern int inet6_rthdr_getflags(const struct cmsghdr *, int);
662
663extern int inet6_opt_init(void *, socklen_t);
664extern int inet6_opt_append(void *, socklen_t, int, __uint8_t, socklen_t,
665 __uint8_t, void **);
666extern int inet6_opt_finish(void *, socklen_t, int);
667extern int inet6_opt_set_val(void *, int, void *, socklen_t);
668
669extern int inet6_opt_next(void *, socklen_t, int, __uint8_t *, socklen_t *,
670 void **);
671extern int inet6_opt_find(void *, socklen_t, int, __uint8_t, socklen_t *,
672 void **);
673extern int inet6_opt_get_val(void *, int, void *, socklen_t);
674extern socklen_t inet6_rth_space(int, int);
675extern void *inet6_rth_init(void *, socklen_t, int, int);
676extern int inet6_rth_add(void *, const struct in6_addr *);
677extern int inet6_rth_reverse(const void *, void *);
678extern int inet6_rth_segments(const void *);
679extern struct in6_addr *inet6_rth_getaddr(const void *, int);
680
681__END_DECLS
682#endif /* PLATFORM_DriverKit */
683#endif /* !_NETINET6_IN6_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/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__ || TARGET_OS_WIN32 || 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
\ No newline at end of file
lib/libc/include/any-macos.12-any/objc/message.h created+319
......@@ -0,0 +1,319 @@
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#endif
\ No newline at end of file
lib/libc/include/any-macos.12-any/objc/objc-api.h created+296
......@@ -0,0 +1,296 @@
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/* OBJC_UNAVAILABLE: unavailable, with a message where supported */
164#if !defined(OBJC_UNAVAILABLE)
165# if __has_extension(attribute_unavailable_with_message)
166# define OBJC_UNAVAILABLE(_msg) __attribute__((unavailable(_msg)))
167# else
168# define OBJC_UNAVAILABLE(_msg) __attribute__((unavailable))
169# endif
170#endif
171
172/* OBJC_DEPRECATED: deprecated, with a message where supported */
173#if !defined(OBJC_DEPRECATED)
174# if __has_extension(attribute_deprecated_with_message)
175# define OBJC_DEPRECATED(_msg) __attribute__((deprecated(_msg)))
176# else
177# define OBJC_DEPRECATED(_msg) __attribute__((deprecated))
178# endif
179#endif
180
181/* OBJC_ARC_UNAVAILABLE: unavailable with -fobjc-arc */
182#if !defined(OBJC_ARC_UNAVAILABLE)
183# if __has_feature(objc_arc)
184# define OBJC_ARC_UNAVAILABLE OBJC_UNAVAILABLE("not available in automatic reference counting mode")
185# else
186# define OBJC_ARC_UNAVAILABLE
187# endif
188#endif
189
190/* OBJC_SWIFT_UNAVAILABLE: unavailable in Swift */
191#if !defined(OBJC_SWIFT_UNAVAILABLE)
192# if __has_feature(attribute_availability_swift)
193# define OBJC_SWIFT_UNAVAILABLE(_msg) __attribute__((availability(swift, unavailable, message=_msg)))
194# else
195# define OBJC_SWIFT_UNAVAILABLE(_msg)
196# endif
197#endif
198
199/* OBJC_ARM64_UNAVAILABLE: unavailable on arm64 (i.e. stret dispatch) */
200#if !defined(OBJC_ARM64_UNAVAILABLE)
201# if defined(__arm64__)
202# define OBJC_ARM64_UNAVAILABLE OBJC_UNAVAILABLE("not available in arm64")
203# else
204# define OBJC_ARM64_UNAVAILABLE
205# endif
206#endif
207
208/* OBJC_GC_UNAVAILABLE: unavailable with -fobjc-gc or -fobjc-gc-only */
209#if !defined(OBJC_GC_UNAVAILABLE)
210# define OBJC_GC_UNAVAILABLE
211#endif
212
213#if !defined(OBJC_EXTERN)
214# if defined(__cplusplus)
215# define OBJC_EXTERN extern "C"
216# else
217# define OBJC_EXTERN extern
218# endif
219#endif
220
221#if !defined(OBJC_VISIBLE)
222# if TARGET_OS_WIN32
223# if defined(BUILDING_OBJC)
224# define OBJC_VISIBLE __declspec(dllexport)
225# else
226# define OBJC_VISIBLE __declspec(dllimport)
227# endif
228# else
229# define OBJC_VISIBLE __attribute__((visibility("default")))
230# endif
231#endif
232
233#if !defined(OBJC_EXPORT)
234# define OBJC_EXPORT OBJC_EXTERN OBJC_VISIBLE
235#endif
236
237#if !defined(OBJC_IMPORT)
238# define OBJC_IMPORT extern
239#endif
240
241#if !defined(OBJC_ROOT_CLASS)
242# if __has_attribute(objc_root_class)
243# define OBJC_ROOT_CLASS __attribute__((objc_root_class))
244# else
245# define OBJC_ROOT_CLASS
246# endif
247#endif
248
249#ifndef __DARWIN_NULL
250#define __DARWIN_NULL NULL
251#endif
252
253#if !defined(OBJC_INLINE)
254# define OBJC_INLINE __inline
255#endif
256
257// Declares an enum type or option bits type as appropriate for each language.
258#if (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum))
259#define OBJC_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
260#if (__cplusplus)
261#define OBJC_OPTIONS(_type, _name) _type _name; enum : _type
262#else
263#define OBJC_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
264#endif
265#else
266#define OBJC_ENUM(_type, _name) _type _name; enum
267#define OBJC_OPTIONS(_type, _name) _type _name; enum
268#endif
269
270#if !defined(OBJC_RETURNS_RETAINED)
271# if __OBJC__ && __has_attribute(ns_returns_retained)
272# define OBJC_RETURNS_RETAINED __attribute__((ns_returns_retained))
273# else
274# define OBJC_RETURNS_RETAINED
275# endif
276#endif
277
278/* OBJC_COLD: very rarely called, e.g. on error path */
279#if !defined(OBJC_COLD)
280# if __OBJC__ && __has_attribute(cold)
281# define OBJC_COLD __attribute__((cold))
282# else
283# define OBJC_COLD
284# endif
285#endif
286
287/* OBJC_NORETURN: does not return normally, but may throw */
288#if !defined(OBJC_NORETURN)
289# if __OBJC__ && __has_attribute(noreturn)
290# define OBJC_NORETURN __attribute__((noreturn))
291# else
292# define OBJC_NORETURN
293# endif
294#endif
295
296#endif
\ No newline at end of file
lib/libc/include/any-macos.12-any/os/base.h created+328
......@@ -0,0 +1,328 @@
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(analyzer_suppress)
155#define OS_ANALYZER_SUPPRESS(RADAR) __attribute__((analyzer_suppress))
156#else
157#define OS_ANALYZER_SUPPRESS(RADAR)
158#endif
159
160#if __has_attribute(enum_extensibility)
161#define __OS_ENUM_ATTR __attribute__((enum_extensibility(open)))
162#define __OS_ENUM_ATTR_CLOSED __attribute__((enum_extensibility(closed)))
163#else
164#define __OS_ENUM_ATTR
165#define __OS_ENUM_ATTR_CLOSED
166#endif // __has_attribute(enum_extensibility)
167
168#if __has_attribute(flag_enum)
169/*!
170 * Compile with -Wflag-enum and -Wassign-enum to enforce at definition and
171 * assignment, respectively, i.e. -Wflag-enum prevents you from creating new
172 * enumeration values from illegal values within the enum definition, and
173 * -Wassign-enum prevents you from assigning illegal values to a variable of the
174 * enum type.
175 */
176#define __OS_OPTIONS_ATTR __attribute__((flag_enum))
177#else
178#define __OS_OPTIONS_ATTR
179#endif // __has_attribute(flag_enum)
180
181#if __has_feature(objc_fixed_enum) || __has_extension(cxx_fixed_enum) || \
182 __has_extension(cxx_strong_enums)
183#define OS_ENUM(_name, _type, ...) \
184 typedef enum : _type { __VA_ARGS__ } _name##_t
185#define OS_CLOSED_ENUM(_name, _type, ...) \
186 typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR_CLOSED _name##_t
187#define OS_OPTIONS(_name, _type, ...) \
188 typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR __OS_OPTIONS_ATTR _name##_t
189#define OS_CLOSED_OPTIONS(_name, _type, ...) \
190 typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR _name##_t
191#else
192/*!
193 * There is unfortunately no good way in plain C to have both fixed-type enums
194 * and enforcement for clang's enum_extensibility extensions. The primary goal
195 * of these macros is to allow you to define an enum and specify its width in a
196 * single statement, and for plain C that is accomplished by defining an
197 * anonymous enum and then separately typedef'ing the requested type name to the
198 * requested underlying integer type. So the type emitted actually has no
199 * relationship at all to the enum, and therefore while the compiler could
200 * enforce enum extensibility if you used the enum type, it cannot do so if you
201 * use the "_t" type resulting from this expression.
202 *
203 * But we still define a named enum type and decorate it appropriately for you,
204 * so if you really want the enum extensibility enforcement, you can use the
205 * enum type yourself, i.e. when compiling with a C compiler:
206 *
207 * OS_CLOSED_ENUM(my_type, uint64_t,
208 * FOO,
209 * BAR,
210 * BAZ,
211 * );
212 *
213 * my_type_t mt = 98; // legal
214 * enum my_type emt = 98; // illegal
215 *
216 * But be aware that the underlying enum type's width is subject only to the C
217 * language's guarantees -- namely that it will be compatible with int, char,
218 * and unsigned char. It is not safe to rely on the size of this type.
219 *
220 * When compiling in ObjC or C++, both of the above assignments are illegal.
221 */
222#define __OS_ENUM_C_FALLBACK(_name, _type, ...) \
223 typedef _type _name##_t; enum _name { __VA_ARGS__ }
224
225#define OS_ENUM(_name, _type, ...) \
226 typedef _type _name##_t; enum { __VA_ARGS__ }
227#define OS_CLOSED_ENUM(_name, _type, ...) \
228 __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \
229 __OS_ENUM_ATTR_CLOSED
230#define OS_OPTIONS(_name, _type, ...) \
231 __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \
232 __OS_ENUM_ATTR __OS_OPTIONS_ATTR
233#define OS_CLOSED_OPTIONS(_name, _type, ...) \
234 __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \
235 __OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR
236#endif // __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums)
237
238#if __has_feature(attribute_availability_swift)
239// equivalent to __SWIFT_UNAVAILABLE from Availability.h
240#define OS_SWIFT_UNAVAILABLE(_msg) \
241 __attribute__((__availability__(swift, unavailable, message=_msg)))
242#else
243#define OS_SWIFT_UNAVAILABLE(_msg)
244#endif
245
246#if __has_attribute(swift_private)
247# define OS_REFINED_FOR_SWIFT __attribute__((__swift_private__))
248#else
249# define OS_REFINED_FOR_SWIFT
250#endif
251
252#if __has_attribute(swift_name)
253# define OS_SWIFT_NAME(_name) __attribute__((__swift_name__(#_name)))
254#else
255# define OS_SWIFT_NAME(_name)
256#endif
257
258#define __OS_STRINGIFY(s) #s
259#define OS_STRINGIFY(s) __OS_STRINGIFY(s)
260#define __OS_CONCAT(x, y) x ## y
261#define OS_CONCAT(x, y) __OS_CONCAT(x, y)
262
263#ifdef __GNUC__
264#define os_prevent_tail_call_optimization() __asm__("")
265#define os_is_compile_time_constant(expr) __builtin_constant_p(expr)
266#define os_compiler_barrier() __asm__ __volatile__("" ::: "memory")
267#else
268#define os_prevent_tail_call_optimization() do { } while (0)
269#define os_is_compile_time_constant(expr) 0
270#define os_compiler_barrier() do { } while (0)
271#endif
272
273#if __has_attribute(not_tail_called)
274#define OS_NOT_TAIL_CALLED __attribute__((__not_tail_called__))
275#else
276#define OS_NOT_TAIL_CALLED
277#endif
278
279
280typedef void (*os_function_t)(void *_Nullable);
281
282#ifdef __BLOCKS__
283/*!
284 * @typedef os_block_t
285 *
286 * @abstract
287 * Generic type for a block taking no arguments and returning no value.
288 *
289 * @discussion
290 * When not building with Objective-C ARC, a block object allocated on or
291 * copied to the heap must be released with a -[release] message or the
292 * Block_release() function.
293 *
294 * The declaration of a block literal allocates storage on the stack.
295 * Therefore, this is an invalid construct:
296 * <code>
297 * os_block_t block;
298 * if (x) {
299 * block = ^{ printf("true\n"); };
300 * } else {
301 * block = ^{ printf("false\n"); };
302 * }
303 * block(); // unsafe!!!
304 * </code>
305 *
306 * What is happening behind the scenes:
307 * <code>
308 * if (x) {
309 * struct Block __tmp_1 = ...; // setup details
310 * block = &__tmp_1;
311 * } else {
312 * struct Block __tmp_2 = ...; // setup details
313 * block = &__tmp_2;
314 * }
315 * </code>
316 *
317 * As the example demonstrates, the address of a stack variable is escaping the
318 * scope in which it is allocated. That is a classic C bug.
319 *
320 * Instead, the block literal must be copied to the heap with the Block_copy()
321 * function or by sending it a -[copy] message.
322 */
323typedef void (^os_block_t)(void);
324#endif
325
326
327
328#endif // __OS_BASE__
\ No newline at end of file
lib/libc/include/any-macos.12-any/pthread.h created+727
......@@ -0,0 +1,727 @@
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, driverkit)
561void pthread_jit_write_protect_np(int enabled);
562
563__API_AVAILABLE(macos(11.0))
564__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
565int pthread_jit_write_protect_supported_np(void);
566
567/*!
568 * @typedef pthread_jit_write_callback_t
569 * The type of a function that can be supplied to {@link
570 * pthread_jit_write_with_callback_np} to write to the MAP_JIT region while it
571 * is writeable.
572 *
573 * @param ctx
574 * A pointer to context that will be passed through to the callback function.
575 *
576 * @result
577 * A result code to be returned to the caller of @{link
578 * pthread_jit_write_with_callback_np}. The system does not interpret/act on
579 * the value of this result.
580 */
581typedef int (*pthread_jit_write_callback_t)(void * _Nullable ctx);
582
583/*!
584 * @define PTHREAD_JIT_WRITE_ALLOW_CALLBACKS_NP
585 * A macro to be used at file scope to list the functions allowed to be passed
586 * to {@link pthread_jit_write_with_callback_np} to write to the MAP_JIT region
587 * while it is writeable. It may be invoked only once per executable/library.
588 *
589 * @param callbacks
590 * The pthread_jit_write_callback_t functions to allow. They should be supplied
591 * as a comma-delimited list.
592 */
593#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__OBJC__) || defined(__cplusplus)
594#define PTHREAD_JIT_WRITE_ALLOW_CALLBACKS_NP(...) \
595 __attribute__((__used__, __section__("__DATA_CONST,__pth_jit_func"))) \
596 static const pthread_jit_write_callback_t __pthread_jit_write_callback_allowlist[] = { \
597 __VA_ARGS__, NULL \
598 }
599#endif /* (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__OBJC__) || defined(__cplusplus) */
600
601/*!
602 * @function pthread_jit_write_with_callback_np
603 *
604 * @abstract
605 * Toggles per-thread write-protection of the MAP_JIT region to writeable,
606 * invokes an allowed callback function to write to it, and toggles protection
607 * back to executable.
608 *
609 * @param callback
610 * The callback function to invoke to write to the MAP_JIT region. It must be
611 * statically allowed using {@link PTHREAD_JIT_WRITE_ALLOW_CALLBACKS_NP}.
612 *
613 * @param ctx
614 * Context to pass through to the invocation of the callback function.
615 *
616 * @result
617 * The result code returned by the callback function.
618 *
619 * @discussion
620 * This function assumes that the MAP_JIT region has executable protection when
621 * called. It is therefore invalid to call it recursively from within a write
622 * callback. The implementation does not detect such invalid recursive calls,
623 * so the client is responsible for preventing them.
624 *
625 * Callbacks _must not_ perform any non-local transfer of control flow (e.g.
626 * throw an exception, longjmp(3)), as doing so would leave the MAP_JIT region
627 * writeable.
628 *
629 * On systems where pthread_jit_write_protect_supported_np(3) is false, this
630 * function calls @callback directly and does nothing else.
631 *
632 * This function only enforces that @callback is allowed if the caller has the
633 * com.apple.security.cs.jit-write-allowlist entitlement. That entitlement also
634 * disallows use of pthread_jit_write_protect_np(3). Adopting the entitlement
635 * is therefore crucial in realizing the security benefits of this interface.
636 *
637 * If the entitlement is not present then this function toggles protection of
638 * the MAP_JIT to writeable, calls @callback and then toggles protection back to
639 * executable, without validating that @callback is an allowed function. This
640 * behavior is intended to permit independent adoption of this interface by
641 * libraries - once all libraries in an application have adopted, the
642 * application should add the entitlement.
643 *
644 * By default, only callbacks in libraries/images present at process start-up
645 * are allowed - callbacks in images loaded dynamically via dlopen(3)/etc. are
646 * not permitted. However, if the additional entitlement
647 * com.apple.security.cs.jit-write-allowlist-freeze-late is _also_ present, any
648 * callbacks in dlopen'd libraries are also added to the set of allowed
649 * callbacks until the {@link pthread_jit_write_freeze_callbacks_np} function is
650 * called.
651 *
652 * The goal of this interface is to allow applications that execute JIT-compiled
653 * code to mitigate against attempts from attackers to escalate to code
654 * execution by getting their own instructions written to the MAP_JIT region.
655 *
656 * Callbacks should assume an attacker can control the input to this function.
657 * They must therefore carefully validate the data that they are passed and do
658 * so using as little attackable state as possible. This means simplifying
659 * control flow and avoiding spills of sensitive registers (e.g. those used for
660 * validation or control flow).
661 *
662 * In the event a callback detects that its input is invalid, it should either
663 * abort in the simplest fashion possible (preferring e.g. __builtin_trap() over
664 * abort(3), the latter being encumbered by various conformance requirements) or
665 * return a result indicating failure.
666 */
667__API_AVAILABLE(macos(11.4))
668__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
669__SWIFT_UNAVAILABLE_MSG("This interface cannot be safely used from Swift")
670int pthread_jit_write_with_callback_np(
671 pthread_jit_write_callback_t _Nonnull callback, void * _Nullable ctx);
672
673/*!
674 * @function pthread_jit_write_freeze_callbacks_np
675 *
676 * @abstract
677 * Freezes the set of allowed pthread JIT write callbacks, preventing any
678 * callbacks in subsequently dlopen'd libraries from being allowed as arguments
679 * to {@link pthread_jit_write_with_callback_np}
680 *
681 * @discussion
682 * If the com.apple.security.cs.jit-write-allowlist-freeze-late entitlement is
683 * present, this function must be called exactly once after all libraries
684 * containing JIT write callbacks have been loaded to prevent any further
685 * runtime modifications to the set of allowed callbacks. Failing to call this
686 * function before calling pthread_jit_write_with_callback_np(3) for the first
687 * time is an error, as is calling it multiple times.
688 *
689 * If the jit-write-allowlist-freeze-late entitlement is not present, calling
690 * this function is an error.
691 *
692 * If an application does not need to dlopen(3) any libraries or frameworks
693 * containing needed JIT write callbacks, it is best to avoid the
694 * jit-write-allowlist-freeze-late entitlement and accompanying need to call
695 * this function, as this allows the runtime to automatically freeze the set of
696 * allowed callbacks early in process initialization.
697 */
698__API_AVAILABLE(macos(12.1))
699__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
700void pthread_jit_write_freeze_callbacks_np(void);
701
702/*!
703 * @function pthread_cpu_number_np
704 *
705 * @param cpu_number_out
706 * The CPU number that the thread was running on at the time of query.
707 * This cpu number is in the interval [0, ncpus) (from sysctlbyname("hw.ncpu"))
708 *
709 * @result
710 * This function returns 0 or the value of errno if an error occurred.
711 *
712 * @note
713 * Optimizations of per-CPU datastructures based on the result of this function
714 * still require synchronization since it is not guaranteed that the thread will
715 * still be on the same CPU by the time the function returns.
716 */
717__API_AVAILABLE(macos(11.0), ios(14.2), tvos(14.2), watchos(7.1))
718int
719pthread_cpu_number_np(size_t *cpu_number_out);
720
721#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE || __cplusplus */
722__END_DECLS
723#if __has_feature(assume_nonnull)
724_Pragma("clang assume_nonnull end")
725#endif
726
727#endif /* _PTHREAD_H */
\ No newline at end of file
lib/libc/include/any-macos.12-any/simd/base.h created+129
......@@ -0,0 +1,129 @@
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_12_0 || \
45 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_15_0 || \
46 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_8_0 || \
47 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_15_0 || \
48 __BRIDGE_OS_VERSION_MIN_REQUIRED >= 60000 || \
49 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_21_0
50# define SIMD_LIBRARY_VERSION 4
51# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13 || \
52 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_11_0 || \
53 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_4_0 || \
54 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_11_0 || \
55 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_19_0
56# define SIMD_LIBRARY_VERSION 3
57# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12 || \
58 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0 || \
59 __WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_3_0 || \
60 __TV_OS_VERSION_MIN_REQUIRED >= __TVOS_10_0
61# define SIMD_LIBRARY_VERSION 2
62# elif __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || \
63 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
64# define SIMD_LIBRARY_VERSION 1
65# else
66# define SIMD_LIBRARY_VERSION 0
67# endif
68# else /* !__has_include(<Availability.h>) */
69# define SIMD_LIBRARY_VERSION 3
70# define __API_AVAILABLE(...) /* Nothing */
71# endif
72
73/* The simd types interoperate with the native simd intrinsic types for each
74 * architecture; the headers that define those types and operations are
75 * automatically included with simd.h */
76# if defined __ARM_NEON__
77# include <arm_neon.h>
78# elif defined __i386__ || defined __x86_64__
79# include <immintrin.h>
80# endif
81
82/* Define a number of function attributes used by the simd functions. */
83# if __has_attribute(__always_inline__)
84# define SIMD_INLINE __attribute__((__always_inline__))
85# else
86# define SIMD_INLINE inline
87# endif
88
89# if __has_attribute(__const__)
90# define SIMD_CONST __attribute__((__const__))
91# else
92# define SIMD_CONST /* nothing */
93# endif
94
95# if __has_attribute(__nodebug__)
96# define SIMD_NODEBUG __attribute__((__nodebug__))
97# else
98# define SIMD_NODEBUG /* nothing */
99# endif
100
101# if __has_attribute(__deprecated__)
102# define SIMD_DEPRECATED(message) __attribute__((__deprecated__(message)))
103# else
104# define SIMD_DEPRECATED(message) /* nothing */
105# endif
106
107#define SIMD_OVERLOAD __attribute__((__overloadable__))
108#define SIMD_CPPFUNC SIMD_INLINE SIMD_CONST SIMD_NODEBUG
109#define SIMD_CFUNC SIMD_CPPFUNC SIMD_OVERLOAD
110#define SIMD_NOINLINE SIMD_CONST SIMD_NODEBUG SIMD_OVERLOAD
111#define SIMD_NONCONST SIMD_INLINE SIMD_NODEBUG SIMD_OVERLOAD
112#define __SIMD_INLINE__ SIMD_CPPFUNC
113#define __SIMD_ATTRIBUTES__ SIMD_CFUNC
114#define __SIMD_OVERLOAD__ SIMD_OVERLOAD
115
116#if defined __cplusplus
117/*! @abstract A boolean scalar. */
118typedef bool simd_bool;
119#else
120/*! @abstract A boolean scalar. */
121typedef _Bool simd_bool;
122#endif
123/*! @abstract A boolean scalar.
124 * @discussion This type is deprecated; In C or Objective-C sources, use
125 * `_Bool` instead. In C++ sources, use `bool`. */
126typedef simd_bool __SIMD_BOOLEAN_TYPE__;
127
128# endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */
129#endif /* defined SIMD_BASE */
\ No newline at end of file
lib/libc/include/any-macos.12-any/simd/math.h created+5783
......@@ -0,0 +1,5783 @@
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 * lgamma(x) simd::lgamma(x)
62 *
63 * fmod(x,y) simd::fmod(x,y)
64 * remainder(x,y) simd::remainder(x,y)
65 *
66 * ceil(x) simd::ceil(x)
67 * floor(x) simd::floor(x)
68 * rint(x) simd::rint(x)
69 * round(x) simd::round(x)
70 * trunc(x) simd::trunc(x)
71 *
72 * fdim(x,y) simd::fdim(x,y)
73 * fmax(x,y) simd::fmax(x,y) When one argument to fmin or fmax is
74 * fmin(x,y) simd::fmin(x,y) constant, use it as the *second* (y)
75 * argument to get better codegen on some
76 * architectures. E.g., write fmin(x,2)
77 * instead of fmin(2,x).
78 * fma(x,y,z) simd::fma(x,y,z) Fast on arm64 and when targeting AVX2
79 * and later; may be quite expensive on
80 * older hardware.
81 * simd_muladd(x,y,z) simd::muladd(x,y,z)
82 *
83 * @copyright 2014-2017 Apple, Inc. All rights reserved.
84 * @unsorted */
85
86#ifndef SIMD_MATH_HEADER
87#define SIMD_MATH_HEADER
88
89#include <simd/base.h>
90#if SIMD_COMPILER_HAS_REQUIRED_FEATURES
91#include <simd/vector_make.h>
92#include <simd/logic.h>
93
94#ifdef __cplusplus
95extern "C" {
96#endif
97/*! @abstract Do not call this function; instead use `acos` in C and
98 * Objective-C, and `simd::acos` in C++. */
99static inline SIMD_CFUNC simd_float2 __tg_acos(simd_float2 x);
100/*! @abstract Do not call this function; instead use `acos` in C and
101 * Objective-C, and `simd::acos` in C++. */
102static inline SIMD_CFUNC simd_float3 __tg_acos(simd_float3 x);
103/*! @abstract Do not call this function; instead use `acos` in C and
104 * Objective-C, and `simd::acos` in C++. */
105static inline SIMD_CFUNC simd_float4 __tg_acos(simd_float4 x);
106/*! @abstract Do not call this function; instead use `acos` in C and
107 * Objective-C, and `simd::acos` in C++. */
108static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x);
109/*! @abstract Do not call this function; instead use `acos` in C and
110 * Objective-C, and `simd::acos` in C++. */
111static inline SIMD_CFUNC simd_float16 __tg_acos(simd_float16 x);
112/*! @abstract Do not call this function; instead use `acos` in C and
113 * Objective-C, and `simd::acos` in C++. */
114static inline SIMD_CFUNC simd_double2 __tg_acos(simd_double2 x);
115/*! @abstract Do not call this function; instead use `acos` in C and
116 * Objective-C, and `simd::acos` in C++. */
117static inline SIMD_CFUNC simd_double3 __tg_acos(simd_double3 x);
118/*! @abstract Do not call this function; instead use `acos` in C and
119 * Objective-C, and `simd::acos` in C++. */
120static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x);
121/*! @abstract Do not call this function; instead use `acos` in C and
122 * Objective-C, and `simd::acos` in C++. */
123static inline SIMD_CFUNC simd_double8 __tg_acos(simd_double8 x);
124
125/*! @abstract Do not call this function; instead use `asin` in C and
126 * Objective-C, and `simd::asin` in C++. */
127static inline SIMD_CFUNC simd_float2 __tg_asin(simd_float2 x);
128/*! @abstract Do not call this function; instead use `asin` in C and
129 * Objective-C, and `simd::asin` in C++. */
130static inline SIMD_CFUNC simd_float3 __tg_asin(simd_float3 x);
131/*! @abstract Do not call this function; instead use `asin` in C and
132 * Objective-C, and `simd::asin` in C++. */
133static inline SIMD_CFUNC simd_float4 __tg_asin(simd_float4 x);
134/*! @abstract Do not call this function; instead use `asin` in C and
135 * Objective-C, and `simd::asin` in C++. */
136static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x);
137/*! @abstract Do not call this function; instead use `asin` in C and
138 * Objective-C, and `simd::asin` in C++. */
139static inline SIMD_CFUNC simd_float16 __tg_asin(simd_float16 x);
140/*! @abstract Do not call this function; instead use `asin` in C and
141 * Objective-C, and `simd::asin` in C++. */
142static inline SIMD_CFUNC simd_double2 __tg_asin(simd_double2 x);
143/*! @abstract Do not call this function; instead use `asin` in C and
144 * Objective-C, and `simd::asin` in C++. */
145static inline SIMD_CFUNC simd_double3 __tg_asin(simd_double3 x);
146/*! @abstract Do not call this function; instead use `asin` in C and
147 * Objective-C, and `simd::asin` in C++. */
148static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x);
149/*! @abstract Do not call this function; instead use `asin` in C and
150 * Objective-C, and `simd::asin` in C++. */
151static inline SIMD_CFUNC simd_double8 __tg_asin(simd_double8 x);
152
153/*! @abstract Do not call this function; instead use `atan` in C and
154 * Objective-C, and `simd::atan` in C++. */
155static inline SIMD_CFUNC simd_float2 __tg_atan(simd_float2 x);
156/*! @abstract Do not call this function; instead use `atan` in C and
157 * Objective-C, and `simd::atan` in C++. */
158static inline SIMD_CFUNC simd_float3 __tg_atan(simd_float3 x);
159/*! @abstract Do not call this function; instead use `atan` in C and
160 * Objective-C, and `simd::atan` in C++. */
161static inline SIMD_CFUNC simd_float4 __tg_atan(simd_float4 x);
162/*! @abstract Do not call this function; instead use `atan` in C and
163 * Objective-C, and `simd::atan` in C++. */
164static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x);
165/*! @abstract Do not call this function; instead use `atan` in C and
166 * Objective-C, and `simd::atan` in C++. */
167static inline SIMD_CFUNC simd_float16 __tg_atan(simd_float16 x);
168/*! @abstract Do not call this function; instead use `atan` in C and
169 * Objective-C, and `simd::atan` in C++. */
170static inline SIMD_CFUNC simd_double2 __tg_atan(simd_double2 x);
171/*! @abstract Do not call this function; instead use `atan` in C and
172 * Objective-C, and `simd::atan` in C++. */
173static inline SIMD_CFUNC simd_double3 __tg_atan(simd_double3 x);
174/*! @abstract Do not call this function; instead use `atan` in C and
175 * Objective-C, and `simd::atan` in C++. */
176static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x);
177/*! @abstract Do not call this function; instead use `atan` in C and
178 * Objective-C, and `simd::atan` in C++. */
179static inline SIMD_CFUNC simd_double8 __tg_atan(simd_double8 x);
180
181/*! @abstract Do not call this function; instead use `cos` in C and
182 * Objective-C, and `simd::cos` in C++. */
183static inline SIMD_CFUNC simd_float2 __tg_cos(simd_float2 x);
184/*! @abstract Do not call this function; instead use `cos` in C and
185 * Objective-C, and `simd::cos` in C++. */
186static inline SIMD_CFUNC simd_float3 __tg_cos(simd_float3 x);
187/*! @abstract Do not call this function; instead use `cos` in C and
188 * Objective-C, and `simd::cos` in C++. */
189static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x);
190/*! @abstract Do not call this function; instead use `cos` in C and
191 * Objective-C, and `simd::cos` in C++. */
192static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x);
193/*! @abstract Do not call this function; instead use `cos` in C and
194 * Objective-C, and `simd::cos` in C++. */
195static inline SIMD_CFUNC simd_float16 __tg_cos(simd_float16 x);
196/*! @abstract Do not call this function; instead use `cos` in C and
197 * Objective-C, and `simd::cos` in C++. */
198static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x);
199/*! @abstract Do not call this function; instead use `cos` in C and
200 * Objective-C, and `simd::cos` in C++. */
201static inline SIMD_CFUNC simd_double3 __tg_cos(simd_double3 x);
202/*! @abstract Do not call this function; instead use `cos` in C and
203 * Objective-C, and `simd::cos` in C++. */
204static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x);
205/*! @abstract Do not call this function; instead use `cos` in C and
206 * Objective-C, and `simd::cos` in C++. */
207static inline SIMD_CFUNC simd_double8 __tg_cos(simd_double8 x);
208
209/*! @abstract Do not call this function; instead use `sin` in C and
210 * Objective-C, and `simd::sin` in C++. */
211static inline SIMD_CFUNC simd_float2 __tg_sin(simd_float2 x);
212/*! @abstract Do not call this function; instead use `sin` in C and
213 * Objective-C, and `simd::sin` in C++. */
214static inline SIMD_CFUNC simd_float3 __tg_sin(simd_float3 x);
215/*! @abstract Do not call this function; instead use `sin` in C and
216 * Objective-C, and `simd::sin` in C++. */
217static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x);
218/*! @abstract Do not call this function; instead use `sin` in C and
219 * Objective-C, and `simd::sin` in C++. */
220static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x);
221/*! @abstract Do not call this function; instead use `sin` in C and
222 * Objective-C, and `simd::sin` in C++. */
223static inline SIMD_CFUNC simd_float16 __tg_sin(simd_float16 x);
224/*! @abstract Do not call this function; instead use `sin` in C and
225 * Objective-C, and `simd::sin` in C++. */
226static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x);
227/*! @abstract Do not call this function; instead use `sin` in C and
228 * Objective-C, and `simd::sin` in C++. */
229static inline SIMD_CFUNC simd_double3 __tg_sin(simd_double3 x);
230/*! @abstract Do not call this function; instead use `sin` in C and
231 * Objective-C, and `simd::sin` in C++. */
232static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x);
233/*! @abstract Do not call this function; instead use `sin` in C and
234 * Objective-C, and `simd::sin` in C++. */
235static inline SIMD_CFUNC simd_double8 __tg_sin(simd_double8 x);
236
237/*! @abstract Do not call this function; instead use `tan` in C and
238 * Objective-C, and `simd::tan` in C++. */
239static inline SIMD_CFUNC simd_float2 __tg_tan(simd_float2 x);
240/*! @abstract Do not call this function; instead use `tan` in C and
241 * Objective-C, and `simd::tan` in C++. */
242static inline SIMD_CFUNC simd_float3 __tg_tan(simd_float3 x);
243/*! @abstract Do not call this function; instead use `tan` in C and
244 * Objective-C, and `simd::tan` in C++. */
245static inline SIMD_CFUNC simd_float4 __tg_tan(simd_float4 x);
246/*! @abstract Do not call this function; instead use `tan` in C and
247 * Objective-C, and `simd::tan` in C++. */
248static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x);
249/*! @abstract Do not call this function; instead use `tan` in C and
250 * Objective-C, and `simd::tan` in C++. */
251static inline SIMD_CFUNC simd_float16 __tg_tan(simd_float16 x);
252/*! @abstract Do not call this function; instead use `tan` in C and
253 * Objective-C, and `simd::tan` in C++. */
254static inline SIMD_CFUNC simd_double2 __tg_tan(simd_double2 x);
255/*! @abstract Do not call this function; instead use `tan` in C and
256 * Objective-C, and `simd::tan` in C++. */
257static inline SIMD_CFUNC simd_double3 __tg_tan(simd_double3 x);
258/*! @abstract Do not call this function; instead use `tan` in C and
259 * Objective-C, and `simd::tan` in C++. */
260static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x);
261/*! @abstract Do not call this function; instead use `tan` in C and
262 * Objective-C, and `simd::tan` in C++. */
263static inline SIMD_CFUNC simd_double8 __tg_tan(simd_double8 x);
264
265#if SIMD_LIBRARY_VERSION >= 1
266/*! @abstract Do not call this function; instead use `cospi` in C and
267 * Objective-C, and `simd::cospi` in C++. */
268static inline SIMD_CFUNC simd_float2 __tg_cospi(simd_float2 x);
269/*! @abstract Do not call this function; instead use `cospi` in C and
270 * Objective-C, and `simd::cospi` in C++. */
271static inline SIMD_CFUNC simd_float3 __tg_cospi(simd_float3 x);
272/*! @abstract Do not call this function; instead use `cospi` in C and
273 * Objective-C, and `simd::cospi` in C++. */
274static inline SIMD_CFUNC simd_float4 __tg_cospi(simd_float4 x);
275/*! @abstract Do not call this function; instead use `cospi` in C and
276 * Objective-C, and `simd::cospi` in C++. */
277static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x);
278/*! @abstract Do not call this function; instead use `cospi` in C and
279 * Objective-C, and `simd::cospi` in C++. */
280static inline SIMD_CFUNC simd_float16 __tg_cospi(simd_float16 x);
281/*! @abstract Do not call this function; instead use `cospi` in C and
282 * Objective-C, and `simd::cospi` in C++. */
283static inline SIMD_CFUNC simd_double2 __tg_cospi(simd_double2 x);
284/*! @abstract Do not call this function; instead use `cospi` in C and
285 * Objective-C, and `simd::cospi` in C++. */
286static inline SIMD_CFUNC simd_double3 __tg_cospi(simd_double3 x);
287/*! @abstract Do not call this function; instead use `cospi` in C and
288 * Objective-C, and `simd::cospi` in C++. */
289static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x);
290/*! @abstract Do not call this function; instead use `cospi` in C and
291 * Objective-C, and `simd::cospi` in C++. */
292static inline SIMD_CFUNC simd_double8 __tg_cospi(simd_double8 x);
293#endif
294
295#if SIMD_LIBRARY_VERSION >= 1
296/*! @abstract Do not call this function; instead use `sinpi` in C and
297 * Objective-C, and `simd::sinpi` in C++. */
298static inline SIMD_CFUNC simd_float2 __tg_sinpi(simd_float2 x);
299/*! @abstract Do not call this function; instead use `sinpi` in C and
300 * Objective-C, and `simd::sinpi` in C++. */
301static inline SIMD_CFUNC simd_float3 __tg_sinpi(simd_float3 x);
302/*! @abstract Do not call this function; instead use `sinpi` in C and
303 * Objective-C, and `simd::sinpi` in C++. */
304static inline SIMD_CFUNC simd_float4 __tg_sinpi(simd_float4 x);
305/*! @abstract Do not call this function; instead use `sinpi` in C and
306 * Objective-C, and `simd::sinpi` in C++. */
307static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x);
308/*! @abstract Do not call this function; instead use `sinpi` in C and
309 * Objective-C, and `simd::sinpi` in C++. */
310static inline SIMD_CFUNC simd_float16 __tg_sinpi(simd_float16 x);
311/*! @abstract Do not call this function; instead use `sinpi` in C and
312 * Objective-C, and `simd::sinpi` in C++. */
313static inline SIMD_CFUNC simd_double2 __tg_sinpi(simd_double2 x);
314/*! @abstract Do not call this function; instead use `sinpi` in C and
315 * Objective-C, and `simd::sinpi` in C++. */
316static inline SIMD_CFUNC simd_double3 __tg_sinpi(simd_double3 x);
317/*! @abstract Do not call this function; instead use `sinpi` in C and
318 * Objective-C, and `simd::sinpi` in C++. */
319static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x);
320/*! @abstract Do not call this function; instead use `sinpi` in C and
321 * Objective-C, and `simd::sinpi` in C++. */
322static inline SIMD_CFUNC simd_double8 __tg_sinpi(simd_double8 x);
323#endif
324
325#if SIMD_LIBRARY_VERSION >= 1
326/*! @abstract Do not call this function; instead use `tanpi` in C and
327 * Objective-C, and `simd::tanpi` in C++. */
328static inline SIMD_CFUNC simd_float2 __tg_tanpi(simd_float2 x);
329/*! @abstract Do not call this function; instead use `tanpi` in C and
330 * Objective-C, and `simd::tanpi` in C++. */
331static inline SIMD_CFUNC simd_float3 __tg_tanpi(simd_float3 x);
332/*! @abstract Do not call this function; instead use `tanpi` in C and
333 * Objective-C, and `simd::tanpi` in C++. */
334static inline SIMD_CFUNC simd_float4 __tg_tanpi(simd_float4 x);
335/*! @abstract Do not call this function; instead use `tanpi` in C and
336 * Objective-C, and `simd::tanpi` in C++. */
337static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x);
338/*! @abstract Do not call this function; instead use `tanpi` in C and
339 * Objective-C, and `simd::tanpi` in C++. */
340static inline SIMD_CFUNC simd_float16 __tg_tanpi(simd_float16 x);
341/*! @abstract Do not call this function; instead use `tanpi` in C and
342 * Objective-C, and `simd::tanpi` in C++. */
343static inline SIMD_CFUNC simd_double2 __tg_tanpi(simd_double2 x);
344/*! @abstract Do not call this function; instead use `tanpi` in C and
345 * Objective-C, and `simd::tanpi` in C++. */
346static inline SIMD_CFUNC simd_double3 __tg_tanpi(simd_double3 x);
347/*! @abstract Do not call this function; instead use `tanpi` in C and
348 * Objective-C, and `simd::tanpi` in C++. */
349static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x);
350/*! @abstract Do not call this function; instead use `tanpi` in C and
351 * Objective-C, and `simd::tanpi` in C++. */
352static inline SIMD_CFUNC simd_double8 __tg_tanpi(simd_double8 x);
353#endif
354
355/*! @abstract Do not call this function; instead use `acosh` in C and
356 * Objective-C, and `simd::acosh` in C++. */
357static inline SIMD_CFUNC simd_float2 __tg_acosh(simd_float2 x);
358/*! @abstract Do not call this function; instead use `acosh` in C and
359 * Objective-C, and `simd::acosh` in C++. */
360static inline SIMD_CFUNC simd_float3 __tg_acosh(simd_float3 x);
361/*! @abstract Do not call this function; instead use `acosh` in C and
362 * Objective-C, and `simd::acosh` in C++. */
363static inline SIMD_CFUNC simd_float4 __tg_acosh(simd_float4 x);
364/*! @abstract Do not call this function; instead use `acosh` in C and
365 * Objective-C, and `simd::acosh` in C++. */
366static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x);
367/*! @abstract Do not call this function; instead use `acosh` in C and
368 * Objective-C, and `simd::acosh` in C++. */
369static inline SIMD_CFUNC simd_float16 __tg_acosh(simd_float16 x);
370/*! @abstract Do not call this function; instead use `acosh` in C and
371 * Objective-C, and `simd::acosh` in C++. */
372static inline SIMD_CFUNC simd_double2 __tg_acosh(simd_double2 x);
373/*! @abstract Do not call this function; instead use `acosh` in C and
374 * Objective-C, and `simd::acosh` in C++. */
375static inline SIMD_CFUNC simd_double3 __tg_acosh(simd_double3 x);
376/*! @abstract Do not call this function; instead use `acosh` in C and
377 * Objective-C, and `simd::acosh` in C++. */
378static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x);
379/*! @abstract Do not call this function; instead use `acosh` in C and
380 * Objective-C, and `simd::acosh` in C++. */
381static inline SIMD_CFUNC simd_double8 __tg_acosh(simd_double8 x);
382
383/*! @abstract Do not call this function; instead use `asinh` in C and
384 * Objective-C, and `simd::asinh` in C++. */
385static inline SIMD_CFUNC simd_float2 __tg_asinh(simd_float2 x);
386/*! @abstract Do not call this function; instead use `asinh` in C and
387 * Objective-C, and `simd::asinh` in C++. */
388static inline SIMD_CFUNC simd_float3 __tg_asinh(simd_float3 x);
389/*! @abstract Do not call this function; instead use `asinh` in C and
390 * Objective-C, and `simd::asinh` in C++. */
391static inline SIMD_CFUNC simd_float4 __tg_asinh(simd_float4 x);
392/*! @abstract Do not call this function; instead use `asinh` in C and
393 * Objective-C, and `simd::asinh` in C++. */
394static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x);
395/*! @abstract Do not call this function; instead use `asinh` in C and
396 * Objective-C, and `simd::asinh` in C++. */
397static inline SIMD_CFUNC simd_float16 __tg_asinh(simd_float16 x);
398/*! @abstract Do not call this function; instead use `asinh` in C and
399 * Objective-C, and `simd::asinh` in C++. */
400static inline SIMD_CFUNC simd_double2 __tg_asinh(simd_double2 x);
401/*! @abstract Do not call this function; instead use `asinh` in C and
402 * Objective-C, and `simd::asinh` in C++. */
403static inline SIMD_CFUNC simd_double3 __tg_asinh(simd_double3 x);
404/*! @abstract Do not call this function; instead use `asinh` in C and
405 * Objective-C, and `simd::asinh` in C++. */
406static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x);
407/*! @abstract Do not call this function; instead use `asinh` in C and
408 * Objective-C, and `simd::asinh` in C++. */
409static inline SIMD_CFUNC simd_double8 __tg_asinh(simd_double8 x);
410
411/*! @abstract Do not call this function; instead use `atanh` in C and
412 * Objective-C, and `simd::atanh` in C++. */
413static inline SIMD_CFUNC simd_float2 __tg_atanh(simd_float2 x);
414/*! @abstract Do not call this function; instead use `atanh` in C and
415 * Objective-C, and `simd::atanh` in C++. */
416static inline SIMD_CFUNC simd_float3 __tg_atanh(simd_float3 x);
417/*! @abstract Do not call this function; instead use `atanh` in C and
418 * Objective-C, and `simd::atanh` in C++. */
419static inline SIMD_CFUNC simd_float4 __tg_atanh(simd_float4 x);
420/*! @abstract Do not call this function; instead use `atanh` in C and
421 * Objective-C, and `simd::atanh` in C++. */
422static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x);
423/*! @abstract Do not call this function; instead use `atanh` in C and
424 * Objective-C, and `simd::atanh` in C++. */
425static inline SIMD_CFUNC simd_float16 __tg_atanh(simd_float16 x);
426/*! @abstract Do not call this function; instead use `atanh` in C and
427 * Objective-C, and `simd::atanh` in C++. */
428static inline SIMD_CFUNC simd_double2 __tg_atanh(simd_double2 x);
429/*! @abstract Do not call this function; instead use `atanh` in C and
430 * Objective-C, and `simd::atanh` in C++. */
431static inline SIMD_CFUNC simd_double3 __tg_atanh(simd_double3 x);
432/*! @abstract Do not call this function; instead use `atanh` in C and
433 * Objective-C, and `simd::atanh` in C++. */
434static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x);
435/*! @abstract Do not call this function; instead use `atanh` in C and
436 * Objective-C, and `simd::atanh` in C++. */
437static inline SIMD_CFUNC simd_double8 __tg_atanh(simd_double8 x);
438
439/*! @abstract Do not call this function; instead use `cosh` in C and
440 * Objective-C, and `simd::cosh` in C++. */
441static inline SIMD_CFUNC simd_float2 __tg_cosh(simd_float2 x);
442/*! @abstract Do not call this function; instead use `cosh` in C and
443 * Objective-C, and `simd::cosh` in C++. */
444static inline SIMD_CFUNC simd_float3 __tg_cosh(simd_float3 x);
445/*! @abstract Do not call this function; instead use `cosh` in C and
446 * Objective-C, and `simd::cosh` in C++. */
447static inline SIMD_CFUNC simd_float4 __tg_cosh(simd_float4 x);
448/*! @abstract Do not call this function; instead use `cosh` in C and
449 * Objective-C, and `simd::cosh` in C++. */
450static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x);
451/*! @abstract Do not call this function; instead use `cosh` in C and
452 * Objective-C, and `simd::cosh` in C++. */
453static inline SIMD_CFUNC simd_float16 __tg_cosh(simd_float16 x);
454/*! @abstract Do not call this function; instead use `cosh` in C and
455 * Objective-C, and `simd::cosh` in C++. */
456static inline SIMD_CFUNC simd_double2 __tg_cosh(simd_double2 x);
457/*! @abstract Do not call this function; instead use `cosh` in C and
458 * Objective-C, and `simd::cosh` in C++. */
459static inline SIMD_CFUNC simd_double3 __tg_cosh(simd_double3 x);
460/*! @abstract Do not call this function; instead use `cosh` in C and
461 * Objective-C, and `simd::cosh` in C++. */
462static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x);
463/*! @abstract Do not call this function; instead use `cosh` in C and
464 * Objective-C, and `simd::cosh` in C++. */
465static inline SIMD_CFUNC simd_double8 __tg_cosh(simd_double8 x);
466
467/*! @abstract Do not call this function; instead use `sinh` in C and
468 * Objective-C, and `simd::sinh` in C++. */
469static inline SIMD_CFUNC simd_float2 __tg_sinh(simd_float2 x);
470/*! @abstract Do not call this function; instead use `sinh` in C and
471 * Objective-C, and `simd::sinh` in C++. */
472static inline SIMD_CFUNC simd_float3 __tg_sinh(simd_float3 x);
473/*! @abstract Do not call this function; instead use `sinh` in C and
474 * Objective-C, and `simd::sinh` in C++. */
475static inline SIMD_CFUNC simd_float4 __tg_sinh(simd_float4 x);
476/*! @abstract Do not call this function; instead use `sinh` in C and
477 * Objective-C, and `simd::sinh` in C++. */
478static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x);
479/*! @abstract Do not call this function; instead use `sinh` in C and
480 * Objective-C, and `simd::sinh` in C++. */
481static inline SIMD_CFUNC simd_float16 __tg_sinh(simd_float16 x);
482/*! @abstract Do not call this function; instead use `sinh` in C and
483 * Objective-C, and `simd::sinh` in C++. */
484static inline SIMD_CFUNC simd_double2 __tg_sinh(simd_double2 x);
485/*! @abstract Do not call this function; instead use `sinh` in C and
486 * Objective-C, and `simd::sinh` in C++. */
487static inline SIMD_CFUNC simd_double3 __tg_sinh(simd_double3 x);
488/*! @abstract Do not call this function; instead use `sinh` in C and
489 * Objective-C, and `simd::sinh` in C++. */
490static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x);
491/*! @abstract Do not call this function; instead use `sinh` in C and
492 * Objective-C, and `simd::sinh` in C++. */
493static inline SIMD_CFUNC simd_double8 __tg_sinh(simd_double8 x);
494
495/*! @abstract Do not call this function; instead use `tanh` in C and
496 * Objective-C, and `simd::tanh` in C++. */
497static inline SIMD_CFUNC simd_float2 __tg_tanh(simd_float2 x);
498/*! @abstract Do not call this function; instead use `tanh` in C and
499 * Objective-C, and `simd::tanh` in C++. */
500static inline SIMD_CFUNC simd_float3 __tg_tanh(simd_float3 x);
501/*! @abstract Do not call this function; instead use `tanh` in C and
502 * Objective-C, and `simd::tanh` in C++. */
503static inline SIMD_CFUNC simd_float4 __tg_tanh(simd_float4 x);
504/*! @abstract Do not call this function; instead use `tanh` in C and
505 * Objective-C, and `simd::tanh` in C++. */
506static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x);
507/*! @abstract Do not call this function; instead use `tanh` in C and
508 * Objective-C, and `simd::tanh` in C++. */
509static inline SIMD_CFUNC simd_float16 __tg_tanh(simd_float16 x);
510/*! @abstract Do not call this function; instead use `tanh` in C and
511 * Objective-C, and `simd::tanh` in C++. */
512static inline SIMD_CFUNC simd_double2 __tg_tanh(simd_double2 x);
513/*! @abstract Do not call this function; instead use `tanh` in C and
514 * Objective-C, and `simd::tanh` in C++. */
515static inline SIMD_CFUNC simd_double3 __tg_tanh(simd_double3 x);
516/*! @abstract Do not call this function; instead use `tanh` in C and
517 * Objective-C, and `simd::tanh` in C++. */
518static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x);
519/*! @abstract Do not call this function; instead use `tanh` in C and
520 * Objective-C, and `simd::tanh` in C++. */
521static inline SIMD_CFUNC simd_double8 __tg_tanh(simd_double8 x);
522
523/*! @abstract Do not call this function; instead use `exp` in C and
524 * Objective-C, and `simd::exp` in C++. */
525static inline SIMD_CFUNC simd_float2 __tg_exp(simd_float2 x);
526/*! @abstract Do not call this function; instead use `exp` in C and
527 * Objective-C, and `simd::exp` in C++. */
528static inline SIMD_CFUNC simd_float3 __tg_exp(simd_float3 x);
529/*! @abstract Do not call this function; instead use `exp` in C and
530 * Objective-C, and `simd::exp` in C++. */
531static inline SIMD_CFUNC simd_float4 __tg_exp(simd_float4 x);
532/*! @abstract Do not call this function; instead use `exp` in C and
533 * Objective-C, and `simd::exp` in C++. */
534static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x);
535/*! @abstract Do not call this function; instead use `exp` in C and
536 * Objective-C, and `simd::exp` in C++. */
537static inline SIMD_CFUNC simd_float16 __tg_exp(simd_float16 x);
538/*! @abstract Do not call this function; instead use `exp` in C and
539 * Objective-C, and `simd::exp` in C++. */
540static inline SIMD_CFUNC simd_double2 __tg_exp(simd_double2 x);
541/*! @abstract Do not call this function; instead use `exp` in C and
542 * Objective-C, and `simd::exp` in C++. */
543static inline SIMD_CFUNC simd_double3 __tg_exp(simd_double3 x);
544/*! @abstract Do not call this function; instead use `exp` in C and
545 * Objective-C, and `simd::exp` in C++. */
546static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x);
547/*! @abstract Do not call this function; instead use `exp` in C and
548 * Objective-C, and `simd::exp` in C++. */
549static inline SIMD_CFUNC simd_double8 __tg_exp(simd_double8 x);
550
551/*! @abstract Do not call this function; instead use `exp2` in C and
552 * Objective-C, and `simd::exp2` in C++. */
553static inline SIMD_CFUNC simd_float2 __tg_exp2(simd_float2 x);
554/*! @abstract Do not call this function; instead use `exp2` in C and
555 * Objective-C, and `simd::exp2` in C++. */
556static inline SIMD_CFUNC simd_float3 __tg_exp2(simd_float3 x);
557/*! @abstract Do not call this function; instead use `exp2` in C and
558 * Objective-C, and `simd::exp2` in C++. */
559static inline SIMD_CFUNC simd_float4 __tg_exp2(simd_float4 x);
560/*! @abstract Do not call this function; instead use `exp2` in C and
561 * Objective-C, and `simd::exp2` in C++. */
562static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x);
563/*! @abstract Do not call this function; instead use `exp2` in C and
564 * Objective-C, and `simd::exp2` in C++. */
565static inline SIMD_CFUNC simd_float16 __tg_exp2(simd_float16 x);
566/*! @abstract Do not call this function; instead use `exp2` in C and
567 * Objective-C, and `simd::exp2` in C++. */
568static inline SIMD_CFUNC simd_double2 __tg_exp2(simd_double2 x);
569/*! @abstract Do not call this function; instead use `exp2` in C and
570 * Objective-C, and `simd::exp2` in C++. */
571static inline SIMD_CFUNC simd_double3 __tg_exp2(simd_double3 x);
572/*! @abstract Do not call this function; instead use `exp2` in C and
573 * Objective-C, and `simd::exp2` in C++. */
574static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x);
575/*! @abstract Do not call this function; instead use `exp2` in C and
576 * Objective-C, and `simd::exp2` in C++. */
577static inline SIMD_CFUNC simd_double8 __tg_exp2(simd_double8 x);
578
579#if SIMD_LIBRARY_VERSION >= 1
580/*! @abstract Do not call this function; instead use `exp10` in C and
581 * Objective-C, and `simd::exp10` in C++. */
582static inline SIMD_CFUNC simd_float2 __tg_exp10(simd_float2 x);
583/*! @abstract Do not call this function; instead use `exp10` in C and
584 * Objective-C, and `simd::exp10` in C++. */
585static inline SIMD_CFUNC simd_float3 __tg_exp10(simd_float3 x);
586/*! @abstract Do not call this function; instead use `exp10` in C and
587 * Objective-C, and `simd::exp10` in C++. */
588static inline SIMD_CFUNC simd_float4 __tg_exp10(simd_float4 x);
589/*! @abstract Do not call this function; instead use `exp10` in C and
590 * Objective-C, and `simd::exp10` in C++. */
591static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x);
592/*! @abstract Do not call this function; instead use `exp10` in C and
593 * Objective-C, and `simd::exp10` in C++. */
594static inline SIMD_CFUNC simd_float16 __tg_exp10(simd_float16 x);
595/*! @abstract Do not call this function; instead use `exp10` in C and
596 * Objective-C, and `simd::exp10` in C++. */
597static inline SIMD_CFUNC simd_double2 __tg_exp10(simd_double2 x);
598/*! @abstract Do not call this function; instead use `exp10` in C and
599 * Objective-C, and `simd::exp10` in C++. */
600static inline SIMD_CFUNC simd_double3 __tg_exp10(simd_double3 x);
601/*! @abstract Do not call this function; instead use `exp10` in C and
602 * Objective-C, and `simd::exp10` in C++. */
603static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x);
604/*! @abstract Do not call this function; instead use `exp10` in C and
605 * Objective-C, and `simd::exp10` in C++. */
606static inline SIMD_CFUNC simd_double8 __tg_exp10(simd_double8 x);
607#endif
608
609/*! @abstract Do not call this function; instead use `expm1` in C and
610 * Objective-C, and `simd::expm1` in C++. */
611static inline SIMD_CFUNC simd_float2 __tg_expm1(simd_float2 x);
612/*! @abstract Do not call this function; instead use `expm1` in C and
613 * Objective-C, and `simd::expm1` in C++. */
614static inline SIMD_CFUNC simd_float3 __tg_expm1(simd_float3 x);
615/*! @abstract Do not call this function; instead use `expm1` in C and
616 * Objective-C, and `simd::expm1` in C++. */
617static inline SIMD_CFUNC simd_float4 __tg_expm1(simd_float4 x);
618/*! @abstract Do not call this function; instead use `expm1` in C and
619 * Objective-C, and `simd::expm1` in C++. */
620static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x);
621/*! @abstract Do not call this function; instead use `expm1` in C and
622 * Objective-C, and `simd::expm1` in C++. */
623static inline SIMD_CFUNC simd_float16 __tg_expm1(simd_float16 x);
624/*! @abstract Do not call this function; instead use `expm1` in C and
625 * Objective-C, and `simd::expm1` in C++. */
626static inline SIMD_CFUNC simd_double2 __tg_expm1(simd_double2 x);
627/*! @abstract Do not call this function; instead use `expm1` in C and
628 * Objective-C, and `simd::expm1` in C++. */
629static inline SIMD_CFUNC simd_double3 __tg_expm1(simd_double3 x);
630/*! @abstract Do not call this function; instead use `expm1` in C and
631 * Objective-C, and `simd::expm1` in C++. */
632static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x);
633/*! @abstract Do not call this function; instead use `expm1` in C and
634 * Objective-C, and `simd::expm1` in C++. */
635static inline SIMD_CFUNC simd_double8 __tg_expm1(simd_double8 x);
636
637/*! @abstract Do not call this function; instead use `log` in C and
638 * Objective-C, and `simd::log` in C++. */
639static inline SIMD_CFUNC simd_float2 __tg_log(simd_float2 x);
640/*! @abstract Do not call this function; instead use `log` in C and
641 * Objective-C, and `simd::log` in C++. */
642static inline SIMD_CFUNC simd_float3 __tg_log(simd_float3 x);
643/*! @abstract Do not call this function; instead use `log` in C and
644 * Objective-C, and `simd::log` in C++. */
645static inline SIMD_CFUNC simd_float4 __tg_log(simd_float4 x);
646/*! @abstract Do not call this function; instead use `log` in C and
647 * Objective-C, and `simd::log` in C++. */
648static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x);
649/*! @abstract Do not call this function; instead use `log` in C and
650 * Objective-C, and `simd::log` in C++. */
651static inline SIMD_CFUNC simd_float16 __tg_log(simd_float16 x);
652/*! @abstract Do not call this function; instead use `log` in C and
653 * Objective-C, and `simd::log` in C++. */
654static inline SIMD_CFUNC simd_double2 __tg_log(simd_double2 x);
655/*! @abstract Do not call this function; instead use `log` in C and
656 * Objective-C, and `simd::log` in C++. */
657static inline SIMD_CFUNC simd_double3 __tg_log(simd_double3 x);
658/*! @abstract Do not call this function; instead use `log` in C and
659 * Objective-C, and `simd::log` in C++. */
660static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x);
661/*! @abstract Do not call this function; instead use `log` in C and
662 * Objective-C, and `simd::log` in C++. */
663static inline SIMD_CFUNC simd_double8 __tg_log(simd_double8 x);
664
665/*! @abstract Do not call this function; instead use `log2` in C and
666 * Objective-C, and `simd::log2` in C++. */
667static inline SIMD_CFUNC simd_float2 __tg_log2(simd_float2 x);
668/*! @abstract Do not call this function; instead use `log2` in C and
669 * Objective-C, and `simd::log2` in C++. */
670static inline SIMD_CFUNC simd_float3 __tg_log2(simd_float3 x);
671/*! @abstract Do not call this function; instead use `log2` in C and
672 * Objective-C, and `simd::log2` in C++. */
673static inline SIMD_CFUNC simd_float4 __tg_log2(simd_float4 x);
674/*! @abstract Do not call this function; instead use `log2` in C and
675 * Objective-C, and `simd::log2` in C++. */
676static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x);
677/*! @abstract Do not call this function; instead use `log2` in C and
678 * Objective-C, and `simd::log2` in C++. */
679static inline SIMD_CFUNC simd_float16 __tg_log2(simd_float16 x);
680/*! @abstract Do not call this function; instead use `log2` in C and
681 * Objective-C, and `simd::log2` in C++. */
682static inline SIMD_CFUNC simd_double2 __tg_log2(simd_double2 x);
683/*! @abstract Do not call this function; instead use `log2` in C and
684 * Objective-C, and `simd::log2` in C++. */
685static inline SIMD_CFUNC simd_double3 __tg_log2(simd_double3 x);
686/*! @abstract Do not call this function; instead use `log2` in C and
687 * Objective-C, and `simd::log2` in C++. */
688static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x);
689/*! @abstract Do not call this function; instead use `log2` in C and
690 * Objective-C, and `simd::log2` in C++. */
691static inline SIMD_CFUNC simd_double8 __tg_log2(simd_double8 x);
692
693/*! @abstract Do not call this function; instead use `log10` in C and
694 * Objective-C, and `simd::log10` in C++. */
695static inline SIMD_CFUNC simd_float2 __tg_log10(simd_float2 x);
696/*! @abstract Do not call this function; instead use `log10` in C and
697 * Objective-C, and `simd::log10` in C++. */
698static inline SIMD_CFUNC simd_float3 __tg_log10(simd_float3 x);
699/*! @abstract Do not call this function; instead use `log10` in C and
700 * Objective-C, and `simd::log10` in C++. */
701static inline SIMD_CFUNC simd_float4 __tg_log10(simd_float4 x);
702/*! @abstract Do not call this function; instead use `log10` in C and
703 * Objective-C, and `simd::log10` in C++. */
704static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x);
705/*! @abstract Do not call this function; instead use `log10` in C and
706 * Objective-C, and `simd::log10` in C++. */
707static inline SIMD_CFUNC simd_float16 __tg_log10(simd_float16 x);
708/*! @abstract Do not call this function; instead use `log10` in C and
709 * Objective-C, and `simd::log10` in C++. */
710static inline SIMD_CFUNC simd_double2 __tg_log10(simd_double2 x);
711/*! @abstract Do not call this function; instead use `log10` in C and
712 * Objective-C, and `simd::log10` in C++. */
713static inline SIMD_CFUNC simd_double3 __tg_log10(simd_double3 x);
714/*! @abstract Do not call this function; instead use `log10` in C and
715 * Objective-C, and `simd::log10` in C++. */
716static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x);
717/*! @abstract Do not call this function; instead use `log10` in C and
718 * Objective-C, and `simd::log10` in C++. */
719static inline SIMD_CFUNC simd_double8 __tg_log10(simd_double8 x);
720
721/*! @abstract Do not call this function; instead use `log1p` in C and
722 * Objective-C, and `simd::log1p` in C++. */
723static inline SIMD_CFUNC simd_float2 __tg_log1p(simd_float2 x);
724/*! @abstract Do not call this function; instead use `log1p` in C and
725 * Objective-C, and `simd::log1p` in C++. */
726static inline SIMD_CFUNC simd_float3 __tg_log1p(simd_float3 x);
727/*! @abstract Do not call this function; instead use `log1p` in C and
728 * Objective-C, and `simd::log1p` in C++. */
729static inline SIMD_CFUNC simd_float4 __tg_log1p(simd_float4 x);
730/*! @abstract Do not call this function; instead use `log1p` in C and
731 * Objective-C, and `simd::log1p` in C++. */
732static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x);
733/*! @abstract Do not call this function; instead use `log1p` in C and
734 * Objective-C, and `simd::log1p` in C++. */
735static inline SIMD_CFUNC simd_float16 __tg_log1p(simd_float16 x);
736/*! @abstract Do not call this function; instead use `log1p` in C and
737 * Objective-C, and `simd::log1p` in C++. */
738static inline SIMD_CFUNC simd_double2 __tg_log1p(simd_double2 x);
739/*! @abstract Do not call this function; instead use `log1p` in C and
740 * Objective-C, and `simd::log1p` in C++. */
741static inline SIMD_CFUNC simd_double3 __tg_log1p(simd_double3 x);
742/*! @abstract Do not call this function; instead use `log1p` in C and
743 * Objective-C, and `simd::log1p` in C++. */
744static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x);
745/*! @abstract Do not call this function; instead use `log1p` in C and
746 * Objective-C, and `simd::log1p` in C++. */
747static inline SIMD_CFUNC simd_double8 __tg_log1p(simd_double8 x);
748
749/*! @abstract Do not call this function; instead use `fabs` in C and
750 * Objective-C, and `simd::fabs` in C++. */
751static inline SIMD_CFUNC simd_float2 __tg_fabs(simd_float2 x);
752/*! @abstract Do not call this function; instead use `fabs` in C and
753 * Objective-C, and `simd::fabs` in C++. */
754static inline SIMD_CFUNC simd_float3 __tg_fabs(simd_float3 x);
755/*! @abstract Do not call this function; instead use `fabs` in C and
756 * Objective-C, and `simd::fabs` in C++. */
757static inline SIMD_CFUNC simd_float4 __tg_fabs(simd_float4 x);
758/*! @abstract Do not call this function; instead use `fabs` in C and
759 * Objective-C, and `simd::fabs` in C++. */
760static inline SIMD_CFUNC simd_float8 __tg_fabs(simd_float8 x);
761/*! @abstract Do not call this function; instead use `fabs` in C and
762 * Objective-C, and `simd::fabs` in C++. */
763static inline SIMD_CFUNC simd_float16 __tg_fabs(simd_float16 x);
764/*! @abstract Do not call this function; instead use `fabs` in C and
765 * Objective-C, and `simd::fabs` in C++. */
766static inline SIMD_CFUNC simd_double2 __tg_fabs(simd_double2 x);
767/*! @abstract Do not call this function; instead use `fabs` in C and
768 * Objective-C, and `simd::fabs` in C++. */
769static inline SIMD_CFUNC simd_double3 __tg_fabs(simd_double3 x);
770/*! @abstract Do not call this function; instead use `fabs` in C and
771 * Objective-C, and `simd::fabs` in C++. */
772static inline SIMD_CFUNC simd_double4 __tg_fabs(simd_double4 x);
773/*! @abstract Do not call this function; instead use `fabs` in C and
774 * Objective-C, and `simd::fabs` in C++. */
775static inline SIMD_CFUNC simd_double8 __tg_fabs(simd_double8 x);
776
777/*! @abstract Do not call this function; instead use `cbrt` in C and
778 * Objective-C, and `simd::cbrt` in C++. */
779static inline SIMD_CFUNC simd_float2 __tg_cbrt(simd_float2 x);
780/*! @abstract Do not call this function; instead use `cbrt` in C and
781 * Objective-C, and `simd::cbrt` in C++. */
782static inline SIMD_CFUNC simd_float3 __tg_cbrt(simd_float3 x);
783/*! @abstract Do not call this function; instead use `cbrt` in C and
784 * Objective-C, and `simd::cbrt` in C++. */
785static inline SIMD_CFUNC simd_float4 __tg_cbrt(simd_float4 x);
786/*! @abstract Do not call this function; instead use `cbrt` in C and
787 * Objective-C, and `simd::cbrt` in C++. */
788static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x);
789/*! @abstract Do not call this function; instead use `cbrt` in C and
790 * Objective-C, and `simd::cbrt` in C++. */
791static inline SIMD_CFUNC simd_float16 __tg_cbrt(simd_float16 x);
792/*! @abstract Do not call this function; instead use `cbrt` in C and
793 * Objective-C, and `simd::cbrt` in C++. */
794static inline SIMD_CFUNC simd_double2 __tg_cbrt(simd_double2 x);
795/*! @abstract Do not call this function; instead use `cbrt` in C and
796 * Objective-C, and `simd::cbrt` in C++. */
797static inline SIMD_CFUNC simd_double3 __tg_cbrt(simd_double3 x);
798/*! @abstract Do not call this function; instead use `cbrt` in C and
799 * Objective-C, and `simd::cbrt` in C++. */
800static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x);
801/*! @abstract Do not call this function; instead use `cbrt` in C and
802 * Objective-C, and `simd::cbrt` in C++. */
803static inline SIMD_CFUNC simd_double8 __tg_cbrt(simd_double8 x);
804
805/*! @abstract Do not call this function; instead use `sqrt` in C and
806 * Objective-C, and `simd::sqrt` in C++. */
807static inline SIMD_CFUNC simd_float2 __tg_sqrt(simd_float2 x);
808/*! @abstract Do not call this function; instead use `sqrt` in C and
809 * Objective-C, and `simd::sqrt` in C++. */
810static inline SIMD_CFUNC simd_float3 __tg_sqrt(simd_float3 x);
811/*! @abstract Do not call this function; instead use `sqrt` in C and
812 * Objective-C, and `simd::sqrt` in C++. */
813static inline SIMD_CFUNC simd_float4 __tg_sqrt(simd_float4 x);
814/*! @abstract Do not call this function; instead use `sqrt` in C and
815 * Objective-C, and `simd::sqrt` in C++. */
816static inline SIMD_CFUNC simd_float8 __tg_sqrt(simd_float8 x);
817/*! @abstract Do not call this function; instead use `sqrt` in C and
818 * Objective-C, and `simd::sqrt` in C++. */
819static inline SIMD_CFUNC simd_float16 __tg_sqrt(simd_float16 x);
820/*! @abstract Do not call this function; instead use `sqrt` in C and
821 * Objective-C, and `simd::sqrt` in C++. */
822static inline SIMD_CFUNC simd_double2 __tg_sqrt(simd_double2 x);
823/*! @abstract Do not call this function; instead use `sqrt` in C and
824 * Objective-C, and `simd::sqrt` in C++. */
825static inline SIMD_CFUNC simd_double3 __tg_sqrt(simd_double3 x);
826/*! @abstract Do not call this function; instead use `sqrt` in C and
827 * Objective-C, and `simd::sqrt` in C++. */
828static inline SIMD_CFUNC simd_double4 __tg_sqrt(simd_double4 x);
829/*! @abstract Do not call this function; instead use `sqrt` in C and
830 * Objective-C, and `simd::sqrt` in C++. */
831static inline SIMD_CFUNC simd_double8 __tg_sqrt(simd_double8 x);
832
833/*! @abstract Do not call this function; instead use `erf` in C and
834 * Objective-C, and `simd::erf` in C++. */
835static inline SIMD_CFUNC simd_float2 __tg_erf(simd_float2 x);
836/*! @abstract Do not call this function; instead use `erf` in C and
837 * Objective-C, and `simd::erf` in C++. */
838static inline SIMD_CFUNC simd_float3 __tg_erf(simd_float3 x);
839/*! @abstract Do not call this function; instead use `erf` in C and
840 * Objective-C, and `simd::erf` in C++. */
841static inline SIMD_CFUNC simd_float4 __tg_erf(simd_float4 x);
842/*! @abstract Do not call this function; instead use `erf` in C and
843 * Objective-C, and `simd::erf` in C++. */
844static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x);
845/*! @abstract Do not call this function; instead use `erf` in C and
846 * Objective-C, and `simd::erf` in C++. */
847static inline SIMD_CFUNC simd_float16 __tg_erf(simd_float16 x);
848/*! @abstract Do not call this function; instead use `erf` in C and
849 * Objective-C, and `simd::erf` in C++. */
850static inline SIMD_CFUNC simd_double2 __tg_erf(simd_double2 x);
851/*! @abstract Do not call this function; instead use `erf` in C and
852 * Objective-C, and `simd::erf` in C++. */
853static inline SIMD_CFUNC simd_double3 __tg_erf(simd_double3 x);
854/*! @abstract Do not call this function; instead use `erf` in C and
855 * Objective-C, and `simd::erf` in C++. */
856static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x);
857/*! @abstract Do not call this function; instead use `erf` in C and
858 * Objective-C, and `simd::erf` in C++. */
859static inline SIMD_CFUNC simd_double8 __tg_erf(simd_double8 x);
860
861/*! @abstract Do not call this function; instead use `erfc` in C and
862 * Objective-C, and `simd::erfc` in C++. */
863static inline SIMD_CFUNC simd_float2 __tg_erfc(simd_float2 x);
864/*! @abstract Do not call this function; instead use `erfc` in C and
865 * Objective-C, and `simd::erfc` in C++. */
866static inline SIMD_CFUNC simd_float3 __tg_erfc(simd_float3 x);
867/*! @abstract Do not call this function; instead use `erfc` in C and
868 * Objective-C, and `simd::erfc` in C++. */
869static inline SIMD_CFUNC simd_float4 __tg_erfc(simd_float4 x);
870/*! @abstract Do not call this function; instead use `erfc` in C and
871 * Objective-C, and `simd::erfc` in C++. */
872static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x);
873/*! @abstract Do not call this function; instead use `erfc` in C and
874 * Objective-C, and `simd::erfc` in C++. */
875static inline SIMD_CFUNC simd_float16 __tg_erfc(simd_float16 x);
876/*! @abstract Do not call this function; instead use `erfc` in C and
877 * Objective-C, and `simd::erfc` in C++. */
878static inline SIMD_CFUNC simd_double2 __tg_erfc(simd_double2 x);
879/*! @abstract Do not call this function; instead use `erfc` in C and
880 * Objective-C, and `simd::erfc` in C++. */
881static inline SIMD_CFUNC simd_double3 __tg_erfc(simd_double3 x);
882/*! @abstract Do not call this function; instead use `erfc` in C and
883 * Objective-C, and `simd::erfc` in C++. */
884static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x);
885/*! @abstract Do not call this function; instead use `erfc` in C and
886 * Objective-C, and `simd::erfc` in C++. */
887static inline SIMD_CFUNC simd_double8 __tg_erfc(simd_double8 x);
888
889/*! @abstract Do not call this function; instead use `tgamma` in C and
890 * Objective-C, and `simd::tgamma` in C++. */
891static inline SIMD_CFUNC simd_float2 __tg_tgamma(simd_float2 x);
892/*! @abstract Do not call this function; instead use `tgamma` in C and
893 * Objective-C, and `simd::tgamma` in C++. */
894static inline SIMD_CFUNC simd_float3 __tg_tgamma(simd_float3 x);
895/*! @abstract Do not call this function; instead use `tgamma` in C and
896 * Objective-C, and `simd::tgamma` in C++. */
897static inline SIMD_CFUNC simd_float4 __tg_tgamma(simd_float4 x);
898/*! @abstract Do not call this function; instead use `tgamma` in C and
899 * Objective-C, and `simd::tgamma` in C++. */
900static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x);
901/*! @abstract Do not call this function; instead use `tgamma` in C and
902 * Objective-C, and `simd::tgamma` in C++. */
903static inline SIMD_CFUNC simd_float16 __tg_tgamma(simd_float16 x);
904/*! @abstract Do not call this function; instead use `tgamma` in C and
905 * Objective-C, and `simd::tgamma` in C++. */
906static inline SIMD_CFUNC simd_double2 __tg_tgamma(simd_double2 x);
907/*! @abstract Do not call this function; instead use `tgamma` in C and
908 * Objective-C, and `simd::tgamma` in C++. */
909static inline SIMD_CFUNC simd_double3 __tg_tgamma(simd_double3 x);
910/*! @abstract Do not call this function; instead use `tgamma` in C and
911 * Objective-C, and `simd::tgamma` in C++. */
912static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x);
913/*! @abstract Do not call this function; instead use `tgamma` in C and
914 * Objective-C, and `simd::tgamma` in C++. */
915static inline SIMD_CFUNC simd_double8 __tg_tgamma(simd_double8 x);
916
917/*! @abstract Do not call this function; instead use `lgamma` in C and
918 * Objective-C, and `simd::lgamma` in C++. */
919static inline SIMD_CFUNC simd_float2 __tg_lgamma(simd_float2 x);
920/*! @abstract Do not call this function; instead use `lgamma` in C and
921 * Objective-C, and `simd::lgamma` in C++. */
922static inline SIMD_CFUNC simd_float3 __tg_lgamma(simd_float3 x);
923/*! @abstract Do not call this function; instead use `lgamma` in C and
924 * Objective-C, and `simd::lgamma` in C++. */
925static inline SIMD_CFUNC simd_float4 __tg_lgamma(simd_float4 x);
926/*! @abstract Do not call this function; instead use `lgamma` in C and
927 * Objective-C, and `simd::lgamma` in C++. */
928static inline SIMD_CFUNC simd_float8 __tg_lgamma(simd_float8 x);
929/*! @abstract Do not call this function; instead use `lgamma` in C and
930 * Objective-C, and `simd::lgamma` in C++. */
931static inline SIMD_CFUNC simd_float16 __tg_lgamma(simd_float16 x);
932/*! @abstract Do not call this function; instead use `lgamma` in C and
933 * Objective-C, and `simd::lgamma` in C++. */
934static inline SIMD_CFUNC simd_double2 __tg_lgamma(simd_double2 x);
935/*! @abstract Do not call this function; instead use `lgamma` in C and
936 * Objective-C, and `simd::lgamma` in C++. */
937static inline SIMD_CFUNC simd_double3 __tg_lgamma(simd_double3 x);
938/*! @abstract Do not call this function; instead use `lgamma` in C and
939 * Objective-C, and `simd::lgamma` in C++. */
940static inline SIMD_CFUNC simd_double4 __tg_lgamma(simd_double4 x);
941/*! @abstract Do not call this function; instead use `lgamma` in C and
942 * Objective-C, and `simd::lgamma` in C++. */
943static inline SIMD_CFUNC simd_double8 __tg_lgamma(simd_double8 x);
944
945/*! @abstract Do not call this function; instead use `ceil` in C and
946 * Objective-C, and `simd::ceil` in C++. */
947static inline SIMD_CFUNC simd_float2 __tg_ceil(simd_float2 x);
948/*! @abstract Do not call this function; instead use `ceil` in C and
949 * Objective-C, and `simd::ceil` in C++. */
950static inline SIMD_CFUNC simd_float3 __tg_ceil(simd_float3 x);
951/*! @abstract Do not call this function; instead use `ceil` in C and
952 * Objective-C, and `simd::ceil` in C++. */
953static inline SIMD_CFUNC simd_float4 __tg_ceil(simd_float4 x);
954/*! @abstract Do not call this function; instead use `ceil` in C and
955 * Objective-C, and `simd::ceil` in C++. */
956static inline SIMD_CFUNC simd_float8 __tg_ceil(simd_float8 x);
957/*! @abstract Do not call this function; instead use `ceil` in C and
958 * Objective-C, and `simd::ceil` in C++. */
959static inline SIMD_CFUNC simd_float16 __tg_ceil(simd_float16 x);
960/*! @abstract Do not call this function; instead use `ceil` in C and
961 * Objective-C, and `simd::ceil` in C++. */
962static inline SIMD_CFUNC simd_double2 __tg_ceil(simd_double2 x);
963/*! @abstract Do not call this function; instead use `ceil` in C and
964 * Objective-C, and `simd::ceil` in C++. */
965static inline SIMD_CFUNC simd_double3 __tg_ceil(simd_double3 x);
966/*! @abstract Do not call this function; instead use `ceil` in C and
967 * Objective-C, and `simd::ceil` in C++. */
968static inline SIMD_CFUNC simd_double4 __tg_ceil(simd_double4 x);
969/*! @abstract Do not call this function; instead use `ceil` in C and
970 * Objective-C, and `simd::ceil` in C++. */
971static inline SIMD_CFUNC simd_double8 __tg_ceil(simd_double8 x);
972
973/*! @abstract Do not call this function; instead use `floor` in C and
974 * Objective-C, and `simd::floor` in C++. */
975static inline SIMD_CFUNC simd_float2 __tg_floor(simd_float2 x);
976/*! @abstract Do not call this function; instead use `floor` in C and
977 * Objective-C, and `simd::floor` in C++. */
978static inline SIMD_CFUNC simd_float3 __tg_floor(simd_float3 x);
979/*! @abstract Do not call this function; instead use `floor` in C and
980 * Objective-C, and `simd::floor` in C++. */
981static inline SIMD_CFUNC simd_float4 __tg_floor(simd_float4 x);
982/*! @abstract Do not call this function; instead use `floor` in C and
983 * Objective-C, and `simd::floor` in C++. */
984static inline SIMD_CFUNC simd_float8 __tg_floor(simd_float8 x);
985/*! @abstract Do not call this function; instead use `floor` in C and
986 * Objective-C, and `simd::floor` in C++. */
987static inline SIMD_CFUNC simd_float16 __tg_floor(simd_float16 x);
988/*! @abstract Do not call this function; instead use `floor` in C and
989 * Objective-C, and `simd::floor` in C++. */
990static inline SIMD_CFUNC simd_double2 __tg_floor(simd_double2 x);
991/*! @abstract Do not call this function; instead use `floor` in C and
992 * Objective-C, and `simd::floor` in C++. */
993static inline SIMD_CFUNC simd_double3 __tg_floor(simd_double3 x);
994/*! @abstract Do not call this function; instead use `floor` in C and
995 * Objective-C, and `simd::floor` in C++. */
996static inline SIMD_CFUNC simd_double4 __tg_floor(simd_double4 x);
997/*! @abstract Do not call this function; instead use `floor` in C and
998 * Objective-C, and `simd::floor` in C++. */
999static inline SIMD_CFUNC simd_double8 __tg_floor(simd_double8 x);
1000
1001/*! @abstract Do not call this function; instead use `rint` in C and
1002 * Objective-C, and `simd::rint` in C++. */
1003static inline SIMD_CFUNC simd_float2 __tg_rint(simd_float2 x);
1004/*! @abstract Do not call this function; instead use `rint` in C and
1005 * Objective-C, and `simd::rint` in C++. */
1006static inline SIMD_CFUNC simd_float3 __tg_rint(simd_float3 x);
1007/*! @abstract Do not call this function; instead use `rint` in C and
1008 * Objective-C, and `simd::rint` in C++. */
1009static inline SIMD_CFUNC simd_float4 __tg_rint(simd_float4 x);
1010/*! @abstract Do not call this function; instead use `rint` in C and
1011 * Objective-C, and `simd::rint` in C++. */
1012static inline SIMD_CFUNC simd_float8 __tg_rint(simd_float8 x);
1013/*! @abstract Do not call this function; instead use `rint` in C and
1014 * Objective-C, and `simd::rint` in C++. */
1015static inline SIMD_CFUNC simd_float16 __tg_rint(simd_float16 x);
1016/*! @abstract Do not call this function; instead use `rint` in C and
1017 * Objective-C, and `simd::rint` in C++. */
1018static inline SIMD_CFUNC simd_double2 __tg_rint(simd_double2 x);
1019/*! @abstract Do not call this function; instead use `rint` in C and
1020 * Objective-C, and `simd::rint` in C++. */
1021static inline SIMD_CFUNC simd_double3 __tg_rint(simd_double3 x);
1022/*! @abstract Do not call this function; instead use `rint` in C and
1023 * Objective-C, and `simd::rint` in C++. */
1024static inline SIMD_CFUNC simd_double4 __tg_rint(simd_double4 x);
1025/*! @abstract Do not call this function; instead use `rint` in C and
1026 * Objective-C, and `simd::rint` in C++. */
1027static inline SIMD_CFUNC simd_double8 __tg_rint(simd_double8 x);
1028
1029/*! @abstract Do not call this function; instead use `round` in C and
1030 * Objective-C, and `simd::round` in C++. */
1031static inline SIMD_CFUNC simd_float2 __tg_round(simd_float2 x);
1032/*! @abstract Do not call this function; instead use `round` in C and
1033 * Objective-C, and `simd::round` in C++. */
1034static inline SIMD_CFUNC simd_float3 __tg_round(simd_float3 x);
1035/*! @abstract Do not call this function; instead use `round` in C and
1036 * Objective-C, and `simd::round` in C++. */
1037static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x);
1038/*! @abstract Do not call this function; instead use `round` in C and
1039 * Objective-C, and `simd::round` in C++. */
1040static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x);
1041/*! @abstract Do not call this function; instead use `round` in C and
1042 * Objective-C, and `simd::round` in C++. */
1043static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x);
1044/*! @abstract Do not call this function; instead use `round` in C and
1045 * Objective-C, and `simd::round` in C++. */
1046static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x);
1047/*! @abstract Do not call this function; instead use `round` in C and
1048 * Objective-C, and `simd::round` in C++. */
1049static inline SIMD_CFUNC simd_double3 __tg_round(simd_double3 x);
1050/*! @abstract Do not call this function; instead use `round` in C and
1051 * Objective-C, and `simd::round` in C++. */
1052static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x);
1053/*! @abstract Do not call this function; instead use `round` in C and
1054 * Objective-C, and `simd::round` in C++. */
1055static inline SIMD_CFUNC simd_double8 __tg_round(simd_double8 x);
1056
1057/*! @abstract Do not call this function; instead use `trunc` in C and
1058 * Objective-C, and `simd::trunc` in C++. */
1059static inline SIMD_CFUNC simd_float2 __tg_trunc(simd_float2 x);
1060/*! @abstract Do not call this function; instead use `trunc` in C and
1061 * Objective-C, and `simd::trunc` in C++. */
1062static inline SIMD_CFUNC simd_float3 __tg_trunc(simd_float3 x);
1063/*! @abstract Do not call this function; instead use `trunc` in C and
1064 * Objective-C, and `simd::trunc` in C++. */
1065static inline SIMD_CFUNC simd_float4 __tg_trunc(simd_float4 x);
1066/*! @abstract Do not call this function; instead use `trunc` in C and
1067 * Objective-C, and `simd::trunc` in C++. */
1068static inline SIMD_CFUNC simd_float8 __tg_trunc(simd_float8 x);
1069/*! @abstract Do not call this function; instead use `trunc` in C and
1070 * Objective-C, and `simd::trunc` in C++. */
1071static inline SIMD_CFUNC simd_float16 __tg_trunc(simd_float16 x);
1072/*! @abstract Do not call this function; instead use `trunc` in C and
1073 * Objective-C, and `simd::trunc` in C++. */
1074static inline SIMD_CFUNC simd_double2 __tg_trunc(simd_double2 x);
1075/*! @abstract Do not call this function; instead use `trunc` in C and
1076 * Objective-C, and `simd::trunc` in C++. */
1077static inline SIMD_CFUNC simd_double3 __tg_trunc(simd_double3 x);
1078/*! @abstract Do not call this function; instead use `trunc` in C and
1079 * Objective-C, and `simd::trunc` in C++. */
1080static inline SIMD_CFUNC simd_double4 __tg_trunc(simd_double4 x);
1081/*! @abstract Do not call this function; instead use `trunc` in C and
1082 * Objective-C, and `simd::trunc` in C++. */
1083static inline SIMD_CFUNC simd_double8 __tg_trunc(simd_double8 x);
1084
1085/*! @abstract Do not call this function; instead use `isfinite` in C and
1086 * Objective-C, and `simd::isfinite` in C++. */
1087static inline SIMD_CFUNC simd_int2 __tg_isfinite(simd_float2 x);
1088/*! @abstract Do not call this function; instead use `isfinite` in C and
1089 * Objective-C, and `simd::isfinite` in C++. */
1090static inline SIMD_CFUNC simd_int3 __tg_isfinite(simd_float3 x);
1091/*! @abstract Do not call this function; instead use `isfinite` in C and
1092 * Objective-C, and `simd::isfinite` in C++. */
1093static inline SIMD_CFUNC simd_int4 __tg_isfinite(simd_float4 x);
1094/*! @abstract Do not call this function; instead use `isfinite` in C and
1095 * Objective-C, and `simd::isfinite` in C++. */
1096static inline SIMD_CFUNC simd_int8 __tg_isfinite(simd_float8 x);
1097/*! @abstract Do not call this function; instead use `isfinite` in C and
1098 * Objective-C, and `simd::isfinite` in C++. */
1099static inline SIMD_CFUNC simd_int16 __tg_isfinite(simd_float16 x);
1100/*! @abstract Do not call this function; instead use `isfinite` in C and
1101 * Objective-C, and `simd::isfinite` in C++. */
1102static inline SIMD_CFUNC simd_long2 __tg_isfinite(simd_double2 x);
1103/*! @abstract Do not call this function; instead use `isfinite` in C and
1104 * Objective-C, and `simd::isfinite` in C++. */
1105static inline SIMD_CFUNC simd_long3 __tg_isfinite(simd_double3 x);
1106/*! @abstract Do not call this function; instead use `isfinite` in C and
1107 * Objective-C, and `simd::isfinite` in C++. */
1108static inline SIMD_CFUNC simd_long4 __tg_isfinite(simd_double4 x);
1109/*! @abstract Do not call this function; instead use `isfinite` in C and
1110 * Objective-C, and `simd::isfinite` in C++. */
1111static inline SIMD_CFUNC simd_long8 __tg_isfinite(simd_double8 x);
1112
1113/*! @abstract Do not call this function; instead use `isinf` in C and
1114 * Objective-C, and `simd::isinf` in C++. */
1115static inline SIMD_CFUNC simd_int2 __tg_isinf(simd_float2 x);
1116/*! @abstract Do not call this function; instead use `isinf` in C and
1117 * Objective-C, and `simd::isinf` in C++. */
1118static inline SIMD_CFUNC simd_int3 __tg_isinf(simd_float3 x);
1119/*! @abstract Do not call this function; instead use `isinf` in C and
1120 * Objective-C, and `simd::isinf` in C++. */
1121static inline SIMD_CFUNC simd_int4 __tg_isinf(simd_float4 x);
1122/*! @abstract Do not call this function; instead use `isinf` in C and
1123 * Objective-C, and `simd::isinf` in C++. */
1124static inline SIMD_CFUNC simd_int8 __tg_isinf(simd_float8 x);
1125/*! @abstract Do not call this function; instead use `isinf` in C and
1126 * Objective-C, and `simd::isinf` in C++. */
1127static inline SIMD_CFUNC simd_int16 __tg_isinf(simd_float16 x);
1128/*! @abstract Do not call this function; instead use `isinf` in C and
1129 * Objective-C, and `simd::isinf` in C++. */
1130static inline SIMD_CFUNC simd_long2 __tg_isinf(simd_double2 x);
1131/*! @abstract Do not call this function; instead use `isinf` in C and
1132 * Objective-C, and `simd::isinf` in C++. */
1133static inline SIMD_CFUNC simd_long3 __tg_isinf(simd_double3 x);
1134/*! @abstract Do not call this function; instead use `isinf` in C and
1135 * Objective-C, and `simd::isinf` in C++. */
1136static inline SIMD_CFUNC simd_long4 __tg_isinf(simd_double4 x);
1137/*! @abstract Do not call this function; instead use `isinf` in C and
1138 * Objective-C, and `simd::isinf` in C++. */
1139static inline SIMD_CFUNC simd_long8 __tg_isinf(simd_double8 x);
1140
1141/*! @abstract Do not call this function; instead use `isnan` in C and
1142 * Objective-C, and `simd::isnan` in C++. */
1143static inline SIMD_CFUNC simd_int2 __tg_isnan(simd_float2 x);
1144/*! @abstract Do not call this function; instead use `isnan` in C and
1145 * Objective-C, and `simd::isnan` in C++. */
1146static inline SIMD_CFUNC simd_int3 __tg_isnan(simd_float3 x);
1147/*! @abstract Do not call this function; instead use `isnan` in C and
1148 * Objective-C, and `simd::isnan` in C++. */
1149static inline SIMD_CFUNC simd_int4 __tg_isnan(simd_float4 x);
1150/*! @abstract Do not call this function; instead use `isnan` in C and
1151 * Objective-C, and `simd::isnan` in C++. */
1152static inline SIMD_CFUNC simd_int8 __tg_isnan(simd_float8 x);
1153/*! @abstract Do not call this function; instead use `isnan` in C and
1154 * Objective-C, and `simd::isnan` in C++. */
1155static inline SIMD_CFUNC simd_int16 __tg_isnan(simd_float16 x);
1156/*! @abstract Do not call this function; instead use `isnan` in C and
1157 * Objective-C, and `simd::isnan` in C++. */
1158static inline SIMD_CFUNC simd_long2 __tg_isnan(simd_double2 x);
1159/*! @abstract Do not call this function; instead use `isnan` in C and
1160 * Objective-C, and `simd::isnan` in C++. */
1161static inline SIMD_CFUNC simd_long3 __tg_isnan(simd_double3 x);
1162/*! @abstract Do not call this function; instead use `isnan` in C and
1163 * Objective-C, and `simd::isnan` in C++. */
1164static inline SIMD_CFUNC simd_long4 __tg_isnan(simd_double4 x);
1165/*! @abstract Do not call this function; instead use `isnan` in C and
1166 * Objective-C, and `simd::isnan` in C++. */
1167static inline SIMD_CFUNC simd_long8 __tg_isnan(simd_double8 x);
1168
1169/*! @abstract Do not call this function; instead use `isnormal` in C and
1170 * Objective-C, and `simd::isnormal` in C++. */
1171static inline SIMD_CFUNC simd_int2 __tg_isnormal(simd_float2 x);
1172/*! @abstract Do not call this function; instead use `isnormal` in C and
1173 * Objective-C, and `simd::isnormal` in C++. */
1174static inline SIMD_CFUNC simd_int3 __tg_isnormal(simd_float3 x);
1175/*! @abstract Do not call this function; instead use `isnormal` in C and
1176 * Objective-C, and `simd::isnormal` in C++. */
1177static inline SIMD_CFUNC simd_int4 __tg_isnormal(simd_float4 x);
1178/*! @abstract Do not call this function; instead use `isnormal` in C and
1179 * Objective-C, and `simd::isnormal` in C++. */
1180static inline SIMD_CFUNC simd_int8 __tg_isnormal(simd_float8 x);
1181/*! @abstract Do not call this function; instead use `isnormal` in C and
1182 * Objective-C, and `simd::isnormal` in C++. */
1183static inline SIMD_CFUNC simd_int16 __tg_isnormal(simd_float16 x);
1184/*! @abstract Do not call this function; instead use `isnormal` in C and
1185 * Objective-C, and `simd::isnormal` in C++. */
1186static inline SIMD_CFUNC simd_long2 __tg_isnormal(simd_double2 x);
1187/*! @abstract Do not call this function; instead use `isnormal` in C and
1188 * Objective-C, and `simd::isnormal` in C++. */
1189static inline SIMD_CFUNC simd_long3 __tg_isnormal(simd_double3 x);
1190/*! @abstract Do not call this function; instead use `isnormal` in C and
1191 * Objective-C, and `simd::isnormal` in C++. */
1192static inline SIMD_CFUNC simd_long4 __tg_isnormal(simd_double4 x);
1193/*! @abstract Do not call this function; instead use `isnormal` in C and
1194 * Objective-C, and `simd::isnormal` in C++. */
1195static inline SIMD_CFUNC simd_long8 __tg_isnormal(simd_double8 x);
1196
1197
1198/*! @abstract Do not call this function; instead use `atan2` in C and
1199 * Objective-C, and `simd::atan2` in C++. */
1200static inline SIMD_CFUNC simd_float2 __tg_atan2(simd_float2 y, simd_float2 x);
1201/*! @abstract Do not call this function; instead use `atan2` in C and
1202 * Objective-C, and `simd::atan2` in C++. */
1203static inline SIMD_CFUNC simd_float3 __tg_atan2(simd_float3 y, simd_float3 x);
1204/*! @abstract Do not call this function; instead use `atan2` in C and
1205 * Objective-C, and `simd::atan2` in C++. */
1206static inline SIMD_CFUNC simd_float4 __tg_atan2(simd_float4 y, simd_float4 x);
1207/*! @abstract Do not call this function; instead use `atan2` in C and
1208 * Objective-C, and `simd::atan2` in C++. */
1209static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x);
1210/*! @abstract Do not call this function; instead use `atan2` in C and
1211 * Objective-C, and `simd::atan2` in C++. */
1212static inline SIMD_CFUNC simd_float16 __tg_atan2(simd_float16 y, simd_float16 x);
1213/*! @abstract Do not call this function; instead use `atan2` in C and
1214 * Objective-C, and `simd::atan2` in C++. */
1215static inline SIMD_CFUNC simd_double2 __tg_atan2(simd_double2 y, simd_double2 x);
1216/*! @abstract Do not call this function; instead use `atan2` in C and
1217 * Objective-C, and `simd::atan2` in C++. */
1218static inline SIMD_CFUNC simd_double3 __tg_atan2(simd_double3 y, simd_double3 x);
1219/*! @abstract Do not call this function; instead use `atan2` in C and
1220 * Objective-C, and `simd::atan2` in C++. */
1221static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x);
1222/*! @abstract Do not call this function; instead use `atan2` in C and
1223 * Objective-C, and `simd::atan2` in C++. */
1224static inline SIMD_CFUNC simd_double8 __tg_atan2(simd_double8 y, simd_double8 x);
1225
1226/*! @abstract Do not call this function; instead use `hypot` in C and
1227 * Objective-C, and `simd::hypot` in C++. */
1228static inline SIMD_CFUNC simd_float2 __tg_hypot(simd_float2 x, simd_float2 y);
1229/*! @abstract Do not call this function; instead use `hypot` in C and
1230 * Objective-C, and `simd::hypot` in C++. */
1231static inline SIMD_CFUNC simd_float3 __tg_hypot(simd_float3 x, simd_float3 y);
1232/*! @abstract Do not call this function; instead use `hypot` in C and
1233 * Objective-C, and `simd::hypot` in C++. */
1234static inline SIMD_CFUNC simd_float4 __tg_hypot(simd_float4 x, simd_float4 y);
1235/*! @abstract Do not call this function; instead use `hypot` in C and
1236 * Objective-C, and `simd::hypot` in C++. */
1237static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y);
1238/*! @abstract Do not call this function; instead use `hypot` in C and
1239 * Objective-C, and `simd::hypot` in C++. */
1240static inline SIMD_CFUNC simd_float16 __tg_hypot(simd_float16 x, simd_float16 y);
1241/*! @abstract Do not call this function; instead use `hypot` in C and
1242 * Objective-C, and `simd::hypot` in C++. */
1243static inline SIMD_CFUNC simd_double2 __tg_hypot(simd_double2 x, simd_double2 y);
1244/*! @abstract Do not call this function; instead use `hypot` in C and
1245 * Objective-C, and `simd::hypot` in C++. */
1246static inline SIMD_CFUNC simd_double3 __tg_hypot(simd_double3 x, simd_double3 y);
1247/*! @abstract Do not call this function; instead use `hypot` in C and
1248 * Objective-C, and `simd::hypot` in C++. */
1249static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y);
1250/*! @abstract Do not call this function; instead use `hypot` in C and
1251 * Objective-C, and `simd::hypot` in C++. */
1252static inline SIMD_CFUNC simd_double8 __tg_hypot(simd_double8 x, simd_double8 y);
1253
1254/*! @abstract Do not call this function; instead use `pow` in C and
1255 * Objective-C, and `simd::pow` in C++. */
1256static inline SIMD_CFUNC simd_float2 __tg_pow(simd_float2 x, simd_float2 y);
1257/*! @abstract Do not call this function; instead use `pow` in C and
1258 * Objective-C, and `simd::pow` in C++. */
1259static inline SIMD_CFUNC simd_float3 __tg_pow(simd_float3 x, simd_float3 y);
1260/*! @abstract Do not call this function; instead use `pow` in C and
1261 * Objective-C, and `simd::pow` in C++. */
1262static inline SIMD_CFUNC simd_float4 __tg_pow(simd_float4 x, simd_float4 y);
1263/*! @abstract Do not call this function; instead use `pow` in C and
1264 * Objective-C, and `simd::pow` in C++. */
1265static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y);
1266/*! @abstract Do not call this function; instead use `pow` in C and
1267 * Objective-C, and `simd::pow` in C++. */
1268static inline SIMD_CFUNC simd_float16 __tg_pow(simd_float16 x, simd_float16 y);
1269/*! @abstract Do not call this function; instead use `pow` in C and
1270 * Objective-C, and `simd::pow` in C++. */
1271static inline SIMD_CFUNC simd_double2 __tg_pow(simd_double2 x, simd_double2 y);
1272/*! @abstract Do not call this function; instead use `pow` in C and
1273 * Objective-C, and `simd::pow` in C++. */
1274static inline SIMD_CFUNC simd_double3 __tg_pow(simd_double3 x, simd_double3 y);
1275/*! @abstract Do not call this function; instead use `pow` in C and
1276 * Objective-C, and `simd::pow` in C++. */
1277static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y);
1278/*! @abstract Do not call this function; instead use `pow` in C and
1279 * Objective-C, and `simd::pow` in C++. */
1280static inline SIMD_CFUNC simd_double8 __tg_pow(simd_double8 x, simd_double8 y);
1281
1282/*! @abstract Do not call this function; instead use `fmod` in C and
1283 * Objective-C, and `simd::fmod` in C++. */
1284static inline SIMD_CFUNC simd_float2 __tg_fmod(simd_float2 x, simd_float2 y);
1285/*! @abstract Do not call this function; instead use `fmod` in C and
1286 * Objective-C, and `simd::fmod` in C++. */
1287static inline SIMD_CFUNC simd_float3 __tg_fmod(simd_float3 x, simd_float3 y);
1288/*! @abstract Do not call this function; instead use `fmod` in C and
1289 * Objective-C, and `simd::fmod` in C++. */
1290static inline SIMD_CFUNC simd_float4 __tg_fmod(simd_float4 x, simd_float4 y);
1291/*! @abstract Do not call this function; instead use `fmod` in C and
1292 * Objective-C, and `simd::fmod` in C++. */
1293static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y);
1294/*! @abstract Do not call this function; instead use `fmod` in C and
1295 * Objective-C, and `simd::fmod` in C++. */
1296static inline SIMD_CFUNC simd_float16 __tg_fmod(simd_float16 x, simd_float16 y);
1297/*! @abstract Do not call this function; instead use `fmod` in C and
1298 * Objective-C, and `simd::fmod` in C++. */
1299static inline SIMD_CFUNC simd_double2 __tg_fmod(simd_double2 x, simd_double2 y);
1300/*! @abstract Do not call this function; instead use `fmod` in C and
1301 * Objective-C, and `simd::fmod` in C++. */
1302static inline SIMD_CFUNC simd_double3 __tg_fmod(simd_double3 x, simd_double3 y);
1303/*! @abstract Do not call this function; instead use `fmod` in C and
1304 * Objective-C, and `simd::fmod` in C++. */
1305static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y);
1306/*! @abstract Do not call this function; instead use `fmod` in C and
1307 * Objective-C, and `simd::fmod` in C++. */
1308static inline SIMD_CFUNC simd_double8 __tg_fmod(simd_double8 x, simd_double8 y);
1309
1310/*! @abstract Do not call this function; instead use `remainder` in C and
1311 * Objective-C, and `simd::remainder` in C++. */
1312static inline SIMD_CFUNC simd_float2 __tg_remainder(simd_float2 x, simd_float2 y);
1313/*! @abstract Do not call this function; instead use `remainder` in C and
1314 * Objective-C, and `simd::remainder` in C++. */
1315static inline SIMD_CFUNC simd_float3 __tg_remainder(simd_float3 x, simd_float3 y);
1316/*! @abstract Do not call this function; instead use `remainder` in C and
1317 * Objective-C, and `simd::remainder` in C++. */
1318static inline SIMD_CFUNC simd_float4 __tg_remainder(simd_float4 x, simd_float4 y);
1319/*! @abstract Do not call this function; instead use `remainder` in C and
1320 * Objective-C, and `simd::remainder` in C++. */
1321static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y);
1322/*! @abstract Do not call this function; instead use `remainder` in C and
1323 * Objective-C, and `simd::remainder` in C++. */
1324static inline SIMD_CFUNC simd_float16 __tg_remainder(simd_float16 x, simd_float16 y);
1325/*! @abstract Do not call this function; instead use `remainder` in C and
1326 * Objective-C, and `simd::remainder` in C++. */
1327static inline SIMD_CFUNC simd_double2 __tg_remainder(simd_double2 x, simd_double2 y);
1328/*! @abstract Do not call this function; instead use `remainder` in C and
1329 * Objective-C, and `simd::remainder` in C++. */
1330static inline SIMD_CFUNC simd_double3 __tg_remainder(simd_double3 x, simd_double3 y);
1331/*! @abstract Do not call this function; instead use `remainder` in C and
1332 * Objective-C, and `simd::remainder` in C++. */
1333static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double4 y);
1334/*! @abstract Do not call this function; instead use `remainder` in C and
1335 * Objective-C, and `simd::remainder` in C++. */
1336static inline SIMD_CFUNC simd_double8 __tg_remainder(simd_double8 x, simd_double8 y);
1337
1338/*! @abstract Do not call this function; instead use `copysign` in C and
1339 * Objective-C, and `simd::copysign` in C++. */
1340static inline SIMD_CFUNC simd_float2 __tg_copysign(simd_float2 x, simd_float2 y);
1341/*! @abstract Do not call this function; instead use `copysign` in C and
1342 * Objective-C, and `simd::copysign` in C++. */
1343static inline SIMD_CFUNC simd_float3 __tg_copysign(simd_float3 x, simd_float3 y);
1344/*! @abstract Do not call this function; instead use `copysign` in C and
1345 * Objective-C, and `simd::copysign` in C++. */
1346static inline SIMD_CFUNC simd_float4 __tg_copysign(simd_float4 x, simd_float4 y);
1347/*! @abstract Do not call this function; instead use `copysign` in C and
1348 * Objective-C, and `simd::copysign` in C++. */
1349static inline SIMD_CFUNC simd_float8 __tg_copysign(simd_float8 x, simd_float8 y);
1350/*! @abstract Do not call this function; instead use `copysign` in C and
1351 * Objective-C, and `simd::copysign` in C++. */
1352static inline SIMD_CFUNC simd_float16 __tg_copysign(simd_float16 x, simd_float16 y);
1353/*! @abstract Do not call this function; instead use `copysign` in C and
1354 * Objective-C, and `simd::copysign` in C++. */
1355static inline SIMD_CFUNC simd_double2 __tg_copysign(simd_double2 x, simd_double2 y);
1356/*! @abstract Do not call this function; instead use `copysign` in C and
1357 * Objective-C, and `simd::copysign` in C++. */
1358static inline SIMD_CFUNC simd_double3 __tg_copysign(simd_double3 x, simd_double3 y);
1359/*! @abstract Do not call this function; instead use `copysign` in C and
1360 * Objective-C, and `simd::copysign` in C++. */
1361static inline SIMD_CFUNC simd_double4 __tg_copysign(simd_double4 x, simd_double4 y);
1362/*! @abstract Do not call this function; instead use `copysign` in C and
1363 * Objective-C, and `simd::copysign` in C++. */
1364static inline SIMD_CFUNC simd_double8 __tg_copysign(simd_double8 x, simd_double8 y);
1365
1366/*! @abstract Do not call this function; instead use `nextafter` in C and
1367 * Objective-C, and `simd::nextafter` in C++. */
1368static inline SIMD_CFUNC simd_float2 __tg_nextafter(simd_float2 x, simd_float2 y);
1369/*! @abstract Do not call this function; instead use `nextafter` in C and
1370 * Objective-C, and `simd::nextafter` in C++. */
1371static inline SIMD_CFUNC simd_float3 __tg_nextafter(simd_float3 x, simd_float3 y);
1372/*! @abstract Do not call this function; instead use `nextafter` in C and
1373 * Objective-C, and `simd::nextafter` in C++. */
1374static inline SIMD_CFUNC simd_float4 __tg_nextafter(simd_float4 x, simd_float4 y);
1375/*! @abstract Do not call this function; instead use `nextafter` in C and
1376 * Objective-C, and `simd::nextafter` in C++. */
1377static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y);
1378/*! @abstract Do not call this function; instead use `nextafter` in C and
1379 * Objective-C, and `simd::nextafter` in C++. */
1380static inline SIMD_CFUNC simd_float16 __tg_nextafter(simd_float16 x, simd_float16 y);
1381/*! @abstract Do not call this function; instead use `nextafter` in C and
1382 * Objective-C, and `simd::nextafter` in C++. */
1383static inline SIMD_CFUNC simd_double2 __tg_nextafter(simd_double2 x, simd_double2 y);
1384/*! @abstract Do not call this function; instead use `nextafter` in C and
1385 * Objective-C, and `simd::nextafter` in C++. */
1386static inline SIMD_CFUNC simd_double3 __tg_nextafter(simd_double3 x, simd_double3 y);
1387/*! @abstract Do not call this function; instead use `nextafter` in C and
1388 * Objective-C, and `simd::nextafter` in C++. */
1389static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double4 y);
1390/*! @abstract Do not call this function; instead use `nextafter` in C and
1391 * Objective-C, and `simd::nextafter` in C++. */
1392static inline SIMD_CFUNC simd_double8 __tg_nextafter(simd_double8 x, simd_double8 y);
1393
1394/*! @abstract Do not call this function; instead use `fdim` in C and
1395 * Objective-C, and `simd::fdim` in C++. */
1396static inline SIMD_CFUNC simd_float2 __tg_fdim(simd_float2 x, simd_float2 y);
1397/*! @abstract Do not call this function; instead use `fdim` in C and
1398 * Objective-C, and `simd::fdim` in C++. */
1399static inline SIMD_CFUNC simd_float3 __tg_fdim(simd_float3 x, simd_float3 y);
1400/*! @abstract Do not call this function; instead use `fdim` in C and
1401 * Objective-C, and `simd::fdim` in C++. */
1402static inline SIMD_CFUNC simd_float4 __tg_fdim(simd_float4 x, simd_float4 y);
1403/*! @abstract Do not call this function; instead use `fdim` in C and
1404 * Objective-C, and `simd::fdim` in C++. */
1405static inline SIMD_CFUNC simd_float8 __tg_fdim(simd_float8 x, simd_float8 y);
1406/*! @abstract Do not call this function; instead use `fdim` in C and
1407 * Objective-C, and `simd::fdim` in C++. */
1408static inline SIMD_CFUNC simd_float16 __tg_fdim(simd_float16 x, simd_float16 y);
1409/*! @abstract Do not call this function; instead use `fdim` in C and
1410 * Objective-C, and `simd::fdim` in C++. */
1411static inline SIMD_CFUNC simd_double2 __tg_fdim(simd_double2 x, simd_double2 y);
1412/*! @abstract Do not call this function; instead use `fdim` in C and
1413 * Objective-C, and `simd::fdim` in C++. */
1414static inline SIMD_CFUNC simd_double3 __tg_fdim(simd_double3 x, simd_double3 y);
1415/*! @abstract Do not call this function; instead use `fdim` in C and
1416 * Objective-C, and `simd::fdim` in C++. */
1417static inline SIMD_CFUNC simd_double4 __tg_fdim(simd_double4 x, simd_double4 y);
1418/*! @abstract Do not call this function; instead use `fdim` in C and
1419 * Objective-C, and `simd::fdim` in C++. */
1420static inline SIMD_CFUNC simd_double8 __tg_fdim(simd_double8 x, simd_double8 y);
1421
1422/*! @abstract Do not call this function; instead use `fmax` in C and
1423 * Objective-C, and `simd::fmax` in C++. */
1424static inline SIMD_CFUNC simd_float2 __tg_fmax(simd_float2 x, simd_float2 y);
1425/*! @abstract Do not call this function; instead use `fmax` in C and
1426 * Objective-C, and `simd::fmax` in C++. */
1427static inline SIMD_CFUNC simd_float3 __tg_fmax(simd_float3 x, simd_float3 y);
1428/*! @abstract Do not call this function; instead use `fmax` in C and
1429 * Objective-C, and `simd::fmax` in C++. */
1430static inline SIMD_CFUNC simd_float4 __tg_fmax(simd_float4 x, simd_float4 y);
1431/*! @abstract Do not call this function; instead use `fmax` in C and
1432 * Objective-C, and `simd::fmax` in C++. */
1433static inline SIMD_CFUNC simd_float8 __tg_fmax(simd_float8 x, simd_float8 y);
1434/*! @abstract Do not call this function; instead use `fmax` in C and
1435 * Objective-C, and `simd::fmax` in C++. */
1436static inline SIMD_CFUNC simd_float16 __tg_fmax(simd_float16 x, simd_float16 y);
1437/*! @abstract Do not call this function; instead use `fmax` in C and
1438 * Objective-C, and `simd::fmax` in C++. */
1439static inline SIMD_CFUNC simd_double2 __tg_fmax(simd_double2 x, simd_double2 y);
1440/*! @abstract Do not call this function; instead use `fmax` in C and
1441 * Objective-C, and `simd::fmax` in C++. */
1442static inline SIMD_CFUNC simd_double3 __tg_fmax(simd_double3 x, simd_double3 y);
1443/*! @abstract Do not call this function; instead use `fmax` in C and
1444 * Objective-C, and `simd::fmax` in C++. */
1445static inline SIMD_CFUNC simd_double4 __tg_fmax(simd_double4 x, simd_double4 y);
1446/*! @abstract Do not call this function; instead use `fmax` in C and
1447 * Objective-C, and `simd::fmax` in C++. */
1448static inline SIMD_CFUNC simd_double8 __tg_fmax(simd_double8 x, simd_double8 y);
1449
1450/*! @abstract Do not call this function; instead use `fmin` in C and
1451 * Objective-C, and `simd::fmin` in C++. */
1452static inline SIMD_CFUNC simd_float2 __tg_fmin(simd_float2 x, simd_float2 y);
1453/*! @abstract Do not call this function; instead use `fmin` in C and
1454 * Objective-C, and `simd::fmin` in C++. */
1455static inline SIMD_CFUNC simd_float3 __tg_fmin(simd_float3 x, simd_float3 y);
1456/*! @abstract Do not call this function; instead use `fmin` in C and
1457 * Objective-C, and `simd::fmin` in C++. */
1458static inline SIMD_CFUNC simd_float4 __tg_fmin(simd_float4 x, simd_float4 y);
1459/*! @abstract Do not call this function; instead use `fmin` in C and
1460 * Objective-C, and `simd::fmin` in C++. */
1461static inline SIMD_CFUNC simd_float8 __tg_fmin(simd_float8 x, simd_float8 y);
1462/*! @abstract Do not call this function; instead use `fmin` in C and
1463 * Objective-C, and `simd::fmin` in C++. */
1464static inline SIMD_CFUNC simd_float16 __tg_fmin(simd_float16 x, simd_float16 y);
1465/*! @abstract Do not call this function; instead use `fmin` in C and
1466 * Objective-C, and `simd::fmin` in C++. */
1467static inline SIMD_CFUNC simd_double2 __tg_fmin(simd_double2 x, simd_double2 y);
1468/*! @abstract Do not call this function; instead use `fmin` in C and
1469 * Objective-C, and `simd::fmin` in C++. */
1470static inline SIMD_CFUNC simd_double3 __tg_fmin(simd_double3 x, simd_double3 y);
1471/*! @abstract Do not call this function; instead use `fmin` in C and
1472 * Objective-C, and `simd::fmin` in C++. */
1473static inline SIMD_CFUNC simd_double4 __tg_fmin(simd_double4 x, simd_double4 y);
1474/*! @abstract Do not call this function; instead use `fmin` in C and
1475 * Objective-C, and `simd::fmin` in C++. */
1476static inline SIMD_CFUNC simd_double8 __tg_fmin(simd_double8 x, simd_double8 y);
1477
1478
1479/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1480 * and `simd::fma` in C++. */
1481static inline SIMD_CFUNC simd_float2 __tg_fma(simd_float2 x, simd_float2 y, simd_float2 z);
1482/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1483 * and `simd::fma` in C++. */
1484static inline SIMD_CFUNC simd_float3 __tg_fma(simd_float3 x, simd_float3 y, simd_float3 z);
1485/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1486 * and `simd::fma` in C++. */
1487static inline SIMD_CFUNC simd_float4 __tg_fma(simd_float4 x, simd_float4 y, simd_float4 z);
1488/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1489 * and `simd::fma` in C++. */
1490static inline SIMD_CFUNC simd_float8 __tg_fma(simd_float8 x, simd_float8 y, simd_float8 z);
1491/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1492 * and `simd::fma` in C++. */
1493static inline SIMD_CFUNC simd_float16 __tg_fma(simd_float16 x, simd_float16 y, simd_float16 z);
1494/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1495 * and `simd::fma` in C++. */
1496static inline SIMD_CFUNC simd_double2 __tg_fma(simd_double2 x, simd_double2 y, simd_double2 z);
1497/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1498 * and `simd::fma` in C++. */
1499static inline SIMD_CFUNC simd_double3 __tg_fma(simd_double3 x, simd_double3 y, simd_double3 z);
1500/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1501 * and `simd::fma` in C++. */
1502static inline SIMD_CFUNC simd_double4 __tg_fma(simd_double4 x, simd_double4 y, simd_double4 z);
1503/*! @abstract Do not call this function; instead use `fma` in C and Objective-C,
1504 * and `simd::fma` in C++. */
1505static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, simd_double8 z);
1506
1507/*! @abstract Computes accum + x*y by the most efficient means available;
1508 * either a fused multiply add or separate multiply and add instructions. */
1509static inline SIMD_CFUNC float simd_muladd(float x, float y, float z);
1510/*! @abstract Computes accum + x*y by the most efficient means available;
1511 * either a fused multiply add or separate multiply and add instructions. */
1512static inline SIMD_CFUNC simd_float2 simd_muladd(simd_float2 x, simd_float2 y, simd_float2 z);
1513/*! @abstract Computes accum + x*y by the most efficient means available;
1514 * either a fused multiply add or separate multiply and add instructions. */
1515static inline SIMD_CFUNC simd_float3 simd_muladd(simd_float3 x, simd_float3 y, simd_float3 z);
1516/*! @abstract Computes accum + x*y by the most efficient means available;
1517 * either a fused multiply add or separate multiply and add instructions. */
1518static inline SIMD_CFUNC simd_float4 simd_muladd(simd_float4 x, simd_float4 y, simd_float4 z);
1519/*! @abstract Computes accum + x*y by the most efficient means available;
1520 * either a fused multiply add or separate multiply and add instructions. */
1521static inline SIMD_CFUNC simd_float8 simd_muladd(simd_float8 x, simd_float8 y, simd_float8 z);
1522/*! @abstract Computes accum + x*y by the most efficient means available;
1523 * either a fused multiply add or separate multiply and add instructions. */
1524static inline SIMD_CFUNC simd_float16 simd_muladd(simd_float16 x, simd_float16 y, simd_float16 z);
1525/*! @abstract Computes accum + x*y by the most efficient means available;
1526 * either a fused multiply add or separate multiply and add instructions. */
1527static inline SIMD_CFUNC double simd_muladd(double x, double y, double z);
1528/*! @abstract Computes accum + x*y by the most efficient means available;
1529 * either a fused multiply add or separate multiply and add instructions. */
1530static inline SIMD_CFUNC simd_double2 simd_muladd(simd_double2 x, simd_double2 y, simd_double2 z);
1531/*! @abstract Computes accum + x*y by the most efficient means available;
1532 * either a fused multiply add or separate multiply and add instructions. */
1533static inline SIMD_CFUNC simd_double3 simd_muladd(simd_double3 x, simd_double3 y, simd_double3 z);
1534/*! @abstract Computes accum + x*y by the most efficient means available;
1535 * either a fused multiply add or separate multiply and add instructions. */
1536static inline SIMD_CFUNC simd_double4 simd_muladd(simd_double4 x, simd_double4 y, simd_double4 z);
1537/*! @abstract Computes accum + x*y by the most efficient means available;
1538 * either a fused multiply add or separate multiply and add instructions. */
1539static inline SIMD_CFUNC simd_double8 simd_muladd(simd_double8 x, simd_double8 y, simd_double8 z);
1540
1541#ifdef __cplusplus
1542} /* extern "C" */
1543
1544#include <cmath>
1545/*! @abstract Do not call this function directly; use simd::acos instead. */
1546static SIMD_CPPFUNC float __tg_acos(float x) { return ::acos(x); }
1547/*! @abstract Do not call this function directly; use simd::acos instead. */
1548static SIMD_CPPFUNC double __tg_acos(double x) { return ::acos(x); }
1549/*! @abstract Do not call this function directly; use simd::asin instead. */
1550static SIMD_CPPFUNC float __tg_asin(float x) { return ::asin(x); }
1551/*! @abstract Do not call this function directly; use simd::asin instead. */
1552static SIMD_CPPFUNC double __tg_asin(double x) { return ::asin(x); }
1553/*! @abstract Do not call this function directly; use simd::atan instead. */
1554static SIMD_CPPFUNC float __tg_atan(float x) { return ::atan(x); }
1555/*! @abstract Do not call this function directly; use simd::atan instead. */
1556static SIMD_CPPFUNC double __tg_atan(double x) { return ::atan(x); }
1557/*! @abstract Do not call this function directly; use simd::cos instead. */
1558static SIMD_CPPFUNC float __tg_cos(float x) { return ::cos(x); }
1559/*! @abstract Do not call this function directly; use simd::cos instead. */
1560static SIMD_CPPFUNC double __tg_cos(double x) { return ::cos(x); }
1561/*! @abstract Do not call this function directly; use simd::sin instead. */
1562static SIMD_CPPFUNC float __tg_sin(float x) { return ::sin(x); }
1563/*! @abstract Do not call this function directly; use simd::sin instead. */
1564static SIMD_CPPFUNC double __tg_sin(double x) { return ::sin(x); }
1565/*! @abstract Do not call this function directly; use simd::tan instead. */
1566static SIMD_CPPFUNC float __tg_tan(float x) { return ::tan(x); }
1567/*! @abstract Do not call this function directly; use simd::tan instead. */
1568static SIMD_CPPFUNC double __tg_tan(double x) { return ::tan(x); }
1569/*! @abstract Do not call this function directly; use simd::cospi instead. */
1570static SIMD_CPPFUNC float __tg_cospi(float x) { return ::__cospi(x); }
1571/*! @abstract Do not call this function directly; use simd::cospi instead. */
1572static SIMD_CPPFUNC double __tg_cospi(double x) { return ::__cospi(x); }
1573/*! @abstract Do not call this function directly; use simd::sinpi instead. */
1574static SIMD_CPPFUNC float __tg_sinpi(float x) { return ::__sinpi(x); }
1575/*! @abstract Do not call this function directly; use simd::sinpi instead. */
1576static SIMD_CPPFUNC double __tg_sinpi(double x) { return ::__sinpi(x); }
1577/*! @abstract Do not call this function directly; use simd::tanpi instead. */
1578static SIMD_CPPFUNC float __tg_tanpi(float x) { return ::__tanpi(x); }
1579/*! @abstract Do not call this function directly; use simd::tanpi instead. */
1580static SIMD_CPPFUNC double __tg_tanpi(double x) { return ::__tanpi(x); }
1581/*! @abstract Do not call this function directly; use simd::acosh instead. */
1582static SIMD_CPPFUNC float __tg_acosh(float x) { return ::acosh(x); }
1583/*! @abstract Do not call this function directly; use simd::acosh instead. */
1584static SIMD_CPPFUNC double __tg_acosh(double x) { return ::acosh(x); }
1585/*! @abstract Do not call this function directly; use simd::asinh instead. */
1586static SIMD_CPPFUNC float __tg_asinh(float x) { return ::asinh(x); }
1587/*! @abstract Do not call this function directly; use simd::asinh instead. */
1588static SIMD_CPPFUNC double __tg_asinh(double x) { return ::asinh(x); }
1589/*! @abstract Do not call this function directly; use simd::atanh instead. */
1590static SIMD_CPPFUNC float __tg_atanh(float x) { return ::atanh(x); }
1591/*! @abstract Do not call this function directly; use simd::atanh instead. */
1592static SIMD_CPPFUNC double __tg_atanh(double x) { return ::atanh(x); }
1593/*! @abstract Do not call this function directly; use simd::cosh instead. */
1594static SIMD_CPPFUNC float __tg_cosh(float x) { return ::cosh(x); }
1595/*! @abstract Do not call this function directly; use simd::cosh instead. */
1596static SIMD_CPPFUNC double __tg_cosh(double x) { return ::cosh(x); }
1597/*! @abstract Do not call this function directly; use simd::sinh instead. */
1598static SIMD_CPPFUNC float __tg_sinh(float x) { return ::sinh(x); }
1599/*! @abstract Do not call this function directly; use simd::sinh instead. */
1600static SIMD_CPPFUNC double __tg_sinh(double x) { return ::sinh(x); }
1601/*! @abstract Do not call this function directly; use simd::tanh instead. */
1602static SIMD_CPPFUNC float __tg_tanh(float x) { return ::tanh(x); }
1603/*! @abstract Do not call this function directly; use simd::tanh instead. */
1604static SIMD_CPPFUNC double __tg_tanh(double x) { return ::tanh(x); }
1605/*! @abstract Do not call this function directly; use simd::exp instead. */
1606static SIMD_CPPFUNC float __tg_exp(float x) { return ::exp(x); }
1607/*! @abstract Do not call this function directly; use simd::exp instead. */
1608static SIMD_CPPFUNC double __tg_exp(double x) { return ::exp(x); }
1609/*! @abstract Do not call this function directly; use simd::exp2 instead. */
1610static SIMD_CPPFUNC float __tg_exp2(float x) { return ::exp2(x); }
1611/*! @abstract Do not call this function directly; use simd::exp2 instead. */
1612static SIMD_CPPFUNC double __tg_exp2(double x) { return ::exp2(x); }
1613/*! @abstract Do not call this function directly; use simd::exp10 instead. */
1614static SIMD_CPPFUNC float __tg_exp10(float x) { return ::__exp10(x); }
1615/*! @abstract Do not call this function directly; use simd::exp10 instead. */
1616static SIMD_CPPFUNC double __tg_exp10(double x) { return ::__exp10(x); }
1617/*! @abstract Do not call this function directly; use simd::expm1 instead. */
1618static SIMD_CPPFUNC float __tg_expm1(float x) { return ::expm1(x); }
1619/*! @abstract Do not call this function directly; use simd::expm1 instead. */
1620static SIMD_CPPFUNC double __tg_expm1(double x) { return ::expm1(x); }
1621/*! @abstract Do not call this function directly; use simd::log instead. */
1622static SIMD_CPPFUNC float __tg_log(float x) { return ::log(x); }
1623/*! @abstract Do not call this function directly; use simd::log instead. */
1624static SIMD_CPPFUNC double __tg_log(double x) { return ::log(x); }
1625/*! @abstract Do not call this function directly; use simd::log2 instead. */
1626static SIMD_CPPFUNC float __tg_log2(float x) { return ::log2(x); }
1627/*! @abstract Do not call this function directly; use simd::log2 instead. */
1628static SIMD_CPPFUNC double __tg_log2(double x) { return ::log2(x); }
1629/*! @abstract Do not call this function directly; use simd::log10 instead. */
1630static SIMD_CPPFUNC float __tg_log10(float x) { return ::log10(x); }
1631/*! @abstract Do not call this function directly; use simd::log10 instead. */
1632static SIMD_CPPFUNC double __tg_log10(double x) { return ::log10(x); }
1633/*! @abstract Do not call this function directly; use simd::log1p instead. */
1634static SIMD_CPPFUNC float __tg_log1p(float x) { return ::log1p(x); }
1635/*! @abstract Do not call this function directly; use simd::log1p instead. */
1636static SIMD_CPPFUNC double __tg_log1p(double x) { return ::log1p(x); }
1637/*! @abstract Do not call this function directly; use simd::fabs instead. */
1638static SIMD_CPPFUNC float __tg_fabs(float x) { return ::fabs(x); }
1639/*! @abstract Do not call this function directly; use simd::fabs instead. */
1640static SIMD_CPPFUNC double __tg_fabs(double x) { return ::fabs(x); }
1641/*! @abstract Do not call this function directly; use simd::cbrt instead. */
1642static SIMD_CPPFUNC float __tg_cbrt(float x) { return ::cbrt(x); }
1643/*! @abstract Do not call this function directly; use simd::cbrt instead. */
1644static SIMD_CPPFUNC double __tg_cbrt(double x) { return ::cbrt(x); }
1645/*! @abstract Do not call this function directly; use simd::sqrt instead. */
1646static SIMD_CPPFUNC float __tg_sqrt(float x) { return ::sqrt(x); }
1647/*! @abstract Do not call this function directly; use simd::sqrt instead. */
1648static SIMD_CPPFUNC double __tg_sqrt(double x) { return ::sqrt(x); }
1649/*! @abstract Do not call this function directly; use simd::erf instead. */
1650static SIMD_CPPFUNC float __tg_erf(float x) { return ::erf(x); }
1651/*! @abstract Do not call this function directly; use simd::erf instead. */
1652static SIMD_CPPFUNC double __tg_erf(double x) { return ::erf(x); }
1653/*! @abstract Do not call this function directly; use simd::erfc instead. */
1654static SIMD_CPPFUNC float __tg_erfc(float x) { return ::erfc(x); }
1655/*! @abstract Do not call this function directly; use simd::erfc instead. */
1656static SIMD_CPPFUNC double __tg_erfc(double x) { return ::erfc(x); }
1657/*! @abstract Do not call this function directly; use simd::tgamma instead. */
1658static SIMD_CPPFUNC float __tg_tgamma(float x) { return ::tgamma(x); }
1659/*! @abstract Do not call this function directly; use simd::tgamma instead. */
1660static SIMD_CPPFUNC double __tg_tgamma(double x) { return ::tgamma(x); }
1661/*! @abstract Do not call this function directly; use simd::lgamma instead. */
1662static SIMD_CPPFUNC float __tg_lgamma(float x) { return ::lgamma(x); }
1663/*! @abstract Do not call this function directly; use simd::lgamma instead. */
1664static SIMD_CPPFUNC double __tg_lgamma(double x) { return ::lgamma(x); }
1665/*! @abstract Do not call this function directly; use simd::ceil instead. */
1666static SIMD_CPPFUNC float __tg_ceil(float x) { return ::ceil(x); }
1667/*! @abstract Do not call this function directly; use simd::ceil instead. */
1668static SIMD_CPPFUNC double __tg_ceil(double x) { return ::ceil(x); }
1669/*! @abstract Do not call this function directly; use simd::floor instead. */
1670static SIMD_CPPFUNC float __tg_floor(float x) { return ::floor(x); }
1671/*! @abstract Do not call this function directly; use simd::floor instead. */
1672static SIMD_CPPFUNC double __tg_floor(double x) { return ::floor(x); }
1673/*! @abstract Do not call this function directly; use simd::rint instead. */
1674static SIMD_CPPFUNC float __tg_rint(float x) { return ::rint(x); }
1675/*! @abstract Do not call this function directly; use simd::rint instead. */
1676static SIMD_CPPFUNC double __tg_rint(double x) { return ::rint(x); }
1677/*! @abstract Do not call this function directly; use simd::round instead. */
1678static SIMD_CPPFUNC float __tg_round(float x) { return ::round(x); }
1679/*! @abstract Do not call this function directly; use simd::round instead. */
1680static SIMD_CPPFUNC double __tg_round(double x) { return ::round(x); }
1681/*! @abstract Do not call this function directly; use simd::trunc instead. */
1682static SIMD_CPPFUNC float __tg_trunc(float x) { return ::trunc(x); }
1683/*! @abstract Do not call this function directly; use simd::trunc instead. */
1684static SIMD_CPPFUNC double __tg_trunc(double x) { return ::trunc(x); }
1685/*! @abstract Do not call this function directly; use simd::isfinite
1686 * instead. */
1687static SIMD_CPPFUNC float __tg_isfinite(float x) { return ::isfinite(x); }
1688/*! @abstract Do not call this function directly; use simd::isfinite
1689 * instead. */
1690static SIMD_CPPFUNC double __tg_isfinite(double x) { return ::isfinite(x); }
1691/*! @abstract Do not call this function directly; use simd::isinf instead. */
1692static SIMD_CPPFUNC float __tg_isinf(float x) { return ::isinf(x); }
1693/*! @abstract Do not call this function directly; use simd::isinf instead. */
1694static SIMD_CPPFUNC double __tg_isinf(double x) { return ::isinf(x); }
1695/*! @abstract Do not call this function directly; use simd::isnan instead. */
1696static SIMD_CPPFUNC float __tg_isnan(float x) { return ::isnan(x); }
1697/*! @abstract Do not call this function directly; use simd::isnan instead. */
1698static SIMD_CPPFUNC double __tg_isnan(double x) { return ::isnan(x); }
1699/*! @abstract Do not call this function directly; use simd::isnormal
1700 * instead. */
1701static SIMD_CPPFUNC float __tg_isnormal(float x) { return ::isnormal(x); }
1702/*! @abstract Do not call this function directly; use simd::isnormal
1703 * instead. */
1704static SIMD_CPPFUNC double __tg_isnormal(double x) { return ::isnormal(x); }
1705/*! @abstract Do not call this function directly; use simd::atan2 instead. */
1706static SIMD_CPPFUNC float __tg_atan2(float x, float y) { return ::atan2(x, y); }
1707/*! @abstract Do not call this function directly; use simd::atan2 instead. */
1708static SIMD_CPPFUNC double __tg_atan2(double x, double y) { return ::atan2(x, y); }
1709/*! @abstract Do not call this function directly; use simd::hypot instead. */
1710static SIMD_CPPFUNC float __tg_hypot(float x, float y) { return ::hypot(x, y); }
1711/*! @abstract Do not call this function directly; use simd::hypot instead. */
1712static SIMD_CPPFUNC double __tg_hypot(double x, double y) { return ::hypot(x, y); }
1713/*! @abstract Do not call this function directly; use simd::pow instead. */
1714static SIMD_CPPFUNC float __tg_pow(float x, float y) { return ::pow(x, y); }
1715/*! @abstract Do not call this function directly; use simd::pow instead. */
1716static SIMD_CPPFUNC double __tg_pow(double x, double y) { return ::pow(x, y); }
1717/*! @abstract Do not call this function directly; use simd::fmod instead. */
1718static SIMD_CPPFUNC float __tg_fmod(float x, float y) { return ::fmod(x, y); }
1719/*! @abstract Do not call this function directly; use simd::fmod instead. */
1720static SIMD_CPPFUNC double __tg_fmod(double x, double y) { return ::fmod(x, y); }
1721/*! @abstract Do not call this function directly; use simd::remainder
1722 * instead. */
1723static SIMD_CPPFUNC float __tg_remainder(float x, float y) { return ::remainder(x, y); }
1724/*! @abstract Do not call this function directly; use simd::remainder
1725 * instead. */
1726static SIMD_CPPFUNC double __tg_remainder(double x, double y) { return ::remainder(x, y); }
1727/*! @abstract Do not call this function directly; use simd::copysign
1728 * instead. */
1729static SIMD_CPPFUNC float __tg_copysign(float x, float y) { return ::copysign(x, y); }
1730/*! @abstract Do not call this function directly; use simd::copysign
1731 * instead. */
1732static SIMD_CPPFUNC double __tg_copysign(double x, double y) { return ::copysign(x, y); }
1733/*! @abstract Do not call this function directly; use simd::nextafter
1734 * instead. */
1735static SIMD_CPPFUNC float __tg_nextafter(float x, float y) { return ::nextafter(x, y); }
1736/*! @abstract Do not call this function directly; use simd::nextafter
1737 * instead. */
1738static SIMD_CPPFUNC double __tg_nextafter(double x, double y) { return ::nextafter(x, y); }
1739/*! @abstract Do not call this function directly; use simd::fdim instead. */
1740static SIMD_CPPFUNC float __tg_fdim(float x, float y) { return ::fdim(x, y); }
1741/*! @abstract Do not call this function directly; use simd::fdim instead. */
1742static SIMD_CPPFUNC double __tg_fdim(double x, double y) { return ::fdim(x, y); }
1743/*! @abstract Do not call this function directly; use simd::fmax instead. */
1744static SIMD_CPPFUNC float __tg_fmax(float x, float y) { return ::fmax(x, y); }
1745/*! @abstract Do not call this function directly; use simd::fmax instead. */
1746static SIMD_CPPFUNC double __tg_fmax(double x, double y) { return ::fmax(x, y); }
1747/*! @abstract Do not call this function directly; use simd::fmin instead. */
1748static SIMD_CPPFUNC float __tg_fmin(float x, float y) { return ::fmin(x, y); }
1749/*! @abstract Do not call this function directly; use simd::fmin instead. */
1750static SIMD_CPPFUNC double __tg_fmin(double x, double y) { return ::fmin(x, y); }
1751/*! @abstract Do not call this function directly; use simd::fma instead. */
1752static SIMD_CPPFUNC float __tg_fma(float x, float y, float z) { return ::fma(x, y, z); }
1753/*! @abstract Do not call this function directly; use simd::fma instead. */
1754static SIMD_CPPFUNC double __tg_fma(double x, double y, double z) { return ::fma(x, y, z); }
1755
1756namespace simd {
1757/*! @abstract Generalizes the <cmath> function acos to operate on vectors of
1758 * floats and doubles. */
1759 template <typename fptypeN>
1760 static SIMD_CPPFUNC fptypeN acos(fptypeN x) { return ::__tg_acos(x); }
1761
1762/*! @abstract Generalizes the <cmath> function asin to operate on vectors of
1763 * floats and doubles. */
1764 template <typename fptypeN>
1765 static SIMD_CPPFUNC fptypeN asin(fptypeN x) { return ::__tg_asin(x); }
1766
1767/*! @abstract Generalizes the <cmath> function atan to operate on vectors of
1768 * floats and doubles. */
1769 template <typename fptypeN>
1770 static SIMD_CPPFUNC fptypeN atan(fptypeN x) { return ::__tg_atan(x); }
1771
1772/*! @abstract Generalizes the <cmath> function cos to operate on vectors of
1773 * floats and doubles. */
1774 template <typename fptypeN>
1775 static SIMD_CPPFUNC fptypeN cos(fptypeN x) { return ::__tg_cos(x); }
1776
1777/*! @abstract Generalizes the <cmath> function sin to operate on vectors of
1778 * floats and doubles. */
1779 template <typename fptypeN>
1780 static SIMD_CPPFUNC fptypeN sin(fptypeN x) { return ::__tg_sin(x); }
1781
1782/*! @abstract Generalizes the <cmath> function tan to operate on vectors of
1783 * floats and doubles. */
1784 template <typename fptypeN>
1785 static SIMD_CPPFUNC fptypeN tan(fptypeN x) { return ::__tg_tan(x); }
1786
1787#if SIMD_LIBRARY_VERSION >= 1
1788/*! @abstract Generalizes the <cmath> function cospi to operate on vectors
1789 * of floats and doubles. */
1790 template <typename fptypeN>
1791 static SIMD_CPPFUNC fptypeN cospi(fptypeN x) { return ::__tg_cospi(x); }
1792#endif
1793
1794#if SIMD_LIBRARY_VERSION >= 1
1795/*! @abstract Generalizes the <cmath> function sinpi to operate on vectors
1796 * of floats and doubles. */
1797 template <typename fptypeN>
1798 static SIMD_CPPFUNC fptypeN sinpi(fptypeN x) { return ::__tg_sinpi(x); }
1799#endif
1800
1801#if SIMD_LIBRARY_VERSION >= 1
1802/*! @abstract Generalizes the <cmath> function tanpi to operate on vectors
1803 * of floats and doubles. */
1804 template <typename fptypeN>
1805 static SIMD_CPPFUNC fptypeN tanpi(fptypeN x) { return ::__tg_tanpi(x); }
1806#endif
1807
1808/*! @abstract Generalizes the <cmath> function acosh to operate on vectors
1809 * of floats and doubles. */
1810 template <typename fptypeN>
1811 static SIMD_CPPFUNC fptypeN acosh(fptypeN x) { return ::__tg_acosh(x); }
1812
1813/*! @abstract Generalizes the <cmath> function asinh to operate on vectors
1814 * of floats and doubles. */
1815 template <typename fptypeN>
1816 static SIMD_CPPFUNC fptypeN asinh(fptypeN x) { return ::__tg_asinh(x); }
1817
1818/*! @abstract Generalizes the <cmath> function atanh to operate on vectors
1819 * of floats and doubles. */
1820 template <typename fptypeN>
1821 static SIMD_CPPFUNC fptypeN atanh(fptypeN x) { return ::__tg_atanh(x); }
1822
1823/*! @abstract Generalizes the <cmath> function cosh to operate on vectors of
1824 * floats and doubles. */
1825 template <typename fptypeN>
1826 static SIMD_CPPFUNC fptypeN cosh(fptypeN x) { return ::__tg_cosh(x); }
1827
1828/*! @abstract Generalizes the <cmath> function sinh to operate on vectors of
1829 * floats and doubles. */
1830 template <typename fptypeN>
1831 static SIMD_CPPFUNC fptypeN sinh(fptypeN x) { return ::__tg_sinh(x); }
1832
1833/*! @abstract Generalizes the <cmath> function tanh to operate on vectors of
1834 * floats and doubles. */
1835 template <typename fptypeN>
1836 static SIMD_CPPFUNC fptypeN tanh(fptypeN x) { return ::__tg_tanh(x); }
1837
1838/*! @abstract Generalizes the <cmath> function exp to operate on vectors of
1839 * floats and doubles. */
1840 template <typename fptypeN>
1841 static SIMD_CPPFUNC fptypeN exp(fptypeN x) { return ::__tg_exp(x); }
1842
1843/*! @abstract Generalizes the <cmath> function exp2 to operate on vectors of
1844 * floats and doubles. */
1845 template <typename fptypeN>
1846 static SIMD_CPPFUNC fptypeN exp2(fptypeN x) { return ::__tg_exp2(x); }
1847
1848#if SIMD_LIBRARY_VERSION >= 1
1849/*! @abstract Generalizes the <cmath> function exp10 to operate on vectors
1850 * of floats and doubles. */
1851 template <typename fptypeN>
1852 static SIMD_CPPFUNC fptypeN exp10(fptypeN x) { return ::__tg_exp10(x); }
1853#endif
1854
1855/*! @abstract Generalizes the <cmath> function expm1 to operate on vectors
1856 * of floats and doubles. */
1857 template <typename fptypeN>
1858 static SIMD_CPPFUNC fptypeN expm1(fptypeN x) { return ::__tg_expm1(x); }
1859
1860/*! @abstract Generalizes the <cmath> function log to operate on vectors of
1861 * floats and doubles. */
1862 template <typename fptypeN>
1863 static SIMD_CPPFUNC fptypeN log(fptypeN x) { return ::__tg_log(x); }
1864
1865/*! @abstract Generalizes the <cmath> function log2 to operate on vectors of
1866 * floats and doubles. */
1867 template <typename fptypeN>
1868 static SIMD_CPPFUNC fptypeN log2(fptypeN x) { return ::__tg_log2(x); }
1869
1870/*! @abstract Generalizes the <cmath> function log10 to operate on vectors
1871 * of floats and doubles. */
1872 template <typename fptypeN>
1873 static SIMD_CPPFUNC fptypeN log10(fptypeN x) { return ::__tg_log10(x); }
1874
1875/*! @abstract Generalizes the <cmath> function log1p to operate on vectors
1876 * of floats and doubles. */
1877 template <typename fptypeN>
1878 static SIMD_CPPFUNC fptypeN log1p(fptypeN x) { return ::__tg_log1p(x); }
1879
1880/*! @abstract Generalizes the <cmath> function fabs to operate on vectors of
1881 * floats and doubles. */
1882 template <typename fptypeN>
1883 static SIMD_CPPFUNC fptypeN fabs(fptypeN x) { return ::__tg_fabs(x); }
1884
1885/*! @abstract Generalizes the <cmath> function cbrt to operate on vectors of
1886 * floats and doubles. */
1887 template <typename fptypeN>
1888 static SIMD_CPPFUNC fptypeN cbrt(fptypeN x) { return ::__tg_cbrt(x); }
1889
1890/*! @abstract Generalizes the <cmath> function sqrt to operate on vectors of
1891 * floats and doubles. */
1892 template <typename fptypeN>
1893 static SIMD_CPPFUNC fptypeN sqrt(fptypeN x) { return ::__tg_sqrt(x); }
1894
1895/*! @abstract Generalizes the <cmath> function erf to operate on vectors of
1896 * floats and doubles. */
1897 template <typename fptypeN>
1898 static SIMD_CPPFUNC fptypeN erf(fptypeN x) { return ::__tg_erf(x); }
1899
1900/*! @abstract Generalizes the <cmath> function erfc to operate on vectors of
1901 * floats and doubles. */
1902 template <typename fptypeN>
1903 static SIMD_CPPFUNC fptypeN erfc(fptypeN x) { return ::__tg_erfc(x); }
1904
1905/*! @abstract Generalizes the <cmath> function tgamma to operate on vectors
1906 * of floats and doubles. */
1907 template <typename fptypeN>
1908 static SIMD_CPPFUNC fptypeN tgamma(fptypeN x) { return ::__tg_tgamma(x); }
1909
1910/*! @abstract Generalizes the <cmath> function lgamma to operate on vectors
1911 * of floats and doubles. */
1912 template <typename fptypeN>
1913 static SIMD_CPPFUNC fptypeN lgamma(fptypeN x) { return ::__tg_lgamma(x); }
1914
1915/*! @abstract Generalizes the <cmath> function ceil to operate on vectors of
1916 * floats and doubles. */
1917 template <typename fptypeN>
1918 static SIMD_CPPFUNC fptypeN ceil(fptypeN x) { return ::__tg_ceil(x); }
1919
1920/*! @abstract Generalizes the <cmath> function floor to operate on vectors
1921 * of floats and doubles. */
1922 template <typename fptypeN>
1923 static SIMD_CPPFUNC fptypeN floor(fptypeN x) { return ::__tg_floor(x); }
1924
1925/*! @abstract Generalizes the <cmath> function rint to operate on vectors of
1926 * floats and doubles. */
1927 template <typename fptypeN>
1928 static SIMD_CPPFUNC fptypeN rint(fptypeN x) { return ::__tg_rint(x); }
1929
1930/*! @abstract Generalizes the <cmath> function round to operate on vectors
1931 * of floats and doubles. */
1932 template <typename fptypeN>
1933 static SIMD_CPPFUNC fptypeN round(fptypeN x) { return ::__tg_round(x); }
1934
1935/*! @abstract Generalizes the <cmath> function trunc to operate on vectors
1936 * of floats and doubles. */
1937 template <typename fptypeN>
1938 static SIMD_CPPFUNC fptypeN trunc(fptypeN x) { return ::__tg_trunc(x); }
1939
1940/*! @abstract Generalizes the <cmath> function isfinite to operate on
1941 * vectors of floats and doubles. */
1942 template <typename fptypeN>
1943 static SIMD_CPPFUNC
1944 typename std::enable_if<std::is_floating_point<typename traits<fptypeN>::scalar_t>::value, typename traits<fptypeN>::mask_t>::type
1945 isfinite(fptypeN x) { return ::__tg_isfinite(x); }
1946
1947/*! @abstract Generalizes the <cmath> function isinf to operate on vectors
1948 * of floats and doubles. */
1949 template <typename fptypeN>
1950 static SIMD_CPPFUNC
1951 typename std::enable_if<std::is_floating_point<typename traits<fptypeN>::scalar_t>::value, typename traits<fptypeN>::mask_t>::type
1952 isinf(fptypeN x) { return ::__tg_isinf(x); }
1953
1954/*! @abstract Generalizes the <cmath> function isnan to operate on vectors
1955 * of floats and doubles. */
1956 template <typename fptypeN>
1957 static SIMD_CPPFUNC
1958 typename std::enable_if<std::is_floating_point<typename traits<fptypeN>::scalar_t>::value, typename traits<fptypeN>::mask_t>::type
1959 isnan(fptypeN x) { return ::__tg_isnan(x); }
1960
1961/*! @abstract Generalizes the <cmath> function isnormal to operate on
1962 * vectors of floats and doubles. */
1963 template <typename fptypeN>
1964 static SIMD_CPPFUNC
1965 typename std::enable_if<std::is_floating_point<typename traits<fptypeN>::scalar_t>::value, typename traits<fptypeN>::mask_t>::type
1966 isnormal(fptypeN x) { return ::__tg_isnormal(x); }
1967
1968/*! @abstract Generalizes the <cmath> function atan2 to operate on vectors
1969 * of floats and doubles. */
1970 template <typename fptypeN>
1971 static SIMD_CPPFUNC fptypeN atan2(fptypeN y, fptypeN x) { return ::__tg_atan2(y, x); }
1972
1973/*! @abstract Generalizes the <cmath> function hypot to operate on vectors
1974 * of floats and doubles. */
1975 template <typename fptypeN>
1976 static SIMD_CPPFUNC fptypeN hypot(fptypeN x, fptypeN y) { return ::__tg_hypot(x, y); }
1977
1978/*! @abstract Generalizes the <cmath> function pow to operate on vectors of
1979 * floats and doubles. */
1980 template <typename fptypeN>
1981 static SIMD_CPPFUNC fptypeN pow(fptypeN x, fptypeN y) { return ::__tg_pow(x, y); }
1982
1983/*! @abstract Generalizes the <cmath> function fmod to operate on vectors of
1984 * floats and doubles. */
1985 template <typename fptypeN>
1986 static SIMD_CPPFUNC fptypeN fmod(fptypeN x, fptypeN y) { return ::__tg_fmod(x, y); }
1987
1988/*! @abstract Generalizes the <cmath> function remainder to operate on
1989 * vectors of floats and doubles. */
1990 template <typename fptypeN>
1991 static SIMD_CPPFUNC fptypeN remainder(fptypeN x, fptypeN y) { return ::__tg_remainder(x, y); }
1992
1993/*! @abstract Generalizes the <cmath> function copysign to operate on
1994 * vectors of floats and doubles. */
1995 template <typename fptypeN>
1996 static SIMD_CPPFUNC fptypeN copysign(fptypeN x, fptypeN y) { return ::__tg_copysign(x, y); }
1997
1998/*! @abstract Generalizes the <cmath> function nextafter to operate on
1999 * vectors of floats and doubles. */
2000 template <typename fptypeN>
2001 static SIMD_CPPFUNC fptypeN nextafter(fptypeN x, fptypeN y) { return ::__tg_nextafter(x, y); }
2002
2003/*! @abstract Generalizes the <cmath> function fdim to operate on vectors of
2004 * floats and doubles. */
2005 template <typename fptypeN>
2006 static SIMD_CPPFUNC fptypeN fdim(fptypeN x, fptypeN y) { return ::__tg_fdim(x, y); }
2007
2008/*! @abstract Generalizes the <cmath> function fmax to operate on vectors of
2009 * floats and doubles. */
2010 template <typename fptypeN>
2011 static SIMD_CPPFUNC fptypeN fmax(fptypeN x, fptypeN y) { return ::__tg_fmax(x, y); }
2012
2013/*! @abstract Generalizes the <cmath> function fmin to operate on vectors of
2014 * floats and doubles. */
2015 template <typename fptypeN>
2016 static SIMD_CPPFUNC fptypeN fmin(fptypeN x, fptypeN y) { return ::__tg_fmin(x, y); }
2017
2018/*! @abstract Generalizes the <cmath> function fma to operate on vectors of
2019 * floats and doubles. */
2020 template <typename fptypeN>
2021 static SIMD_CPPFUNC fptypeN fma(fptypeN x, fptypeN y, fptypeN z) { return ::__tg_fma(x, y, z); }
2022
2023/*! @abstract Computes x*y + z by the most efficient means available; either
2024 * a fused multiply add or separate multiply and add. */
2025 template <typename fptypeN>
2026 static SIMD_CPPFUNC fptypeN muladd(fptypeN x, fptypeN y, fptypeN z) { return ::simd_muladd(x, y, z); }
2027};
2028
2029extern "C" {
2030#else
2031#include <tgmath.h>
2032/* C and Objective-C, we need some infrastructure to piggyback on tgmath.h */
2033static SIMD_OVERLOAD simd_float2 __tg_promote(simd_float2);
2034static SIMD_OVERLOAD simd_float3 __tg_promote(simd_float3);
2035static SIMD_OVERLOAD simd_float4 __tg_promote(simd_float4);
2036static SIMD_OVERLOAD simd_float8 __tg_promote(simd_float8);
2037static SIMD_OVERLOAD simd_float16 __tg_promote(simd_float16);
2038static SIMD_OVERLOAD simd_double2 __tg_promote(simd_double2);
2039static SIMD_OVERLOAD simd_double3 __tg_promote(simd_double3);
2040static SIMD_OVERLOAD simd_double4 __tg_promote(simd_double4);
2041static SIMD_OVERLOAD simd_double8 __tg_promote(simd_double8);
2042
2043/* Apple extensions to <math.h>, added in macOS 10.9 and iOS 7.0 */
2044#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9 || \
2045 __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0 || \
2046 __DRIVERKIT_VERSION_MIN_REQUIRED >= __DRIVERKIT_19_0
2047static inline SIMD_CFUNC float __tg_cospi(float x) { return __cospif(x); }
2048static inline SIMD_CFUNC double __tg_cospi(double x) { return __cospi(x); }
2049#undef cospi
2050/*! @abstract `cospi(x)` computes `cos(pi * x)` without intermediate rounding.
2051 *
2052 * @discussion Both faster and more accurate than multiplying by `pi` and then
2053 * calling `cos`. Defined for `float` and `double` as well as vectors of
2054 * floats and doubles as provided by `<simd/simd.h>`. */
2055#define cospi(__x) __tg_cospi(__tg_promote1((__x))(__x))
2056
2057static inline SIMD_CFUNC float __tg_sinpi(float x) { return __sinpif(x); }
2058static inline SIMD_CFUNC double __tg_sinpi(double x) { return __sinpi(x); }
2059#undef sinpi
2060/*! @abstract `sinpi(x)` computes `sin(pi * x)` without intermediate rounding.
2061 *
2062 * @discussion Both faster and more accurate than multiplying by `pi` and then
2063 * calling `sin`. Defined for `float` and `double` as well as vectors
2064 * of floats and doubles as provided by `<simd/simd.h>`. */
2065#define sinpi(__x) __tg_sinpi(__tg_promote1((__x))(__x))
2066
2067static inline SIMD_CFUNC float __tg_tanpi(float x) { return __tanpif(x); }
2068static inline SIMD_CFUNC double __tg_tanpi(double x) { return __tanpi(x); }
2069#undef tanpi
2070/*! @abstract `tanpi(x)` computes `tan(pi * x)` without intermediate rounding.
2071 *
2072 * @discussion Both faster and more accurate than multiplying by `pi` and then
2073 * calling `tan`. Defined for `float` and `double` as well as vectors of
2074 * floats and doubles as provided by `<simd/simd.h>`. */
2075#define tanpi(__x) __tg_tanpi(__tg_promote1((__x))(__x))
2076
2077static inline SIMD_CFUNC float __tg_exp10(float x) { return __exp10f(x); }
2078static inline SIMD_CFUNC double __tg_exp10(double x) { return __exp10(x); }
2079#undef exp10
2080/*! @abstract `exp10(x)` computes `10**x` more efficiently and accurately
2081 * than `pow(10, x)`.
2082 *
2083 * @discussion Defined for `float` and `double` as well as vectors of floats
2084 * and doubles as provided by `<simd/simd.h>`. */
2085#define exp10(__x) __tg_exp10(__tg_promote1((__x))(__x))
2086#endif
2087
2088#if (defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__)
2089static inline SIMD_CFUNC int __tg_isfinite(float x) { return __inline_isfinitef(x); }
2090static inline SIMD_CFUNC int __tg_isfinite(double x) { return __inline_isfinited(x); }
2091static inline SIMD_CFUNC int __tg_isfinite(long double x) { return __inline_isfinitel(x); }
2092#undef isfinite
2093/*! @abstract `__tg_isfinite(x)` determines if x is a finite value.
2094 *
2095 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2096 * and doubles as provided by `<simd/simd.h>`. */
2097#define isfinite(__x) __tg_isfinite(__tg_promote1((__x))(__x))
2098
2099static inline SIMD_CFUNC int __tg_isinf(float x) { return __inline_isinff(x); }
2100static inline SIMD_CFUNC int __tg_isinf(double x) { return __inline_isinfd(x); }
2101static inline SIMD_CFUNC int __tg_isinf(long double x) { return __inline_isinfl(x); }
2102#undef isinf
2103/*! @abstract `__tg_isinf(x)` determines if x is positive or negative infinity.
2104 *
2105 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2106 * and doubles as provided by `<simd/simd.h>`. */
2107#define isinf(__x) __tg_isinf(__tg_promote1((__x))(__x))
2108
2109static inline SIMD_CFUNC int __tg_isnan(float x) { return __inline_isnanf(x); }
2110static inline SIMD_CFUNC int __tg_isnan(double x) { return __inline_isnand(x); }
2111static inline SIMD_CFUNC int __tg_isnan(long double x) { return __inline_isnanl(x); }
2112#undef isnan
2113/*! @abstract `__tg_isnan(x)` determines if x is a not-a-number (NaN) value.
2114 *
2115 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2116 * and doubles as provided by `<simd/simd.h>`. */
2117#define isnan(__x) __tg_isnan(__tg_promote1((__x))(__x))
2118
2119static inline SIMD_CFUNC int __tg_isnormal(float x) { return __inline_isnormalf(x); }
2120static inline SIMD_CFUNC int __tg_isnormal(double x) { return __inline_isnormald(x); }
2121static inline SIMD_CFUNC int __tg_isnormal(long double x) { return __inline_isnormall(x); }
2122#undef isnormal
2123/*! @abstract `__tg_isnormal(x)` determines if x is a normal value.
2124 *
2125 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2126 * and doubles as provided by `<simd/simd.h>`. */
2127#define isnormal(__x) __tg_isnormal(__tg_promote1((__x))(__x))
2128
2129#else /* defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__ */
2130
2131static inline SIMD_CFUNC int __tg_isfinite(float x) { return __isfinitef(x); }
2132static inline SIMD_CFUNC int __tg_isfinite(double x) { return __isfinited(x); }
2133static inline SIMD_CFUNC int __tg_isfinite(long double x) { return __isfinitel(x); }
2134#undef isfinite
2135/*! @abstract `__tg_isfinite(x)` determines if x is a finite value.
2136 *
2137 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2138 * and doubles as provided by `<simd/simd.h>`. */
2139#define isfinite(__x) __tg_isfinite(__tg_promote1((__x))(__x))
2140
2141static inline SIMD_CFUNC int __tg_isinf(float x) { return __isinff(x); }
2142static inline SIMD_CFUNC int __tg_isinf(double x) { return __isinfd(x); }
2143static inline SIMD_CFUNC int __tg_isinf(long double x) { return __isinfl(x); }
2144#undef isinf
2145/*! @abstract `__tg_isinf(x)` determines if x is positive or negative infinity.
2146 *
2147 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2148 * and doubles as provided by `<simd/simd.h>`. */
2149#define isinf(__x) __tg_isinf(__tg_promote1((__x))(__x))
2150
2151static inline SIMD_CFUNC int __tg_isnan(float x) { return __isnanf(x); }
2152static inline SIMD_CFUNC int __tg_isnan(double x) { return __isnand(x); }
2153static inline SIMD_CFUNC int __tg_isnan(long double x) { return __isnanl(x); }
2154#undef isnan
2155/*! @abstract `__tg_isnan(x)` determines if x is a not-a-number (NaN) value.
2156 *
2157 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2158 * and doubles as provided by `<simd/simd.h>`. */
2159#define isnan(__x) __tg_isnan(__tg_promote1((__x))(__x))
2160
2161static inline SIMD_CFUNC int __tg_isnormal(float x) { return __isnormalf(x); }
2162static inline SIMD_CFUNC int __tg_isnormal(double x) { return __isnormald(x); }
2163static inline SIMD_CFUNC int __tg_isnormal(long double x) { return __isnormall(x); }
2164#undef isnormal
2165/*! @abstract `__tg_isnormal(x)` determines if x is a normal value.
2166 *
2167 * @discussion Defined for `float`, `double` and `long double` as well as vectors of floats
2168 * and doubles as provided by `<simd/simd.h>`. */
2169#define isnormal(__x) __tg_isnormal(__tg_promote1((__x))(__x))
2170#endif /* defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__ */
2171#endif /* !__cplusplus */
2172
2173#pragma mark - fabs implementation
2174static inline SIMD_CFUNC simd_float2 __tg_fabs(simd_float2 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2175static inline SIMD_CFUNC simd_float3 __tg_fabs(simd_float3 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2176static inline SIMD_CFUNC simd_float4 __tg_fabs(simd_float4 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2177static inline SIMD_CFUNC simd_float8 __tg_fabs(simd_float8 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2178static inline SIMD_CFUNC simd_float16 __tg_fabs(simd_float16 x) { return simd_bitselect(0.0, x, 0x7fffffff); }
2179static inline SIMD_CFUNC simd_double2 __tg_fabs(simd_double2 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
2180static inline SIMD_CFUNC simd_double3 __tg_fabs(simd_double3 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
2181static inline SIMD_CFUNC simd_double4 __tg_fabs(simd_double4 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
2182static inline SIMD_CFUNC simd_double8 __tg_fabs(simd_double8 x) { return simd_bitselect(0.0, x, 0x7fffffffffffffffL); }
2183
2184#pragma mark - isfinite implementation
2185static inline SIMD_CFUNC simd_int2 __tg_isfinite(simd_float2 x) { return x == x && __tg_fabs(x) != (simd_float2)INFINITY; }
2186static inline SIMD_CFUNC simd_int3 __tg_isfinite(simd_float3 x) { return x == x && __tg_fabs(x) != (simd_float3)INFINITY; }
2187static inline SIMD_CFUNC simd_int4 __tg_isfinite(simd_float4 x) { return x == x && __tg_fabs(x) != (simd_float4)INFINITY; }
2188static inline SIMD_CFUNC simd_int8 __tg_isfinite(simd_float8 x) { return x == x && __tg_fabs(x) != (simd_float8)INFINITY; }
2189static inline SIMD_CFUNC simd_int16 __tg_isfinite(simd_float16 x) { return x == x && __tg_fabs(x) != (simd_float16)INFINITY; }
2190static inline SIMD_CFUNC simd_long2 __tg_isfinite(simd_double2 x) { return x == x && __tg_fabs(x) != (simd_double2)INFINITY; }
2191static inline SIMD_CFUNC simd_long3 __tg_isfinite(simd_double3 x) { return x == x && __tg_fabs(x) != (simd_double3)INFINITY; }
2192static inline SIMD_CFUNC simd_long4 __tg_isfinite(simd_double4 x) { return x == x && __tg_fabs(x) != (simd_double4)INFINITY; }
2193static inline SIMD_CFUNC simd_long8 __tg_isfinite(simd_double8 x) { return x == x && __tg_fabs(x) != (simd_double8)INFINITY; }
2194
2195#pragma mark - isinf implementation
2196static inline SIMD_CFUNC simd_int2 __tg_isinf(simd_float2 x) { return __tg_fabs(x) == (simd_float2)INFINITY; }
2197static inline SIMD_CFUNC simd_int3 __tg_isinf(simd_float3 x) { return __tg_fabs(x) == (simd_float3)INFINITY; }
2198static inline SIMD_CFUNC simd_int4 __tg_isinf(simd_float4 x) { return __tg_fabs(x) == (simd_float4)INFINITY; }
2199static inline SIMD_CFUNC simd_int8 __tg_isinf(simd_float8 x) { return __tg_fabs(x) == (simd_float8)INFINITY; }
2200static inline SIMD_CFUNC simd_int16 __tg_isinf(simd_float16 x) { return __tg_fabs(x) == (simd_float16)INFINITY; }
2201static inline SIMD_CFUNC simd_long2 __tg_isinf(simd_double2 x) { return __tg_fabs(x) == (simd_double2)INFINITY; }
2202static inline SIMD_CFUNC simd_long3 __tg_isinf(simd_double3 x) { return __tg_fabs(x) == (simd_double3)INFINITY; }
2203static inline SIMD_CFUNC simd_long4 __tg_isinf(simd_double4 x) { return __tg_fabs(x) == (simd_double4)INFINITY; }
2204static inline SIMD_CFUNC simd_long8 __tg_isinf(simd_double8 x) { return __tg_fabs(x) == (simd_double8)INFINITY; }
2205
2206#pragma mark - isnan implementation
2207static inline SIMD_CFUNC simd_int2 __tg_isnan(simd_float2 x) { return x != x; }
2208static inline SIMD_CFUNC simd_int3 __tg_isnan(simd_float3 x) { return x != x; }
2209static inline SIMD_CFUNC simd_int4 __tg_isnan(simd_float4 x) { return x != x; }
2210static inline SIMD_CFUNC simd_int8 __tg_isnan(simd_float8 x) { return x != x; }
2211static inline SIMD_CFUNC simd_int16 __tg_isnan(simd_float16 x) { return x != x; }
2212static inline SIMD_CFUNC simd_long2 __tg_isnan(simd_double2 x) { return x != x; }
2213static inline SIMD_CFUNC simd_long3 __tg_isnan(simd_double3 x) { return x != x; }
2214static inline SIMD_CFUNC simd_long4 __tg_isnan(simd_double4 x) { return x != x; }
2215static inline SIMD_CFUNC simd_long8 __tg_isnan(simd_double8 x) { return x != x; }
2216
2217#pragma mark - isnormal implementation
2218static inline SIMD_CFUNC simd_int2 __tg_isnormal(simd_float2 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float2)__FLT_MIN__; }
2219static inline SIMD_CFUNC simd_int3 __tg_isnormal(simd_float3 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float3)__FLT_MIN__; }
2220static inline SIMD_CFUNC simd_int4 __tg_isnormal(simd_float4 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float4)__FLT_MIN__; }
2221static inline SIMD_CFUNC simd_int8 __tg_isnormal(simd_float8 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float8)__FLT_MIN__; }
2222static inline SIMD_CFUNC simd_int16 __tg_isnormal(simd_float16 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_float16)__FLT_MIN__; }
2223static inline SIMD_CFUNC simd_long2 __tg_isnormal(simd_double2 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_double2)__DBL_MIN__; }
2224static inline SIMD_CFUNC simd_long3 __tg_isnormal(simd_double3 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_double3)__DBL_MIN__; }
2225static inline SIMD_CFUNC simd_long4 __tg_isnormal(simd_double4 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_double4)__DBL_MIN__; }
2226static inline SIMD_CFUNC simd_long8 __tg_isnormal(simd_double8 x) { return __tg_isfinite(x) && __tg_fabs(x) >= (simd_double8)__DBL_MIN__; }
2227
2228#pragma mark - fmin, fmax implementation
2229static SIMD_CFUNC simd_float2 __tg_fmin(simd_float2 x, simd_float2 y) {
2230#if defined __SSE2__
2231 return simd_make_float2(__tg_fmin(simd_make_float4_undef(x), simd_make_float4_undef(y)));
2232#elif defined __arm64__
2233 return vminnm_f32(x, y);
2234#elif defined __arm__ && __FINITE_MATH_ONLY__
2235 return vmin_f32(x, y);
2236#else
2237 return simd_bitselect(y, x, (x <= y) | (y != y));
2238#endif
2239}
2240
2241static SIMD_CFUNC simd_float3 __tg_fmin(simd_float3 x, simd_float3 y) {
2242 return simd_make_float3(__tg_fmin(simd_make_float4_undef(x), simd_make_float4_undef(y)));
2243}
2244
2245static SIMD_CFUNC simd_float4 __tg_fmin(simd_float4 x, simd_float4 y) {
2246#if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__
2247 return _mm_range_ps(x, y, 4);
2248#elif defined __SSE2__ && __FINITE_MATH_ONLY__
2249 return _mm_min_ps(x, y);
2250#elif defined __SSE2__
2251 return simd_bitselect(_mm_min_ps(x, y), x, y != y);
2252#elif defined __arm64__
2253 return vminnmq_f32(x, y);
2254#elif defined __arm__ && __FINITE_MATH_ONLY__
2255 return vminq_f32(x, y);
2256#else
2257 return simd_bitselect(y, x, (x <= y) | (y != y));
2258#endif
2259}
2260
2261static SIMD_CFUNC simd_float8 __tg_fmin(simd_float8 x, simd_float8 y) {
2262#if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__
2263 return _mm256_range_ps(x, y, 4);
2264#elif defined __AVX__ && __FINITE_MATH_ONLY__
2265 return _mm256_min_ps(x, y);
2266#elif defined __AVX__
2267 return simd_bitselect(_mm256_min_ps(x, y), x, y != y);
2268#else
2269 return simd_make_float8(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi));
2270#endif
2271}
2272
2273static SIMD_CFUNC simd_float16 __tg_fmin(simd_float16 x, simd_float16 y) {
2274#if defined __x86_64__ && defined __AVX512DQ__ && !__FINITE_MATH_ONLY__
2275 return _mm512_range_ps(x, y, 4);
2276#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__
2277 return _mm512_min_ps(x, y);
2278#elif defined __x86_64__ && defined __AVX512F__
2279 return simd_bitselect(_mm512_min_ps(x, y), x, y != y);
2280#else
2281 return simd_make_float16(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi));
2282#endif
2283}
2284
2285static SIMD_CFUNC simd_double2 __tg_fmin(simd_double2 x, simd_double2 y) {
2286#if defined __AVX512DQ__ && defined __AVX512VL__
2287 return _mm_range_pd(x, y, 4);
2288#elif defined __SSE2__ && __FINITE_MATH_ONLY__
2289 return _mm_min_pd(x, y);
2290#elif defined __SSE2__
2291 return simd_bitselect(_mm_min_pd(x, y), x, y != y);
2292#elif defined __arm64__
2293 return vminnmq_f64(x, y);
2294#else
2295 return simd_bitselect(y, x, (x <= y) | (y != y));
2296#endif
2297}
2298
2299static SIMD_CFUNC simd_double3 __tg_fmin(simd_double3 x, simd_double3 y) {
2300 return simd_make_double3(__tg_fmin(simd_make_double4_undef(x), simd_make_double4_undef(y)));
2301}
2302
2303static SIMD_CFUNC simd_double4 __tg_fmin(simd_double4 x, simd_double4 y) {
2304#if defined __AVX512DQ__ && defined __AVX512VL__
2305 return _mm256_range_pd(x, y, 4);
2306#elif defined __AVX__ && __FINITE_MATH_ONLY__
2307 return _mm256_min_pd(x, y);
2308#elif defined __AVX__
2309 return simd_bitselect(_mm256_min_pd(x, y), x, y != y);
2310#else
2311 return simd_make_double4(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi));
2312#endif
2313}
2314
2315static SIMD_CFUNC simd_double8 __tg_fmin(simd_double8 x, simd_double8 y) {
2316#if defined __x86_64__ && defined __AVX512DQ__
2317 return _mm512_range_pd(x, y, 4);
2318#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__
2319 return _mm512_min_pd(x, y);
2320#elif defined __x86_64__ && defined __AVX512F__
2321 return simd_bitselect(_mm512_min_pd(x, y), x, y != y);
2322#else
2323 return simd_make_double8(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi));
2324#endif
2325}
2326
2327static SIMD_CFUNC simd_float2 __tg_fmax(simd_float2 x, simd_float2 y) {
2328#if defined __SSE2__
2329 return simd_make_float2(__tg_fmax(simd_make_float4_undef(x), simd_make_float4_undef(y)));
2330#elif defined __arm64__
2331 return vmaxnm_f32(x, y);
2332#elif defined __arm__ && __FINITE_MATH_ONLY__
2333 return vmax_f32(x, y);
2334#else
2335 return simd_bitselect(y, x, (x >= y) | (y != y));
2336#endif
2337}
2338
2339static SIMD_CFUNC simd_float3 __tg_fmax(simd_float3 x, simd_float3 y) {
2340 return simd_make_float3(__tg_fmax(simd_make_float4_undef(x), simd_make_float4_undef(y)));
2341}
2342
2343static SIMD_CFUNC simd_float4 __tg_fmax(simd_float4 x, simd_float4 y) {
2344#if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__
2345 return _mm_range_ps(x, y, 5);
2346#elif defined __SSE2__ && __FINITE_MATH_ONLY__
2347 return _mm_max_ps(x, y);
2348#elif defined __SSE2__
2349 return simd_bitselect(_mm_max_ps(x, y), x, y != y);
2350#elif defined __arm64__
2351 return vmaxnmq_f32(x, y);
2352#elif defined __arm__ && __FINITE_MATH_ONLY__
2353 return vmaxq_f32(x, y);
2354#else
2355 return simd_bitselect(y, x, (x >= y) | (y != y));
2356#endif
2357}
2358
2359static SIMD_CFUNC simd_float8 __tg_fmax(simd_float8 x, simd_float8 y) {
2360#if defined __AVX512DQ__ && defined __AVX512VL__ && !__FINITE_MATH_ONLY__
2361 return _mm256_range_ps(x, y, 5);
2362#elif defined __AVX__ && __FINITE_MATH_ONLY__
2363 return _mm256_max_ps(x, y);
2364#elif defined __AVX__
2365 return simd_bitselect(_mm256_max_ps(x, y), x, y != y);
2366#else
2367 return simd_make_float8(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi));
2368#endif
2369}
2370
2371static SIMD_CFUNC simd_float16 __tg_fmax(simd_float16 x, simd_float16 y) {
2372#if defined __x86_64__ && defined __AVX512DQ__ && !__FINITE_MATH_ONLY__
2373 return _mm512_range_ps(x, y, 5);
2374#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__
2375 return _mm512_max_ps(x, y);
2376#elif defined __x86_64__ && defined __AVX512F__
2377 return simd_bitselect(_mm512_max_ps(x, y), x, y != y);
2378#else
2379 return simd_make_float16(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi));
2380#endif
2381}
2382
2383static SIMD_CFUNC simd_double2 __tg_fmax(simd_double2 x, simd_double2 y) {
2384#if defined __AVX512DQ__ && defined __AVX512VL__
2385 return _mm_range_pd(x, y, 5);
2386#elif defined __SSE2__ && __FINITE_MATH_ONLY__
2387 return _mm_max_pd(x, y);
2388#elif defined __SSE2__
2389 return simd_bitselect(_mm_max_pd(x, y), x, y != y);
2390#elif defined __arm64__
2391 return vmaxnmq_f64(x, y);
2392#else
2393 return simd_bitselect(y, x, (x >= y) | (y != y));
2394#endif
2395}
2396
2397static SIMD_CFUNC simd_double3 __tg_fmax(simd_double3 x, simd_double3 y) {
2398 return simd_make_double3(__tg_fmax(simd_make_double4_undef(x), simd_make_double4_undef(y)));
2399}
2400
2401static SIMD_CFUNC simd_double4 __tg_fmax(simd_double4 x, simd_double4 y) {
2402#if defined __AVX512DQ__ && defined __AVX512VL__
2403 return _mm256_range_pd(x, y, 5);
2404#elif defined __AVX__ && __FINITE_MATH_ONLY__
2405 return _mm256_max_pd(x, y);
2406#elif defined __AVX__
2407 return simd_bitselect(_mm256_max_pd(x, y), x, y != y);
2408#else
2409 return simd_make_double4(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi));
2410#endif
2411}
2412
2413static SIMD_CFUNC simd_double8 __tg_fmax(simd_double8 x, simd_double8 y) {
2414#if defined __x86_64__ && defined __AVX512DQ__
2415 return _mm512_range_pd(x, y, 5);
2416#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__
2417 return _mm512_max_pd(x, y);
2418#elif defined __x86_64__ && defined __AVX512F__
2419 return simd_bitselect(_mm512_max_pd(x, y), x, y != y);
2420#else
2421 return simd_make_double8(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi));
2422#endif
2423}
2424
2425#pragma mark - copysign implementation
2426static inline SIMD_CFUNC simd_float2 __tg_copysign(simd_float2 x, simd_float2 y) { return simd_bitselect(y, x, 0x7fffffff); }
2427static inline SIMD_CFUNC simd_float3 __tg_copysign(simd_float3 x, simd_float3 y) { return simd_bitselect(y, x, 0x7fffffff); }
2428static inline SIMD_CFUNC simd_float4 __tg_copysign(simd_float4 x, simd_float4 y) { return simd_bitselect(y, x, 0x7fffffff); }
2429static inline SIMD_CFUNC simd_float8 __tg_copysign(simd_float8 x, simd_float8 y) { return simd_bitselect(y, x, 0x7fffffff); }
2430static inline SIMD_CFUNC simd_float16 __tg_copysign(simd_float16 x, simd_float16 y) { return simd_bitselect(y, x, 0x7fffffff); }
2431static inline SIMD_CFUNC simd_double2 __tg_copysign(simd_double2 x, simd_double2 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); }
2432static inline SIMD_CFUNC simd_double3 __tg_copysign(simd_double3 x, simd_double3 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); }
2433static inline SIMD_CFUNC simd_double4 __tg_copysign(simd_double4 x, simd_double4 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); }
2434static inline SIMD_CFUNC simd_double8 __tg_copysign(simd_double8 x, simd_double8 y) { return simd_bitselect(y, x, 0x7fffffffffffffffL); }
2435
2436#pragma mark - sqrt implementation
2437static SIMD_CFUNC simd_float2 __tg_sqrt(simd_float2 x) {
2438#if defined __SSE2__
2439 return simd_make_float2(__tg_sqrt(simd_make_float4_undef(x)));
2440#elif defined __arm64__
2441 return vsqrt_f32(x);
2442#else
2443 return simd_make_float2(sqrt(x.x), sqrt(x.y));
2444#endif
2445}
2446
2447static SIMD_CFUNC simd_float3 __tg_sqrt(simd_float3 x) {
2448 return simd_make_float3(__tg_sqrt(simd_make_float4_undef(x)));
2449}
2450
2451static SIMD_CFUNC simd_float4 __tg_sqrt(simd_float4 x) {
2452#if defined __SSE2__
2453 return _mm_sqrt_ps(x);
2454#elif defined __arm64__
2455 return vsqrtq_f32(x);
2456#else
2457 return simd_make_float4(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2458#endif
2459}
2460
2461static SIMD_CFUNC simd_float8 __tg_sqrt(simd_float8 x) {
2462#if defined __AVX__
2463 return _mm256_sqrt_ps(x);
2464#else
2465 return simd_make_float8(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2466#endif
2467}
2468
2469static SIMD_CFUNC simd_float16 __tg_sqrt(simd_float16 x) {
2470#if defined __x86_64__ && defined __AVX512F__
2471 return _mm512_sqrt_ps(x);
2472#else
2473 return simd_make_float16(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2474#endif
2475}
2476
2477static SIMD_CFUNC simd_double2 __tg_sqrt(simd_double2 x) {
2478#if defined __SSE2__
2479 return _mm_sqrt_pd(x);
2480#elif defined __arm64__
2481 return vsqrtq_f64(x);
2482#else
2483 return simd_make_double2(sqrt(x.x), sqrt(x.y));
2484#endif
2485}
2486
2487static SIMD_CFUNC simd_double3 __tg_sqrt(simd_double3 x) {
2488 return simd_make_double3(__tg_sqrt(simd_make_double4_undef(x)));
2489}
2490
2491static SIMD_CFUNC simd_double4 __tg_sqrt(simd_double4 x) {
2492#if defined __AVX__
2493 return _mm256_sqrt_pd(x);
2494#else
2495 return simd_make_double4(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2496#endif
2497}
2498
2499static SIMD_CFUNC simd_double8 __tg_sqrt(simd_double8 x) {
2500#if defined __x86_64__ && defined __AVX512F__
2501 return _mm512_sqrt_pd(x);
2502#else
2503 return simd_make_double8(__tg_sqrt(x.lo), __tg_sqrt(x.hi));
2504#endif
2505}
2506
2507#pragma mark - ceil, floor, rint, trunc implementation
2508static SIMD_CFUNC simd_float2 __tg_ceil(simd_float2 x) {
2509#if defined __arm64__
2510 return vrndp_f32(x);
2511#else
2512 return simd_make_float2(__tg_ceil(simd_make_float4_undef(x)));
2513#endif
2514}
2515
2516static SIMD_CFUNC simd_float3 __tg_ceil(simd_float3 x) {
2517 return simd_make_float3(__tg_ceil(simd_make_float4_undef(x)));
2518}
2519
2520#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2521extern simd_float4 _simd_ceil_f4(simd_float4 x);
2522#endif
2523
2524static SIMD_CFUNC simd_float4 __tg_ceil(simd_float4 x) {
2525#if defined __SSE4_1__
2526 return _mm_round_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2527#elif defined __arm64__
2528 return vrndpq_f32(x);
2529#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2530 return _simd_ceil_f4(x);
2531#else
2532 simd_float4 truncated = __tg_trunc(x);
2533 simd_float4 adjust = simd_bitselect((simd_float4)0, 1, truncated < x);
2534 return __tg_copysign(truncated + adjust, x);
2535#endif
2536}
2537
2538static SIMD_CFUNC simd_float8 __tg_ceil(simd_float8 x) {
2539#if defined __AVX__
2540 return _mm256_round_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2541#else
2542 return simd_make_float8(__tg_ceil(x.lo), __tg_ceil(x.hi));
2543#endif
2544}
2545
2546static SIMD_CFUNC simd_float16 __tg_ceil(simd_float16 x) {
2547#if defined __x86_64__ && defined __AVX512F__
2548 return _mm512_roundscale_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2549#else
2550 return simd_make_float16(__tg_ceil(x.lo), __tg_ceil(x.hi));
2551#endif
2552}
2553
2554#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2555extern simd_double2 _simd_ceil_d2(simd_double2 x);
2556#endif
2557
2558static SIMD_CFUNC simd_double2 __tg_ceil(simd_double2 x) {
2559#if defined __SSE4_1__
2560 return _mm_round_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2561#elif defined __arm64__
2562 return vrndpq_f64(x);
2563#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2564 return _simd_ceil_d2(x);
2565#else
2566 simd_double2 truncated = __tg_trunc(x);
2567 simd_double2 adjust = simd_bitselect((simd_double2)0, 1, truncated < x);
2568 return __tg_copysign(truncated + adjust, x);
2569#endif
2570}
2571
2572static SIMD_CFUNC simd_double3 __tg_ceil(simd_double3 x) {
2573 return simd_make_double3(__tg_ceil(simd_make_double4_undef(x)));
2574}
2575
2576static SIMD_CFUNC simd_double4 __tg_ceil(simd_double4 x) {
2577#if defined __AVX__
2578 return _mm256_round_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2579#else
2580 return simd_make_double4(__tg_ceil(x.lo), __tg_ceil(x.hi));
2581#endif
2582}
2583
2584static SIMD_CFUNC simd_double8 __tg_ceil(simd_double8 x) {
2585#if defined __x86_64__ && defined __AVX512F__
2586 return _mm512_roundscale_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC);
2587#else
2588 return simd_make_double8(__tg_ceil(x.lo), __tg_ceil(x.hi));
2589#endif
2590}
2591
2592static SIMD_CFUNC simd_float2 __tg_floor(simd_float2 x) {
2593#if defined __arm64__
2594 return vrndm_f32(x);
2595#else
2596 return simd_make_float2(__tg_floor(simd_make_float4_undef(x)));
2597#endif
2598}
2599
2600static SIMD_CFUNC simd_float3 __tg_floor(simd_float3 x) {
2601 return simd_make_float3(__tg_floor(simd_make_float4_undef(x)));
2602}
2603
2604#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2605extern simd_float4 _simd_floor_f4(simd_float4 x);
2606#endif
2607
2608static SIMD_CFUNC simd_float4 __tg_floor(simd_float4 x) {
2609#if defined __SSE4_1__
2610 return _mm_round_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2611#elif defined __arm64__
2612 return vrndmq_f32(x);
2613#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2614 return _simd_floor_f4(x);
2615#else
2616 simd_float4 truncated = __tg_trunc(x);
2617 simd_float4 adjust = simd_bitselect((simd_float4)0, 1, truncated > x);
2618 return truncated - adjust;
2619#endif
2620}
2621
2622static SIMD_CFUNC simd_float8 __tg_floor(simd_float8 x) {
2623#if defined __AVX__
2624 return _mm256_round_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2625#else
2626 return simd_make_float8(__tg_floor(x.lo), __tg_floor(x.hi));
2627#endif
2628}
2629
2630static SIMD_CFUNC simd_float16 __tg_floor(simd_float16 x) {
2631#if defined __x86_64__ && defined __AVX512F__
2632 return _mm512_roundscale_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2633#else
2634 return simd_make_float16(__tg_floor(x.lo), __tg_floor(x.hi));
2635#endif
2636}
2637
2638#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2639extern simd_double2 _simd_floor_d2(simd_double2 x);
2640#endif
2641
2642static SIMD_CFUNC simd_double2 __tg_floor(simd_double2 x) {
2643#if defined __SSE4_1__
2644 return _mm_round_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2645#elif defined __arm64__
2646 return vrndmq_f64(x);
2647#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2648 return _simd_floor_d2(x);
2649#else
2650 simd_double2 truncated = __tg_trunc(x);
2651 simd_double2 adjust = simd_bitselect((simd_double2)0, 1, truncated > x);
2652 return truncated - adjust;
2653#endif
2654}
2655
2656static SIMD_CFUNC simd_double3 __tg_floor(simd_double3 x) {
2657 return simd_make_double3(__tg_floor(simd_make_double4_undef(x)));
2658}
2659
2660static SIMD_CFUNC simd_double4 __tg_floor(simd_double4 x) {
2661#if defined __AVX__
2662 return _mm256_round_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2663#else
2664 return simd_make_double4(__tg_floor(x.lo), __tg_floor(x.hi));
2665#endif
2666}
2667
2668static SIMD_CFUNC simd_double8 __tg_floor(simd_double8 x) {
2669#if defined __x86_64__ && defined __AVX512F__
2670 return _mm512_roundscale_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC);
2671#else
2672 return simd_make_double8(__tg_floor(x.lo), __tg_floor(x.hi));
2673#endif
2674}
2675
2676static SIMD_CFUNC simd_float2 __tg_rint(simd_float2 x) {
2677#if defined __arm64__
2678 return vrndx_f32(x);
2679#else
2680 return simd_make_float2(__tg_rint(simd_make_float4_undef(x)));
2681#endif
2682}
2683
2684static SIMD_CFUNC simd_float3 __tg_rint(simd_float3 x) {
2685 return simd_make_float3(__tg_rint(simd_make_float4_undef(x)));
2686}
2687
2688#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2689extern simd_float4 _simd_rint_f4(simd_float4 x);
2690#endif
2691
2692static SIMD_CFUNC simd_float4 __tg_rint(simd_float4 x) {
2693#if defined __SSE4_1__
2694 return _mm_round_ps(x, _MM_FROUND_RINT);
2695#elif defined __arm64__
2696 return vrndxq_f32(x);
2697#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2698 return _simd_rint_f4(x);
2699#else
2700 simd_float4 magic = __tg_copysign(0x1.0p23, x);
2701 simd_int4 x_is_small = __tg_fabs(x) < 0x1.0p23;
2702 return simd_bitselect(x, (x + magic) - magic, x_is_small & 0x7fffffff);
2703#endif
2704}
2705
2706static SIMD_CFUNC simd_float8 __tg_rint(simd_float8 x) {
2707#if defined __AVX__
2708 return _mm256_round_ps(x, _MM_FROUND_RINT);
2709#else
2710 return simd_make_float8(__tg_rint(x.lo), __tg_rint(x.hi));
2711#endif
2712}
2713
2714static SIMD_CFUNC simd_float16 __tg_rint(simd_float16 x) {
2715#if defined __x86_64__ && defined __AVX512F__
2716 return _mm512_roundscale_ps(x, _MM_FROUND_RINT);
2717#else
2718 return simd_make_float16(__tg_rint(x.lo), __tg_rint(x.hi));
2719#endif
2720}
2721
2722#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2723extern simd_double2 _simd_rint_d2(simd_double2 x);
2724#endif
2725
2726static SIMD_CFUNC simd_double2 __tg_rint(simd_double2 x) {
2727#if defined __SSE4_1__
2728 return _mm_round_pd(x, _MM_FROUND_RINT);
2729#elif defined __arm64__
2730 return vrndxq_f64(x);
2731#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2732 return _simd_rint_d2(x);
2733#else
2734 simd_double2 magic = __tg_copysign(0x1.0p52, x);
2735 simd_long2 x_is_small = __tg_fabs(x) < 0x1.0p52;
2736 return simd_bitselect(x, (x + magic) - magic, x_is_small & 0x7fffffffffffffff);
2737#endif
2738}
2739
2740static SIMD_CFUNC simd_double3 __tg_rint(simd_double3 x) {
2741 return simd_make_double3(__tg_rint(simd_make_double4_undef(x)));
2742}
2743
2744static SIMD_CFUNC simd_double4 __tg_rint(simd_double4 x) {
2745#if defined __AVX__
2746 return _mm256_round_pd(x, _MM_FROUND_RINT);
2747#else
2748 return simd_make_double4(__tg_rint(x.lo), __tg_rint(x.hi));
2749#endif
2750}
2751
2752static SIMD_CFUNC simd_double8 __tg_rint(simd_double8 x) {
2753#if defined __x86_64__ && defined __AVX512F__
2754 return _mm512_roundscale_pd(x, _MM_FROUND_RINT);
2755#else
2756 return simd_make_double8(__tg_rint(x.lo), __tg_rint(x.hi));
2757#endif
2758}
2759
2760static SIMD_CFUNC simd_float2 __tg_trunc(simd_float2 x) {
2761#if defined __arm64__
2762 return vrnd_f32(x);
2763#else
2764 return simd_make_float2(__tg_trunc(simd_make_float4_undef(x)));
2765#endif
2766}
2767
2768static SIMD_CFUNC simd_float3 __tg_trunc(simd_float3 x) {
2769 return simd_make_float3(__tg_trunc(simd_make_float4_undef(x)));
2770}
2771
2772#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2773extern simd_float4 _simd_trunc_f4(simd_float4 x);
2774#endif
2775
2776static SIMD_CFUNC simd_float4 __tg_trunc(simd_float4 x) {
2777#if defined __SSE4_1__
2778 return _mm_round_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2779#elif defined __arm64__
2780 return vrndq_f32(x);
2781#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2782 return _simd_trunc_f4(x);
2783#else
2784 simd_float4 binade = simd_bitselect(0, x, 0x7f800000);
2785 simd_int4 mask = (simd_int4)__tg_fmin(-2*binade + 1, -0);
2786 simd_float4 result = simd_bitselect(0, x, mask);
2787 return simd_bitselect(x, result, binade < 0x1.0p23);
2788#endif
2789}
2790
2791static SIMD_CFUNC simd_float8 __tg_trunc(simd_float8 x) {
2792#if defined __AVX__
2793 return _mm256_round_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2794#else
2795 return simd_make_float8(__tg_trunc(x.lo), __tg_trunc(x.hi));
2796#endif
2797}
2798
2799static SIMD_CFUNC simd_float16 __tg_trunc(simd_float16 x) {
2800#if defined __x86_64__ && defined __AVX512F__
2801 return _mm512_roundscale_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2802#else
2803 return simd_make_float16(__tg_trunc(x.lo), __tg_trunc(x.hi));
2804#endif
2805}
2806
2807#if defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2808extern simd_double2 _simd_trunc_d2(simd_double2 x);
2809#endif
2810
2811static SIMD_CFUNC simd_double2 __tg_trunc(simd_double2 x) {
2812#if defined __SSE4_1__
2813 return _mm_round_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2814#elif defined __arm64__
2815 return vrndq_f64(x);
2816#elif defined __arm__ && SIMD_LIBRARY_VERSION >= 3
2817 return _simd_trunc_d2(x);
2818#else
2819 simd_double2 binade = simd_bitselect(0, x, 0x7ff0000000000000);
2820 simd_long2 mask = (simd_long2)__tg_fmin(-2*binade + 1, -0);
2821 simd_double2 result = simd_bitselect(0, x, mask);
2822 return simd_bitselect(x, result, binade < 0x1.0p52);
2823#endif
2824}
2825
2826static SIMD_CFUNC simd_double3 __tg_trunc(simd_double3 x) {
2827 return simd_make_double3(__tg_trunc(simd_make_double4_undef(x)));
2828}
2829
2830static SIMD_CFUNC simd_double4 __tg_trunc(simd_double4 x) {
2831#if defined __AVX__
2832 return _mm256_round_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2833#else
2834 return simd_make_double4(__tg_trunc(x.lo), __tg_trunc(x.hi));
2835#endif
2836}
2837
2838static SIMD_CFUNC simd_double8 __tg_trunc(simd_double8 x) {
2839#if defined __x86_64__ && defined __AVX512F__
2840 return _mm512_roundscale_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC);
2841#else
2842 return simd_make_double8(__tg_trunc(x.lo), __tg_trunc(x.hi));
2843#endif
2844}
2845
2846#pragma mark - sine, cosine implementation
2847static inline SIMD_CFUNC simd_float2 __tg_sin(simd_float2 x) {
2848 return simd_make_float2(__tg_sin(simd_make_float4(x)));
2849}
2850
2851static inline SIMD_CFUNC simd_float3 __tg_sin(simd_float3 x) {
2852 return simd_make_float3(__tg_sin(simd_make_float4(x)));
2853}
2854
2855#if SIMD_LIBRARY_VERSION >= 3
2856extern simd_float4 _simd_sin_f4(simd_float4 x);
2857static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) {
2858 return _simd_sin_f4(x);
2859}
2860#elif SIMD_LIBRARY_VERSION == 1
2861extern simd_float4 __sin_f4(simd_float4 x);
2862static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) {
2863 return __sin_f4(x);
2864}
2865#else
2866static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) {
2867 return simd_make_float4(sin(x.x), sin(x.y), sin(x.z), sin(x.w));
2868}
2869#endif
2870
2871#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
2872extern simd_float8 _simd_sin_f8(simd_float8 x);
2873static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x) {
2874 return _simd_sin_f8(x);
2875}
2876#else
2877static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x) {
2878 return simd_make_float8(__tg_sin(x.lo), __tg_sin(x.hi));
2879}
2880#endif
2881
2882#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
2883extern simd_float16 _simd_sin_f16(simd_float16 x);
2884static inline SIMD_CFUNC simd_float16 __tg_sin(simd_float16 x) {
2885 return _simd_sin_f16(x);
2886}
2887#else
2888static inline SIMD_CFUNC simd_float16 __tg_sin(simd_float16 x) {
2889 return simd_make_float16(__tg_sin(x.lo), __tg_sin(x.hi));
2890}
2891#endif
2892
2893#if SIMD_LIBRARY_VERSION >= 3
2894extern simd_double2 _simd_sin_d2(simd_double2 x);
2895static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x) {
2896 return _simd_sin_d2(x);
2897}
2898#elif SIMD_LIBRARY_VERSION == 1
2899extern simd_double2 __sin_d2(simd_double2 x);
2900static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x) {
2901 return __sin_d2(x);
2902}
2903#else
2904static inline SIMD_CFUNC simd_double2 __tg_sin(simd_double2 x) {
2905 return simd_make_double2(sin(x.x), sin(x.y));
2906}
2907#endif
2908
2909static inline SIMD_CFUNC simd_double3 __tg_sin(simd_double3 x) {
2910 return simd_make_double3(__tg_sin(simd_make_double4(x)));
2911}
2912
2913#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
2914extern simd_double4 _simd_sin_d4(simd_double4 x);
2915static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x) {
2916 return _simd_sin_d4(x);
2917}
2918#else
2919static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x) {
2920 return simd_make_double4(__tg_sin(x.lo), __tg_sin(x.hi));
2921}
2922#endif
2923
2924#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
2925extern simd_double8 _simd_sin_d8(simd_double8 x);
2926static inline SIMD_CFUNC simd_double8 __tg_sin(simd_double8 x) {
2927 return _simd_sin_d8(x);
2928}
2929#else
2930static inline SIMD_CFUNC simd_double8 __tg_sin(simd_double8 x) {
2931 return simd_make_double8(__tg_sin(x.lo), __tg_sin(x.hi));
2932}
2933#endif
2934
2935static inline SIMD_CFUNC simd_float2 __tg_cos(simd_float2 x) {
2936 return simd_make_float2(__tg_cos(simd_make_float4(x)));
2937}
2938
2939static inline SIMD_CFUNC simd_float3 __tg_cos(simd_float3 x) {
2940 return simd_make_float3(__tg_cos(simd_make_float4(x)));
2941}
2942
2943#if SIMD_LIBRARY_VERSION >= 3
2944extern simd_float4 _simd_cos_f4(simd_float4 x);
2945static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) {
2946 return _simd_cos_f4(x);
2947}
2948#elif SIMD_LIBRARY_VERSION == 1
2949extern simd_float4 __cos_f4(simd_float4 x);
2950static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) {
2951 return __cos_f4(x);
2952}
2953#else
2954static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) {
2955 return simd_make_float4(cos(x.x), cos(x.y), cos(x.z), cos(x.w));
2956}
2957#endif
2958
2959#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
2960extern simd_float8 _simd_cos_f8(simd_float8 x);
2961static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x) {
2962 return _simd_cos_f8(x);
2963}
2964#else
2965static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x) {
2966 return simd_make_float8(__tg_cos(x.lo), __tg_cos(x.hi));
2967}
2968#endif
2969
2970#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
2971extern simd_float16 _simd_cos_f16(simd_float16 x);
2972static inline SIMD_CFUNC simd_float16 __tg_cos(simd_float16 x) {
2973 return _simd_cos_f16(x);
2974}
2975#else
2976static inline SIMD_CFUNC simd_float16 __tg_cos(simd_float16 x) {
2977 return simd_make_float16(__tg_cos(x.lo), __tg_cos(x.hi));
2978}
2979#endif
2980
2981#if SIMD_LIBRARY_VERSION >= 3
2982extern simd_double2 _simd_cos_d2(simd_double2 x);
2983static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x) {
2984 return _simd_cos_d2(x);
2985}
2986#elif SIMD_LIBRARY_VERSION == 1
2987extern simd_double2 __cos_d2(simd_double2 x);
2988static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x) {
2989 return __cos_d2(x);
2990}
2991#else
2992static inline SIMD_CFUNC simd_double2 __tg_cos(simd_double2 x) {
2993 return simd_make_double2(cos(x.x), cos(x.y));
2994}
2995#endif
2996
2997static inline SIMD_CFUNC simd_double3 __tg_cos(simd_double3 x) {
2998 return simd_make_double3(__tg_cos(simd_make_double4(x)));
2999}
3000
3001#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3002extern simd_double4 _simd_cos_d4(simd_double4 x);
3003static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x) {
3004 return _simd_cos_d4(x);
3005}
3006#else
3007static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x) {
3008 return simd_make_double4(__tg_cos(x.lo), __tg_cos(x.hi));
3009}
3010#endif
3011
3012#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3013extern simd_double8 _simd_cos_d8(simd_double8 x);
3014static inline SIMD_CFUNC simd_double8 __tg_cos(simd_double8 x) {
3015 return _simd_cos_d8(x);
3016}
3017#else
3018static inline SIMD_CFUNC simd_double8 __tg_cos(simd_double8 x) {
3019 return simd_make_double8(__tg_cos(x.lo), __tg_cos(x.hi));
3020}
3021#endif
3022
3023
3024#pragma mark - acos implementation
3025static inline SIMD_CFUNC simd_float2 __tg_acos(simd_float2 x) {
3026 return simd_make_float2(__tg_acos(simd_make_float4(x)));
3027}
3028
3029static inline SIMD_CFUNC simd_float3 __tg_acos(simd_float3 x) {
3030 return simd_make_float3(__tg_acos(simd_make_float4(x)));
3031}
3032
3033#if SIMD_LIBRARY_VERSION >= 3
3034extern simd_float4 _simd_acos_f4(simd_float4 x);
3035static inline SIMD_CFUNC simd_float4 __tg_acos(simd_float4 x) {
3036 return _simd_acos_f4(x);
3037}
3038#else
3039static inline SIMD_CFUNC simd_float4 __tg_acos(simd_float4 x) {
3040 return simd_make_float4(acos(x.x), acos(x.y), acos(x.z), acos(x.w));
3041}
3042#endif
3043
3044#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3045extern simd_float8 _simd_acos_f8(simd_float8 x);
3046static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x) {
3047 return _simd_acos_f8(x);
3048}
3049#else
3050static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x) {
3051 return simd_make_float8(__tg_acos(x.lo), __tg_acos(x.hi));
3052}
3053#endif
3054
3055#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3056extern simd_float16 _simd_acos_f16(simd_float16 x);
3057static inline SIMD_CFUNC simd_float16 __tg_acos(simd_float16 x) {
3058 return _simd_acos_f16(x);
3059}
3060#else
3061static inline SIMD_CFUNC simd_float16 __tg_acos(simd_float16 x) {
3062 return simd_make_float16(__tg_acos(x.lo), __tg_acos(x.hi));
3063}
3064#endif
3065
3066#if SIMD_LIBRARY_VERSION >= 3
3067extern simd_double2 _simd_acos_d2(simd_double2 x);
3068static inline SIMD_CFUNC simd_double2 __tg_acos(simd_double2 x) {
3069 return _simd_acos_d2(x);
3070}
3071#else
3072static inline SIMD_CFUNC simd_double2 __tg_acos(simd_double2 x) {
3073 return simd_make_double2(acos(x.x), acos(x.y));
3074}
3075#endif
3076
3077static inline SIMD_CFUNC simd_double3 __tg_acos(simd_double3 x) {
3078 return simd_make_double3(__tg_acos(simd_make_double4(x)));
3079}
3080
3081#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3082extern simd_double4 _simd_acos_d4(simd_double4 x);
3083static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x) {
3084 return _simd_acos_d4(x);
3085}
3086#else
3087static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x) {
3088 return simd_make_double4(__tg_acos(x.lo), __tg_acos(x.hi));
3089}
3090#endif
3091
3092#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3093extern simd_double8 _simd_acos_d8(simd_double8 x);
3094static inline SIMD_CFUNC simd_double8 __tg_acos(simd_double8 x) {
3095 return _simd_acos_d8(x);
3096}
3097#else
3098static inline SIMD_CFUNC simd_double8 __tg_acos(simd_double8 x) {
3099 return simd_make_double8(__tg_acos(x.lo), __tg_acos(x.hi));
3100}
3101#endif
3102
3103#pragma mark - asin implementation
3104static inline SIMD_CFUNC simd_float2 __tg_asin(simd_float2 x) {
3105 return simd_make_float2(__tg_asin(simd_make_float4(x)));
3106}
3107
3108static inline SIMD_CFUNC simd_float3 __tg_asin(simd_float3 x) {
3109 return simd_make_float3(__tg_asin(simd_make_float4(x)));
3110}
3111
3112#if SIMD_LIBRARY_VERSION >= 3
3113extern simd_float4 _simd_asin_f4(simd_float4 x);
3114static inline SIMD_CFUNC simd_float4 __tg_asin(simd_float4 x) {
3115 return _simd_asin_f4(x);
3116}
3117#else
3118static inline SIMD_CFUNC simd_float4 __tg_asin(simd_float4 x) {
3119 return simd_make_float4(asin(x.x), asin(x.y), asin(x.z), asin(x.w));
3120}
3121#endif
3122
3123#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3124extern simd_float8 _simd_asin_f8(simd_float8 x);
3125static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x) {
3126 return _simd_asin_f8(x);
3127}
3128#else
3129static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x) {
3130 return simd_make_float8(__tg_asin(x.lo), __tg_asin(x.hi));
3131}
3132#endif
3133
3134#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3135extern simd_float16 _simd_asin_f16(simd_float16 x);
3136static inline SIMD_CFUNC simd_float16 __tg_asin(simd_float16 x) {
3137 return _simd_asin_f16(x);
3138}
3139#else
3140static inline SIMD_CFUNC simd_float16 __tg_asin(simd_float16 x) {
3141 return simd_make_float16(__tg_asin(x.lo), __tg_asin(x.hi));
3142}
3143#endif
3144
3145#if SIMD_LIBRARY_VERSION >= 3
3146extern simd_double2 _simd_asin_d2(simd_double2 x);
3147static inline SIMD_CFUNC simd_double2 __tg_asin(simd_double2 x) {
3148 return _simd_asin_d2(x);
3149}
3150#else
3151static inline SIMD_CFUNC simd_double2 __tg_asin(simd_double2 x) {
3152 return simd_make_double2(asin(x.x), asin(x.y));
3153}
3154#endif
3155
3156static inline SIMD_CFUNC simd_double3 __tg_asin(simd_double3 x) {
3157 return simd_make_double3(__tg_asin(simd_make_double4(x)));
3158}
3159
3160#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3161extern simd_double4 _simd_asin_d4(simd_double4 x);
3162static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x) {
3163 return _simd_asin_d4(x);
3164}
3165#else
3166static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x) {
3167 return simd_make_double4(__tg_asin(x.lo), __tg_asin(x.hi));
3168}
3169#endif
3170
3171#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3172extern simd_double8 _simd_asin_d8(simd_double8 x);
3173static inline SIMD_CFUNC simd_double8 __tg_asin(simd_double8 x) {
3174 return _simd_asin_d8(x);
3175}
3176#else
3177static inline SIMD_CFUNC simd_double8 __tg_asin(simd_double8 x) {
3178 return simd_make_double8(__tg_asin(x.lo), __tg_asin(x.hi));
3179}
3180#endif
3181
3182#pragma mark - atan implementation
3183static inline SIMD_CFUNC simd_float2 __tg_atan(simd_float2 x) {
3184 return simd_make_float2(__tg_atan(simd_make_float4(x)));
3185}
3186
3187static inline SIMD_CFUNC simd_float3 __tg_atan(simd_float3 x) {
3188 return simd_make_float3(__tg_atan(simd_make_float4(x)));
3189}
3190
3191#if SIMD_LIBRARY_VERSION >= 3
3192extern simd_float4 _simd_atan_f4(simd_float4 x);
3193static inline SIMD_CFUNC simd_float4 __tg_atan(simd_float4 x) {
3194 return _simd_atan_f4(x);
3195}
3196#else
3197static inline SIMD_CFUNC simd_float4 __tg_atan(simd_float4 x) {
3198 return simd_make_float4(atan(x.x), atan(x.y), atan(x.z), atan(x.w));
3199}
3200#endif
3201
3202#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3203extern simd_float8 _simd_atan_f8(simd_float8 x);
3204static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x) {
3205 return _simd_atan_f8(x);
3206}
3207#else
3208static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x) {
3209 return simd_make_float8(__tg_atan(x.lo), __tg_atan(x.hi));
3210}
3211#endif
3212
3213#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3214extern simd_float16 _simd_atan_f16(simd_float16 x);
3215static inline SIMD_CFUNC simd_float16 __tg_atan(simd_float16 x) {
3216 return _simd_atan_f16(x);
3217}
3218#else
3219static inline SIMD_CFUNC simd_float16 __tg_atan(simd_float16 x) {
3220 return simd_make_float16(__tg_atan(x.lo), __tg_atan(x.hi));
3221}
3222#endif
3223
3224#if SIMD_LIBRARY_VERSION >= 3
3225extern simd_double2 _simd_atan_d2(simd_double2 x);
3226static inline SIMD_CFUNC simd_double2 __tg_atan(simd_double2 x) {
3227 return _simd_atan_d2(x);
3228}
3229#else
3230static inline SIMD_CFUNC simd_double2 __tg_atan(simd_double2 x) {
3231 return simd_make_double2(atan(x.x), atan(x.y));
3232}
3233#endif
3234
3235static inline SIMD_CFUNC simd_double3 __tg_atan(simd_double3 x) {
3236 return simd_make_double3(__tg_atan(simd_make_double4(x)));
3237}
3238
3239#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3240extern simd_double4 _simd_atan_d4(simd_double4 x);
3241static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x) {
3242 return _simd_atan_d4(x);
3243}
3244#else
3245static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x) {
3246 return simd_make_double4(__tg_atan(x.lo), __tg_atan(x.hi));
3247}
3248#endif
3249
3250#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3251extern simd_double8 _simd_atan_d8(simd_double8 x);
3252static inline SIMD_CFUNC simd_double8 __tg_atan(simd_double8 x) {
3253 return _simd_atan_d8(x);
3254}
3255#else
3256static inline SIMD_CFUNC simd_double8 __tg_atan(simd_double8 x) {
3257 return simd_make_double8(__tg_atan(x.lo), __tg_atan(x.hi));
3258}
3259#endif
3260
3261#pragma mark - tan implementation
3262static inline SIMD_CFUNC simd_float2 __tg_tan(simd_float2 x) {
3263 return simd_make_float2(__tg_tan(simd_make_float4(x)));
3264}
3265
3266static inline SIMD_CFUNC simd_float3 __tg_tan(simd_float3 x) {
3267 return simd_make_float3(__tg_tan(simd_make_float4(x)));
3268}
3269
3270#if SIMD_LIBRARY_VERSION >= 3
3271extern simd_float4 _simd_tan_f4(simd_float4 x);
3272static inline SIMD_CFUNC simd_float4 __tg_tan(simd_float4 x) {
3273 return _simd_tan_f4(x);
3274}
3275#else
3276static inline SIMD_CFUNC simd_float4 __tg_tan(simd_float4 x) {
3277 return simd_make_float4(tan(x.x), tan(x.y), tan(x.z), tan(x.w));
3278}
3279#endif
3280
3281#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3282extern simd_float8 _simd_tan_f8(simd_float8 x);
3283static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x) {
3284 return _simd_tan_f8(x);
3285}
3286#else
3287static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x) {
3288 return simd_make_float8(__tg_tan(x.lo), __tg_tan(x.hi));
3289}
3290#endif
3291
3292#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3293extern simd_float16 _simd_tan_f16(simd_float16 x);
3294static inline SIMD_CFUNC simd_float16 __tg_tan(simd_float16 x) {
3295 return _simd_tan_f16(x);
3296}
3297#else
3298static inline SIMD_CFUNC simd_float16 __tg_tan(simd_float16 x) {
3299 return simd_make_float16(__tg_tan(x.lo), __tg_tan(x.hi));
3300}
3301#endif
3302
3303#if SIMD_LIBRARY_VERSION >= 3
3304extern simd_double2 _simd_tan_d2(simd_double2 x);
3305static inline SIMD_CFUNC simd_double2 __tg_tan(simd_double2 x) {
3306 return _simd_tan_d2(x);
3307}
3308#else
3309static inline SIMD_CFUNC simd_double2 __tg_tan(simd_double2 x) {
3310 return simd_make_double2(tan(x.x), tan(x.y));
3311}
3312#endif
3313
3314static inline SIMD_CFUNC simd_double3 __tg_tan(simd_double3 x) {
3315 return simd_make_double3(__tg_tan(simd_make_double4(x)));
3316}
3317
3318#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3319extern simd_double4 _simd_tan_d4(simd_double4 x);
3320static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x) {
3321 return _simd_tan_d4(x);
3322}
3323#else
3324static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x) {
3325 return simd_make_double4(__tg_tan(x.lo), __tg_tan(x.hi));
3326}
3327#endif
3328
3329#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3330extern simd_double8 _simd_tan_d8(simd_double8 x);
3331static inline SIMD_CFUNC simd_double8 __tg_tan(simd_double8 x) {
3332 return _simd_tan_d8(x);
3333}
3334#else
3335static inline SIMD_CFUNC simd_double8 __tg_tan(simd_double8 x) {
3336 return simd_make_double8(__tg_tan(x.lo), __tg_tan(x.hi));
3337}
3338#endif
3339
3340#pragma mark - cospi implementation
3341#if SIMD_LIBRARY_VERSION >= 1
3342static inline SIMD_CFUNC simd_float2 __tg_cospi(simd_float2 x) {
3343 return simd_make_float2(__tg_cospi(simd_make_float4(x)));
3344}
3345
3346static inline SIMD_CFUNC simd_float3 __tg_cospi(simd_float3 x) {
3347 return simd_make_float3(__tg_cospi(simd_make_float4(x)));
3348}
3349
3350#if SIMD_LIBRARY_VERSION >= 3
3351extern simd_float4 _simd_cospi_f4(simd_float4 x);
3352static inline SIMD_CFUNC simd_float4 __tg_cospi(simd_float4 x) {
3353 return _simd_cospi_f4(x);
3354}
3355#else
3356static inline SIMD_CFUNC simd_float4 __tg_cospi(simd_float4 x) {
3357 return simd_make_float4(__cospi(x.x), __cospi(x.y), __cospi(x.z), __cospi(x.w));
3358}
3359#endif
3360
3361#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3362extern simd_float8 _simd_cospi_f8(simd_float8 x);
3363static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x) {
3364 return _simd_cospi_f8(x);
3365}
3366#else
3367static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x) {
3368 return simd_make_float8(__tg_cospi(x.lo), __tg_cospi(x.hi));
3369}
3370#endif
3371
3372#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3373extern simd_float16 _simd_cospi_f16(simd_float16 x);
3374static inline SIMD_CFUNC simd_float16 __tg_cospi(simd_float16 x) {
3375 return _simd_cospi_f16(x);
3376}
3377#else
3378static inline SIMD_CFUNC simd_float16 __tg_cospi(simd_float16 x) {
3379 return simd_make_float16(__tg_cospi(x.lo), __tg_cospi(x.hi));
3380}
3381#endif
3382
3383#if SIMD_LIBRARY_VERSION >= 3
3384extern simd_double2 _simd_cospi_d2(simd_double2 x);
3385static inline SIMD_CFUNC simd_double2 __tg_cospi(simd_double2 x) {
3386 return _simd_cospi_d2(x);
3387}
3388#else
3389static inline SIMD_CFUNC simd_double2 __tg_cospi(simd_double2 x) {
3390 return simd_make_double2(__cospi(x.x), __cospi(x.y));
3391}
3392#endif
3393
3394static inline SIMD_CFUNC simd_double3 __tg_cospi(simd_double3 x) {
3395 return simd_make_double3(__tg_cospi(simd_make_double4(x)));
3396}
3397
3398#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3399extern simd_double4 _simd_cospi_d4(simd_double4 x);
3400static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x) {
3401 return _simd_cospi_d4(x);
3402}
3403#else
3404static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x) {
3405 return simd_make_double4(__tg_cospi(x.lo), __tg_cospi(x.hi));
3406}
3407#endif
3408
3409#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3410extern simd_double8 _simd_cospi_d8(simd_double8 x);
3411static inline SIMD_CFUNC simd_double8 __tg_cospi(simd_double8 x) {
3412 return _simd_cospi_d8(x);
3413}
3414#else
3415static inline SIMD_CFUNC simd_double8 __tg_cospi(simd_double8 x) {
3416 return simd_make_double8(__tg_cospi(x.lo), __tg_cospi(x.hi));
3417}
3418#endif
3419
3420#endif /* SIMD_LIBRARY_VERSION */
3421#pragma mark - sinpi implementation
3422#if SIMD_LIBRARY_VERSION >= 1
3423static inline SIMD_CFUNC simd_float2 __tg_sinpi(simd_float2 x) {
3424 return simd_make_float2(__tg_sinpi(simd_make_float4(x)));
3425}
3426
3427static inline SIMD_CFUNC simd_float3 __tg_sinpi(simd_float3 x) {
3428 return simd_make_float3(__tg_sinpi(simd_make_float4(x)));
3429}
3430
3431#if SIMD_LIBRARY_VERSION >= 3
3432extern simd_float4 _simd_sinpi_f4(simd_float4 x);
3433static inline SIMD_CFUNC simd_float4 __tg_sinpi(simd_float4 x) {
3434 return _simd_sinpi_f4(x);
3435}
3436#else
3437static inline SIMD_CFUNC simd_float4 __tg_sinpi(simd_float4 x) {
3438 return simd_make_float4(__sinpi(x.x), __sinpi(x.y), __sinpi(x.z), __sinpi(x.w));
3439}
3440#endif
3441
3442#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3443extern simd_float8 _simd_sinpi_f8(simd_float8 x);
3444static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x) {
3445 return _simd_sinpi_f8(x);
3446}
3447#else
3448static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x) {
3449 return simd_make_float8(__tg_sinpi(x.lo), __tg_sinpi(x.hi));
3450}
3451#endif
3452
3453#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3454extern simd_float16 _simd_sinpi_f16(simd_float16 x);
3455static inline SIMD_CFUNC simd_float16 __tg_sinpi(simd_float16 x) {
3456 return _simd_sinpi_f16(x);
3457}
3458#else
3459static inline SIMD_CFUNC simd_float16 __tg_sinpi(simd_float16 x) {
3460 return simd_make_float16(__tg_sinpi(x.lo), __tg_sinpi(x.hi));
3461}
3462#endif
3463
3464#if SIMD_LIBRARY_VERSION >= 3
3465extern simd_double2 _simd_sinpi_d2(simd_double2 x);
3466static inline SIMD_CFUNC simd_double2 __tg_sinpi(simd_double2 x) {
3467 return _simd_sinpi_d2(x);
3468}
3469#else
3470static inline SIMD_CFUNC simd_double2 __tg_sinpi(simd_double2 x) {
3471 return simd_make_double2(__sinpi(x.x), __sinpi(x.y));
3472}
3473#endif
3474
3475static inline SIMD_CFUNC simd_double3 __tg_sinpi(simd_double3 x) {
3476 return simd_make_double3(__tg_sinpi(simd_make_double4(x)));
3477}
3478
3479#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3480extern simd_double4 _simd_sinpi_d4(simd_double4 x);
3481static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x) {
3482 return _simd_sinpi_d4(x);
3483}
3484#else
3485static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x) {
3486 return simd_make_double4(__tg_sinpi(x.lo), __tg_sinpi(x.hi));
3487}
3488#endif
3489
3490#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3491extern simd_double8 _simd_sinpi_d8(simd_double8 x);
3492static inline SIMD_CFUNC simd_double8 __tg_sinpi(simd_double8 x) {
3493 return _simd_sinpi_d8(x);
3494}
3495#else
3496static inline SIMD_CFUNC simd_double8 __tg_sinpi(simd_double8 x) {
3497 return simd_make_double8(__tg_sinpi(x.lo), __tg_sinpi(x.hi));
3498}
3499#endif
3500
3501#endif /* SIMD_LIBRARY_VERSION */
3502#pragma mark - tanpi implementation
3503#if SIMD_LIBRARY_VERSION >= 1
3504static inline SIMD_CFUNC simd_float2 __tg_tanpi(simd_float2 x) {
3505 return simd_make_float2(__tg_tanpi(simd_make_float4(x)));
3506}
3507
3508static inline SIMD_CFUNC simd_float3 __tg_tanpi(simd_float3 x) {
3509 return simd_make_float3(__tg_tanpi(simd_make_float4(x)));
3510}
3511
3512#if SIMD_LIBRARY_VERSION >= 3
3513extern simd_float4 _simd_tanpi_f4(simd_float4 x);
3514static inline SIMD_CFUNC simd_float4 __tg_tanpi(simd_float4 x) {
3515 return _simd_tanpi_f4(x);
3516}
3517#else
3518static inline SIMD_CFUNC simd_float4 __tg_tanpi(simd_float4 x) {
3519 return simd_make_float4(__tanpi(x.x), __tanpi(x.y), __tanpi(x.z), __tanpi(x.w));
3520}
3521#endif
3522
3523#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3524extern simd_float8 _simd_tanpi_f8(simd_float8 x);
3525static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x) {
3526 return _simd_tanpi_f8(x);
3527}
3528#else
3529static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x) {
3530 return simd_make_float8(__tg_tanpi(x.lo), __tg_tanpi(x.hi));
3531}
3532#endif
3533
3534#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3535extern simd_float16 _simd_tanpi_f16(simd_float16 x);
3536static inline SIMD_CFUNC simd_float16 __tg_tanpi(simd_float16 x) {
3537 return _simd_tanpi_f16(x);
3538}
3539#else
3540static inline SIMD_CFUNC simd_float16 __tg_tanpi(simd_float16 x) {
3541 return simd_make_float16(__tg_tanpi(x.lo), __tg_tanpi(x.hi));
3542}
3543#endif
3544
3545#if SIMD_LIBRARY_VERSION >= 3
3546extern simd_double2 _simd_tanpi_d2(simd_double2 x);
3547static inline SIMD_CFUNC simd_double2 __tg_tanpi(simd_double2 x) {
3548 return _simd_tanpi_d2(x);
3549}
3550#else
3551static inline SIMD_CFUNC simd_double2 __tg_tanpi(simd_double2 x) {
3552 return simd_make_double2(__tanpi(x.x), __tanpi(x.y));
3553}
3554#endif
3555
3556static inline SIMD_CFUNC simd_double3 __tg_tanpi(simd_double3 x) {
3557 return simd_make_double3(__tg_tanpi(simd_make_double4(x)));
3558}
3559
3560#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3561extern simd_double4 _simd_tanpi_d4(simd_double4 x);
3562static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x) {
3563 return _simd_tanpi_d4(x);
3564}
3565#else
3566static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x) {
3567 return simd_make_double4(__tg_tanpi(x.lo), __tg_tanpi(x.hi));
3568}
3569#endif
3570
3571#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3572extern simd_double8 _simd_tanpi_d8(simd_double8 x);
3573static inline SIMD_CFUNC simd_double8 __tg_tanpi(simd_double8 x) {
3574 return _simd_tanpi_d8(x);
3575}
3576#else
3577static inline SIMD_CFUNC simd_double8 __tg_tanpi(simd_double8 x) {
3578 return simd_make_double8(__tg_tanpi(x.lo), __tg_tanpi(x.hi));
3579}
3580#endif
3581
3582#endif /* SIMD_LIBRARY_VERSION */
3583#pragma mark - acosh implementation
3584static inline SIMD_CFUNC simd_float2 __tg_acosh(simd_float2 x) {
3585 return simd_make_float2(__tg_acosh(simd_make_float4(x)));
3586}
3587
3588static inline SIMD_CFUNC simd_float3 __tg_acosh(simd_float3 x) {
3589 return simd_make_float3(__tg_acosh(simd_make_float4(x)));
3590}
3591
3592#if SIMD_LIBRARY_VERSION >= 3
3593extern simd_float4 _simd_acosh_f4(simd_float4 x);
3594static inline SIMD_CFUNC simd_float4 __tg_acosh(simd_float4 x) {
3595 return _simd_acosh_f4(x);
3596}
3597#else
3598static inline SIMD_CFUNC simd_float4 __tg_acosh(simd_float4 x) {
3599 return simd_make_float4(acosh(x.x), acosh(x.y), acosh(x.z), acosh(x.w));
3600}
3601#endif
3602
3603#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3604extern simd_float8 _simd_acosh_f8(simd_float8 x);
3605static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x) {
3606 return _simd_acosh_f8(x);
3607}
3608#else
3609static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x) {
3610 return simd_make_float8(__tg_acosh(x.lo), __tg_acosh(x.hi));
3611}
3612#endif
3613
3614#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3615extern simd_float16 _simd_acosh_f16(simd_float16 x);
3616static inline SIMD_CFUNC simd_float16 __tg_acosh(simd_float16 x) {
3617 return _simd_acosh_f16(x);
3618}
3619#else
3620static inline SIMD_CFUNC simd_float16 __tg_acosh(simd_float16 x) {
3621 return simd_make_float16(__tg_acosh(x.lo), __tg_acosh(x.hi));
3622}
3623#endif
3624
3625#if SIMD_LIBRARY_VERSION >= 3
3626extern simd_double2 _simd_acosh_d2(simd_double2 x);
3627static inline SIMD_CFUNC simd_double2 __tg_acosh(simd_double2 x) {
3628 return _simd_acosh_d2(x);
3629}
3630#else
3631static inline SIMD_CFUNC simd_double2 __tg_acosh(simd_double2 x) {
3632 return simd_make_double2(acosh(x.x), acosh(x.y));
3633}
3634#endif
3635
3636static inline SIMD_CFUNC simd_double3 __tg_acosh(simd_double3 x) {
3637 return simd_make_double3(__tg_acosh(simd_make_double4(x)));
3638}
3639
3640#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3641extern simd_double4 _simd_acosh_d4(simd_double4 x);
3642static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x) {
3643 return _simd_acosh_d4(x);
3644}
3645#else
3646static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x) {
3647 return simd_make_double4(__tg_acosh(x.lo), __tg_acosh(x.hi));
3648}
3649#endif
3650
3651#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3652extern simd_double8 _simd_acosh_d8(simd_double8 x);
3653static inline SIMD_CFUNC simd_double8 __tg_acosh(simd_double8 x) {
3654 return _simd_acosh_d8(x);
3655}
3656#else
3657static inline SIMD_CFUNC simd_double8 __tg_acosh(simd_double8 x) {
3658 return simd_make_double8(__tg_acosh(x.lo), __tg_acosh(x.hi));
3659}
3660#endif
3661
3662#pragma mark - asinh implementation
3663static inline SIMD_CFUNC simd_float2 __tg_asinh(simd_float2 x) {
3664 return simd_make_float2(__tg_asinh(simd_make_float4(x)));
3665}
3666
3667static inline SIMD_CFUNC simd_float3 __tg_asinh(simd_float3 x) {
3668 return simd_make_float3(__tg_asinh(simd_make_float4(x)));
3669}
3670
3671#if SIMD_LIBRARY_VERSION >= 3
3672extern simd_float4 _simd_asinh_f4(simd_float4 x);
3673static inline SIMD_CFUNC simd_float4 __tg_asinh(simd_float4 x) {
3674 return _simd_asinh_f4(x);
3675}
3676#else
3677static inline SIMD_CFUNC simd_float4 __tg_asinh(simd_float4 x) {
3678 return simd_make_float4(asinh(x.x), asinh(x.y), asinh(x.z), asinh(x.w));
3679}
3680#endif
3681
3682#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3683extern simd_float8 _simd_asinh_f8(simd_float8 x);
3684static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x) {
3685 return _simd_asinh_f8(x);
3686}
3687#else
3688static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x) {
3689 return simd_make_float8(__tg_asinh(x.lo), __tg_asinh(x.hi));
3690}
3691#endif
3692
3693#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3694extern simd_float16 _simd_asinh_f16(simd_float16 x);
3695static inline SIMD_CFUNC simd_float16 __tg_asinh(simd_float16 x) {
3696 return _simd_asinh_f16(x);
3697}
3698#else
3699static inline SIMD_CFUNC simd_float16 __tg_asinh(simd_float16 x) {
3700 return simd_make_float16(__tg_asinh(x.lo), __tg_asinh(x.hi));
3701}
3702#endif
3703
3704#if SIMD_LIBRARY_VERSION >= 3
3705extern simd_double2 _simd_asinh_d2(simd_double2 x);
3706static inline SIMD_CFUNC simd_double2 __tg_asinh(simd_double2 x) {
3707 return _simd_asinh_d2(x);
3708}
3709#else
3710static inline SIMD_CFUNC simd_double2 __tg_asinh(simd_double2 x) {
3711 return simd_make_double2(asinh(x.x), asinh(x.y));
3712}
3713#endif
3714
3715static inline SIMD_CFUNC simd_double3 __tg_asinh(simd_double3 x) {
3716 return simd_make_double3(__tg_asinh(simd_make_double4(x)));
3717}
3718
3719#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3720extern simd_double4 _simd_asinh_d4(simd_double4 x);
3721static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x) {
3722 return _simd_asinh_d4(x);
3723}
3724#else
3725static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x) {
3726 return simd_make_double4(__tg_asinh(x.lo), __tg_asinh(x.hi));
3727}
3728#endif
3729
3730#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3731extern simd_double8 _simd_asinh_d8(simd_double8 x);
3732static inline SIMD_CFUNC simd_double8 __tg_asinh(simd_double8 x) {
3733 return _simd_asinh_d8(x);
3734}
3735#else
3736static inline SIMD_CFUNC simd_double8 __tg_asinh(simd_double8 x) {
3737 return simd_make_double8(__tg_asinh(x.lo), __tg_asinh(x.hi));
3738}
3739#endif
3740
3741#pragma mark - atanh implementation
3742static inline SIMD_CFUNC simd_float2 __tg_atanh(simd_float2 x) {
3743 return simd_make_float2(__tg_atanh(simd_make_float4(x)));
3744}
3745
3746static inline SIMD_CFUNC simd_float3 __tg_atanh(simd_float3 x) {
3747 return simd_make_float3(__tg_atanh(simd_make_float4(x)));
3748}
3749
3750#if SIMD_LIBRARY_VERSION >= 3
3751extern simd_float4 _simd_atanh_f4(simd_float4 x);
3752static inline SIMD_CFUNC simd_float4 __tg_atanh(simd_float4 x) {
3753 return _simd_atanh_f4(x);
3754}
3755#else
3756static inline SIMD_CFUNC simd_float4 __tg_atanh(simd_float4 x) {
3757 return simd_make_float4(atanh(x.x), atanh(x.y), atanh(x.z), atanh(x.w));
3758}
3759#endif
3760
3761#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3762extern simd_float8 _simd_atanh_f8(simd_float8 x);
3763static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x) {
3764 return _simd_atanh_f8(x);
3765}
3766#else
3767static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x) {
3768 return simd_make_float8(__tg_atanh(x.lo), __tg_atanh(x.hi));
3769}
3770#endif
3771
3772#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3773extern simd_float16 _simd_atanh_f16(simd_float16 x);
3774static inline SIMD_CFUNC simd_float16 __tg_atanh(simd_float16 x) {
3775 return _simd_atanh_f16(x);
3776}
3777#else
3778static inline SIMD_CFUNC simd_float16 __tg_atanh(simd_float16 x) {
3779 return simd_make_float16(__tg_atanh(x.lo), __tg_atanh(x.hi));
3780}
3781#endif
3782
3783#if SIMD_LIBRARY_VERSION >= 3
3784extern simd_double2 _simd_atanh_d2(simd_double2 x);
3785static inline SIMD_CFUNC simd_double2 __tg_atanh(simd_double2 x) {
3786 return _simd_atanh_d2(x);
3787}
3788#else
3789static inline SIMD_CFUNC simd_double2 __tg_atanh(simd_double2 x) {
3790 return simd_make_double2(atanh(x.x), atanh(x.y));
3791}
3792#endif
3793
3794static inline SIMD_CFUNC simd_double3 __tg_atanh(simd_double3 x) {
3795 return simd_make_double3(__tg_atanh(simd_make_double4(x)));
3796}
3797
3798#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3799extern simd_double4 _simd_atanh_d4(simd_double4 x);
3800static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x) {
3801 return _simd_atanh_d4(x);
3802}
3803#else
3804static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x) {
3805 return simd_make_double4(__tg_atanh(x.lo), __tg_atanh(x.hi));
3806}
3807#endif
3808
3809#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3810extern simd_double8 _simd_atanh_d8(simd_double8 x);
3811static inline SIMD_CFUNC simd_double8 __tg_atanh(simd_double8 x) {
3812 return _simd_atanh_d8(x);
3813}
3814#else
3815static inline SIMD_CFUNC simd_double8 __tg_atanh(simd_double8 x) {
3816 return simd_make_double8(__tg_atanh(x.lo), __tg_atanh(x.hi));
3817}
3818#endif
3819
3820#pragma mark - cosh implementation
3821static inline SIMD_CFUNC simd_float2 __tg_cosh(simd_float2 x) {
3822 return simd_make_float2(__tg_cosh(simd_make_float4(x)));
3823}
3824
3825static inline SIMD_CFUNC simd_float3 __tg_cosh(simd_float3 x) {
3826 return simd_make_float3(__tg_cosh(simd_make_float4(x)));
3827}
3828
3829#if SIMD_LIBRARY_VERSION >= 3
3830extern simd_float4 _simd_cosh_f4(simd_float4 x);
3831static inline SIMD_CFUNC simd_float4 __tg_cosh(simd_float4 x) {
3832 return _simd_cosh_f4(x);
3833}
3834#else
3835static inline SIMD_CFUNC simd_float4 __tg_cosh(simd_float4 x) {
3836 return simd_make_float4(cosh(x.x), cosh(x.y), cosh(x.z), cosh(x.w));
3837}
3838#endif
3839
3840#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3841extern simd_float8 _simd_cosh_f8(simd_float8 x);
3842static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x) {
3843 return _simd_cosh_f8(x);
3844}
3845#else
3846static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x) {
3847 return simd_make_float8(__tg_cosh(x.lo), __tg_cosh(x.hi));
3848}
3849#endif
3850
3851#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3852extern simd_float16 _simd_cosh_f16(simd_float16 x);
3853static inline SIMD_CFUNC simd_float16 __tg_cosh(simd_float16 x) {
3854 return _simd_cosh_f16(x);
3855}
3856#else
3857static inline SIMD_CFUNC simd_float16 __tg_cosh(simd_float16 x) {
3858 return simd_make_float16(__tg_cosh(x.lo), __tg_cosh(x.hi));
3859}
3860#endif
3861
3862#if SIMD_LIBRARY_VERSION >= 3
3863extern simd_double2 _simd_cosh_d2(simd_double2 x);
3864static inline SIMD_CFUNC simd_double2 __tg_cosh(simd_double2 x) {
3865 return _simd_cosh_d2(x);
3866}
3867#else
3868static inline SIMD_CFUNC simd_double2 __tg_cosh(simd_double2 x) {
3869 return simd_make_double2(cosh(x.x), cosh(x.y));
3870}
3871#endif
3872
3873static inline SIMD_CFUNC simd_double3 __tg_cosh(simd_double3 x) {
3874 return simd_make_double3(__tg_cosh(simd_make_double4(x)));
3875}
3876
3877#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3878extern simd_double4 _simd_cosh_d4(simd_double4 x);
3879static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x) {
3880 return _simd_cosh_d4(x);
3881}
3882#else
3883static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x) {
3884 return simd_make_double4(__tg_cosh(x.lo), __tg_cosh(x.hi));
3885}
3886#endif
3887
3888#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3889extern simd_double8 _simd_cosh_d8(simd_double8 x);
3890static inline SIMD_CFUNC simd_double8 __tg_cosh(simd_double8 x) {
3891 return _simd_cosh_d8(x);
3892}
3893#else
3894static inline SIMD_CFUNC simd_double8 __tg_cosh(simd_double8 x) {
3895 return simd_make_double8(__tg_cosh(x.lo), __tg_cosh(x.hi));
3896}
3897#endif
3898
3899#pragma mark - sinh implementation
3900static inline SIMD_CFUNC simd_float2 __tg_sinh(simd_float2 x) {
3901 return simd_make_float2(__tg_sinh(simd_make_float4(x)));
3902}
3903
3904static inline SIMD_CFUNC simd_float3 __tg_sinh(simd_float3 x) {
3905 return simd_make_float3(__tg_sinh(simd_make_float4(x)));
3906}
3907
3908#if SIMD_LIBRARY_VERSION >= 3
3909extern simd_float4 _simd_sinh_f4(simd_float4 x);
3910static inline SIMD_CFUNC simd_float4 __tg_sinh(simd_float4 x) {
3911 return _simd_sinh_f4(x);
3912}
3913#else
3914static inline SIMD_CFUNC simd_float4 __tg_sinh(simd_float4 x) {
3915 return simd_make_float4(sinh(x.x), sinh(x.y), sinh(x.z), sinh(x.w));
3916}
3917#endif
3918
3919#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3920extern simd_float8 _simd_sinh_f8(simd_float8 x);
3921static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x) {
3922 return _simd_sinh_f8(x);
3923}
3924#else
3925static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x) {
3926 return simd_make_float8(__tg_sinh(x.lo), __tg_sinh(x.hi));
3927}
3928#endif
3929
3930#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3931extern simd_float16 _simd_sinh_f16(simd_float16 x);
3932static inline SIMD_CFUNC simd_float16 __tg_sinh(simd_float16 x) {
3933 return _simd_sinh_f16(x);
3934}
3935#else
3936static inline SIMD_CFUNC simd_float16 __tg_sinh(simd_float16 x) {
3937 return simd_make_float16(__tg_sinh(x.lo), __tg_sinh(x.hi));
3938}
3939#endif
3940
3941#if SIMD_LIBRARY_VERSION >= 3
3942extern simd_double2 _simd_sinh_d2(simd_double2 x);
3943static inline SIMD_CFUNC simd_double2 __tg_sinh(simd_double2 x) {
3944 return _simd_sinh_d2(x);
3945}
3946#else
3947static inline SIMD_CFUNC simd_double2 __tg_sinh(simd_double2 x) {
3948 return simd_make_double2(sinh(x.x), sinh(x.y));
3949}
3950#endif
3951
3952static inline SIMD_CFUNC simd_double3 __tg_sinh(simd_double3 x) {
3953 return simd_make_double3(__tg_sinh(simd_make_double4(x)));
3954}
3955
3956#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3957extern simd_double4 _simd_sinh_d4(simd_double4 x);
3958static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x) {
3959 return _simd_sinh_d4(x);
3960}
3961#else
3962static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x) {
3963 return simd_make_double4(__tg_sinh(x.lo), __tg_sinh(x.hi));
3964}
3965#endif
3966
3967#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
3968extern simd_double8 _simd_sinh_d8(simd_double8 x);
3969static inline SIMD_CFUNC simd_double8 __tg_sinh(simd_double8 x) {
3970 return _simd_sinh_d8(x);
3971}
3972#else
3973static inline SIMD_CFUNC simd_double8 __tg_sinh(simd_double8 x) {
3974 return simd_make_double8(__tg_sinh(x.lo), __tg_sinh(x.hi));
3975}
3976#endif
3977
3978#pragma mark - tanh implementation
3979static inline SIMD_CFUNC simd_float2 __tg_tanh(simd_float2 x) {
3980 return simd_make_float2(__tg_tanh(simd_make_float4(x)));
3981}
3982
3983static inline SIMD_CFUNC simd_float3 __tg_tanh(simd_float3 x) {
3984 return simd_make_float3(__tg_tanh(simd_make_float4(x)));
3985}
3986
3987#if SIMD_LIBRARY_VERSION >= 3
3988extern simd_float4 _simd_tanh_f4(simd_float4 x);
3989static inline SIMD_CFUNC simd_float4 __tg_tanh(simd_float4 x) {
3990 return _simd_tanh_f4(x);
3991}
3992#else
3993static inline SIMD_CFUNC simd_float4 __tg_tanh(simd_float4 x) {
3994 return simd_make_float4(tanh(x.x), tanh(x.y), tanh(x.z), tanh(x.w));
3995}
3996#endif
3997
3998#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
3999extern simd_float8 _simd_tanh_f8(simd_float8 x);
4000static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x) {
4001 return _simd_tanh_f8(x);
4002}
4003#else
4004static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x) {
4005 return simd_make_float8(__tg_tanh(x.lo), __tg_tanh(x.hi));
4006}
4007#endif
4008
4009#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4010extern simd_float16 _simd_tanh_f16(simd_float16 x);
4011static inline SIMD_CFUNC simd_float16 __tg_tanh(simd_float16 x) {
4012 return _simd_tanh_f16(x);
4013}
4014#else
4015static inline SIMD_CFUNC simd_float16 __tg_tanh(simd_float16 x) {
4016 return simd_make_float16(__tg_tanh(x.lo), __tg_tanh(x.hi));
4017}
4018#endif
4019
4020#if SIMD_LIBRARY_VERSION >= 3
4021extern simd_double2 _simd_tanh_d2(simd_double2 x);
4022static inline SIMD_CFUNC simd_double2 __tg_tanh(simd_double2 x) {
4023 return _simd_tanh_d2(x);
4024}
4025#else
4026static inline SIMD_CFUNC simd_double2 __tg_tanh(simd_double2 x) {
4027 return simd_make_double2(tanh(x.x), tanh(x.y));
4028}
4029#endif
4030
4031static inline SIMD_CFUNC simd_double3 __tg_tanh(simd_double3 x) {
4032 return simd_make_double3(__tg_tanh(simd_make_double4(x)));
4033}
4034
4035#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4036extern simd_double4 _simd_tanh_d4(simd_double4 x);
4037static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x) {
4038 return _simd_tanh_d4(x);
4039}
4040#else
4041static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x) {
4042 return simd_make_double4(__tg_tanh(x.lo), __tg_tanh(x.hi));
4043}
4044#endif
4045
4046#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4047extern simd_double8 _simd_tanh_d8(simd_double8 x);
4048static inline SIMD_CFUNC simd_double8 __tg_tanh(simd_double8 x) {
4049 return _simd_tanh_d8(x);
4050}
4051#else
4052static inline SIMD_CFUNC simd_double8 __tg_tanh(simd_double8 x) {
4053 return simd_make_double8(__tg_tanh(x.lo), __tg_tanh(x.hi));
4054}
4055#endif
4056
4057#pragma mark - exp implementation
4058static inline SIMD_CFUNC simd_float2 __tg_exp(simd_float2 x) {
4059 return simd_make_float2(__tg_exp(simd_make_float4(x)));
4060}
4061
4062static inline SIMD_CFUNC simd_float3 __tg_exp(simd_float3 x) {
4063 return simd_make_float3(__tg_exp(simd_make_float4(x)));
4064}
4065
4066#if SIMD_LIBRARY_VERSION >= 3
4067extern simd_float4 _simd_exp_f4(simd_float4 x);
4068static inline SIMD_CFUNC simd_float4 __tg_exp(simd_float4 x) {
4069 return _simd_exp_f4(x);
4070}
4071#else
4072static inline SIMD_CFUNC simd_float4 __tg_exp(simd_float4 x) {
4073 return simd_make_float4(exp(x.x), exp(x.y), exp(x.z), exp(x.w));
4074}
4075#endif
4076
4077#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4078extern simd_float8 _simd_exp_f8(simd_float8 x);
4079static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x) {
4080 return _simd_exp_f8(x);
4081}
4082#else
4083static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x) {
4084 return simd_make_float8(__tg_exp(x.lo), __tg_exp(x.hi));
4085}
4086#endif
4087
4088#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4089extern simd_float16 _simd_exp_f16(simd_float16 x);
4090static inline SIMD_CFUNC simd_float16 __tg_exp(simd_float16 x) {
4091 return _simd_exp_f16(x);
4092}
4093#else
4094static inline SIMD_CFUNC simd_float16 __tg_exp(simd_float16 x) {
4095 return simd_make_float16(__tg_exp(x.lo), __tg_exp(x.hi));
4096}
4097#endif
4098
4099#if SIMD_LIBRARY_VERSION >= 3
4100extern simd_double2 _simd_exp_d2(simd_double2 x);
4101static inline SIMD_CFUNC simd_double2 __tg_exp(simd_double2 x) {
4102 return _simd_exp_d2(x);
4103}
4104#else
4105static inline SIMD_CFUNC simd_double2 __tg_exp(simd_double2 x) {
4106 return simd_make_double2(exp(x.x), exp(x.y));
4107}
4108#endif
4109
4110static inline SIMD_CFUNC simd_double3 __tg_exp(simd_double3 x) {
4111 return simd_make_double3(__tg_exp(simd_make_double4(x)));
4112}
4113
4114#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4115extern simd_double4 _simd_exp_d4(simd_double4 x);
4116static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x) {
4117 return _simd_exp_d4(x);
4118}
4119#else
4120static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x) {
4121 return simd_make_double4(__tg_exp(x.lo), __tg_exp(x.hi));
4122}
4123#endif
4124
4125#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4126extern simd_double8 _simd_exp_d8(simd_double8 x);
4127static inline SIMD_CFUNC simd_double8 __tg_exp(simd_double8 x) {
4128 return _simd_exp_d8(x);
4129}
4130#else
4131static inline SIMD_CFUNC simd_double8 __tg_exp(simd_double8 x) {
4132 return simd_make_double8(__tg_exp(x.lo), __tg_exp(x.hi));
4133}
4134#endif
4135
4136#pragma mark - exp2 implementation
4137static inline SIMD_CFUNC simd_float2 __tg_exp2(simd_float2 x) {
4138 return simd_make_float2(__tg_exp2(simd_make_float4(x)));
4139}
4140
4141static inline SIMD_CFUNC simd_float3 __tg_exp2(simd_float3 x) {
4142 return simd_make_float3(__tg_exp2(simd_make_float4(x)));
4143}
4144
4145#if SIMD_LIBRARY_VERSION >= 3
4146extern simd_float4 _simd_exp2_f4(simd_float4 x);
4147static inline SIMD_CFUNC simd_float4 __tg_exp2(simd_float4 x) {
4148 return _simd_exp2_f4(x);
4149}
4150#else
4151static inline SIMD_CFUNC simd_float4 __tg_exp2(simd_float4 x) {
4152 return simd_make_float4(exp2(x.x), exp2(x.y), exp2(x.z), exp2(x.w));
4153}
4154#endif
4155
4156#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4157extern simd_float8 _simd_exp2_f8(simd_float8 x);
4158static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x) {
4159 return _simd_exp2_f8(x);
4160}
4161#else
4162static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x) {
4163 return simd_make_float8(__tg_exp2(x.lo), __tg_exp2(x.hi));
4164}
4165#endif
4166
4167#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4168extern simd_float16 _simd_exp2_f16(simd_float16 x);
4169static inline SIMD_CFUNC simd_float16 __tg_exp2(simd_float16 x) {
4170 return _simd_exp2_f16(x);
4171}
4172#else
4173static inline SIMD_CFUNC simd_float16 __tg_exp2(simd_float16 x) {
4174 return simd_make_float16(__tg_exp2(x.lo), __tg_exp2(x.hi));
4175}
4176#endif
4177
4178#if SIMD_LIBRARY_VERSION >= 3
4179extern simd_double2 _simd_exp2_d2(simd_double2 x);
4180static inline SIMD_CFUNC simd_double2 __tg_exp2(simd_double2 x) {
4181 return _simd_exp2_d2(x);
4182}
4183#else
4184static inline SIMD_CFUNC simd_double2 __tg_exp2(simd_double2 x) {
4185 return simd_make_double2(exp2(x.x), exp2(x.y));
4186}
4187#endif
4188
4189static inline SIMD_CFUNC simd_double3 __tg_exp2(simd_double3 x) {
4190 return simd_make_double3(__tg_exp2(simd_make_double4(x)));
4191}
4192
4193#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4194extern simd_double4 _simd_exp2_d4(simd_double4 x);
4195static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x) {
4196 return _simd_exp2_d4(x);
4197}
4198#else
4199static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x) {
4200 return simd_make_double4(__tg_exp2(x.lo), __tg_exp2(x.hi));
4201}
4202#endif
4203
4204#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4205extern simd_double8 _simd_exp2_d8(simd_double8 x);
4206static inline SIMD_CFUNC simd_double8 __tg_exp2(simd_double8 x) {
4207 return _simd_exp2_d8(x);
4208}
4209#else
4210static inline SIMD_CFUNC simd_double8 __tg_exp2(simd_double8 x) {
4211 return simd_make_double8(__tg_exp2(x.lo), __tg_exp2(x.hi));
4212}
4213#endif
4214
4215#pragma mark - exp10 implementation
4216#if SIMD_LIBRARY_VERSION >= 1
4217static inline SIMD_CFUNC simd_float2 __tg_exp10(simd_float2 x) {
4218 return simd_make_float2(__tg_exp10(simd_make_float4(x)));
4219}
4220
4221static inline SIMD_CFUNC simd_float3 __tg_exp10(simd_float3 x) {
4222 return simd_make_float3(__tg_exp10(simd_make_float4(x)));
4223}
4224
4225#if SIMD_LIBRARY_VERSION >= 3
4226extern simd_float4 _simd_exp10_f4(simd_float4 x);
4227static inline SIMD_CFUNC simd_float4 __tg_exp10(simd_float4 x) {
4228 return _simd_exp10_f4(x);
4229}
4230#else
4231static inline SIMD_CFUNC simd_float4 __tg_exp10(simd_float4 x) {
4232 return simd_make_float4(__exp10(x.x), __exp10(x.y), __exp10(x.z), __exp10(x.w));
4233}
4234#endif
4235
4236#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4237extern simd_float8 _simd_exp10_f8(simd_float8 x);
4238static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x) {
4239 return _simd_exp10_f8(x);
4240}
4241#else
4242static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x) {
4243 return simd_make_float8(__tg_exp10(x.lo), __tg_exp10(x.hi));
4244}
4245#endif
4246
4247#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4248extern simd_float16 _simd_exp10_f16(simd_float16 x);
4249static inline SIMD_CFUNC simd_float16 __tg_exp10(simd_float16 x) {
4250 return _simd_exp10_f16(x);
4251}
4252#else
4253static inline SIMD_CFUNC simd_float16 __tg_exp10(simd_float16 x) {
4254 return simd_make_float16(__tg_exp10(x.lo), __tg_exp10(x.hi));
4255}
4256#endif
4257
4258#if SIMD_LIBRARY_VERSION >= 3
4259extern simd_double2 _simd_exp10_d2(simd_double2 x);
4260static inline SIMD_CFUNC simd_double2 __tg_exp10(simd_double2 x) {
4261 return _simd_exp10_d2(x);
4262}
4263#else
4264static inline SIMD_CFUNC simd_double2 __tg_exp10(simd_double2 x) {
4265 return simd_make_double2(__exp10(x.x), __exp10(x.y));
4266}
4267#endif
4268
4269static inline SIMD_CFUNC simd_double3 __tg_exp10(simd_double3 x) {
4270 return simd_make_double3(__tg_exp10(simd_make_double4(x)));
4271}
4272
4273#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4274extern simd_double4 _simd_exp10_d4(simd_double4 x);
4275static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x) {
4276 return _simd_exp10_d4(x);
4277}
4278#else
4279static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x) {
4280 return simd_make_double4(__tg_exp10(x.lo), __tg_exp10(x.hi));
4281}
4282#endif
4283
4284#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4285extern simd_double8 _simd_exp10_d8(simd_double8 x);
4286static inline SIMD_CFUNC simd_double8 __tg_exp10(simd_double8 x) {
4287 return _simd_exp10_d8(x);
4288}
4289#else
4290static inline SIMD_CFUNC simd_double8 __tg_exp10(simd_double8 x) {
4291 return simd_make_double8(__tg_exp10(x.lo), __tg_exp10(x.hi));
4292}
4293#endif
4294
4295#endif /* SIMD_LIBRARY_VERSION */
4296#pragma mark - expm1 implementation
4297static inline SIMD_CFUNC simd_float2 __tg_expm1(simd_float2 x) {
4298 return simd_make_float2(__tg_expm1(simd_make_float4(x)));
4299}
4300
4301static inline SIMD_CFUNC simd_float3 __tg_expm1(simd_float3 x) {
4302 return simd_make_float3(__tg_expm1(simd_make_float4(x)));
4303}
4304
4305#if SIMD_LIBRARY_VERSION >= 3
4306extern simd_float4 _simd_expm1_f4(simd_float4 x);
4307static inline SIMD_CFUNC simd_float4 __tg_expm1(simd_float4 x) {
4308 return _simd_expm1_f4(x);
4309}
4310#else
4311static inline SIMD_CFUNC simd_float4 __tg_expm1(simd_float4 x) {
4312 return simd_make_float4(expm1(x.x), expm1(x.y), expm1(x.z), expm1(x.w));
4313}
4314#endif
4315
4316#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4317extern simd_float8 _simd_expm1_f8(simd_float8 x);
4318static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x) {
4319 return _simd_expm1_f8(x);
4320}
4321#else
4322static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x) {
4323 return simd_make_float8(__tg_expm1(x.lo), __tg_expm1(x.hi));
4324}
4325#endif
4326
4327#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4328extern simd_float16 _simd_expm1_f16(simd_float16 x);
4329static inline SIMD_CFUNC simd_float16 __tg_expm1(simd_float16 x) {
4330 return _simd_expm1_f16(x);
4331}
4332#else
4333static inline SIMD_CFUNC simd_float16 __tg_expm1(simd_float16 x) {
4334 return simd_make_float16(__tg_expm1(x.lo), __tg_expm1(x.hi));
4335}
4336#endif
4337
4338#if SIMD_LIBRARY_VERSION >= 3
4339extern simd_double2 _simd_expm1_d2(simd_double2 x);
4340static inline SIMD_CFUNC simd_double2 __tg_expm1(simd_double2 x) {
4341 return _simd_expm1_d2(x);
4342}
4343#else
4344static inline SIMD_CFUNC simd_double2 __tg_expm1(simd_double2 x) {
4345 return simd_make_double2(expm1(x.x), expm1(x.y));
4346}
4347#endif
4348
4349static inline SIMD_CFUNC simd_double3 __tg_expm1(simd_double3 x) {
4350 return simd_make_double3(__tg_expm1(simd_make_double4(x)));
4351}
4352
4353#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4354extern simd_double4 _simd_expm1_d4(simd_double4 x);
4355static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x) {
4356 return _simd_expm1_d4(x);
4357}
4358#else
4359static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x) {
4360 return simd_make_double4(__tg_expm1(x.lo), __tg_expm1(x.hi));
4361}
4362#endif
4363
4364#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4365extern simd_double8 _simd_expm1_d8(simd_double8 x);
4366static inline SIMD_CFUNC simd_double8 __tg_expm1(simd_double8 x) {
4367 return _simd_expm1_d8(x);
4368}
4369#else
4370static inline SIMD_CFUNC simd_double8 __tg_expm1(simd_double8 x) {
4371 return simd_make_double8(__tg_expm1(x.lo), __tg_expm1(x.hi));
4372}
4373#endif
4374
4375#pragma mark - log implementation
4376static inline SIMD_CFUNC simd_float2 __tg_log(simd_float2 x) {
4377 return simd_make_float2(__tg_log(simd_make_float4(x)));
4378}
4379
4380static inline SIMD_CFUNC simd_float3 __tg_log(simd_float3 x) {
4381 return simd_make_float3(__tg_log(simd_make_float4(x)));
4382}
4383
4384#if SIMD_LIBRARY_VERSION >= 3
4385extern simd_float4 _simd_log_f4(simd_float4 x);
4386static inline SIMD_CFUNC simd_float4 __tg_log(simd_float4 x) {
4387 return _simd_log_f4(x);
4388}
4389#else
4390static inline SIMD_CFUNC simd_float4 __tg_log(simd_float4 x) {
4391 return simd_make_float4(log(x.x), log(x.y), log(x.z), log(x.w));
4392}
4393#endif
4394
4395#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4396extern simd_float8 _simd_log_f8(simd_float8 x);
4397static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x) {
4398 return _simd_log_f8(x);
4399}
4400#else
4401static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x) {
4402 return simd_make_float8(__tg_log(x.lo), __tg_log(x.hi));
4403}
4404#endif
4405
4406#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4407extern simd_float16 _simd_log_f16(simd_float16 x);
4408static inline SIMD_CFUNC simd_float16 __tg_log(simd_float16 x) {
4409 return _simd_log_f16(x);
4410}
4411#else
4412static inline SIMD_CFUNC simd_float16 __tg_log(simd_float16 x) {
4413 return simd_make_float16(__tg_log(x.lo), __tg_log(x.hi));
4414}
4415#endif
4416
4417#if SIMD_LIBRARY_VERSION >= 3
4418extern simd_double2 _simd_log_d2(simd_double2 x);
4419static inline SIMD_CFUNC simd_double2 __tg_log(simd_double2 x) {
4420 return _simd_log_d2(x);
4421}
4422#else
4423static inline SIMD_CFUNC simd_double2 __tg_log(simd_double2 x) {
4424 return simd_make_double2(log(x.x), log(x.y));
4425}
4426#endif
4427
4428static inline SIMD_CFUNC simd_double3 __tg_log(simd_double3 x) {
4429 return simd_make_double3(__tg_log(simd_make_double4(x)));
4430}
4431
4432#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4433extern simd_double4 _simd_log_d4(simd_double4 x);
4434static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x) {
4435 return _simd_log_d4(x);
4436}
4437#else
4438static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x) {
4439 return simd_make_double4(__tg_log(x.lo), __tg_log(x.hi));
4440}
4441#endif
4442
4443#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4444extern simd_double8 _simd_log_d8(simd_double8 x);
4445static inline SIMD_CFUNC simd_double8 __tg_log(simd_double8 x) {
4446 return _simd_log_d8(x);
4447}
4448#else
4449static inline SIMD_CFUNC simd_double8 __tg_log(simd_double8 x) {
4450 return simd_make_double8(__tg_log(x.lo), __tg_log(x.hi));
4451}
4452#endif
4453
4454#pragma mark - log2 implementation
4455static inline SIMD_CFUNC simd_float2 __tg_log2(simd_float2 x) {
4456 return simd_make_float2(__tg_log2(simd_make_float4(x)));
4457}
4458
4459static inline SIMD_CFUNC simd_float3 __tg_log2(simd_float3 x) {
4460 return simd_make_float3(__tg_log2(simd_make_float4(x)));
4461}
4462
4463#if SIMD_LIBRARY_VERSION >= 3
4464extern simd_float4 _simd_log2_f4(simd_float4 x);
4465static inline SIMD_CFUNC simd_float4 __tg_log2(simd_float4 x) {
4466 return _simd_log2_f4(x);
4467}
4468#else
4469static inline SIMD_CFUNC simd_float4 __tg_log2(simd_float4 x) {
4470 return simd_make_float4(log2(x.x), log2(x.y), log2(x.z), log2(x.w));
4471}
4472#endif
4473
4474#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4475extern simd_float8 _simd_log2_f8(simd_float8 x);
4476static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x) {
4477 return _simd_log2_f8(x);
4478}
4479#else
4480static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x) {
4481 return simd_make_float8(__tg_log2(x.lo), __tg_log2(x.hi));
4482}
4483#endif
4484
4485#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4486extern simd_float16 _simd_log2_f16(simd_float16 x);
4487static inline SIMD_CFUNC simd_float16 __tg_log2(simd_float16 x) {
4488 return _simd_log2_f16(x);
4489}
4490#else
4491static inline SIMD_CFUNC simd_float16 __tg_log2(simd_float16 x) {
4492 return simd_make_float16(__tg_log2(x.lo), __tg_log2(x.hi));
4493}
4494#endif
4495
4496#if SIMD_LIBRARY_VERSION >= 3
4497extern simd_double2 _simd_log2_d2(simd_double2 x);
4498static inline SIMD_CFUNC simd_double2 __tg_log2(simd_double2 x) {
4499 return _simd_log2_d2(x);
4500}
4501#else
4502static inline SIMD_CFUNC simd_double2 __tg_log2(simd_double2 x) {
4503 return simd_make_double2(log2(x.x), log2(x.y));
4504}
4505#endif
4506
4507static inline SIMD_CFUNC simd_double3 __tg_log2(simd_double3 x) {
4508 return simd_make_double3(__tg_log2(simd_make_double4(x)));
4509}
4510
4511#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4512extern simd_double4 _simd_log2_d4(simd_double4 x);
4513static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x) {
4514 return _simd_log2_d4(x);
4515}
4516#else
4517static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x) {
4518 return simd_make_double4(__tg_log2(x.lo), __tg_log2(x.hi));
4519}
4520#endif
4521
4522#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4523extern simd_double8 _simd_log2_d8(simd_double8 x);
4524static inline SIMD_CFUNC simd_double8 __tg_log2(simd_double8 x) {
4525 return _simd_log2_d8(x);
4526}
4527#else
4528static inline SIMD_CFUNC simd_double8 __tg_log2(simd_double8 x) {
4529 return simd_make_double8(__tg_log2(x.lo), __tg_log2(x.hi));
4530}
4531#endif
4532
4533#pragma mark - log10 implementation
4534static inline SIMD_CFUNC simd_float2 __tg_log10(simd_float2 x) {
4535 return simd_make_float2(__tg_log10(simd_make_float4(x)));
4536}
4537
4538static inline SIMD_CFUNC simd_float3 __tg_log10(simd_float3 x) {
4539 return simd_make_float3(__tg_log10(simd_make_float4(x)));
4540}
4541
4542#if SIMD_LIBRARY_VERSION >= 3
4543extern simd_float4 _simd_log10_f4(simd_float4 x);
4544static inline SIMD_CFUNC simd_float4 __tg_log10(simd_float4 x) {
4545 return _simd_log10_f4(x);
4546}
4547#else
4548static inline SIMD_CFUNC simd_float4 __tg_log10(simd_float4 x) {
4549 return simd_make_float4(log10(x.x), log10(x.y), log10(x.z), log10(x.w));
4550}
4551#endif
4552
4553#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4554extern simd_float8 _simd_log10_f8(simd_float8 x);
4555static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x) {
4556 return _simd_log10_f8(x);
4557}
4558#else
4559static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x) {
4560 return simd_make_float8(__tg_log10(x.lo), __tg_log10(x.hi));
4561}
4562#endif
4563
4564#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4565extern simd_float16 _simd_log10_f16(simd_float16 x);
4566static inline SIMD_CFUNC simd_float16 __tg_log10(simd_float16 x) {
4567 return _simd_log10_f16(x);
4568}
4569#else
4570static inline SIMD_CFUNC simd_float16 __tg_log10(simd_float16 x) {
4571 return simd_make_float16(__tg_log10(x.lo), __tg_log10(x.hi));
4572}
4573#endif
4574
4575#if SIMD_LIBRARY_VERSION >= 3
4576extern simd_double2 _simd_log10_d2(simd_double2 x);
4577static inline SIMD_CFUNC simd_double2 __tg_log10(simd_double2 x) {
4578 return _simd_log10_d2(x);
4579}
4580#else
4581static inline SIMD_CFUNC simd_double2 __tg_log10(simd_double2 x) {
4582 return simd_make_double2(log10(x.x), log10(x.y));
4583}
4584#endif
4585
4586static inline SIMD_CFUNC simd_double3 __tg_log10(simd_double3 x) {
4587 return simd_make_double3(__tg_log10(simd_make_double4(x)));
4588}
4589
4590#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4591extern simd_double4 _simd_log10_d4(simd_double4 x);
4592static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x) {
4593 return _simd_log10_d4(x);
4594}
4595#else
4596static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x) {
4597 return simd_make_double4(__tg_log10(x.lo), __tg_log10(x.hi));
4598}
4599#endif
4600
4601#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4602extern simd_double8 _simd_log10_d8(simd_double8 x);
4603static inline SIMD_CFUNC simd_double8 __tg_log10(simd_double8 x) {
4604 return _simd_log10_d8(x);
4605}
4606#else
4607static inline SIMD_CFUNC simd_double8 __tg_log10(simd_double8 x) {
4608 return simd_make_double8(__tg_log10(x.lo), __tg_log10(x.hi));
4609}
4610#endif
4611
4612#pragma mark - log1p implementation
4613static inline SIMD_CFUNC simd_float2 __tg_log1p(simd_float2 x) {
4614 return simd_make_float2(__tg_log1p(simd_make_float4(x)));
4615}
4616
4617static inline SIMD_CFUNC simd_float3 __tg_log1p(simd_float3 x) {
4618 return simd_make_float3(__tg_log1p(simd_make_float4(x)));
4619}
4620
4621#if SIMD_LIBRARY_VERSION >= 3
4622extern simd_float4 _simd_log1p_f4(simd_float4 x);
4623static inline SIMD_CFUNC simd_float4 __tg_log1p(simd_float4 x) {
4624 return _simd_log1p_f4(x);
4625}
4626#else
4627static inline SIMD_CFUNC simd_float4 __tg_log1p(simd_float4 x) {
4628 return simd_make_float4(log1p(x.x), log1p(x.y), log1p(x.z), log1p(x.w));
4629}
4630#endif
4631
4632#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4633extern simd_float8 _simd_log1p_f8(simd_float8 x);
4634static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x) {
4635 return _simd_log1p_f8(x);
4636}
4637#else
4638static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x) {
4639 return simd_make_float8(__tg_log1p(x.lo), __tg_log1p(x.hi));
4640}
4641#endif
4642
4643#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4644extern simd_float16 _simd_log1p_f16(simd_float16 x);
4645static inline SIMD_CFUNC simd_float16 __tg_log1p(simd_float16 x) {
4646 return _simd_log1p_f16(x);
4647}
4648#else
4649static inline SIMD_CFUNC simd_float16 __tg_log1p(simd_float16 x) {
4650 return simd_make_float16(__tg_log1p(x.lo), __tg_log1p(x.hi));
4651}
4652#endif
4653
4654#if SIMD_LIBRARY_VERSION >= 3
4655extern simd_double2 _simd_log1p_d2(simd_double2 x);
4656static inline SIMD_CFUNC simd_double2 __tg_log1p(simd_double2 x) {
4657 return _simd_log1p_d2(x);
4658}
4659#else
4660static inline SIMD_CFUNC simd_double2 __tg_log1p(simd_double2 x) {
4661 return simd_make_double2(log1p(x.x), log1p(x.y));
4662}
4663#endif
4664
4665static inline SIMD_CFUNC simd_double3 __tg_log1p(simd_double3 x) {
4666 return simd_make_double3(__tg_log1p(simd_make_double4(x)));
4667}
4668
4669#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4670extern simd_double4 _simd_log1p_d4(simd_double4 x);
4671static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x) {
4672 return _simd_log1p_d4(x);
4673}
4674#else
4675static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x) {
4676 return simd_make_double4(__tg_log1p(x.lo), __tg_log1p(x.hi));
4677}
4678#endif
4679
4680#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4681extern simd_double8 _simd_log1p_d8(simd_double8 x);
4682static inline SIMD_CFUNC simd_double8 __tg_log1p(simd_double8 x) {
4683 return _simd_log1p_d8(x);
4684}
4685#else
4686static inline SIMD_CFUNC simd_double8 __tg_log1p(simd_double8 x) {
4687 return simd_make_double8(__tg_log1p(x.lo), __tg_log1p(x.hi));
4688}
4689#endif
4690
4691#pragma mark - cbrt implementation
4692static inline SIMD_CFUNC simd_float2 __tg_cbrt(simd_float2 x) {
4693 return simd_make_float2(__tg_cbrt(simd_make_float4(x)));
4694}
4695
4696static inline SIMD_CFUNC simd_float3 __tg_cbrt(simd_float3 x) {
4697 return simd_make_float3(__tg_cbrt(simd_make_float4(x)));
4698}
4699
4700#if SIMD_LIBRARY_VERSION >= 3
4701extern simd_float4 _simd_cbrt_f4(simd_float4 x);
4702static inline SIMD_CFUNC simd_float4 __tg_cbrt(simd_float4 x) {
4703 return _simd_cbrt_f4(x);
4704}
4705#else
4706static inline SIMD_CFUNC simd_float4 __tg_cbrt(simd_float4 x) {
4707 return simd_make_float4(cbrt(x.x), cbrt(x.y), cbrt(x.z), cbrt(x.w));
4708}
4709#endif
4710
4711#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4712extern simd_float8 _simd_cbrt_f8(simd_float8 x);
4713static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x) {
4714 return _simd_cbrt_f8(x);
4715}
4716#else
4717static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x) {
4718 return simd_make_float8(__tg_cbrt(x.lo), __tg_cbrt(x.hi));
4719}
4720#endif
4721
4722#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4723extern simd_float16 _simd_cbrt_f16(simd_float16 x);
4724static inline SIMD_CFUNC simd_float16 __tg_cbrt(simd_float16 x) {
4725 return _simd_cbrt_f16(x);
4726}
4727#else
4728static inline SIMD_CFUNC simd_float16 __tg_cbrt(simd_float16 x) {
4729 return simd_make_float16(__tg_cbrt(x.lo), __tg_cbrt(x.hi));
4730}
4731#endif
4732
4733#if SIMD_LIBRARY_VERSION >= 3
4734extern simd_double2 _simd_cbrt_d2(simd_double2 x);
4735static inline SIMD_CFUNC simd_double2 __tg_cbrt(simd_double2 x) {
4736 return _simd_cbrt_d2(x);
4737}
4738#else
4739static inline SIMD_CFUNC simd_double2 __tg_cbrt(simd_double2 x) {
4740 return simd_make_double2(cbrt(x.x), cbrt(x.y));
4741}
4742#endif
4743
4744static inline SIMD_CFUNC simd_double3 __tg_cbrt(simd_double3 x) {
4745 return simd_make_double3(__tg_cbrt(simd_make_double4(x)));
4746}
4747
4748#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4749extern simd_double4 _simd_cbrt_d4(simd_double4 x);
4750static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x) {
4751 return _simd_cbrt_d4(x);
4752}
4753#else
4754static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x) {
4755 return simd_make_double4(__tg_cbrt(x.lo), __tg_cbrt(x.hi));
4756}
4757#endif
4758
4759#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4760extern simd_double8 _simd_cbrt_d8(simd_double8 x);
4761static inline SIMD_CFUNC simd_double8 __tg_cbrt(simd_double8 x) {
4762 return _simd_cbrt_d8(x);
4763}
4764#else
4765static inline SIMD_CFUNC simd_double8 __tg_cbrt(simd_double8 x) {
4766 return simd_make_double8(__tg_cbrt(x.lo), __tg_cbrt(x.hi));
4767}
4768#endif
4769
4770#pragma mark - erf implementation
4771static inline SIMD_CFUNC simd_float2 __tg_erf(simd_float2 x) {
4772 return simd_make_float2(__tg_erf(simd_make_float4(x)));
4773}
4774
4775static inline SIMD_CFUNC simd_float3 __tg_erf(simd_float3 x) {
4776 return simd_make_float3(__tg_erf(simd_make_float4(x)));
4777}
4778
4779#if SIMD_LIBRARY_VERSION >= 3
4780extern simd_float4 _simd_erf_f4(simd_float4 x);
4781static inline SIMD_CFUNC simd_float4 __tg_erf(simd_float4 x) {
4782 return _simd_erf_f4(x);
4783}
4784#else
4785static inline SIMD_CFUNC simd_float4 __tg_erf(simd_float4 x) {
4786 return simd_make_float4(erf(x.x), erf(x.y), erf(x.z), erf(x.w));
4787}
4788#endif
4789
4790#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4791extern simd_float8 _simd_erf_f8(simd_float8 x);
4792static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x) {
4793 return _simd_erf_f8(x);
4794}
4795#else
4796static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x) {
4797 return simd_make_float8(__tg_erf(x.lo), __tg_erf(x.hi));
4798}
4799#endif
4800
4801#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4802extern simd_float16 _simd_erf_f16(simd_float16 x);
4803static inline SIMD_CFUNC simd_float16 __tg_erf(simd_float16 x) {
4804 return _simd_erf_f16(x);
4805}
4806#else
4807static inline SIMD_CFUNC simd_float16 __tg_erf(simd_float16 x) {
4808 return simd_make_float16(__tg_erf(x.lo), __tg_erf(x.hi));
4809}
4810#endif
4811
4812#if SIMD_LIBRARY_VERSION >= 3
4813extern simd_double2 _simd_erf_d2(simd_double2 x);
4814static inline SIMD_CFUNC simd_double2 __tg_erf(simd_double2 x) {
4815 return _simd_erf_d2(x);
4816}
4817#else
4818static inline SIMD_CFUNC simd_double2 __tg_erf(simd_double2 x) {
4819 return simd_make_double2(erf(x.x), erf(x.y));
4820}
4821#endif
4822
4823static inline SIMD_CFUNC simd_double3 __tg_erf(simd_double3 x) {
4824 return simd_make_double3(__tg_erf(simd_make_double4(x)));
4825}
4826
4827#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4828extern simd_double4 _simd_erf_d4(simd_double4 x);
4829static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x) {
4830 return _simd_erf_d4(x);
4831}
4832#else
4833static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x) {
4834 return simd_make_double4(__tg_erf(x.lo), __tg_erf(x.hi));
4835}
4836#endif
4837
4838#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4839extern simd_double8 _simd_erf_d8(simd_double8 x);
4840static inline SIMD_CFUNC simd_double8 __tg_erf(simd_double8 x) {
4841 return _simd_erf_d8(x);
4842}
4843#else
4844static inline SIMD_CFUNC simd_double8 __tg_erf(simd_double8 x) {
4845 return simd_make_double8(__tg_erf(x.lo), __tg_erf(x.hi));
4846}
4847#endif
4848
4849#pragma mark - erfc implementation
4850static inline SIMD_CFUNC simd_float2 __tg_erfc(simd_float2 x) {
4851 return simd_make_float2(__tg_erfc(simd_make_float4(x)));
4852}
4853
4854static inline SIMD_CFUNC simd_float3 __tg_erfc(simd_float3 x) {
4855 return simd_make_float3(__tg_erfc(simd_make_float4(x)));
4856}
4857
4858#if SIMD_LIBRARY_VERSION >= 3
4859extern simd_float4 _simd_erfc_f4(simd_float4 x);
4860static inline SIMD_CFUNC simd_float4 __tg_erfc(simd_float4 x) {
4861 return _simd_erfc_f4(x);
4862}
4863#else
4864static inline SIMD_CFUNC simd_float4 __tg_erfc(simd_float4 x) {
4865 return simd_make_float4(erfc(x.x), erfc(x.y), erfc(x.z), erfc(x.w));
4866}
4867#endif
4868
4869#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4870extern simd_float8 _simd_erfc_f8(simd_float8 x);
4871static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x) {
4872 return _simd_erfc_f8(x);
4873}
4874#else
4875static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x) {
4876 return simd_make_float8(__tg_erfc(x.lo), __tg_erfc(x.hi));
4877}
4878#endif
4879
4880#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4881extern simd_float16 _simd_erfc_f16(simd_float16 x);
4882static inline SIMD_CFUNC simd_float16 __tg_erfc(simd_float16 x) {
4883 return _simd_erfc_f16(x);
4884}
4885#else
4886static inline SIMD_CFUNC simd_float16 __tg_erfc(simd_float16 x) {
4887 return simd_make_float16(__tg_erfc(x.lo), __tg_erfc(x.hi));
4888}
4889#endif
4890
4891#if SIMD_LIBRARY_VERSION >= 3
4892extern simd_double2 _simd_erfc_d2(simd_double2 x);
4893static inline SIMD_CFUNC simd_double2 __tg_erfc(simd_double2 x) {
4894 return _simd_erfc_d2(x);
4895}
4896#else
4897static inline SIMD_CFUNC simd_double2 __tg_erfc(simd_double2 x) {
4898 return simd_make_double2(erfc(x.x), erfc(x.y));
4899}
4900#endif
4901
4902static inline SIMD_CFUNC simd_double3 __tg_erfc(simd_double3 x) {
4903 return simd_make_double3(__tg_erfc(simd_make_double4(x)));
4904}
4905
4906#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4907extern simd_double4 _simd_erfc_d4(simd_double4 x);
4908static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x) {
4909 return _simd_erfc_d4(x);
4910}
4911#else
4912static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x) {
4913 return simd_make_double4(__tg_erfc(x.lo), __tg_erfc(x.hi));
4914}
4915#endif
4916
4917#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4918extern simd_double8 _simd_erfc_d8(simd_double8 x);
4919static inline SIMD_CFUNC simd_double8 __tg_erfc(simd_double8 x) {
4920 return _simd_erfc_d8(x);
4921}
4922#else
4923static inline SIMD_CFUNC simd_double8 __tg_erfc(simd_double8 x) {
4924 return simd_make_double8(__tg_erfc(x.lo), __tg_erfc(x.hi));
4925}
4926#endif
4927
4928#pragma mark - tgamma implementation
4929static inline SIMD_CFUNC simd_float2 __tg_tgamma(simd_float2 x) {
4930 return simd_make_float2(__tg_tgamma(simd_make_float4(x)));
4931}
4932
4933static inline SIMD_CFUNC simd_float3 __tg_tgamma(simd_float3 x) {
4934 return simd_make_float3(__tg_tgamma(simd_make_float4(x)));
4935}
4936
4937#if SIMD_LIBRARY_VERSION >= 3
4938extern simd_float4 _simd_tgamma_f4(simd_float4 x);
4939static inline SIMD_CFUNC simd_float4 __tg_tgamma(simd_float4 x) {
4940 return _simd_tgamma_f4(x);
4941}
4942#else
4943static inline SIMD_CFUNC simd_float4 __tg_tgamma(simd_float4 x) {
4944 return simd_make_float4(tgamma(x.x), tgamma(x.y), tgamma(x.z), tgamma(x.w));
4945}
4946#endif
4947
4948#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4949extern simd_float8 _simd_tgamma_f8(simd_float8 x);
4950static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x) {
4951 return _simd_tgamma_f8(x);
4952}
4953#else
4954static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x) {
4955 return simd_make_float8(__tg_tgamma(x.lo), __tg_tgamma(x.hi));
4956}
4957#endif
4958
4959#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4960extern simd_float16 _simd_tgamma_f16(simd_float16 x);
4961static inline SIMD_CFUNC simd_float16 __tg_tgamma(simd_float16 x) {
4962 return _simd_tgamma_f16(x);
4963}
4964#else
4965static inline SIMD_CFUNC simd_float16 __tg_tgamma(simd_float16 x) {
4966 return simd_make_float16(__tg_tgamma(x.lo), __tg_tgamma(x.hi));
4967}
4968#endif
4969
4970#if SIMD_LIBRARY_VERSION >= 3
4971extern simd_double2 _simd_tgamma_d2(simd_double2 x);
4972static inline SIMD_CFUNC simd_double2 __tg_tgamma(simd_double2 x) {
4973 return _simd_tgamma_d2(x);
4974}
4975#else
4976static inline SIMD_CFUNC simd_double2 __tg_tgamma(simd_double2 x) {
4977 return simd_make_double2(tgamma(x.x), tgamma(x.y));
4978}
4979#endif
4980
4981static inline SIMD_CFUNC simd_double3 __tg_tgamma(simd_double3 x) {
4982 return simd_make_double3(__tg_tgamma(simd_make_double4(x)));
4983}
4984
4985#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
4986extern simd_double4 _simd_tgamma_d4(simd_double4 x);
4987static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x) {
4988 return _simd_tgamma_d4(x);
4989}
4990#else
4991static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x) {
4992 return simd_make_double4(__tg_tgamma(x.lo), __tg_tgamma(x.hi));
4993}
4994#endif
4995
4996#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
4997extern simd_double8 _simd_tgamma_d8(simd_double8 x);
4998static inline SIMD_CFUNC simd_double8 __tg_tgamma(simd_double8 x) {
4999 return _simd_tgamma_d8(x);
5000}
5001#else
5002static inline SIMD_CFUNC simd_double8 __tg_tgamma(simd_double8 x) {
5003 return simd_make_double8(__tg_tgamma(x.lo), __tg_tgamma(x.hi));
5004}
5005#endif
5006
5007#pragma mark - round implementation
5008static inline SIMD_CFUNC simd_float2 __tg_round(simd_float2 x) {
5009 return simd_make_float2(__tg_round(simd_make_float4(x)));
5010}
5011
5012static inline SIMD_CFUNC simd_float3 __tg_round(simd_float3 x) {
5013 return simd_make_float3(__tg_round(simd_make_float4(x)));
5014}
5015
5016#if SIMD_LIBRARY_VERSION >= 3
5017extern simd_float4 _simd_round_f4(simd_float4 x);
5018static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x) {
5019#if defined __arm64__
5020 return vrndaq_f32(x);
5021#else
5022 return _simd_round_f4(x);
5023#endif
5024}
5025#else
5026static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x) {
5027 return simd_make_float4(round(x.x), round(x.y), round(x.z), round(x.w));
5028}
5029#endif
5030
5031#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5032extern simd_float8 _simd_round_f8(simd_float8 x);
5033static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x) {
5034 return _simd_round_f8(x);
5035}
5036#else
5037static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x) {
5038 return simd_make_float8(__tg_round(x.lo), __tg_round(x.hi));
5039}
5040#endif
5041
5042#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5043extern simd_float16 _simd_round_f16(simd_float16 x);
5044static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x) {
5045 return _simd_round_f16(x);
5046}
5047#else
5048static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x) {
5049 return simd_make_float16(__tg_round(x.lo), __tg_round(x.hi));
5050}
5051#endif
5052
5053#if SIMD_LIBRARY_VERSION >= 3
5054extern simd_double2 _simd_round_d2(simd_double2 x);
5055static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x) {
5056#if defined __arm64__
5057 return vrndaq_f64(x);
5058#else
5059 return _simd_round_d2(x);
5060#endif
5061}
5062#else
5063static inline SIMD_CFUNC simd_double2 __tg_round(simd_double2 x) {
5064 return simd_make_double2(round(x.x), round(x.y));
5065}
5066#endif
5067
5068static inline SIMD_CFUNC simd_double3 __tg_round(simd_double3 x) {
5069 return simd_make_double3(__tg_round(simd_make_double4(x)));
5070}
5071
5072#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5073extern simd_double4 _simd_round_d4(simd_double4 x);
5074static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x) {
5075 return _simd_round_d4(x);
5076}
5077#else
5078static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x) {
5079 return simd_make_double4(__tg_round(x.lo), __tg_round(x.hi));
5080}
5081#endif
5082
5083#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5084extern simd_double8 _simd_round_d8(simd_double8 x);
5085static inline SIMD_CFUNC simd_double8 __tg_round(simd_double8 x) {
5086 return _simd_round_d8(x);
5087}
5088#else
5089static inline SIMD_CFUNC simd_double8 __tg_round(simd_double8 x) {
5090 return simd_make_double8(__tg_round(x.lo), __tg_round(x.hi));
5091}
5092#endif
5093
5094#pragma mark - atan2 implementation
5095static inline SIMD_CFUNC simd_float2 __tg_atan2(simd_float2 y, simd_float2 x) {
5096 return simd_make_float2(__tg_atan2(simd_make_float4(y), simd_make_float4(x)));
5097}
5098
5099static inline SIMD_CFUNC simd_float3 __tg_atan2(simd_float3 y, simd_float3 x) {
5100 return simd_make_float3(__tg_atan2(simd_make_float4(y), simd_make_float4(x)));
5101}
5102
5103#if SIMD_LIBRARY_VERSION >= 3
5104extern simd_float4 _simd_atan2_f4(simd_float4 y, simd_float4 x);
5105static inline SIMD_CFUNC simd_float4 __tg_atan2(simd_float4 y, simd_float4 x) {
5106 return _simd_atan2_f4(y, x);
5107}
5108#else
5109static inline SIMD_CFUNC simd_float4 __tg_atan2(simd_float4 y, simd_float4 x) {
5110 return simd_make_float4(atan2(y.x, x.x), atan2(y.y, x.y), atan2(y.z, x.z), atan2(y.w, x.w));
5111}
5112#endif
5113
5114#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5115extern simd_float8 _simd_atan2_f8(simd_float8 y, simd_float8 x);
5116static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x) {
5117 return _simd_atan2_f8(y, x);
5118}
5119#else
5120static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x) {
5121 return simd_make_float8(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi));
5122}
5123#endif
5124
5125#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5126extern simd_float16 _simd_atan2_f16(simd_float16 y, simd_float16 x);
5127static inline SIMD_CFUNC simd_float16 __tg_atan2(simd_float16 y, simd_float16 x) {
5128 return _simd_atan2_f16(y, x);
5129}
5130#else
5131static inline SIMD_CFUNC simd_float16 __tg_atan2(simd_float16 y, simd_float16 x) {
5132 return simd_make_float16(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi));
5133}
5134#endif
5135
5136#if SIMD_LIBRARY_VERSION >= 3
5137extern simd_double2 _simd_atan2_d2(simd_double2 y, simd_double2 x);
5138static inline SIMD_CFUNC simd_double2 __tg_atan2(simd_double2 y, simd_double2 x) {
5139 return _simd_atan2_d2(y, x);
5140}
5141#else
5142static inline SIMD_CFUNC simd_double2 __tg_atan2(simd_double2 y, simd_double2 x) {
5143 return simd_make_double2(atan2(y.x, x.x), atan2(y.y, x.y));
5144}
5145#endif
5146
5147static inline SIMD_CFUNC simd_double3 __tg_atan2(simd_double3 y, simd_double3 x) {
5148 return simd_make_double3(__tg_atan2(simd_make_double4(y), simd_make_double4(x)));
5149}
5150
5151#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5152extern simd_double4 _simd_atan2_d4(simd_double4 y, simd_double4 x);
5153static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x) {
5154 return _simd_atan2_d4(y, x);
5155}
5156#else
5157static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x) {
5158 return simd_make_double4(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi));
5159}
5160#endif
5161
5162#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5163extern simd_double8 _simd_atan2_d8(simd_double8 y, simd_double8 x);
5164static inline SIMD_CFUNC simd_double8 __tg_atan2(simd_double8 y, simd_double8 x) {
5165 return _simd_atan2_d8(y, x);
5166}
5167#else
5168static inline SIMD_CFUNC simd_double8 __tg_atan2(simd_double8 y, simd_double8 x) {
5169 return simd_make_double8(__tg_atan2(y.lo, x.lo), __tg_atan2(y.hi, x.hi));
5170}
5171#endif
5172
5173#pragma mark - hypot implementation
5174static inline SIMD_CFUNC simd_float2 __tg_hypot(simd_float2 x, simd_float2 y) {
5175 return simd_make_float2(__tg_hypot(simd_make_float4(x), simd_make_float4(y)));
5176}
5177
5178static inline SIMD_CFUNC simd_float3 __tg_hypot(simd_float3 x, simd_float3 y) {
5179 return simd_make_float3(__tg_hypot(simd_make_float4(x), simd_make_float4(y)));
5180}
5181
5182#if SIMD_LIBRARY_VERSION >= 3
5183extern simd_float4 _simd_hypot_f4(simd_float4 x, simd_float4 y);
5184static inline SIMD_CFUNC simd_float4 __tg_hypot(simd_float4 x, simd_float4 y) {
5185 return _simd_hypot_f4(x, y);
5186}
5187#else
5188static inline SIMD_CFUNC simd_float4 __tg_hypot(simd_float4 x, simd_float4 y) {
5189 return simd_make_float4(hypot(x.x, y.x), hypot(x.y, y.y), hypot(x.z, y.z), hypot(x.w, y.w));
5190}
5191#endif
5192
5193#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5194extern simd_float8 _simd_hypot_f8(simd_float8 x, simd_float8 y);
5195static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y) {
5196 return _simd_hypot_f8(x, y);
5197}
5198#else
5199static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y) {
5200 return simd_make_float8(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi));
5201}
5202#endif
5203
5204#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5205extern simd_float16 _simd_hypot_f16(simd_float16 x, simd_float16 y);
5206static inline SIMD_CFUNC simd_float16 __tg_hypot(simd_float16 x, simd_float16 y) {
5207 return _simd_hypot_f16(x, y);
5208}
5209#else
5210static inline SIMD_CFUNC simd_float16 __tg_hypot(simd_float16 x, simd_float16 y) {
5211 return simd_make_float16(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi));
5212}
5213#endif
5214
5215#if SIMD_LIBRARY_VERSION >= 3
5216extern simd_double2 _simd_hypot_d2(simd_double2 x, simd_double2 y);
5217static inline SIMD_CFUNC simd_double2 __tg_hypot(simd_double2 x, simd_double2 y) {
5218 return _simd_hypot_d2(x, y);
5219}
5220#else
5221static inline SIMD_CFUNC simd_double2 __tg_hypot(simd_double2 x, simd_double2 y) {
5222 return simd_make_double2(hypot(x.x, y.x), hypot(x.y, y.y));
5223}
5224#endif
5225
5226static inline SIMD_CFUNC simd_double3 __tg_hypot(simd_double3 x, simd_double3 y) {
5227 return simd_make_double3(__tg_hypot(simd_make_double4(x), simd_make_double4(y)));
5228}
5229
5230#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5231extern simd_double4 _simd_hypot_d4(simd_double4 x, simd_double4 y);
5232static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y) {
5233 return _simd_hypot_d4(x, y);
5234}
5235#else
5236static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y) {
5237 return simd_make_double4(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi));
5238}
5239#endif
5240
5241#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5242extern simd_double8 _simd_hypot_d8(simd_double8 x, simd_double8 y);
5243static inline SIMD_CFUNC simd_double8 __tg_hypot(simd_double8 x, simd_double8 y) {
5244 return _simd_hypot_d8(x, y);
5245}
5246#else
5247static inline SIMD_CFUNC simd_double8 __tg_hypot(simd_double8 x, simd_double8 y) {
5248 return simd_make_double8(__tg_hypot(x.lo, y.lo), __tg_hypot(x.hi, y.hi));
5249}
5250#endif
5251
5252#pragma mark - pow implementation
5253static inline SIMD_CFUNC simd_float2 __tg_pow(simd_float2 x, simd_float2 y) {
5254 return simd_make_float2(__tg_pow(simd_make_float4(x), simd_make_float4(y)));
5255}
5256
5257static inline SIMD_CFUNC simd_float3 __tg_pow(simd_float3 x, simd_float3 y) {
5258 return simd_make_float3(__tg_pow(simd_make_float4(x), simd_make_float4(y)));
5259}
5260
5261#if SIMD_LIBRARY_VERSION >= 3
5262extern simd_float4 _simd_pow_f4(simd_float4 x, simd_float4 y);
5263static inline SIMD_CFUNC simd_float4 __tg_pow(simd_float4 x, simd_float4 y) {
5264 return _simd_pow_f4(x, y);
5265}
5266#else
5267static inline SIMD_CFUNC simd_float4 __tg_pow(simd_float4 x, simd_float4 y) {
5268 return simd_make_float4(pow(x.x, y.x), pow(x.y, y.y), pow(x.z, y.z), pow(x.w, y.w));
5269}
5270#endif
5271
5272#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5273extern simd_float8 _simd_pow_f8(simd_float8 x, simd_float8 y);
5274static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y) {
5275 return _simd_pow_f8(x, y);
5276}
5277#else
5278static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y) {
5279 return simd_make_float8(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi));
5280}
5281#endif
5282
5283#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5284extern simd_float16 _simd_pow_f16(simd_float16 x, simd_float16 y);
5285static inline SIMD_CFUNC simd_float16 __tg_pow(simd_float16 x, simd_float16 y) {
5286 return _simd_pow_f16(x, y);
5287}
5288#else
5289static inline SIMD_CFUNC simd_float16 __tg_pow(simd_float16 x, simd_float16 y) {
5290 return simd_make_float16(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi));
5291}
5292#endif
5293
5294#if SIMD_LIBRARY_VERSION >= 3
5295extern simd_double2 _simd_pow_d2(simd_double2 x, simd_double2 y);
5296static inline SIMD_CFUNC simd_double2 __tg_pow(simd_double2 x, simd_double2 y) {
5297 return _simd_pow_d2(x, y);
5298}
5299#else
5300static inline SIMD_CFUNC simd_double2 __tg_pow(simd_double2 x, simd_double2 y) {
5301 return simd_make_double2(pow(x.x, y.x), pow(x.y, y.y));
5302}
5303#endif
5304
5305static inline SIMD_CFUNC simd_double3 __tg_pow(simd_double3 x, simd_double3 y) {
5306 return simd_make_double3(__tg_pow(simd_make_double4(x), simd_make_double4(y)));
5307}
5308
5309#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5310extern simd_double4 _simd_pow_d4(simd_double4 x, simd_double4 y);
5311static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y) {
5312 return _simd_pow_d4(x, y);
5313}
5314#else
5315static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y) {
5316 return simd_make_double4(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi));
5317}
5318#endif
5319
5320#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5321extern simd_double8 _simd_pow_d8(simd_double8 x, simd_double8 y);
5322static inline SIMD_CFUNC simd_double8 __tg_pow(simd_double8 x, simd_double8 y) {
5323 return _simd_pow_d8(x, y);
5324}
5325#else
5326static inline SIMD_CFUNC simd_double8 __tg_pow(simd_double8 x, simd_double8 y) {
5327 return simd_make_double8(__tg_pow(x.lo, y.lo), __tg_pow(x.hi, y.hi));
5328}
5329#endif
5330
5331#pragma mark - fmod implementation
5332static inline SIMD_CFUNC simd_float2 __tg_fmod(simd_float2 x, simd_float2 y) {
5333 return simd_make_float2(__tg_fmod(simd_make_float4(x), simd_make_float4(y)));
5334}
5335
5336static inline SIMD_CFUNC simd_float3 __tg_fmod(simd_float3 x, simd_float3 y) {
5337 return simd_make_float3(__tg_fmod(simd_make_float4(x), simd_make_float4(y)));
5338}
5339
5340#if SIMD_LIBRARY_VERSION >= 3
5341extern simd_float4 _simd_fmod_f4(simd_float4 x, simd_float4 y);
5342static inline SIMD_CFUNC simd_float4 __tg_fmod(simd_float4 x, simd_float4 y) {
5343 return _simd_fmod_f4(x, y);
5344}
5345#else
5346static inline SIMD_CFUNC simd_float4 __tg_fmod(simd_float4 x, simd_float4 y) {
5347 return simd_make_float4(fmod(x.x, y.x), fmod(x.y, y.y), fmod(x.z, y.z), fmod(x.w, y.w));
5348}
5349#endif
5350
5351#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5352extern simd_float8 _simd_fmod_f8(simd_float8 x, simd_float8 y);
5353static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y) {
5354 return _simd_fmod_f8(x, y);
5355}
5356#else
5357static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y) {
5358 return simd_make_float8(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi));
5359}
5360#endif
5361
5362#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5363extern simd_float16 _simd_fmod_f16(simd_float16 x, simd_float16 y);
5364static inline SIMD_CFUNC simd_float16 __tg_fmod(simd_float16 x, simd_float16 y) {
5365 return _simd_fmod_f16(x, y);
5366}
5367#else
5368static inline SIMD_CFUNC simd_float16 __tg_fmod(simd_float16 x, simd_float16 y) {
5369 return simd_make_float16(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi));
5370}
5371#endif
5372
5373#if SIMD_LIBRARY_VERSION >= 3
5374extern simd_double2 _simd_fmod_d2(simd_double2 x, simd_double2 y);
5375static inline SIMD_CFUNC simd_double2 __tg_fmod(simd_double2 x, simd_double2 y) {
5376 return _simd_fmod_d2(x, y);
5377}
5378#else
5379static inline SIMD_CFUNC simd_double2 __tg_fmod(simd_double2 x, simd_double2 y) {
5380 return simd_make_double2(fmod(x.x, y.x), fmod(x.y, y.y));
5381}
5382#endif
5383
5384static inline SIMD_CFUNC simd_double3 __tg_fmod(simd_double3 x, simd_double3 y) {
5385 return simd_make_double3(__tg_fmod(simd_make_double4(x), simd_make_double4(y)));
5386}
5387
5388#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5389extern simd_double4 _simd_fmod_d4(simd_double4 x, simd_double4 y);
5390static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y) {
5391 return _simd_fmod_d4(x, y);
5392}
5393#else
5394static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y) {
5395 return simd_make_double4(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi));
5396}
5397#endif
5398
5399#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5400extern simd_double8 _simd_fmod_d8(simd_double8 x, simd_double8 y);
5401static inline SIMD_CFUNC simd_double8 __tg_fmod(simd_double8 x, simd_double8 y) {
5402 return _simd_fmod_d8(x, y);
5403}
5404#else
5405static inline SIMD_CFUNC simd_double8 __tg_fmod(simd_double8 x, simd_double8 y) {
5406 return simd_make_double8(__tg_fmod(x.lo, y.lo), __tg_fmod(x.hi, y.hi));
5407}
5408#endif
5409
5410#pragma mark - remainder implementation
5411static inline SIMD_CFUNC simd_float2 __tg_remainder(simd_float2 x, simd_float2 y) {
5412 return simd_make_float2(__tg_remainder(simd_make_float4(x), simd_make_float4(y)));
5413}
5414
5415static inline SIMD_CFUNC simd_float3 __tg_remainder(simd_float3 x, simd_float3 y) {
5416 return simd_make_float3(__tg_remainder(simd_make_float4(x), simd_make_float4(y)));
5417}
5418
5419#if SIMD_LIBRARY_VERSION >= 3
5420extern simd_float4 _simd_remainder_f4(simd_float4 x, simd_float4 y);
5421static inline SIMD_CFUNC simd_float4 __tg_remainder(simd_float4 x, simd_float4 y) {
5422 return _simd_remainder_f4(x, y);
5423}
5424#else
5425static inline SIMD_CFUNC simd_float4 __tg_remainder(simd_float4 x, simd_float4 y) {
5426 return simd_make_float4(remainder(x.x, y.x), remainder(x.y, y.y), remainder(x.z, y.z), remainder(x.w, y.w));
5427}
5428#endif
5429
5430#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5431extern simd_float8 _simd_remainder_f8(simd_float8 x, simd_float8 y);
5432static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y) {
5433 return _simd_remainder_f8(x, y);
5434}
5435#else
5436static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y) {
5437 return simd_make_float8(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi));
5438}
5439#endif
5440
5441#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5442extern simd_float16 _simd_remainder_f16(simd_float16 x, simd_float16 y);
5443static inline SIMD_CFUNC simd_float16 __tg_remainder(simd_float16 x, simd_float16 y) {
5444 return _simd_remainder_f16(x, y);
5445}
5446#else
5447static inline SIMD_CFUNC simd_float16 __tg_remainder(simd_float16 x, simd_float16 y) {
5448 return simd_make_float16(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi));
5449}
5450#endif
5451
5452#if SIMD_LIBRARY_VERSION >= 3
5453extern simd_double2 _simd_remainder_d2(simd_double2 x, simd_double2 y);
5454static inline SIMD_CFUNC simd_double2 __tg_remainder(simd_double2 x, simd_double2 y) {
5455 return _simd_remainder_d2(x, y);
5456}
5457#else
5458static inline SIMD_CFUNC simd_double2 __tg_remainder(simd_double2 x, simd_double2 y) {
5459 return simd_make_double2(remainder(x.x, y.x), remainder(x.y, y.y));
5460}
5461#endif
5462
5463static inline SIMD_CFUNC simd_double3 __tg_remainder(simd_double3 x, simd_double3 y) {
5464 return simd_make_double3(__tg_remainder(simd_make_double4(x), simd_make_double4(y)));
5465}
5466
5467#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5468extern simd_double4 _simd_remainder_d4(simd_double4 x, simd_double4 y);
5469static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double4 y) {
5470 return _simd_remainder_d4(x, y);
5471}
5472#else
5473static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double4 y) {
5474 return simd_make_double4(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi));
5475}
5476#endif
5477
5478#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5479extern simd_double8 _simd_remainder_d8(simd_double8 x, simd_double8 y);
5480static inline SIMD_CFUNC simd_double8 __tg_remainder(simd_double8 x, simd_double8 y) {
5481 return _simd_remainder_d8(x, y);
5482}
5483#else
5484static inline SIMD_CFUNC simd_double8 __tg_remainder(simd_double8 x, simd_double8 y) {
5485 return simd_make_double8(__tg_remainder(x.lo, y.lo), __tg_remainder(x.hi, y.hi));
5486}
5487#endif
5488
5489#pragma mark - nextafter implementation
5490static inline SIMD_CFUNC simd_float2 __tg_nextafter(simd_float2 x, simd_float2 y) {
5491 return simd_make_float2(__tg_nextafter(simd_make_float4(x), simd_make_float4(y)));
5492}
5493
5494static inline SIMD_CFUNC simd_float3 __tg_nextafter(simd_float3 x, simd_float3 y) {
5495 return simd_make_float3(__tg_nextafter(simd_make_float4(x), simd_make_float4(y)));
5496}
5497
5498#if SIMD_LIBRARY_VERSION >= 3
5499extern simd_float4 _simd_nextafter_f4(simd_float4 x, simd_float4 y);
5500static inline SIMD_CFUNC simd_float4 __tg_nextafter(simd_float4 x, simd_float4 y) {
5501 return _simd_nextafter_f4(x, y);
5502}
5503#else
5504static inline SIMD_CFUNC simd_float4 __tg_nextafter(simd_float4 x, simd_float4 y) {
5505 return simd_make_float4(nextafter(x.x, y.x), nextafter(x.y, y.y), nextafter(x.z, y.z), nextafter(x.w, y.w));
5506}
5507#endif
5508
5509#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5510extern simd_float8 _simd_nextafter_f8(simd_float8 x, simd_float8 y);
5511static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y) {
5512 return _simd_nextafter_f8(x, y);
5513}
5514#else
5515static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y) {
5516 return simd_make_float8(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi));
5517}
5518#endif
5519
5520#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5521extern simd_float16 _simd_nextafter_f16(simd_float16 x, simd_float16 y);
5522static inline SIMD_CFUNC simd_float16 __tg_nextafter(simd_float16 x, simd_float16 y) {
5523 return _simd_nextafter_f16(x, y);
5524}
5525#else
5526static inline SIMD_CFUNC simd_float16 __tg_nextafter(simd_float16 x, simd_float16 y) {
5527 return simd_make_float16(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi));
5528}
5529#endif
5530
5531#if SIMD_LIBRARY_VERSION >= 3
5532extern simd_double2 _simd_nextafter_d2(simd_double2 x, simd_double2 y);
5533static inline SIMD_CFUNC simd_double2 __tg_nextafter(simd_double2 x, simd_double2 y) {
5534 return _simd_nextafter_d2(x, y);
5535}
5536#else
5537static inline SIMD_CFUNC simd_double2 __tg_nextafter(simd_double2 x, simd_double2 y) {
5538 return simd_make_double2(nextafter(x.x, y.x), nextafter(x.y, y.y));
5539}
5540#endif
5541
5542static inline SIMD_CFUNC simd_double3 __tg_nextafter(simd_double3 x, simd_double3 y) {
5543 return simd_make_double3(__tg_nextafter(simd_make_double4(x), simd_make_double4(y)));
5544}
5545
5546#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__
5547extern simd_double4 _simd_nextafter_d4(simd_double4 x, simd_double4 y);
5548static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double4 y) {
5549 return _simd_nextafter_d4(x, y);
5550}
5551#else
5552static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double4 y) {
5553 return simd_make_double4(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi));
5554}
5555#endif
5556
5557#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__
5558extern simd_double8 _simd_nextafter_d8(simd_double8 x, simd_double8 y);
5559static inline SIMD_CFUNC simd_double8 __tg_nextafter(simd_double8 x, simd_double8 y) {
5560 return _simd_nextafter_d8(x, y);
5561}
5562#else
5563static inline SIMD_CFUNC simd_double8 __tg_nextafter(simd_double8 x, simd_double8 y) {
5564 return simd_make_double8(__tg_nextafter(x.lo, y.lo), __tg_nextafter(x.hi, y.hi));
5565}
5566#endif
5567
5568#pragma mark - lgamma implementation
5569static inline SIMD_CFUNC simd_float2 __tg_lgamma(simd_float2 x) {
5570 return simd_make_float2(__tg_lgamma(simd_make_float4(x)));
5571}
5572
5573static inline SIMD_CFUNC simd_float3 __tg_lgamma(simd_float3 x) {
5574 return simd_make_float3(__tg_lgamma(simd_make_float4(x)));
5575}
5576
5577#if SIMD_LIBRARY_VERSION >= 4
5578extern simd_float4 _simd_lgamma_f4(simd_float4 x);
5579static inline SIMD_CFUNC simd_float4 __tg_lgamma(simd_float4 x) {
5580 return _simd_lgamma_f4(x);
5581}
5582#else
5583static inline SIMD_CFUNC simd_float4 __tg_lgamma(simd_float4 x) {
5584 return simd_make_float4(lgamma(x.x), lgamma(x.y), lgamma(x.z), lgamma(x.w));
5585}
5586#endif
5587
5588#if SIMD_LIBRARY_VERSION >= 4 && defined __x86_64__ && defined __AVX2__
5589extern simd_float8 _simd_lgamma_f8(simd_float8 x);
5590static inline SIMD_CFUNC simd_float8 __tg_lgamma(simd_float8 x) {
5591 return _simd_lgamma_f8(x);
5592}
5593#else
5594static inline SIMD_CFUNC simd_float8 __tg_lgamma(simd_float8 x) {
5595 return simd_make_float8(__tg_lgamma(x.lo), __tg_lgamma(x.hi));
5596}
5597#endif
5598
5599#if SIMD_LIBRARY_VERSION >= 4 && defined __x86_64__ && defined __AVX512F__
5600extern simd_float16 _simd_lgamma_f16(simd_float16 x);
5601static inline SIMD_CFUNC simd_float16 __tg_lgamma(simd_float16 x) {
5602 return _simd_lgamma_f16(x);
5603}
5604#else
5605static inline SIMD_CFUNC simd_float16 __tg_lgamma(simd_float16 x) {
5606 return simd_make_float16(__tg_lgamma(x.lo), __tg_lgamma(x.hi));
5607}
5608#endif
5609
5610#if SIMD_LIBRARY_VERSION >= 4
5611extern simd_double2 _simd_lgamma_d2(simd_double2 x);
5612static inline SIMD_CFUNC simd_double2 __tg_lgamma(simd_double2 x) {
5613 return _simd_lgamma_d2(x);
5614}
5615#else
5616static inline SIMD_CFUNC simd_double2 __tg_lgamma(simd_double2 x) {
5617 return simd_make_double2(lgamma(x.x), lgamma(x.y));
5618}
5619#endif
5620
5621static inline SIMD_CFUNC simd_double3 __tg_lgamma(simd_double3 x) {
5622 return simd_make_double3(__tg_lgamma(simd_make_double4(x)));
5623}
5624
5625#if SIMD_LIBRARY_VERSION >= 4 && defined __x86_64__ && defined __AVX2__
5626extern simd_double4 _simd_lgamma_d4(simd_double4 x);
5627static inline SIMD_CFUNC simd_double4 __tg_lgamma(simd_double4 x) {
5628 return _simd_lgamma_d4(x);
5629}
5630#else
5631static inline SIMD_CFUNC simd_double4 __tg_lgamma(simd_double4 x) {
5632 return simd_make_double4(__tg_lgamma(x.lo), __tg_lgamma(x.hi));
5633}
5634#endif
5635
5636#if SIMD_LIBRARY_VERSION >= 4 && defined __x86_64__ && defined __AVX512F__
5637extern simd_double8 _simd_lgamma_d8(simd_double8 x);
5638static inline SIMD_CFUNC simd_double8 __tg_lgamma(simd_double8 x) {
5639 return _simd_lgamma_d8(x);
5640}
5641#else
5642static inline SIMD_CFUNC simd_double8 __tg_lgamma(simd_double8 x) {
5643 return simd_make_double8(__tg_lgamma(x.lo), __tg_lgamma(x.hi));
5644}
5645#endif
5646
5647static inline SIMD_CFUNC simd_float2 __tg_fdim(simd_float2 x, simd_float2 y) { return simd_bitselect(x-y, 0, x<y); }
5648static inline SIMD_CFUNC simd_float3 __tg_fdim(simd_float3 x, simd_float3 y) { return simd_bitselect(x-y, 0, x<y); }
5649static inline SIMD_CFUNC simd_float4 __tg_fdim(simd_float4 x, simd_float4 y) { return simd_bitselect(x-y, 0, x<y); }
5650static inline SIMD_CFUNC simd_float8 __tg_fdim(simd_float8 x, simd_float8 y) { return simd_bitselect(x-y, 0, x<y); }
5651static inline SIMD_CFUNC simd_float16 __tg_fdim(simd_float16 x, simd_float16 y) { return simd_bitselect(x-y, 0, x<y); }
5652static inline SIMD_CFUNC simd_double2 __tg_fdim(simd_double2 x, simd_double2 y) { return simd_bitselect(x-y, 0, x<y); }
5653static inline SIMD_CFUNC simd_double3 __tg_fdim(simd_double3 x, simd_double3 y) { return simd_bitselect(x-y, 0, x<y); }
5654static inline SIMD_CFUNC simd_double4 __tg_fdim(simd_double4 x, simd_double4 y) { return simd_bitselect(x-y, 0, x<y); }
5655static inline SIMD_CFUNC simd_double8 __tg_fdim(simd_double8 x, simd_double8 y) { return simd_bitselect(x-y, 0, x<y); }
5656
5657static inline SIMD_CFUNC simd_float2 __tg_fma(simd_float2 x, simd_float2 y, simd_float2 z) {
5658#if defined __arm64__ || defined __ARM_VFPV4__
5659 return vfma_f32(z, x, y);
5660#else
5661 return simd_make_float2(__tg_fma(simd_make_float4_undef(x), simd_make_float4_undef(y), simd_make_float4_undef(z)));
5662#endif
5663}
5664
5665static inline SIMD_CFUNC simd_float3 __tg_fma(simd_float3 x, simd_float3 y, simd_float3 z) {
5666 return simd_make_float3(__tg_fma(simd_make_float4(x), simd_make_float4(y), simd_make_float4(z)));
5667}
5668
5669#if SIMD_LIBRARY_VERSION >= 3
5670extern simd_float4 _simd_fma_f4(simd_float4 x, simd_float4 y, simd_float4 z);
5671#endif
5672static inline SIMD_CFUNC simd_float4 __tg_fma(simd_float4 x, simd_float4 y, simd_float4 z) {
5673#if defined __arm64__ || defined __ARM_VFPV4__
5674 return vfmaq_f32(z, x, y);
5675#elif (defined __i386__ || defined __x86_64__) && defined __FMA__
5676 return _mm_fmadd_ps(x, y, z);
5677#elif SIMD_LIBRARY_VERSION >= 3
5678 return _simd_fma_f4(x, y, z);
5679#else
5680 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));
5681#endif
5682}
5683
5684static inline SIMD_CFUNC simd_float8 __tg_fma(simd_float8 x, simd_float8 y, simd_float8 z) {
5685#if (defined __i386__ || defined __x86_64__) && defined __FMA__
5686 return _mm256_fmadd_ps(x, y, z);
5687#else
5688 return simd_make_float8(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi));
5689#endif
5690}
5691
5692static inline SIMD_CFUNC simd_float16 __tg_fma(simd_float16 x, simd_float16 y, simd_float16 z) {
5693#if defined __x86_64__ && defined __AVX512F__
5694 return _mm512_fmadd_ps(x, y, z);
5695#else
5696 return simd_make_float16(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi));
5697#endif
5698}
5699
5700#if SIMD_LIBRARY_VERSION >= 3
5701extern simd_double2 _simd_fma_d2(simd_double2 x, simd_double2 y, simd_double2 z);
5702#endif
5703static inline SIMD_CFUNC simd_double2 __tg_fma(simd_double2 x, simd_double2 y, simd_double2 z) {
5704#if defined __arm64__
5705 return vfmaq_f64(z, x, y);
5706#elif (defined __i386__ || defined __x86_64__) && defined __FMA__
5707 return _mm_fmadd_pd(x, y, z);
5708#elif SIMD_LIBRARY_VERSION >= 3
5709 return _simd_fma_d2(x, y, z);
5710#else
5711 return simd_make_double2(fma(x.x, y.x, z.x), fma(x.y, y.y, z.y));
5712#endif
5713}
5714
5715static inline SIMD_CFUNC simd_double3 __tg_fma(simd_double3 x, simd_double3 y, simd_double3 z) {
5716 return simd_make_double3(__tg_fma(simd_make_double4(x), simd_make_double4(y), simd_make_double4(z)));
5717}
5718
5719static inline SIMD_CFUNC simd_double4 __tg_fma(simd_double4 x, simd_double4 y, simd_double4 z) {
5720#if (defined __i386__ || defined __x86_64__) && defined __FMA__
5721 return _mm256_fmadd_pd(x, y, z);
5722#else
5723 return simd_make_double4(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi));
5724#endif
5725}
5726
5727static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, simd_double8 z) {
5728#if defined __x86_64__ && defined __AVX512F__
5729 return _mm512_fmadd_pd(x, y, z);
5730#else
5731 return simd_make_double8(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi));
5732#endif
5733}
5734
5735static inline SIMD_CFUNC float simd_muladd(float x, float y, float z) {
5736#pragma STDC FP_CONTRACT ON
5737 return x*y + z;
5738}
5739static inline SIMD_CFUNC simd_float2 simd_muladd(simd_float2 x, simd_float2 y, simd_float2 z) {
5740#pragma STDC FP_CONTRACT ON
5741 return x*y + z;
5742}
5743static inline SIMD_CFUNC simd_float3 simd_muladd(simd_float3 x, simd_float3 y, simd_float3 z) {
5744#pragma STDC FP_CONTRACT ON
5745 return x*y + z;
5746}
5747static inline SIMD_CFUNC simd_float4 simd_muladd(simd_float4 x, simd_float4 y, simd_float4 z) {
5748#pragma STDC FP_CONTRACT ON
5749 return x*y + z;
5750}
5751static inline SIMD_CFUNC simd_float8 simd_muladd(simd_float8 x, simd_float8 y, simd_float8 z) {
5752#pragma STDC FP_CONTRACT ON
5753 return x*y + z;
5754}
5755static inline SIMD_CFUNC simd_float16 simd_muladd(simd_float16 x, simd_float16 y, simd_float16 z) {
5756#pragma STDC FP_CONTRACT ON
5757 return x*y + z;
5758}
5759static inline SIMD_CFUNC double simd_muladd(double x, double y, double z) {
5760#pragma STDC FP_CONTRACT ON
5761 return x*y + z;
5762}
5763static inline SIMD_CFUNC simd_double2 simd_muladd(simd_double2 x, simd_double2 y, simd_double2 z) {
5764#pragma STDC FP_CONTRACT ON
5765 return x*y + z;
5766}
5767static inline SIMD_CFUNC simd_double3 simd_muladd(simd_double3 x, simd_double3 y, simd_double3 z) {
5768#pragma STDC FP_CONTRACT ON
5769 return x*y + z;
5770}
5771static inline SIMD_CFUNC simd_double4 simd_muladd(simd_double4 x, simd_double4 y, simd_double4 z) {
5772#pragma STDC FP_CONTRACT ON
5773 return x*y + z;
5774}
5775static inline SIMD_CFUNC simd_double8 simd_muladd(simd_double8 x, simd_double8 y, simd_double8 z) {
5776#pragma STDC FP_CONTRACT ON
5777 return x*y + z;
5778}
5779#ifdef __cplusplus
5780} /* extern "C" */
5781#endif
5782#endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */
5783#endif /* SIMD_MATH_HEADER */
\ No newline at end of file
lib/libc/include/any-macos.12-any/stdio.h created+402
......@@ -0,0 +1,402 @@
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
221#if __DARWIN_C_LEVEL >= 199209L
222__BEGIN_DECLS
223int pclose(FILE *) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
224#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
225FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
226#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
227FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
228#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
229__END_DECLS
230#endif /* __DARWIN_C_LEVEL >= 199209L */
231
232/* Additional functionality provided by:
233 * POSIX.1c-1995,
234 * POSIX.1i-1995,
235 * and the omnibus ISO/IEC 9945-1: 1996
236 */
237
238#if __DARWIN_C_LEVEL >= 199506L
239
240/* Functions internal to the implementation. */
241__BEGIN_DECLS
242int __srget(FILE *);
243int __svfscanf(FILE *, const char *, va_list) __scanflike(2, 0);
244int __swbuf(int, FILE *);
245__END_DECLS
246
247/*
248 * The __sfoo macros are here so that we can
249 * define function versions in the C library.
250 */
251#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
252#if defined(__GNUC__) && defined(__STDC__)
253__header_always_inline int __sputc(int _c, FILE *_p) {
254 if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
255 return (*_p->_p++ = _c);
256 else
257 return (__swbuf(_c, _p));
258}
259#else
260/*
261 * This has been tuned to generate reasonable code on the vax using pcc.
262 */
263#define __sputc(c, p) \
264 (--(p)->_w < 0 ? \
265 (p)->_w >= (p)->_lbfsize ? \
266 (*(p)->_p = (c)), *(p)->_p != '\n' ? \
267 (int)*(p)->_p++ : \
268 __swbuf('\n', p) : \
269 __swbuf((int)(c), p) : \
270 (*(p)->_p = (c), (int)*(p)->_p++))
271#endif
272
273#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
274#define __sferror(p) (((p)->_flags & __SERR) != 0)
275#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
276#define __sfileno(p) ((p)->_file)
277
278__BEGIN_DECLS
279void flockfile(FILE *);
280int ftrylockfile(FILE *);
281void funlockfile(FILE *);
282int getc_unlocked(FILE *);
283int getchar_unlocked(void);
284int putc_unlocked(int, FILE *);
285int putchar_unlocked(int);
286
287/* Removed in Issue 6 */
288#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
289int getw(FILE *);
290int putw(int, FILE *);
291#endif
292
293__swift_unavailable("Use mkstemp(3) instead.")
294#if !defined(_POSIX_C_SOURCE)
295__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.")
296#endif
297char *tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam);
298__END_DECLS
299
300#ifndef lint
301#define getc_unlocked(fp) __sgetc(fp)
302#define putc_unlocked(x, fp) __sputc(x, fp)
303#endif /* lint */
304
305#define getchar_unlocked() getc_unlocked(stdin)
306#define putchar_unlocked(x) putc_unlocked(x, stdout)
307#endif /* __DARWIN_C_LEVEL >= 199506L */
308
309
310
311/* Additional functionality provided by:
312 * POSIX.1-2001
313 * ISO C99
314 */
315
316#if __DARWIN_C_LEVEL >= 200112L
317#include <sys/_types/_off_t.h>
318
319__BEGIN_DECLS
320int fseeko(FILE * __stream, off_t __offset, int __whence);
321off_t ftello(FILE * __stream);
322__END_DECLS
323#endif /* __DARWIN_C_LEVEL >= 200112L */
324
325#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
326__BEGIN_DECLS
327int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
328int vfscanf(FILE * __restrict __stream, const char * __restrict __format, va_list) __scanflike(2, 0);
329int vscanf(const char * __restrict __format, va_list) __scanflike(1, 0);
330int vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0);
331int vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0);
332__END_DECLS
333#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */
334
335
336
337/* Additional functionality provided by:
338 * POSIX.1-2008
339 */
340
341#if __DARWIN_C_LEVEL >= 200809L
342#include <sys/_types/_ssize_t.h>
343
344__BEGIN_DECLS
345int dprintf(int, const char * __restrict, ...) __printflike(2, 3) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
346int vdprintf(int, const char * __restrict, va_list) __printflike(2, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
347ssize_t getdelim(char ** __restrict __linep, size_t * __restrict __linecapp, int __delimiter, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
348ssize_t getline(char ** __restrict __linep, size_t * __restrict __linecapp, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
349FILE *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));
350FILE *open_memstream(char **__bufp, size_t *__sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
351__END_DECLS
352#endif /* __DARWIN_C_LEVEL >= 200809L */
353
354
355
356/* Darwin extensions */
357
358#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
359__BEGIN_DECLS
360extern __const int sys_nerr; /* perror(3) external variables */
361extern __const char *__const sys_errlist[];
362
363int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
364char *ctermid_r(char *);
365char *fgetln(FILE *, size_t *);
366__const char *fmtcheck(const char *, const char *);
367int fpurge(FILE *);
368void setbuffer(FILE *, char *, int);
369int setlinebuf(FILE *);
370int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
371
372
373/*
374 * Stdio function-access interface.
375 */
376FILE *funopen(const void *,
377 int (* _Nullable)(void *, char *, int),
378 int (* _Nullable)(void *, const char *, int),
379 fpos_t (* _Nullable)(void *, fpos_t, int),
380 int (* _Nullable)(void *));
381__END_DECLS
382#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
383#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
384
385#define feof_unlocked(p) __sfeof(p)
386#define ferror_unlocked(p) __sferror(p)
387#define clearerr_unlocked(p) __sclearerr(p)
388#define fileno_unlocked(p) __sfileno(p)
389
390#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
391
392
393#ifdef _USE_EXTENDED_LOCALES_
394#include <xlocale/_stdio.h>
395#endif /* _USE_EXTENDED_LOCALES_ */
396
397#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
398/* Security checking functions. */
399#include <secure/_stdio.h>
400#endif
401
402#endif /* _STDIO_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/stdlib.h created+375
......@@ -0,0 +1,375 @@
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__swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)")
182__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
183__WATCHOS_PROHIBITED __TVOS_PROHIBITED
184int system(const char *) __DARWIN_ALIAS_C(system);
185
186
187size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
188int wctomb(char *, wchar_t);
189
190#ifndef _ANSI_SOURCE
191void _Exit(int) __dead2;
192long a64l(const char *);
193double drand48(void);
194char *ecvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
195double erand48(unsigned short[3]);
196char *fcvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
197char *gcvt(double, int, char *); /* LEGACY */
198int getsubopt(char **, char * const *, char **);
199int grantpt(int);
200#if __DARWIN_UNIX03
201char *initstate(unsigned, char *, size_t); /* no __DARWIN_ALIAS needed */
202#else /* !__DARWIN_UNIX03 */
203char *initstate(unsigned long, char *, long);
204#endif /* __DARWIN_UNIX03 */
205long jrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
206char *l64a(long);
207void lcong48(unsigned short[7]);
208long lrand48(void) __swift_unavailable("Use arc4random instead.");
209char *mktemp(char *);
210int mkstemp(char *);
211long mrand48(void) __swift_unavailable("Use arc4random instead.");
212long nrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
213int posix_openpt(int);
214char *ptsname(int);
215
216#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
217int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3));
218#endif
219
220int putenv(char *) __DARWIN_ALIAS(putenv);
221long random(void) __swift_unavailable("Use arc4random instead.");
222int rand_r(unsigned *) __swift_unavailable("Use arc4random instead.");
223#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH)
224char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath);
225#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */
226char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath);
227#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */
228unsigned short
229 *seed48(unsigned short[3]);
230int setenv(const char * __name, const char * __value, int __overwrite) __DARWIN_ALIAS(setenv);
231#if __DARWIN_UNIX03
232void setkey(const char *) __DARWIN_ALIAS(setkey);
233#else /* !__DARWIN_UNIX03 */
234int setkey(const char *);
235#endif /* __DARWIN_UNIX03 */
236char *setstate(const char *);
237void srand48(long);
238#if __DARWIN_UNIX03
239void srandom(unsigned);
240#else /* !__DARWIN_UNIX03 */
241void srandom(unsigned long);
242#endif /* __DARWIN_UNIX03 */
243int unlockpt(int);
244#if __DARWIN_UNIX03
245int unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
246#else /* !__DARWIN_UNIX03 */
247void unsetenv(const char *);
248#endif /* __DARWIN_UNIX03 */
249#endif /* !_ANSI_SOURCE */
250
251#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
252#include <machine/types.h>
253#include <sys/_types/_dev_t.h>
254#include <sys/_types/_mode_t.h>
255#include <_types/_uint32_t.h>
256
257uint32_t arc4random(void);
258void arc4random_addrandom(unsigned char * /*dat*/, int /*datlen*/)
259 __OSX_DEPRECATED(10.0, 10.12, "use arc4random_stir")
260 __IOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
261 __TVOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
262 __WATCHOS_DEPRECATED(1.0, 3.0, "use arc4random_stir");
263void arc4random_buf(void * __buf, size_t __nbytes) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
264void arc4random_stir(void);
265uint32_t
266 arc4random_uniform(uint32_t __upper_bound) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
267#ifdef __BLOCKS__
268int atexit_b(void (^ _Nonnull)(void)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
269
270#ifdef __BLOCKS__
271#if __has_attribute(noescape)
272#define __bsearch_noescape __attribute__((__noescape__))
273#else
274#define __bsearch_noescape
275#endif
276#endif /* __BLOCKS__ */
277void *bsearch_b(const void *__key, const void *__base, size_t __nel,
278 size_t __width, int (^ _Nonnull __compar)(const void *, const void *) __bsearch_noescape)
279 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
280#endif /* __BLOCKS__ */
281
282 /* getcap(3) functions */
283char *cgetcap(char *, const char *, int);
284int cgetclose(void);
285int cgetent(char **, char **, const char *);
286int cgetfirst(char **, char **);
287int cgetmatch(const char *, const char *);
288int cgetnext(char **, char **);
289int cgetnum(char *, const char *, long *);
290int cgetset(const char *);
291int cgetstr(char *, const char *, char **);
292int cgetustr(char *, const char *, char **);
293
294int 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;
295char *devname(dev_t, mode_t);
296char *devname_r(dev_t, mode_t, char *buf, int len);
297char *getbsize(int *, long *);
298int getloadavg(double [], int);
299const char
300 *getprogname(void);
301void setprogname(const char *);
302
303#ifdef __BLOCKS__
304#if __has_attribute(noescape)
305#define __sort_noescape __attribute__((__noescape__))
306#else
307#define __sort_noescape
308#endif
309#endif /* __BLOCKS__ */
310
311int heapsort(void *__base, size_t __nel, size_t __width,
312 int (* _Nonnull __compar)(const void *, const void *));
313#ifdef __BLOCKS__
314int heapsort_b(void *__base, size_t __nel, size_t __width,
315 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
316 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
317#endif /* __BLOCKS__ */
318int mergesort(void *__base, size_t __nel, size_t __width,
319 int (* _Nonnull __compar)(const void *, const void *));
320#ifdef __BLOCKS__
321int mergesort_b(void *__base, size_t __nel, size_t __width,
322 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
323 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
324#endif /* __BLOCKS__ */
325void psort(void *__base, size_t __nel, size_t __width,
326 int (* _Nonnull __compar)(const void *, const void *))
327 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
328#ifdef __BLOCKS__
329void psort_b(void *__base, size_t __nel, size_t __width,
330 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
331 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
332#endif /* __BLOCKS__ */
333void psort_r(void *__base, size_t __nel, size_t __width, void *,
334 int (* _Nonnull __compar)(void *, const void *, const void *))
335 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
336#ifdef __BLOCKS__
337void qsort_b(void *__base, size_t __nel, size_t __width,
338 int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
339 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
340#endif /* __BLOCKS__ */
341void qsort_r(void *__base, size_t __nel, size_t __width, void *,
342 int (* _Nonnull __compar)(void *, const void *, const void *));
343int radixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
344 unsigned __endbyte);
345int rpmatch(const char *)
346 __API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
347int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
348 unsigned __endbyte);
349void sranddev(void);
350void srandomdev(void);
351void *reallocf(void *__ptr, size_t __size) __alloc_size(2);
352long long
353 strtonum(const char *__numstr, long long __minval, long long __maxval, const char **__errstrp)
354 __API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0));
355#if !__DARWIN_NO_LONG_LONG
356long long
357 strtoq(const char *__str, char **__endptr, int __base);
358unsigned long long
359 strtouq(const char *__str, char **__endptr, int __base);
360#endif /* !__DARWIN_NO_LONG_LONG */
361extern char *suboptarg; /* getsubopt(3) external variable */
362/* valloc is now declared in _malloc.h */
363#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
364
365/* Poison the following routines if -fshort-wchar is set */
366#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
367#pragma GCC poison mbstowcs mbtowc wcstombs wctomb
368#endif
369__END_DECLS
370
371#ifdef _USE_EXTENDED_LOCALES_
372#include <xlocale/_stdlib.h>
373#endif /* _USE_EXTENDED_LOCALES_ */
374
375#endif /* _STDLIB_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/sys/resource.h created+524
......@@ -0,0 +1,524 @@
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#define IOPOL_TYPE_VFS_IGNORE_PERMISSIONS 7
461#define IOPOL_TYPE_VFS_SKIP_MTIME_UPDATE 8
462#define IOPOL_TYPE_VFS_ALLOW_LOW_SPACE_WRITES 9
463
464/* scope */
465#define IOPOL_SCOPE_PROCESS 0
466#define IOPOL_SCOPE_THREAD 1
467#define IOPOL_SCOPE_DARWIN_BG 2
468
469/* I/O Priority */
470#define IOPOL_DEFAULT 0
471#define IOPOL_IMPORTANT 1
472#define IOPOL_PASSIVE 2
473#define IOPOL_THROTTLE 3
474#define IOPOL_UTILITY 4
475#define IOPOL_STANDARD 5
476
477/* compatibility with older names */
478#define IOPOL_APPLICATION IOPOL_STANDARD
479#define IOPOL_NORMAL IOPOL_IMPORTANT
480
481
482#define IOPOL_ATIME_UPDATES_DEFAULT 0
483#define IOPOL_ATIME_UPDATES_OFF 1
484
485#define IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT 0
486#define IOPOL_MATERIALIZE_DATALESS_FILES_OFF 1
487#define IOPOL_MATERIALIZE_DATALESS_FILES_ON 2
488
489#define IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT 0
490#define IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME 1
491
492#define IOPOL_VFS_TRIGGER_RESOLVE_DEFAULT 0
493#define IOPOL_VFS_TRIGGER_RESOLVE_OFF 1
494
495#define IOPOL_VFS_CONTENT_PROTECTION_DEFAULT 0
496#define IOPOL_VFS_CONTENT_PROTECTION_IGNORE 1
497
498#define IOPOL_VFS_IGNORE_PERMISSIONS_OFF 0
499#define IOPOL_VFS_IGNORE_PERMISSIONS_ON 1
500
501#define IOPOL_VFS_SKIP_MTIME_UPDATE_OFF 0
502#define IOPOL_VFS_SKIP_MTIME_UPDATE_ON 1
503
504#define IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_OFF 0
505#define IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_ON 1
506
507#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
508
509
510__BEGIN_DECLS
511int getpriority(int, id_t);
512#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
513int getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
514#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
515int getrlimit(int, struct rlimit *) __DARWIN_ALIAS(getrlimit);
516int getrusage(int, struct rusage *);
517int setpriority(int, id_t, int);
518#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
519int setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
520#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
521int setrlimit(int, const struct rlimit *) __DARWIN_ALIAS(setrlimit);
522__END_DECLS
523
524#endif /* !_SYS_RESOURCE_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/sys/socket.h created+745
......@@ -0,0 +1,745 @@
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
82#include <Availability.h>
83
84/*
85 * Definitions related to sockets: types, address families, options.
86 */
87
88/*
89 * Data types.
90 */
91
92#include <sys/_types/_gid_t.h>
93#include <sys/_types/_off_t.h>
94#include <sys/_types/_pid_t.h>
95#include <sys/_types/_sa_family_t.h>
96#include <sys/_types/_socklen_t.h>
97
98/* XXX Not explicitly defined by POSIX, but function return types are */
99#include <sys/_types/_size_t.h>
100
101/* XXX Not explicitly defined by POSIX, but function return types are */
102#include <sys/_types/_ssize_t.h>
103
104/*
105 * [XSI] The iovec structure shall be defined as described in <sys/uio.h>.
106 */
107#include <sys/_types/_iovec_t.h>
108
109/*
110 * Types
111 */
112#define SOCK_STREAM 1 /* stream socket */
113#define SOCK_DGRAM 2 /* datagram socket */
114#define SOCK_RAW 3 /* raw-protocol interface */
115#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
116#define SOCK_RDM 4 /* reliably-delivered message */
117#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
118#define SOCK_SEQPACKET 5 /* sequenced packet stream */
119
120/*
121 * Option flags per-socket.
122 */
123#define SO_DEBUG 0x0001 /* turn on debugging info recording */
124#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
125#define SO_REUSEADDR 0x0004 /* allow local address reuse */
126#define SO_KEEPALIVE 0x0008 /* keep connections alive */
127#define SO_DONTROUTE 0x0010 /* just use interface addresses */
128#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
129#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
130#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
131#define SO_LINGER 0x0080 /* linger on close if data present (in ticks) */
132#else
133#define SO_LINGER 0x1080 /* linger on close if data present (in seconds) */
134#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
135#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
136#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
137#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
138#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */
139#define SO_TIMESTAMP_MONOTONIC 0x0800 /* Monotonically increasing timestamp on rcvd dgram */
140#ifndef __APPLE__
141#define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */
142#else
143#define SO_DONTTRUNC 0x2000 /* APPLE: Retain unread data */
144 /* (ATOMIC proto) */
145#define SO_WANTMORE 0x4000 /* APPLE: Give hint when more data ready */
146#define SO_WANTOOBFLAG 0x8000 /* APPLE: Want OOB in MSG_FLAG on receive */
147
148
149#endif /* (!__APPLE__) */
150#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
151
152/*
153 * Additional options, not kept in so_options.
154 */
155#define SO_SNDBUF 0x1001 /* send buffer size */
156#define SO_RCVBUF 0x1002 /* receive buffer size */
157#define SO_SNDLOWAT 0x1003 /* send low-water mark */
158#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
159#define SO_SNDTIMEO 0x1005 /* send timeout */
160#define SO_RCVTIMEO 0x1006 /* receive timeout */
161#define SO_ERROR 0x1007 /* get error status and clear */
162#define SO_TYPE 0x1008 /* get socket type */
163#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
164#define SO_LABEL 0x1010 /* deprecated */
165#define SO_PEERLABEL 0x1011 /* deprecated */
166#ifdef __APPLE__
167#define SO_NREAD 0x1020 /* APPLE: get 1st-packet byte count */
168#define SO_NKE 0x1021 /* APPLE: Install socket-level NKE */
169#define SO_NOSIGPIPE 0x1022 /* APPLE: No SIGPIPE on EPIPE */
170#define SO_NOADDRERR 0x1023 /* APPLE: Returns EADDRNOTAVAIL when src is not available anymore */
171#define SO_NWRITE 0x1024 /* APPLE: Get number of bytes currently in send socket buffer */
172#define SO_REUSESHAREUID 0x1025 /* APPLE: Allow reuse of port/socket by different userids */
173#ifdef __APPLE_API_PRIVATE
174#define SO_NOTIFYCONFLICT 0x1026 /* APPLE: send notification if there is a bind on a port which is already in use */
175#define SO_UPCALLCLOSEWAIT 0x1027 /* APPLE: block on close until an upcall returns */
176#endif
177#define SO_LINGER_SEC 0x1080 /* linger on close if data present (in seconds) */
178#define SO_RANDOMPORT 0x1082 /* APPLE: request local port randomization */
179#define SO_NP_EXTENSIONS 0x1083 /* To turn off some POSIX behavior */
180#endif
181
182#define SO_NUMRCVPKT 0x1112 /* number of datagrams in receive socket buffer */
183#define SO_NET_SERVICE_TYPE 0x1116 /* Network service type */
184
185
186#define SO_NETSVC_MARKING_LEVEL 0x1119 /* Get QoS marking in effect for socket */
187
188
189/* When adding new socket-options, you need to make sure MPTCP supports these as well! */
190
191/*
192 * Network Service Type for option SO_NET_SERVICE_TYPE
193 *
194 * The vast majority of sockets should use Best Effort that is the default
195 * Network Service Type. Other Network Service Types have to be used only if
196 * the traffic actually matches the description of the Network Service Type.
197 *
198 * Network Service Types do not represent priorities but rather describe
199 * different categories of delay, jitter and loss parameters.
200 * Those parameters may influence protocols from layer 4 protocols like TCP
201 * to layer 2 protocols like Wi-Fi. The Network Service Type can determine
202 * how the traffic is queued and scheduled by the host networking stack and
203 * by other entities on the network like switches and routers. For example
204 * for Wi-Fi, the Network Service Type can select the marking of the
205 * layer 2 packet with the appropriate WMM Access Category.
206 *
207 * There is no point in attempting to game the system and use
208 * a Network Service Type that does not correspond to the actual
209 * traffic characteristic but one that seems to have a higher precedence.
210 * The reason is that for service classes that have lower tolerance
211 * for delay and jitter, the queues size is lower than for service
212 * classes that are more tolerant to delay and jitter.
213 *
214 * For example using a voice service type for bulk data transfer will lead
215 * to disastrous results as soon as congestion happens because the voice
216 * queue overflows and packets get dropped. This is not only bad for the bulk
217 * data transfer but it is also bad for VoIP apps that legitimately are using
218 * the voice service type.
219 *
220 * The characteristics of the Network Service Types are based on the service
221 * classes defined in RFC 4594 "Configuration Guidelines for DiffServ Service
222 * Classes"
223 *
224 * When system detects the outgoing interface belongs to a DiffServ domain
225 * that follows the recommendation of the IETF draft "Guidelines for DiffServ to
226 * IEEE 802.11 Mapping", the packet will marked at layer 3 with a DSCP value
227 * that corresponds to Network Service Type.
228 *
229 * NET_SERVICE_TYPE_BE
230 * "Best Effort", unclassified/standard. This is the default service
231 * class and cover the majority of the traffic.
232 *
233 * NET_SERVICE_TYPE_BK
234 * "Background", high delay tolerant, loss tolerant. elastic flow,
235 * variable size & long-lived. E.g: non-interactive network bulk transfer
236 * like synching or backup.
237 *
238 * NET_SERVICE_TYPE_RD
239 * "Responsive Data", a notch higher than "Best Effort", medium delay
240 * tolerant, elastic & inelastic flow, bursty, long-lived. E.g. email,
241 * instant messaging, for which there is a sense of interactivity and
242 * urgency (user waiting for output).
243 *
244 * NET_SERVICE_TYPE_OAM
245 * "Operations, Administration, and Management", medium delay tolerant,
246 * low-medium loss tolerant, elastic & inelastic flows, variable size.
247 * E.g. VPN tunnels.
248 *
249 * NET_SERVICE_TYPE_AV
250 * "Multimedia Audio/Video Streaming", medium delay tolerant, low-medium
251 * loss tolerant, elastic flow, constant packet interval, variable rate
252 * and size. E.g. video and audio playback with buffering.
253 *
254 * NET_SERVICE_TYPE_RV
255 * "Responsive Multimedia Audio/Video", low delay tolerant, low-medium
256 * loss tolerant, elastic flow, variable packet interval, rate and size.
257 * E.g. screen sharing.
258 *
259 * NET_SERVICE_TYPE_VI
260 * "Interactive Video", low delay tolerant, low-medium loss tolerant,
261 * elastic flow, constant packet interval, variable rate & size. E.g.
262 * video telephony.
263 *
264 * NET_SERVICE_TYPE_SIG
265 * "Signaling", low delay tolerant, low loss tolerant, inelastic flow,
266 * jitter tolerant, rate is bursty but short, variable size. E.g. SIP.
267 *
268 * NET_SERVICE_TYPE_VO
269 * "Interactive Voice", very low delay tolerant, very low loss tolerant,
270 * inelastic flow, constant packet rate, somewhat fixed size.
271 * E.g. VoIP.
272 */
273
274#define NET_SERVICE_TYPE_BE 0 /* Best effort */
275#define NET_SERVICE_TYPE_BK 1 /* Background system initiated */
276#define NET_SERVICE_TYPE_SIG 2 /* Signaling */
277#define NET_SERVICE_TYPE_VI 3 /* Interactive Video */
278#define NET_SERVICE_TYPE_VO 4 /* Interactive Voice */
279#define NET_SERVICE_TYPE_RV 5 /* Responsive Multimedia Audio/Video */
280#define NET_SERVICE_TYPE_AV 6 /* Multimedia Audio/Video Streaming */
281#define NET_SERVICE_TYPE_OAM 7 /* Operations, Administration, and Management */
282#define NET_SERVICE_TYPE_RD 8 /* Responsive Data */
283
284
285/* These are supported values for SO_NETSVC_MARKING_LEVEL */
286#define NETSVC_MRKNG_UNKNOWN 0 /* The outgoing network interface is not known */
287#define NETSVC_MRKNG_LVL_L2 1 /* Default marking at layer 2 (for example Wi-Fi WMM) */
288#define NETSVC_MRKNG_LVL_L3L2_ALL 2 /* Layer 3 DSCP marking and layer 2 marking for all Network Service Types */
289#define NETSVC_MRKNG_LVL_L3L2_BK 3 /* The system policy limits layer 3 DSCP marking and layer 2 marking
290 * to background Network Service Types */
291
292
293typedef __uint32_t sae_associd_t;
294#define SAE_ASSOCID_ANY 0
295#define SAE_ASSOCID_ALL ((sae_associd_t)(-1ULL))
296
297typedef __uint32_t sae_connid_t;
298#define SAE_CONNID_ANY 0
299#define SAE_CONNID_ALL ((sae_connid_t)(-1ULL))
300
301/* connectx() flag parameters */
302#define CONNECT_RESUME_ON_READ_WRITE 0x1 /* resume connect() on read/write */
303#define CONNECT_DATA_IDEMPOTENT 0x2 /* data is idempotent */
304#define CONNECT_DATA_AUTHENTICATED 0x4 /* data includes security that replaces the TFO-cookie */
305
306/* sockaddr endpoints */
307typedef struct sa_endpoints {
308 unsigned int sae_srcif; /* optional source interface */
309 const struct sockaddr *sae_srcaddr; /* optional source address */
310 socklen_t sae_srcaddrlen; /* size of source address */
311 const struct sockaddr *sae_dstaddr; /* destination address */
312 socklen_t sae_dstaddrlen; /* size of destination address */
313} sa_endpoints_t;
314#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
315
316/*
317 * Structure used for manipulating linger option.
318 */
319struct linger {
320 int l_onoff; /* option on/off */
321 int l_linger; /* linger time */
322};
323
324#ifndef __APPLE__
325struct accept_filter_arg {
326 char af_name[16];
327 char af_arg[256 - 16];
328};
329#endif
330
331#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
332#ifdef __APPLE__
333
334/*
335 * Structure to control non-portable Sockets extension to POSIX
336 */
337struct so_np_extensions {
338 u_int32_t npx_flags;
339 u_int32_t npx_mask;
340};
341
342#define SONPX_SETOPTSHUT 0x000000001 /* flag for allowing setsockopt after shutdown */
343
344
345
346#endif
347#endif
348
349/*
350 * Level number for (get/set)sockopt() to apply to socket itself.
351 */
352#define SOL_SOCKET 0xffff /* options for socket level */
353
354
355/*
356 * Address families.
357 */
358#define AF_UNSPEC 0 /* unspecified */
359#define AF_UNIX 1 /* local to host (pipes) */
360#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
361#define AF_LOCAL AF_UNIX /* backward compatibility */
362#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
363#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
364#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
365#define AF_IMPLINK 3 /* arpanet imp addresses */
366#define AF_PUP 4 /* pup protocols: e.g. BSP */
367#define AF_CHAOS 5 /* mit CHAOS protocols */
368#define AF_NS 6 /* XEROX NS protocols */
369#define AF_ISO 7 /* ISO protocols */
370#define AF_OSI AF_ISO
371#define AF_ECMA 8 /* European computer manufacturers */
372#define AF_DATAKIT 9 /* datakit protocols */
373#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
374#define AF_SNA 11 /* IBM SNA */
375#define AF_DECnet 12 /* DECnet */
376#define AF_DLI 13 /* DEC Direct data link interface */
377#define AF_LAT 14 /* LAT */
378#define AF_HYLINK 15 /* NSC Hyperchannel */
379#define AF_APPLETALK 16 /* Apple Talk */
380#define AF_ROUTE 17 /* Internal Routing Protocol */
381#define AF_LINK 18 /* Link layer interface */
382#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
383#define AF_COIP 20 /* connection-oriented IP, aka ST II */
384#define AF_CNT 21 /* Computer Network Technology */
385#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */
386#define AF_IPX 23 /* Novell Internet Protocol */
387#define AF_SIP 24 /* Simple Internet Protocol */
388#define pseudo_AF_PIP 25 /* Help Identify PIP packets */
389#define AF_NDRV 27 /* Network Driver 'raw' access */
390#define AF_ISDN 28 /* Integrated Services Digital Network */
391#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */
392#define pseudo_AF_KEY 29 /* Internal key-management function */
393#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
394#define AF_INET6 30 /* IPv6 */
395#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
396#define AF_NATM 31 /* native ATM access */
397#define AF_SYSTEM 32 /* Kernel event messages */
398#define AF_NETBIOS 33 /* NetBIOS */
399#define AF_PPP 34 /* PPP communication protocol */
400#define pseudo_AF_HDRCMPLT 35 /* Used by BPF to not rewrite headers
401 * in interface output routine */
402#define AF_RESERVED_36 36 /* Reserved for internal usage */
403#define AF_IEEE80211 37 /* IEEE 802.11 protocol */
404#define AF_UTUN 38
405#define AF_VSOCK 40 /* VM Sockets */
406#define AF_MAX 41
407#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
408
409/*
410 * [XSI] Structure used by kernel to store most addresses.
411 */
412struct sockaddr {
413 __uint8_t sa_len; /* total length */
414 sa_family_t sa_family; /* [XSI] address family */
415 char sa_data[14]; /* [XSI] addr value (actually larger) */
416};
417
418#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
419#define SOCK_MAXADDRLEN 255 /* longest possible addresses */
420
421/*
422 * Structure used by kernel to pass protocol
423 * information in raw sockets.
424 */
425struct sockproto {
426 __uint16_t sp_family; /* address family */
427 __uint16_t sp_protocol; /* protocol */
428};
429#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
430
431/*
432 * RFC 2553: protocol-independent placeholder for socket addresses
433 */
434#define _SS_MAXSIZE 128
435#define _SS_ALIGNSIZE (sizeof(__int64_t))
436#define _SS_PAD1SIZE \
437 (_SS_ALIGNSIZE - sizeof(__uint8_t) - sizeof(sa_family_t))
438#define _SS_PAD2SIZE \
439 (_SS_MAXSIZE - sizeof(__uint8_t) - sizeof(sa_family_t) - \
440 _SS_PAD1SIZE - _SS_ALIGNSIZE)
441
442/*
443 * [XSI] sockaddr_storage
444 */
445struct sockaddr_storage {
446 __uint8_t ss_len; /* address length */
447 sa_family_t ss_family; /* [XSI] address family */
448 char __ss_pad1[_SS_PAD1SIZE];
449 __int64_t __ss_align; /* force structure storage alignment */
450 char __ss_pad2[_SS_PAD2SIZE];
451};
452
453/*
454 * Protocol families, same as address families for now.
455 */
456#define PF_UNSPEC AF_UNSPEC
457#define PF_LOCAL AF_LOCAL
458#define PF_UNIX PF_LOCAL /* backward compatibility */
459#define PF_INET AF_INET
460#define PF_IMPLINK AF_IMPLINK
461#define PF_PUP AF_PUP
462#define PF_CHAOS AF_CHAOS
463#define PF_NS AF_NS
464#define PF_ISO AF_ISO
465#define PF_OSI AF_ISO
466#define PF_ECMA AF_ECMA
467#define PF_DATAKIT AF_DATAKIT
468#define PF_CCITT AF_CCITT
469#define PF_SNA AF_SNA
470#define PF_DECnet AF_DECnet
471#define PF_DLI AF_DLI
472#define PF_LAT AF_LAT
473#define PF_HYLINK AF_HYLINK
474#define PF_APPLETALK AF_APPLETALK
475#define PF_ROUTE AF_ROUTE
476#define PF_LINK AF_LINK
477#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
478#define PF_COIP AF_COIP
479#define PF_CNT AF_CNT
480#define PF_SIP AF_SIP
481#define PF_IPX AF_IPX /* same format as AF_NS */
482#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */
483#define PF_PIP pseudo_AF_PIP
484#define PF_NDRV AF_NDRV
485#define PF_ISDN AF_ISDN
486#define PF_KEY pseudo_AF_KEY
487#define PF_INET6 AF_INET6
488#define PF_NATM AF_NATM
489#define PF_SYSTEM AF_SYSTEM
490#define PF_NETBIOS AF_NETBIOS
491#define PF_PPP AF_PPP
492#define PF_RESERVED_36 AF_RESERVED_36
493#define PF_UTUN AF_UTUN
494#define PF_VSOCK AF_VSOCK
495#define PF_MAX AF_MAX
496
497/*
498 * These do not have socket-layer support:
499 */
500#define PF_VLAN ((uint32_t)0x766c616e) /* 'vlan' */
501#define PF_BOND ((uint32_t)0x626f6e64) /* 'bond' */
502
503/*
504 * Definitions for network related sysctl, CTL_NET.
505 *
506 * Second level is protocol family.
507 * Third level is protocol number.
508 *
509 * Further levels are defined by the individual families below.
510 */
511#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
512#define NET_MAXID AF_MAX
513#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
514
515
516#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
517/*
518 * PF_ROUTE - Routing table
519 *
520 * Three additional levels are defined:
521 * Fourth: address family, 0 is wildcard
522 * Fifth: type of info, defined below
523 * Sixth: flag(s) to mask with for NET_RT_FLAGS
524 */
525#define NET_RT_DUMP 1 /* dump; may limit to a.f. */
526#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */
527#define NET_RT_IFLIST 3 /* survey interface list */
528#define NET_RT_STAT 4 /* routing statistics */
529#define NET_RT_TRASH 5 /* routes not in table but not freed */
530#define NET_RT_IFLIST2 6 /* interface list with addresses */
531#define NET_RT_DUMP2 7 /* dump; may limit to a.f. */
532/*
533 * Allows read access non-local host's MAC address
534 * if the process has neighbor cache entitlement.
535 */
536#define NET_RT_FLAGS_PRIV 10
537#define NET_RT_MAXID 11
538#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
539
540
541
542
543/*
544 * Maximum queue length specifiable by listen.
545 */
546#define SOMAXCONN 128
547
548/*
549 * [XSI] Message header for recvmsg and sendmsg calls.
550 * Used value-result for recvmsg, value only for sendmsg.
551 */
552struct msghdr {
553 void *msg_name; /* [XSI] optional address */
554 socklen_t msg_namelen; /* [XSI] size of address */
555 struct iovec *msg_iov; /* [XSI] scatter/gather array */
556 int msg_iovlen; /* [XSI] # elements in msg_iov */
557 void *msg_control; /* [XSI] ancillary data, see below */
558 socklen_t msg_controllen; /* [XSI] ancillary data buffer len */
559 int msg_flags; /* [XSI] flags on received message */
560};
561
562
563
564#define MSG_OOB 0x1 /* process out-of-band data */
565#define MSG_PEEK 0x2 /* peek at incoming message */
566#define MSG_DONTROUTE 0x4 /* send without using routing tables */
567#define MSG_EOR 0x8 /* data completes record */
568#define MSG_TRUNC 0x10 /* data discarded before delivery */
569#define MSG_CTRUNC 0x20 /* control data lost before delivery */
570#define MSG_WAITALL 0x40 /* wait for full request or error */
571#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
572#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */
573#define MSG_EOF 0x100 /* data completes connection */
574#ifdef __APPLE__
575#ifdef __APPLE_API_OBSOLETE
576#define MSG_WAITSTREAM 0x200 /* wait up to full request.. may return partial */
577#endif
578#define MSG_FLUSH 0x400 /* Start of 'hold' seq; dump so_temp, deprecated */
579#define MSG_HOLD 0x800 /* Hold frag in so_temp, deprecated */
580#define MSG_SEND 0x1000 /* Send the packet in so_temp, deprecated */
581#define MSG_HAVEMORE 0x2000 /* Data ready to be read */
582#define MSG_RCVMORE 0x4000 /* Data remains in current pkt */
583#endif
584#define MSG_NEEDSA 0x10000 /* Fail receive if socket address cannot be allocated */
585#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
586
587#if __DARWIN_C_LEVEL >= 200809L
588#define MSG_NOSIGNAL 0x80000 /* do not generate SIGPIPE on EOF */
589#endif /* __DARWIN_C_LEVEL */
590
591#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
592#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
593
594/*
595 * Header for ancillary data objects in msg_control buffer.
596 * Used for additional information with/about a datagram
597 * not expressible by flags. The format is a sequence
598 * of message elements headed by cmsghdr structures.
599 */
600struct cmsghdr {
601 socklen_t cmsg_len; /* [XSI] data byte count, including hdr */
602 int cmsg_level; /* [XSI] originating protocol */
603 int cmsg_type; /* [XSI] protocol-specific type */
604/* followed by unsigned char cmsg_data[]; */
605};
606
607#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
608#ifndef __APPLE__
609/*
610 * While we may have more groups than this, the cmsgcred struct must
611 * be able to fit in an mbuf, and NGROUPS_MAX is too large to allow
612 * this.
613 */
614#define CMGROUP_MAX 16
615
616/*
617 * Credentials structure, used to verify the identity of a peer
618 * process that has sent us a message. This is allocated by the
619 * peer process but filled in by the kernel. This prevents the
620 * peer from lying about its identity. (Note that cmcred_groups[0]
621 * is the effective GID.)
622 */
623struct cmsgcred {
624 pid_t cmcred_pid; /* PID of sending process */
625 uid_t cmcred_uid; /* real UID of sending process */
626 uid_t cmcred_euid; /* effective UID of sending process */
627 gid_t cmcred_gid; /* real GID of sending process */
628 short cmcred_ngroups; /* number or groups */
629 gid_t cmcred_groups[CMGROUP_MAX]; /* groups */
630};
631#endif
632#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
633
634/* given pointer to struct cmsghdr, return pointer to data */
635#define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \
636 __DARWIN_ALIGN32(sizeof(struct cmsghdr)))
637
638/*
639 * RFC 2292 requires to check msg_controllen, in case that the kernel returns
640 * an empty list for some reasons.
641 */
642#define CMSG_FIRSTHDR(mhdr) \
643 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
644 (struct cmsghdr *)(mhdr)->msg_control : \
645 (struct cmsghdr *)0L)
646
647
648/*
649 * Given pointer to struct cmsghdr, return pointer to next cmsghdr
650 * RFC 2292 says that CMSG_NXTHDR(mhdr, NULL) is equivalent to CMSG_FIRSTHDR(mhdr)
651 */
652#define CMSG_NXTHDR(mhdr, cmsg) \
653 ((char *)(cmsg) == (char *)0L ? CMSG_FIRSTHDR(mhdr) : \
654 ((((unsigned char *)(cmsg) + \
655 __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len) + \
656 __DARWIN_ALIGN32(sizeof(struct cmsghdr))) > \
657 ((unsigned char *)(mhdr)->msg_control + \
658 (mhdr)->msg_controllen)) ? \
659 (struct cmsghdr *)0L /* NULL */ : \
660 (struct cmsghdr *)(void *)((unsigned char *)(cmsg) + \
661 __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len))))
662
663#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
664/* RFC 2292 additions */
665#define CMSG_SPACE(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + __DARWIN_ALIGN32(l))
666#define CMSG_LEN(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + (l))
667
668#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
669
670/* "Socket"-level control message types: */
671#define SCM_RIGHTS 0x01 /* access rights (array of int) */
672#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
673#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */
674#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */
675#define SCM_TIMESTAMP_MONOTONIC 0x04 /* timestamp (uint64_t) */
676
677
678#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
679
680/*
681 * howto arguments for shutdown(2), specified by Posix.1g.
682 */
683#define SHUT_RD 0 /* shut down the reading side */
684#define SHUT_WR 1 /* shut down the writing side */
685#define SHUT_RDWR 2 /* shut down both sides */
686
687#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
688/*
689 * sendfile(2) header/trailer struct
690 */
691struct sf_hdtr {
692 struct iovec *headers; /* pointer to an array of header struct iovec's */
693 int hdr_cnt; /* number of header iovec's */
694 struct iovec *trailers; /* pointer to an array of trailer struct iovec's */
695 int trl_cnt; /* number of trailer iovec's */
696};
697
698
699#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
700
701
702__BEGIN_DECLS
703
704int accept(int, struct sockaddr * __restrict, socklen_t * __restrict)
705__DARWIN_ALIAS_C(accept);
706int bind(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS(bind);
707int connect(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(connect);
708int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict)
709__DARWIN_ALIAS(getpeername);
710int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict)
711__DARWIN_ALIAS(getsockname);
712int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict);
713int listen(int, int) __DARWIN_ALIAS(listen);
714ssize_t recv(int, void *, size_t, int) __DARWIN_ALIAS_C(recv);
715ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict,
716 socklen_t * __restrict) __DARWIN_ALIAS_C(recvfrom);
717ssize_t recvmsg(int, struct msghdr *, int) __DARWIN_ALIAS_C(recvmsg);
718ssize_t send(int, const void *, size_t, int) __DARWIN_ALIAS_C(send);
719ssize_t sendmsg(int, const struct msghdr *, int) __DARWIN_ALIAS_C(sendmsg);
720ssize_t sendto(int, const void *, size_t,
721 int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(sendto);
722int setsockopt(int, int, int, const void *, socklen_t);
723int shutdown(int, int);
724int sockatmark(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
725int socket(int, int, int);
726int socketpair(int, int, int, int *) __DARWIN_ALIAS(socketpair);
727
728#if !defined(_POSIX_C_SOURCE)
729int sendfile(int, int, off_t, off_t *, struct sf_hdtr *, int);
730#endif /* !_POSIX_C_SOURCE */
731
732#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
733void pfctlinput(int, struct sockaddr *);
734
735__API_AVAILABLE(macosx(10.11), ios(9.0), tvos(9.0), watchos(2.0))
736int connectx(int, const sa_endpoints_t *, sae_associd_t, unsigned int,
737 const struct iovec *, unsigned int, size_t *, sae_connid_t *);
738
739__API_AVAILABLE(macosx(10.11), ios(9.0), tvos(9.0), watchos(2.0))
740int disconnectx(int, sae_associd_t, sae_connid_t);
741#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
742__END_DECLS
743
744
745#endif /* !_SYS_SOCKET_H_ */
\ No newline at end of file
lib/libc/include/any-macos.12-any/xpc/base.h created+216
......@@ -0,0 +1,216 @@
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#ifndef XPC_TESTEXPORT
90#define XPC_TESTEXPORT XPC_NOEXPORT
91#endif // XPC_TESTEXPORT
92
93#if defined(__XPC_TEST__) && __XPC_TEST__
94#define XPC_TESTSTATIC
95#define XPC_TESTEXTERN extern
96#else // defined(__XPC_TEST__) && __XPC_TEST__
97#define XPC_TESTSTATIC static
98#endif // defined(__XPC_TEST__) && __XPC_TEST__
99
100#if __has_feature(objc_arc)
101#define XPC_GIVES_REFERENCE __strong
102#define XPC_UNRETAINED __unsafe_unretained
103#define XPC_BRIDGE(xo) ((__bridge void *)(xo))
104#define XPC_BRIDGEREF_BEGIN(xo) ((__bridge_retained void *)(xo))
105#define XPC_BRIDGEREF_BEGIN_WITH_REF(xo) ((__bridge void *)(xo))
106#define XPC_BRIDGEREF_MIDDLE(xo) ((__bridge id)(xo))
107#define XPC_BRIDGEREF_END(xo) ((__bridge_transfer id)(xo))
108#else // __has_feature(objc_arc)
109#define XPC_GIVES_REFERENCE
110#define XPC_UNRETAINED
111#define XPC_BRIDGE(xo) (xo)
112#define XPC_BRIDGEREF_BEGIN(xo) (xo)
113#define XPC_BRIDGEREF_BEGIN_WITH_REF(xo) (xo)
114#define XPC_BRIDGEREF_MIDDLE(xo) (xo)
115#define XPC_BRIDGEREF_END(xo) (xo)
116#endif // __has_feature(objc_arc)
117
118#define _xpc_unreachable() __builtin_unreachable()
119#else // __GNUC__
120/*! @parseOnly */
121#define XPC_CONSTRUCTOR
122/*! @parseOnly */
123#define XPC_NORETURN
124/*! @parseOnly */
125#define XPC_NOTHROW
126/*! @parseOnly */
127#define XPC_NONNULL1
128/*! @parseOnly */
129#define XPC_NONNULL2
130/*! @parseOnly */
131#define XPC_NONNULL3
132/*! @parseOnly */
133#define XPC_NONNULL4
134/*! @parseOnly */
135#define XPC_NONNULL5
136/*! @parseOnly */
137#define XPC_NONNULL6
138/*! @parseOnly */
139#define XPC_NONNULL7
140/*! @parseOnly */
141#define XPC_NONNULL8
142/*! @parseOnly */
143#define XPC_NONNULL9
144/*! @parseOnly */
145#define XPC_NONNULL10
146/*! @parseOnly */
147#define XPC_NONNULL11
148/*! @parseOnly */
149#define XPC_NONNULL(n)
150/*! @parseOnly */
151#define XPC_NONNULL_ALL
152/*! @parseOnly */
153#define XPC_SENTINEL
154/*! @parseOnly */
155#define XPC_PURE
156/*! @parseOnly */
157#define XPC_WARN_RESULT
158/*! @parseOnly */
159#define XPC_MALLOC
160/*! @parseOnly */
161#define XPC_UNUSED
162/*! @parseOnly */
163#define XPC_PACKED
164/*! @parseOnly */
165#define XPC_PRINTF(m, n)
166/*! @parseOnly */
167#define XPC_INLINE static inline
168/*! @parseOnly */
169#define XPC_NOINLINE
170/*! @parseOnly */
171#define XPC_NOIMPL
172/*! @parseOnly */
173#define XPC_EXPORT extern
174/*! @parseOnly */
175#define XPC_WEAKIMPORT
176/*! @parseOnly */
177#define XPC_DEPRECATED
178/*! @parseOnly */
179#define XPC_UNAVAILABLE(m)
180/*! @parseOnly */
181#define XPC_NOESCAPE
182#endif // __GNUC__
183
184#if __has_feature(assume_nonnull)
185#define XPC_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
186#define XPC_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
187#else
188#define XPC_ASSUME_NONNULL_BEGIN
189#define XPC_ASSUME_NONNULL_END
190#endif
191
192#if __has_feature(nullability_on_arrays)
193#define XPC_NONNULL_ARRAY _Nonnull
194#else
195#define XPC_NONNULL_ARRAY
196#endif
197
198#ifdef OS_CLOSED_OPTIONS
199#define XPC_FLAGS_ENUM(_name, _type, ...) \
200 OS_CLOSED_OPTIONS(_name, _type, __VA_ARGS__)
201#else // OS_CLOSED_ENUM
202#define XPC_FLAGS_ENUM(_name, _type, ...) \
203 OS_ENUM(_name, _type, __VA_ARGS__)
204#endif // OS_CLOSED_ENUM
205
206#ifdef OS_CLOSED_ENUM
207#define XPC_ENUM(_name, _type, ...) \
208 OS_CLOSED_ENUM(_name, _type, __VA_ARGS__)
209#else // OS_CLOSED_ENUM
210#define XPC_ENUM(_name, _type, ...) \
211 OS_ENUM(_name, _type, __VA_ARGS__)
212#endif // OS_CLOSED_ENUM
213
214__END_DECLS
215
216#endif // __XPC_BASE_H__
\ No newline at end of file
lib/libc/include/any-macos.12-any/xpc/connection.h created+794
......@@ -0,0 +1,794 @@
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_ERROR_PEER_CODE_SIGNING_REQUIREMENT
84 * On macOS, this error will be delivered to a peer connection's event handler
85 * when the XPC runtime has detected that a peer connection does not
86 * satisfy the code signing requirement specified for the connection.
87 *
88 * See {@link xpc_connection_set_peer_code_signing_requirement}
89 */
90#define XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT \
91 XPC_GLOBAL_OBJECT(_xpc_error_peer_code_signing_requirement)
92__API_AVAILABLE(macos(12.0))
93XPC_EXPORT
94const struct _xpc_dictionary_s _xpc_error_peer_code_signing_requirement;
95
96/*!
97 * @constant XPC_CONNECTION_MACH_SERVICE_LISTENER
98 * Passed to xpc_connection_create_mach_service(). This flag indicates that the
99 * caller is the listener for the named service. This flag may only be passed
100 * for services which are advertised in the process' launchd.plist(5). You may
101 * not use this flag to dynamically add services to the Mach bootstrap
102 * namespace.
103 */
104#define XPC_CONNECTION_MACH_SERVICE_LISTENER (1 << 0)
105
106/*!
107 * @constant XPC_CONNECTION_MACH_SERVICE_PRIVILEGED
108 * Passed to xpc_connection_create_mach_service(). This flag indicates that the
109 * job advertising the service name in its launchd.plist(5) should be in the
110 * privileged Mach bootstrap. This is typically accomplished by placing your
111 * launchd.plist(5) in /Library/LaunchDaemons. If specified alongside the
112 * XPC_CONNECTION_MACH_SERVICE_LISTENER flag, this flag is a no-op.
113 */
114#define XPC_CONNECTION_MACH_SERVICE_PRIVILEGED (1 << 1)
115
116/*!
117 * @typedef xpc_finalizer_f
118 * A function that is invoked when a connection is being torn down and its
119 * context needs to be freed. The sole argument is the value that was given to
120 * {@link xpc_connection_set_context} or NULL if no context has been set. It is
121 * not safe to reference the connection from within this function.
122 *
123 * @param value
124 * The context object that is to be disposed of.
125 */
126typedef void (*xpc_finalizer_t)(void * _Nullable value);
127
128/*!
129 * @function xpc_connection_create
130 * Creates a new connection object.
131 *
132 * @param name
133 * If non-NULL, the name of the service with which to connect. The returned
134 * connection will be a peer.
135 *
136 * If NULL, an anonymous listener connection will be created. You can embed the
137 * ability to create new peer connections in an endpoint, which can be inserted
138 * into a message and sent to another process .
139 *
140 * @param targetq
141 * The GCD queue to which the event handler block will be submitted. This
142 * parameter may be NULL, in which case the connection's target queue will be
143 * libdispatch's default target queue, defined as DISPATCH_TARGET_QUEUE_DEFAULT.
144 * The target queue may be changed later with a call to
145 * xpc_connection_set_target_queue().
146 *
147 * @result
148 * A new connection object. The caller is responsible for disposing of the
149 * returned object with {@link xpc_release} when it is no longer needed.
150 *
151 * @discussion
152 * This method will succeed even if the named service does not exist. This is
153 * because the XPC namespace is not queried for the service name until the
154 * connection has been activated. See {@link xpc_connection_activate()}.
155 *
156 * XPC connections, like dispatch sources, are returned in an inactive state, so
157 * you must call {@link xpc_connection_activate()} in order to begin receiving
158 * events from the connection. Also like dispatch sources, connections must be
159 * activated and not suspended in order to be safely released. It is
160 * a programming error to release an inactive or suspended connection.
161 */
162__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
163XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT
164xpc_connection_t
165xpc_connection_create(const char * _Nullable name,
166 dispatch_queue_t _Nullable targetq);
167
168/*!
169 * @function xpc_connection_create_mach_service
170 * Creates a new connection object representing a Mach service.
171 *
172 * @param name
173 * The name of the remote service with which to connect. The service name must
174 * exist in a Mach bootstrap that is accessible to the process and be advertised
175 * in a launchd.plist.
176 *
177 * @param targetq
178 * The GCD queue to which the event handler block will be submitted. This
179 * parameter may be NULL, in which case the connection's target queue will be
180 * libdispatch's default target queue, defined as DISPATCH_TARGET_QUEUE_DEFAULT.
181 * The target queue may be changed later with a call to
182 * xpc_connection_set_target_queue().
183 *
184 * @param flags
185 * Additional attributes with which to create the connection.
186 *
187 * @result
188 * A new connection object.
189 *
190 * @discussion
191 * If the XPC_CONNECTION_MACH_SERVICE_LISTENER flag is given to this method,
192 * then the connection returned will be a listener connection. Otherwise, a peer
193 * connection will be returned. See the documentation for
194 * {@link xpc_connection_set_event_handler()} for the semantics of listener
195 * connections versus peer connections.
196 *
197 * This method will succeed even if the named service does not exist. This is
198 * because the Mach namespace is not queried for the service name until the
199 * connection has been activated. See {@link xpc_connection_activate()}.
200 */
201__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
202XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
203xpc_connection_t
204xpc_connection_create_mach_service(const char *name,
205 dispatch_queue_t _Nullable targetq, uint64_t flags);
206
207/*!
208 * @function xpc_connection_create_from_endpoint
209 * Creates a new connection from the given endpoint.
210 *
211 * @param endpoint
212 * The endpoint from which to create the new connection.
213 *
214 * @result
215 * A new peer connection to the listener represented by the given endpoint.
216 *
217 * The same responsibilities of setting an event handler and activating the
218 * connection after calling xpc_connection_create() apply to the connection
219 * returned by this API. Since the connection yielded by this API is not
220 * associated with a name (and therefore is not rediscoverable), this connection
221 * will receive XPC_ERROR_CONNECTION_INVALID if the listening side crashes,
222 * exits or cancels the listener connection.
223 */
224__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
225XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL_ALL
226xpc_connection_t
227xpc_connection_create_from_endpoint(xpc_endpoint_t endpoint);
228
229/*!
230 * @function xpc_connection_set_target_queue
231 * Sets the target queue of the given connection.
232 *
233 * @param connection
234 * The connection object which is to be manipulated.
235 *
236 * @param targetq
237 * The GCD queue to which the event handler block will be submitted. This
238 * parameter may be NULL, in which case the connection's target queue will be
239 * libdispatch's default target queue, defined as DISPATCH_TARGET_QUEUE_DEFAULT.
240 *
241 * @discussion
242 * Setting the target queue is asynchronous and non-preemptive and therefore
243 * this method will not interrupt the execution of an already-running event
244 * handler block. Setting the target queue may be likened to issuing a barrier
245 * to the connection which does the actual work of changing the target queue.
246 *
247 * The XPC runtime guarantees this non-preemptiveness even for concurrent target
248 * queues. If the target queue is a concurrent queue, then XPC still guarantees
249 * that there will never be more than one invocation of the connection's event
250 * handler block executing concurrently. If you wish to process events
251 * concurrently, you can dispatch_async(3) to a concurrent queue from within
252 * the event handler.
253 *
254 * IMPORTANT: When called from within the event handler block,
255 * dispatch_get_current_queue(3) is NOT guaranteed to return a pointer to the
256 * queue set with this method.
257 *
258 * Despite this seeming inconsistency, the XPC runtime guarantees that, when the
259 * target queue is a serial queue, the event handler block will execute
260 * synchonously with respect to other blocks submitted to that same queue. When
261 * the target queue is a concurrent queue, the event handler block may run
262 * concurrently with other blocks submitted to that queue, but it will never run
263 * concurrently with other invocations of itself for the same connection, as
264 * discussed previously.
265 */
266__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
267XPC_EXPORT XPC_NONNULL1
268void
269xpc_connection_set_target_queue(xpc_connection_t connection,
270 dispatch_queue_t _Nullable targetq);
271
272/*!
273 * @function xpc_connection_set_event_handler
274 * Sets the event handler block for the connection.
275 *
276 * @param connection
277 * The connection object which is to be manipulated.
278 *
279 * @param handler
280 * The event handler block.
281 *
282 * @discussion
283 * Setting the event handler is asynchronous and non-preemptive, and therefore
284 * this method will not interrupt the execution of an already-running event
285 * handler block. If the event handler is executing at the time of this call, it
286 * will finish, and then the connection's event handler will be changed before
287 * the next invocation of the event handler. The XPC runtime guarantees this
288 * non-preemptiveness even for concurrent target queues.
289 *
290 * Connection event handlers are non-reentrant, so it is safe to call
291 * xpc_connection_set_event_handler() from within the event handler block.
292 *
293 * The event handler's execution should be treated as a barrier to all
294 * connection activity. When it is executing, the connection will not attempt to
295 * send or receive messages, including reply messages. Thus, it is not safe to
296 * call xpc_connection_send_message_with_reply_sync() on the connection from
297 * within the event handler.
298 *
299 * You do not hold a reference on the object received as the event handler's
300 * only argument. Regardless of the type of object received, it is safe to call
301 * xpc_retain() on the object to obtain a reference to it.
302 *
303 * A connection may receive different events depending upon whether it is a
304 * listener or not. Any connection may receive an error in its event handler.
305 * But while normal connections may receive messages in addition to errors,
306 * listener connections will receive connections and and not messages.
307 *
308 * Connections received by listeners are equivalent to those returned by
309 * xpc_connection_create() with a non-NULL name argument and a NULL targetq
310 * argument with the exception that you do not hold a reference on them.
311 * You must set an event handler and activate the connection. If you do not wish
312 * to accept the connection, you may simply call xpc_connection_cancel() on it
313 * and return. The runtime will dispose of it for you.
314 *
315 * If there is an error in the connection, this handler will be invoked with the
316 * error dictionary as its argument. This dictionary will be one of the well-
317 * known XPC_ERROR_* dictionaries.
318 *
319 * Regardless of the type of event, ownership of the event object is NOT
320 * implicitly transferred. Thus, the object will be released and deallocated at
321 * some point in the future after the event handler returns. If you wish the
322 * event's lifetime to persist, you must retain it with xpc_retain().
323 *
324 * Connections received through the event handler will be released and
325 * deallocated after the connection has gone invalid and delivered that event to
326 * its event handler.
327 */
328__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
329XPC_EXPORT XPC_NONNULL_ALL
330void
331xpc_connection_set_event_handler(xpc_connection_t connection,
332 xpc_handler_t handler);
333
334/*!
335 * @function xpc_connection_activate
336 * Activates the connection. Connections start in an inactive state, so you must
337 * call xpc_connection_activate() on a connection before it will send or receive
338 * any messages.
339 *
340 * @param connection
341 * The connection object which is to be manipulated.
342 *
343 * @discussion
344 * Calling xpc_connection_activate() on an active connection has no effect.
345 * Releasing the last reference on an inactive connection that was created with
346 * an xpc_connection_create*() call is undefined.
347 *
348 * For backward compatibility reasons, xpc_connection_resume() on an inactive
349 * and not otherwise suspended xpc connection has the same effect as calling
350 * xpc_connection_activate(). For new code, using xpc_connection_activate()
351 * is preferred.
352 */
353__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0)
354__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
355XPC_EXPORT XPC_NONNULL_ALL
356void
357xpc_connection_activate(xpc_connection_t connection);
358
359/*!
360 * @function xpc_connection_suspend
361 * Suspends the connection so that the event handler block will not fire and
362 * that the connection will not attempt to send any messages it has in its
363 * queue. All calls to xpc_connection_suspend() must be balanced with calls to
364 * xpc_connection_resume() before releasing the last reference to the
365 * connection.
366 *
367 * @param connection
368 * The connection object which is to be manipulated.
369 *
370 * @discussion
371 * Suspension is asynchronous and non-preemptive, and therefore this method will
372 * not interrupt the execution of an already-running event handler block. If
373 * the event handler is executing at the time of this call, it will finish, and
374 * then the connection will be suspended before the next scheduled invocation
375 * of the event handler. The XPC runtime guarantees this non-preemptiveness even
376 * for concurrent target queues.
377 *
378 * Connection event handlers are non-reentrant, so it is safe to call
379 * xpc_connection_suspend() from within the event handler block.
380 */
381__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
382XPC_EXPORT XPC_NONNULL_ALL
383void
384xpc_connection_suspend(xpc_connection_t connection);
385
386/*!
387 * @function xpc_connection_resume
388 * Resumes the connection.
389 *
390 * @param connection
391 * The connection object which is to be manipulated.
392 *
393 * @discussion
394 * In order for a connection to become live, every call to
395 * xpc_connection_suspend() must be balanced with a call to
396 * xpc_connection_resume().
397 *
398 * For backward compatibility reasons, xpc_connection_resume() on an inactive
399 * and not otherwise suspended xpc connection has the same effect as calling
400 * xpc_connection_activate(). For new code, using xpc_connection_activate()
401 * is preferred.
402 *
403 * Calling xpc_connection_resume() more times than xpc_connection_suspend()
404 * has been called is otherwise considered an error.
405 */
406__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
407XPC_EXPORT XPC_NONNULL_ALL
408void
409xpc_connection_resume(xpc_connection_t connection);
410
411/*!
412 * @function xpc_connection_send_message
413 * Sends a message over the connection to the destination service.
414 *
415 * @param connection
416 * The connection over which the message shall be sent.
417 *
418 * @param message
419 * The message to send. This must be a dictionary object. This dictionary is
420 * logically copied by the connection, so it is safe to modify the dictionary
421 * after this call.
422 *
423 * @discussion
424 * Messages are delivered in FIFO order. This API is safe to call from multiple
425 * GCD queues. There is no indication that a message was delivered successfully.
426 * This is because even once the message has been successfully enqueued on the
427 * remote end, there are no guarantees about when the runtime will dequeue the
428 * message and invoke the other connection's event handler block.
429 *
430 * If this API is used to send a message that is in reply to another message,
431 * there is no guarantee of ordering between the invocations of the connection's
432 * event handler and the reply handler for that message, even if they are
433 * targeted to the same queue.
434 *
435 * After extensive study, we have found that clients who are interested in
436 * the state of the message on the server end are typically holding open
437 * transactions related to that message. And the only reliable way to track the
438 * lifetime of that transaction is at the protocol layer. So the server should
439 * send a reply message, which upon receiving, will cause the client to close
440 * its transaction.
441 */
442__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
443XPC_EXPORT XPC_NONNULL_ALL
444void
445xpc_connection_send_message(xpc_connection_t connection, xpc_object_t message);
446
447/*!
448 * @function xpc_connection_send_barrier
449 * Issues a barrier against the connection's message-send activity.
450 *
451 * @param connection
452 * The connection against which the barrier is to be issued.
453 *
454 * @param barrier
455 * The barrier block to issue. This barrier prevents concurrent message-send
456 * activity on the connection. No messages will be sent while the barrier block
457 * is executing.
458 *
459 * @discussion
460 * XPC guarantees that, even if the connection's target queue is a concurrent
461 * queue, there are no other messages being sent concurrently while the barrier
462 * block is executing. XPC does not guarantee that the receipt of messages
463 * (either through the connection's event handler or through reply handlers)
464 * will be suspended while the barrier is executing.
465 *
466 * A barrier is issued relative to the message-send queue. Thus, if you call
467 * xpc_connection_send_message() five times and then call
468 * xpc_connection_send_barrier(), the barrier will be invoked after the fifth
469 * message has been sent and its memory disposed of. You may safely cancel a
470 * connection from within a barrier block.
471 *
472 * If a barrier is issued after sending a message which expects a reply, the
473 * behavior is the same as described above. The receipt of a reply message will
474 * not influence when the barrier runs.
475 *
476 * A barrier block can be useful for throttling resource consumption on the
477 * connected side of a connection. For example, if your connection sends many
478 * large messages, you can use a barrier to limit the number of messages that
479 * are inflight at any given time. This can be particularly useful for messages
480 * that contain kernel resources (like file descriptors) which have a system-
481 * wide limit.
482 *
483 * If a barrier is issued on a canceled connection, it will be invoked
484 * immediately. If a connection has been canceled and still has outstanding
485 * barriers, those barriers will be invoked as part of the connection's
486 * unwinding process.
487 *
488 * It is important to note that a barrier block's execution order is not
489 * guaranteed with respect to other blocks that have been scheduled on the
490 * target queue of the connection. Or said differently,
491 * xpc_connection_send_barrier(3) is not equivalent to dispatch_async(3).
492 */
493__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
494XPC_EXPORT XPC_NONNULL_ALL
495void
496xpc_connection_send_barrier(xpc_connection_t connection,
497 dispatch_block_t barrier);
498
499/*!
500 * @function xpc_connection_send_message_with_reply
501 * Sends a message over the connection to the destination service and associates
502 * a handler to be invoked when the remote service sends a reply message.
503 *
504 * @param connection
505 * The connection over which the message shall be sent.
506 *
507 * @param message
508 * The message to send. This must be a dictionary object.
509 *
510 * @param replyq
511 * The GCD queue to which the reply handler will be submitted. This may be a
512 * concurrent queue.
513 *
514 * @param handler
515 * The handler block to invoke when a reply to the message is received from
516 * the connection. If the remote service exits prematurely before the reply was
517 * received, the XPC_ERROR_CONNECTION_INTERRUPTED error will be returned.
518 * If the connection went invalid before the message could be sent, the
519 * XPC_ERROR_CONNECTION_INVALID error will be returned.
520 *
521 * @discussion
522 * If the given GCD queue is a concurrent queue, XPC cannot guarantee that there
523 * will not be multiple reply handlers being invoked concurrently. XPC does not
524 * guarantee any ordering for the invocation of reply handers. So if multiple
525 * messages are waiting for replies and the connection goes invalid, there is no
526 * guarantee that the reply handlers will be invoked in FIFO order. Similarly,
527 * XPC does not guarantee that reply handlers will not run concurrently with
528 * the connection's event handler in the case that the reply queue and the
529 * connection's target queue are the same concurrent queue.
530 */
531__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
532XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL4
533void
534xpc_connection_send_message_with_reply(xpc_connection_t connection,
535 xpc_object_t message, dispatch_queue_t _Nullable replyq,
536 xpc_handler_t handler);
537
538/*!
539 * @function xpc_connection_send_message_with_reply_sync
540 * Sends a message over the connection and blocks the caller until a reply is
541 * received.
542 *
543 * @param connection
544 * The connection over which the message shall be sent.
545 *
546 * @param message
547 * The message to send. This must be a dictionary object.
548 *
549 * @result
550 * The message that the remote service sent in reply to the original message.
551 * If the remote service exits prematurely before the reply was received, the
552 * XPC_ERROR_CONNECTION_INTERRUPTED error will be returned. If the connection
553 * went invalid before the message could be sent, the
554 * XPC_ERROR_CONNECTION_INVALID error will be returned.
555 *
556 * You are responsible for releasing the returned object.
557 *
558 * @discussion
559 * This API supports priority inversion avoidance, and should be used instead of
560 * combining xpc_connection_send_message_with_reply() with a semaphore.
561 *
562 * Invoking this API from a queue that is a part of the target queue hierarchy
563 * results in deadlocks under certain conditions.
564 *
565 * Be judicious about your use of this API. It can block indefinitely, so if you
566 * are using it to implement an API that can be called from the main thread, you
567 * may wish to consider allowing the API to take a queue and callback block so
568 * that results may be delivered asynchronously if possible.
569 */
570__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
571XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT XPC_RETURNS_RETAINED
572xpc_object_t
573xpc_connection_send_message_with_reply_sync(xpc_connection_t connection,
574 xpc_object_t message);
575
576/*!
577 * @function xpc_connection_cancel
578 * Cancels the connection and ensures that its event handler will not fire
579 * again. After this call, any messages that have not yet been sent will be
580 * discarded, and the connection will be unwound. If there are messages that are
581 * awaiting replies, they will have their reply handlers invoked with the
582 * XPC_ERROR_CONNECTION_INVALID error.
583 *
584 * @param connection
585 * The connection object which is to be manipulated.
586 *
587 * @discussion
588 * Cancellation is asynchronous and non-preemptive and therefore this method
589 * will not interrupt the execution of an already-running event handler block.
590 * If the event handler is executing at the time of this call, it will finish,
591 * and then the connection will be canceled, causing a final invocation of the
592 * event handler to be scheduled with the XPC_ERROR_CONNECTION_INVALID error.
593 * After that invocation, there will be no further invocations of the event
594 * handler.
595 *
596 * The XPC runtime guarantees this non-preemptiveness even for concurrent target
597 * queues.
598 */
599__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
600XPC_EXPORT XPC_NONNULL_ALL
601void
602xpc_connection_cancel(xpc_connection_t connection);
603
604/*!
605 * @function xpc_connection_get_name
606 * Returns the name of the service with which the connections was created.
607 *
608 * @param connection
609 * The connection object which is to be examined.
610 *
611 * @result
612 * The name of the remote service. If you obtained the connection through an
613 * invocation of another connection's event handler, NULL is returned.
614 */
615__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
616XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
617const char * _Nullable
618xpc_connection_get_name(xpc_connection_t connection);
619
620/*!
621 * @function xpc_connection_get_euid
622 * Returns the EUID of the remote peer.
623 *
624 * @param connection
625 * The connection object which is to be examined.
626 *
627 * @result
628 * The EUID of the remote peer at the time the connection was made.
629 */
630__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
631XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
632uid_t
633xpc_connection_get_euid(xpc_connection_t connection);
634
635/*!
636 * @function xpc_connection_get_egid
637 * Returns the EGID of the remote peer.
638 *
639 * @param connection
640 * The connection object which is to be examined.
641 *
642 * @result
643 * The EGID of the remote peer at the time the connection was made.
644 */
645__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
646XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
647gid_t
648xpc_connection_get_egid(xpc_connection_t connection);
649
650/*!
651 * @function xpc_connection_get_pid
652 * Returns the PID of the remote peer.
653 *
654 * @param connection
655 * The connection object which is to be examined.
656 *
657 * @result
658 * The PID of the remote peer.
659 *
660 * @discussion
661 * A given PID is not guaranteed to be unique across an entire boot cycle.
662 * Great care should be taken when dealing with this information, as it can go
663 * stale after the connection is established. OS X recycles PIDs, and therefore
664 * another process could spawn and claim the PID before a message is actually
665 * received from the connection.
666 *
667 * XPC will deliver an error to your event handler if the remote process goes
668 * away, but there are no guarantees as to the timing of this notification's
669 * delivery either at the kernel layer or at the XPC layer.
670 */
671__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
672XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
673pid_t
674xpc_connection_get_pid(xpc_connection_t connection);
675
676/*!
677 * @function xpc_connection_get_asid
678 * Returns the audit session identifier of the remote peer.
679 *
680 * @param connection
681 * The connection object which is to be examined.
682 *
683 * @result
684 * The audit session ID of the remote peer at the time the connection was made.
685 */
686__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
687XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
688au_asid_t
689xpc_connection_get_asid(xpc_connection_t connection);
690
691/*!
692 * @function xpc_connection_set_context
693 * Sets context on an connection.
694 *
695 * @param connection
696 * The connection which is to be manipulated.
697 *
698 * @param context
699 * The context to associate with the connection.
700 *
701 * @discussion
702 * If you must manage the memory of the context object, you must set a finalizer
703 * to dispose of it. If this method is called on a connection which already has
704 * context associated with it, the finalizer will NOT be invoked. The finalizer
705 * is only invoked when the connection is being deallocated.
706 *
707 * It is recommended that, instead of changing the actual context pointer
708 * associated with the object, you instead change the state of the context
709 * object itself.
710 */
711__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
712XPC_EXPORT XPC_NONNULL1
713void
714xpc_connection_set_context(xpc_connection_t connection,
715 void * _Nullable context);
716
717/*!
718 * @function xpc_connection_get_context
719 * Returns the context associated with the connection.
720 *
721 * @param connection
722 * The connection which is to be examined.
723 *
724 * @result
725 * The context associated with the connection. NULL if there has been no context
726 * associated with the object.
727 */
728__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
729XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
730void * _Nullable
731xpc_connection_get_context(xpc_connection_t connection);
732
733/*!
734 * @function xpc_connection_set_finalizer_f
735 * Sets the finalizer for the given connection.
736 *
737 * @param connection
738 * The connection on which to set the finalizer.
739 *
740 * @param finalizer
741 * The function that will be invoked when the connection's retain count has
742 * dropped to zero and is being torn down.
743 *
744 * @discussion
745 * This method disposes of the context value associated with a connection, as
746 * set by {@link xpc_connection_set_context}.
747 *
748 * For many uses of context objects, this API allows for a convenient shorthand
749 * for freeing them. For example, for a context object allocated with malloc(3):
750 *
751 * xpc_connection_set_finalizer_f(object, free);
752 */
753__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
754XPC_EXPORT XPC_NONNULL1
755void
756xpc_connection_set_finalizer_f(xpc_connection_t connection,
757 xpc_finalizer_t _Nullable finalizer);
758
759/*!
760 * @function xpc_connection_set_peer_code_signing_requirement
761 * Requires that the connection peer satisfies a code signing requirement.
762 *
763 * @param connection
764 * The connection object which is to be modified.
765 *
766 * @param requirement
767 * The code signing requirement to be satisfied by the peer
768 * It is safe to deallocate the requirement string after calling `xpc_connection_set_peer_code_signing_requirement`
769 *
770 * @result
771 * 0 on success, non-zero on error
772 *
773 * @discussion
774 * This function will return an error promptly if the code signing requirement string is invalid.
775 *
776 * It is a programming error to call `xpc_connection_set_peer_code_signing_requirement` more than once per connection.
777 *
778 * All messages received on this connection will be checked to ensure they come from a peer who satisfies
779 * the code signing requirement. For a listener connection, requests that do not satisfy the requirement
780 * are dropped. When a reply is expected on the connection and the peer does not satisfy the requirement
781 * XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT will be delivered instead of the reply.
782 *
783 * @see https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html
784 */
785__API_AVAILABLE(macos(12.0))
786XPC_EXPORT XPC_NONNULL_ALL XPC_WARN_RESULT
787int
788xpc_connection_set_peer_code_signing_requirement(xpc_connection_t connection, const char *requirement);
789
790
791__END_DECLS
792XPC_ASSUME_NONNULL_END
793
794#endif // __XPC_CONNECTION_H__
\ No newline at end of file
lib/libc/include/any-macos.13-any/AvailabilityInternal.h+4-4
......@@ -55,7 +55,7 @@
5555 #ifdef __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
5656 /* compiler sets __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ when -mtvos-version-min is used */
5757 #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
58 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_16_1
58 #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_16_2
5959 /* for compatibility with existing code. New code should use platform specific checks */
6060 #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000
6161 #endif
......@@ -65,7 +65,7 @@
6565 #ifdef __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
6666 /* compiler sets __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ when -mwatchos-version-min is used */
6767 #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
68 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_9_1
68 #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_9_2
6969 /* for compatibility with existing code. New code should use platform specific checks */
7070 #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000
7171 #endif
......@@ -90,14 +90,14 @@
9090#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
9191 /* make sure a default max version is set */
9292 #ifndef __MAC_OS_X_VERSION_MAX_ALLOWED
93 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_13_0
93 #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_13_1
9494 #endif
9595#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
9696
9797#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
9898 /* make sure a default max version is set */
9999 #ifndef __IPHONE_OS_VERSION_MAX_ALLOWED
100 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_16_1
100 #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_16_2
101101 #endif
102102 /* make sure a valid min is set */
103103 #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0
lib/libc/include/any-macos.13-any/AvailabilityVersions.h+4
......@@ -68,6 +68,7 @@
6868#define __MAC_12_2 120200
6969#define __MAC_12_3 120300
7070#define __MAC_13_0 130000
71#define __MAC_13_1 130100
7172/* __MAC_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
7273
7374#define __IPHONE_2_0 20000
......@@ -132,6 +133,7 @@
132133#define __IPHONE_15_4 150400
133134#define __IPHONE_16_0 160000
134135#define __IPHONE_16_1 160100
136#define __IPHONE_16_2 160200
135137/* __IPHONE_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
136138
137139#define __TVOS_9_0 90000
......@@ -169,6 +171,7 @@
169171#define __TVOS_15_4 150400
170172#define __TVOS_16_0 160000
171173#define __TVOS_16_1 160100
174#define __TVOS_16_2 160200
172175
173176#define __WATCHOS_1_0 10000
174177#define __WATCHOS_2_0 20000
......@@ -203,6 +206,7 @@
203206#define __WATCHOS_8_5 80500
204207#define __WATCHOS_9_0 90000
205208#define __WATCHOS_9_1 90100
209#define __WATCHOS_9_2 90200
206210
207211/*
208212 * Set up standard Mac OS X versions
lib/libc/include/any-macos.13-any/net/if.h+1-1
......@@ -152,7 +152,7 @@ struct if_clonereq {
152152#define IFNET_SLOWHZ 1 /* granularity is 1 second */
153153#define IFQ_DEF_C_TARGET_DELAY (10ULL * 1000 * 1000) /* 10 ms */
154154#define IFQ_DEF_C_UPDATE_INTERVAL (100ULL * 1000 * 1000) /* 100 ms */
155#define IFQ_DEF_L4S_TARGET_DELAY (10ULL * 1000 * 1000) /* 10 ms */
155#define IFQ_DEF_L4S_TARGET_DELAY (2ULL * 1000 * 1000) /* 2 ms */
156156#define IFQ_DEF_L4S_UPDATE_INTERVAL (100ULL * 1000 * 1000) /* 100 ms */
157157#define IFQ_LL_C_TARGET_DELAY (10ULL * 1000 * 1000) /* 10 ms */
158158#define IFQ_LL_C_UPDATE_INTERVAL (100ULL * 1000 * 1000) /* 100 ms */
lib/libc/include/any-macos.13-any/sys/_symbol_aliasing.h+12
......@@ -383,6 +383,12 @@
383383#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_1(x)
384384#endif
385385
386#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 160200
387#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_2(x) x
388#else
389#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_2(x)
390#endif
391
386392#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000
387393#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x
388394#else
......@@ -633,4 +639,10 @@
633639#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_0(x) x
634640#else
635641#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_0(x)
642#endif
643
644#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 130100
645#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_1(x) x
646#else
647#define __DARWIN_ALIAS_STARTING_MAC___MAC_13_1(x)
636648#endif
\ No newline at end of file
lib/libc/include/any-macos.13-any/sys/constrained_ctypes.h+76-30
......@@ -31,9 +31,8 @@
3131
3232#include <sys/cdefs.h>
3333
34/* This file introduces macros for constraining pointer
35 * types to specific contracts:
36 *
34/*
35 * Constraining pointer types based on contracts.
3736 *
3837 * 1. List of supported constrained pointers.
3938 *
......@@ -184,12 +183,19 @@
184183 * `basetag`: the prefix of the constrained type.
185184 *
186185 * This macro acts differently in the user-space and the kernel-space
187 * code. When used in the former, it will only declare types which are
188 * ABI-safe. See `ABI Compatibility Considerations' below for more details.
186 * code.
187 * When used in the user-space code, the macro will declare
188 * types which are ABI-safe. See `ABI Compatibility Considerations'
189 * below for more details on ABI-safety. In the user-space code,
190 * the macro is guarded by the `__CCT_ENABLE_USER_SPACE' compilation
191 * flag.
192 * When used in the kernel-space code, the macro will declare
193 * the common constrained types.
189194 *
190195 * Examples:
191196 *
192 * (1) When used from the user space,
197 * (1) When used from the user space, and `__CCT_ENABLE_USER_SPACE'
198 * is defined, the expression
193199 * `__CCT_DECLARE_CONSTRAINED_PTR_TYPES(struct socket, socket);'
194200 * will declare types:
195201 *
......@@ -224,16 +230,32 @@
224230 *
225231 * `basetype`: the pointee type.
226232 * `basetag`: the prefix of the constrained type.
227 * `...`: list of `REF', `CREF', `BPTR' or `PTR', which represent
228 * the desired constraints.
233 * `...`: list of constraints:
234 * - `__CCT_REF' for the "reference" contract;
235 * - `__CCT_CREF' for the "const reference" contract;
236 * - `__CCT_PTR' for the "checked pointer" contract; or
237 * - `__CCT_BPTR' for the "bidirectional pointer" contract.
229238 *
230239 * Examples:
231240 *
232 * (1) `__CCT_DECLARE_CONSTRAINED_PTR_TYPE(struct socket, socket, REF)'
233 * will declare the type `socket_ref_t`:
241 * (1) `__CCT_DECLARE_CONSTRAINED_PTR_TYPE(struct socket, socket, __CCT_REF)'
242 * will declare the type
243 * `reference' pointer to `struct socket'
244 * and call this type by `socket_ref_t'
234245 *
235 * (2) `__CCT_DECLARE_CONSTRAINED_PTR_TYPE(struct socket, socket, REF, PTR, REF)'
236 * will declare the type `socket_ref_ptr_ref_t`:
246 * (2) `__CCT_DECLARE_CONSTRAINED_PTR_TYPE(struct socket, socket, __CCT_REF, __CCT_PTR)'
247 * will declare the type
248 * `checked' pointer to `socket_ref_t'
249 * which in turn is equivalent to the type
250 * `checked' pointer to `reference' pointer to `struct socket'
251 *
252 * (3) `__CCT_DECLARE_CONSTRAINED_PTR_TYPE(struct socket, socket, __CCT_REF, __CCT_PTR, __CCT_REF)'
253 * will declare the type
254 * `reference' pointer to `socket_ref_ptr_t'
255 * which is equivalent to the type
256 * `reference' pointer to `checked' pointer to `socket_ref_t'
257 * which in turn is equivalent to the type
258 * `reference' pointer to `checked' pointer to `reference' pointer to `struct socket'
237259 *
238260 *
239261 * 3. Using constrained pointer types.
......@@ -513,27 +535,28 @@
513535 * Support for other compilers will be added after the introduction of support
514536 * for pointer tagging on those compilers.
515537 */
538#if defined(KERNEL) || defined(__CCT_ENABLE_USER_SPACE)
516539#if defined(__clang__)
517#define __CCT_CONTRACT_ATTR_REF __single
518#define __CCT_CONTRACT_ATTR_CREF const __single
540#define __CCT_CONTRACT_ATTR___CCT_REF __single
541#define __CCT_CONTRACT_ATTR___CCT_CREF const __single
519542#if __has_ptrcheck
520#define __CCT_CONTRACT_ATTR_BPTR __bidi_indexable
521#define __CCT_CONTRACT_ATTR_PTR __indexable
543#define __CCT_CONTRACT_ATTR___CCT_BPTR __bidi_indexable
544#define __CCT_CONTRACT_ATTR___CCT_PTR __indexable
522545#else /* __clang__ + __has_ptrcheck */
523#define __CCT_CONTRACT_ATTR_BPTR
524#define __CCT_CONTRACT_ATTR_PTR
546#define __CCT_CONTRACT_ATTR___CCT_BPTR
547#define __CCT_CONTRACT_ATTR___CCT_PTR
525548#endif /* __clang__ + !__has_ptrcheck */
526549#else /* !__clang__ */
527#define __CCT_CONTRACT_ATTR_REF
528#define __CCT_CONTRACT_ATTR_CREF const
529#define __CCT_CONTRACT_ATTR_BPTR
530#define __CCT_CONTRACT_ATTR_PTR
550#define __CCT_CONTRACT_ATTR___CCT_REF
551#define __CCT_CONTRACT_ATTR___CCT_CREF const
552#define __CCT_CONTRACT_ATTR___CCT_BPTR
553#define __CCT_CONTRACT_ATTR___CCT_PTR
531554#endif /* __clang__ */
532555
533#define __CCT_CONTRACT_TAG_REF _ref
534#define __CCT_CONTRACT_TAG_CREF _cref
535#define __CCT_CONTRACT_TAG_BPTR _bptr
536#define __CCT_CONTRACT_TAG_PTR _ptr
556#define __CCT_CONTRACT_TAG___CCT_REF _ref
557#define __CCT_CONTRACT_TAG___CCT_CREF _cref
558#define __CCT_CONTRACT_TAG___CCT_BPTR _bptr
559#define __CCT_CONTRACT_TAG___CCT_PTR _ptr
537560
538561/* Helper macros */
539562#define __CCT_DEFER(F, ...) F(__VA_ARGS__)
......@@ -572,20 +595,43 @@ typedef basetype * __CCT_CONTRACT_TO_ATTR(kind1)
572595 * __CCT_CONTRACT_TO_ATTR(kind2) \
573596 * __CCT_CONTRACT_TO_ATTR(kind3) \
574597 __CCT_DEFER(__CONCAT, basetag, __CCT_CONTRACT_LIST_TO_TAGGED_SUFFIX_3(kind1, kind2, kind3))
598#endif /* defined(KERNEL) || defined(__CCT_ENABLE_USER_SPACE) */
575599
576600/*
577601 * Lower level type constructor.
578602 */
603#if defined(KERNEL) || defined(__CCT_ENABLE_USER_SPACE)
579604#define __CCT_DECLARE_CONSTRAINED_PTR_TYPE(basetype, basetag, ...) \
580605 __CCT_DISPATCH(__CCT_DECLARE_CONSTRAINED_PTR_TYPE, basetype, basetag, __VA_ARGS__)
606#else /* !defined(KERNEL) && !defined(__CCT_ENABLE_USER_SPACE) */
607#if defined(__clang__)
608#pragma clang diagnostic push
609#pragma clang diagnostic ignored "-Wextra-semi"
610#endif /* defined(__clang__) */
611#define __CCT_DECLARE_CONSTRAINED_PTR_TYPE(basetype, basetag, ...)
612#if defined(__clang__)
613#pragma clang diagnostic pop
614#endif /* defined(__clang__) */
615#endif /* !defined(KERNEL) && !defined(__CCT_ENABLE_USER_SPACE) */
581616
582617/*
583618 * Higher level type constructors.
584 * The constrained types that can potentially break the ABI are not exposed
585 * into the user-space.
586619 */
620#if defined(__CCT_ENABLE_USER_SPACE)
621/* Limiting the higher-level constructor to the ABI-preserving constructs. */
587622#define __CCT_DECLARE_CONSTRAINED_PTR_TYPES(basetype, basetag) \
588__CCT_DECLARE_CONSTRAINED_PTR_TYPE(basetype, basetag, REF); \
589__CCT_DECLARE_CONSTRAINED_PTR_TYPE(basetype, basetag, REF, REF)
623 __CCT_DECLARE_CONSTRAINED_PTR_TYPE(basetype, basetag, __CCT_REF); \
624 __CCT_DECLARE_CONSTRAINED_PTR_TYPE(basetype, basetag, __CCT_REF, __CCT_REF)
625#else /* !defined(__CCT_ENABLE_USER_SPACE) */
626/* Disabling the higher-level constructor */
627#if defined(__clang__)
628#pragma clang diagnostic push
629#pragma clang diagnostic ignored "-Wextra-semi"
630#endif /* defined(__clang__) */
631#define __CCT_DECLARE_CONSTRAINED_PTR_TYPES(basetype, basetag)
632#if defined(__clang__)
633#pragma clang diagnostic pop
634#endif /* defined(__clang__) */
635#endif /* !defined(__CCT_ENABLE_USER_SPACE) */
590636
591637#endif /* __CONSTRAINED_CTYPES__ */
\ No newline at end of file
lib/libc/include/any-macos.13-any/vis.h created+143
......@@ -0,0 +1,143 @@
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/* $NetBSD: vis.h,v 1.25 2017/04/23 01:57:36 christos Exp $ */
24/* $FreeBSD$ */
25
26/*-
27 * Copyright (c) 1990, 1993
28 * The Regents of the University of California. All rights reserved.
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. Neither the name of the University nor the names of its contributors
39 * may be used to endorse or promote products derived from this software
40 * without specific prior written permission.
41 *
42 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
43 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
46 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
48 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
52 * SUCH DAMAGE.
53 *
54 * @(#)vis.h 8.1 (Berkeley) 6/2/93
55 */
56
57#ifndef _VIS_H_
58#define _VIS_H_
59
60#include <_types.h>
61#include <sys/_types/_size_t.h>
62
63/*
64 * to select alternate encoding format
65 */
66#define VIS_OCTAL 0x0001 /* use octal \ddd format */
67#define VIS_CSTYLE 0x0002 /* use \[nrft0..] where appropiate */
68
69/*
70 * to alter set of characters encoded (default is to encode all
71 * non-graphic except space, tab, and newline).
72 */
73#define VIS_SP 0x0004 /* also encode space */
74#define VIS_TAB 0x0008 /* also encode tab */
75#define VIS_NL 0x0010 /* also encode newline */
76#define VIS_WHITE (VIS_SP | VIS_TAB | VIS_NL)
77#define VIS_SAFE 0x0020 /* only encode "unsafe" characters */
78#define VIS_DQ 0x8000 /* also encode double quotes */
79
80/*
81 * other
82 */
83#define VIS_NOSLASH 0x0040 /* inhibit printing '\' */
84#define VIS_HTTP1808 0x0080 /* http-style escape % hex hex */
85#define VIS_HTTPSTYLE 0x0080 /* http-style escape % hex hex */
86#define VIS_GLOB 0x0100 /* encode glob(3) magic characters */
87#define VIS_MIMESTYLE 0x0200 /* mime-style escape = HEX HEX */
88#define VIS_HTTP1866 0x0400 /* http-style &#num; or &string; */
89#define VIS_NOESCAPE 0x0800 /* don't decode `\' */
90#define _VIS_END 0x1000 /* for unvis */
91#define VIS_SHELL 0x2000 /* encode shell special characters [not glob] */
92#define VIS_META (VIS_WHITE | VIS_GLOB | VIS_SHELL)
93#define VIS_NOLOCALE 0x4000 /* encode using the C locale */
94
95/*
96 * unvis return codes
97 */
98#define UNVIS_VALID 1 /* character valid */
99#define UNVIS_VALIDPUSH 2 /* character valid, push back passed char */
100#define UNVIS_NOCHAR 3 /* valid sequence, no character produced */
101#define UNVIS_SYNBAD -1 /* unrecognized escape sequence */
102#define UNVIS_ERROR -2 /* decoder in unknown state (unrecoverable) */
103
104/*
105 * unvis flags
106 */
107#define UNVIS_END _VIS_END /* no more characters */
108
109#include <sys/cdefs.h>
110
111__BEGIN_DECLS
112char *vis(char *, int, int, int);
113char *nvis(char *, size_t, int, int, int);
114
115char *svis(char *, int, int, int, const char *);
116char *snvis(char *, size_t, int, int, int, const char *);
117
118int strvis(char *, const char *, int);
119int stravis(char **, const char *, int);
120int strnvis(char *, size_t, const char *, int);
121
122int strsvis(char *, const char *, int, const char *);
123int strsnvis(char *, size_t, const char *, int, const char *);
124
125int strvisx(char *, const char *, size_t, int);
126int strnvisx(char *, size_t, const char *, size_t, int);
127int strenvisx(char *, size_t, const char *, size_t, int, int *);
128
129int strsvisx(char *, const char *, size_t, int, const char *);
130int strsnvisx(char *, size_t, const char *, size_t, int, const char *);
131int strsenvisx(char *, size_t, const char *, size_t , int, const char *,
132 int *);
133
134int strunvis(char *, const char *);
135int strnunvis(char *, size_t, const char *);
136
137int strunvisx(char *, const char *, int);
138int strnunvisx(char *, size_t, const char *, int);
139
140int unvis(char *, int, int *, int);
141__END_DECLS
142
143#endif /* !_VIS_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/i386/_limits.h-4
......@@ -22,10 +22,6 @@
2222#ifndef _I386__LIMITS_H_
2323#define _I386__LIMITS_H_
2424
25#if defined (__i386__) || defined (__x86_64__)
26
2725#define __DARWIN_CLK_TCK 100 /* ticks per second */
2826
29#endif /* defined (__i386__) || defined (__x86_64__) */
30
3127#endif /* _I386__LIMITS_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/i386/_mcontext.h-4
......@@ -29,8 +29,6 @@
2929#ifndef __I386_MCONTEXT_H_
3030#define __I386_MCONTEXT_H_
3131
32#if defined (__i386__) || defined (__x86_64__)
33
3432#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
3533#include <sys/appleapiopts.h>
3634#include <mach/machine/_structs.h>
......@@ -211,6 +209,4 @@ typedef _STRUCT_MCONTEXT32 *mcontext_t;
211209#endif
212210#endif /* _MCONTEXT_T */
213211
214#endif /* defined (__i386__) || defined (__x86_64__) */
215
216212#endif /* __I386_MCONTEXT_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/i386/_param.h-3
......@@ -29,8 +29,6 @@
2929#ifndef _I386__PARAM_H_
3030#define _I386__PARAM_H_
3131
32#if defined (__i386__) || defined (__x86_64__)
33
3432#include <i386/_types.h>
3533
3634/*
......@@ -44,6 +42,5 @@
4442#define __DARWIN_ALIGNBYTES32 (sizeof(__uint32_t) - 1)
4543#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32)
4644
47#endif /* defined (__i386__) || defined (__x86_64__) */
4845
4946#endif /* _I386__PARAM_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/i386/_types.h-4
......@@ -28,8 +28,6 @@
2828#ifndef _BSD_I386__TYPES_H_
2929#define _BSD_I386__TYPES_H_
3030
31#if defined (__i386__) || defined (__x86_64__)
32
3331/*
3432 * This header file contains integer types. It's intended to also contain
3533 * flotaing point and other arithmetic types, as needed, later.
......@@ -121,6 +119,4 @@ typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
121119typedef long __darwin_ssize_t; /* byte count or error */
122120typedef long __darwin_time_t; /* time() */
123121
124#endif /* defined (__i386__) || defined (__x86_64__) */
125
126122#endif /* _BSD_I386__TYPES_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/i386/eflags.h-4
......@@ -59,8 +59,6 @@
5959#ifndef _I386_EFLAGS_H_
6060#define _I386_EFLAGS_H_
6161
62#if defined (__i386__) || defined (__x86_64__)
63
6462/*
6563 * i386 flags register
6664 */
......@@ -93,6 +91,4 @@
9391#define EFL_USER_SET (EFL_IF)
9492#define EFL_USER_CLEAR (EFL_IOPL|EFL_NT|EFL_RF)
9593
96#endif /* defined (__i386__) || defined (__x86_64__) */
97
9894#endif /* _I386_EFLAGS_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/i386/endian.h-3
......@@ -66,8 +66,6 @@
6666#ifndef _I386__ENDIAN_H_
6767#define _I386__ENDIAN_H_
6868
69#if defined (__i386__) || defined (__x86_64__)
70
7169#include <sys/cdefs.h>
7270/*
7371 * Define _NOQUAD if the compiler does NOT support 64-bit integers.
......@@ -101,5 +99,4 @@
10199#include <sys/_endian.h>
102100
103101#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
104#endif /* defined (__i386__) || defined (__x86_64__) */
105102#endif /* !_I386__ENDIAN_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/i386/limits.h-4
......@@ -36,8 +36,6 @@
3636#ifndef _I386_LIMITS_H_
3737#define _I386_LIMITS_H_
3838
39#if defined (__i386__) || defined (__x86_64__)
40
4139#include <sys/cdefs.h>
4240#include <i386/_limits.h>
4341
......@@ -106,6 +104,4 @@
106104#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
107105#endif /* !_ANSI_SOURCE */
108106
109#endif /* defined (__i386__) || defined (__x86_64__) */
110
111107#endif /* _I386_LIMITS_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/i386/param.h-4
......@@ -72,8 +72,6 @@
7272#ifndef _I386_PARAM_H_
7373#define _I386_PARAM_H_
7474
75#if defined (__i386__) || defined (__x86_64__)
76
7775#include <i386/_param.h>
7876
7977/*
......@@ -170,6 +168,4 @@
170168#define DELAY(n) { int N = (n); while (--N > 0); }
171169#endif /* defined(KERNEL) || defined(STANDALONE) */
172170
173#endif /* defined (__i386__) || defined (__x86_64__) */
174
175171#endif /* _I386_PARAM_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/i386/signal.h-4
......@@ -33,8 +33,6 @@
3333#ifndef _I386_SIGNAL_H_
3434#define _I386_SIGNAL_H_ 1
3535
36#if defined (__i386__) || defined (__x86_64__)
37
3836#include <sys/cdefs.h>
3937
4038#ifndef _ANSI_SOURCE
......@@ -42,6 +40,4 @@ typedef int sig_atomic_t;
4240
4341#endif /* ! _ANSI_SOURCE */
4442
45#endif /* defined (__i386__) || defined (__x86_64__) */
46
4743#endif /* _I386_SIGNAL_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/i386/types.h+2-6
......@@ -63,12 +63,9 @@
6363 * @(#)types.h 8.3 (Berkeley) 1/5/94
6464 */
6565
66#ifndef _I386_MACHTYPES_H_
67#define _I386_MACHTYPES_H_
66#ifndef _MACHTYPES_H_
6867#define _MACHTYPES_H_
6968
70#if defined (__i386__) || defined (__x86_64__)
71
7269#ifndef __ASSEMBLER__
7370#include <i386/_types.h>
7471#include <sys/cdefs.h>
......@@ -114,5 +111,4 @@ typedef int64_t user_off_t;
114111typedef u_int64_t syscall_arg_t;
115112
116113#endif /* __ASSEMBLER__ */
117#endif /* defined (__i386__) || defined (__x86_64__) */
118#endif /* _I386_MACHTYPES_H_ */
\ No newline at end of file
114#endif /* _MACHTYPES_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/mach/i386/_structs.h-4
......@@ -32,8 +32,6 @@
3232#ifndef _MACH_I386__STRUCTS_H_
3333#define _MACH_I386__STRUCTS_H_
3434
35#if defined (__i386__) || defined (__x86_64__)
36
3735#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
3836#include <machine/types.h> /* __uint8_t */
3937
......@@ -1311,6 +1309,4 @@ _STRUCT_X86_CPMU_STATE64
13111309};
13121310#endif /* !__DARWIN_UNIX03 */
13131311
1314#endif /* defined (__i386__) || defined (__x86_64__) */
1315
13161312#endif /* _MACH_I386__STRUCTS_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/mach/i386/boolean.h-4
......@@ -65,14 +65,10 @@
6565#ifndef _MACH_I386_BOOLEAN_H_
6666#define _MACH_I386_BOOLEAN_H_
6767
68#if defined (__i386__) || defined (__x86_64__)
69
7068#if defined(__x86_64__) && !defined(KERNEL)
7169typedef unsigned int boolean_t;
7270#else
7371typedef int boolean_t;
7472#endif
7573
76#endif /* defined (__i386__) || defined (__x86_64__) */
77
7874#endif /* _MACH_I386_BOOLEAN_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/mach/i386/exception.h-4
......@@ -59,8 +59,6 @@
5959#ifndef _MACH_I386_EXCEPTION_H_
6060#define _MACH_I386_EXCEPTION_H_
6161
62#if defined (__i386__) || defined (__x86_64__)
63
6462/*
6563 * No machine dependent types for the 80386
6664 */
......@@ -134,6 +132,4 @@
134132 */
135133#define EXC_MASK_MACHINE 0
136134
137#endif /* defined (__i386__) || defined (__x86_64__) */
138
139135#endif /* _MACH_I386_EXCEPTION_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/mach/i386/fp_reg.h-4
......@@ -59,8 +59,6 @@
5959#ifndef _I386_FP_SAVE_H_
6060#define _I386_FP_SAVE_H_
6161
62#if defined (__i386__) || defined (__x86_64__)
63
6462/*
6563 * Control register
6664 */
......@@ -117,6 +115,4 @@
117115#define FP_387 3 /* 80387 or 80486 */
118116#define FP_FXSR 4 /* Fast save/restore SIMD Extension */
119117
120#endif /* defined (__i386__) || defined (__x86_64__) */
121
122118#endif /* _I386_FP_SAVE_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/mach/i386/kern_return.h-4
......@@ -67,12 +67,8 @@
6767#ifndef _MACH_I386_KERN_RETURN_H_
6868#define _MACH_I386_KERN_RETURN_H_
6969
70#if defined (__i386__) || defined (__x86_64__)
71
7270#ifndef ASSEMBLER
7371typedef int kern_return_t;
7472#endif /* ASSEMBLER */
7573
76#endif /* defined (__i386__) || defined (__x86_64__) */
77
7874#endif /* _MACH_I386_KERN_RETURN_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/mach/i386/processor_info.h-4
......@@ -34,8 +34,4 @@
3434#ifndef _MACH_I386_PROCESSOR_INFO_H_
3535#define _MACH_I386_PROCESSOR_INFO_H_
3636
37#if defined (__i386__) || defined (__x86_64__)
38
39#endif /* defined (__i386__) || defined (__x86_64__) */
40
4137#endif /* _MACH_I386_PROCESSOR_INFO_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/mach/i386/rpc.h-4
......@@ -32,8 +32,4 @@
3232#ifndef _MACH_I386_RPC_H_
3333#define _MACH_I386_RPC_H_
3434
35#if defined (__i386__) || defined (__x86_64__)
36
37#endif /* defined (__i386__) || defined (__x86_64__) */
38
3935#endif /* _MACH_I386_RPC_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/mach/i386/thread_state.h+3-3
......@@ -32,11 +32,11 @@
3232#ifndef _MACH_I386_THREAD_STATE_H_
3333#define _MACH_I386_THREAD_STATE_H_
3434
35#if defined (__i386__) || defined (__x86_64__)
36
3735/* Size of maximum exported thread state in 32-bit words */
3836#define I386_THREAD_STATE_MAX (614) /* Size of biggest state possible */
3937
40#endif /* defined (__i386__) || defined (__x86_64__) */
38#if defined (__i386__) || defined(__x86_64__)
39#define THREAD_STATE_MAX I386_THREAD_STATE_MAX
40#endif
4141
4242#endif /* _MACH_I386_THREAD_STATE_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/mach/i386/thread_status.h+1-5
......@@ -67,12 +67,10 @@
6767#ifndef _MACH_I386_THREAD_STATUS_H_
6868#define _MACH_I386_THREAD_STATUS_H_
6969
70#if defined (__i386__) || defined (__x86_64__)
71
7270#include <mach/machine/_structs.h>
73#include <mach/machine/thread_state.h>
7471#include <mach/message.h>
7572#include <mach/i386/fp_reg.h>
73#include <mach/i386/thread_state.h>
7674#include <i386/eflags.h>
7775
7876
......@@ -361,6 +359,4 @@ typedef struct x86_avx512_state x86_avx512_state_t;
361359#define MACHINE_THREAD_STATE_COUNT x86_THREAD_STATE_COUNT
362360
363361
364#endif /* defined (__i386__) || defined (__x86_64__) */
365
366362#endif /* _MACH_I386_THREAD_STATUS_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/mach/i386/vm_param.h+2-8
......@@ -90,8 +90,6 @@
9090#ifndef _MACH_I386_VM_PARAM_H_
9191#define _MACH_I386_VM_PARAM_H_
9292
93#if defined (__i386__) || defined (__x86_64__)
94
9593#if !defined(KERNEL) && !defined(__ASSEMBLER__)
9694
9795#include <mach/vm_page_size.h>
......@@ -124,11 +122,9 @@
124122
125123#define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL)
126124/*
127 * Default top of user stack, grows down from here.
128 * Address chosen to be 1G (3rd level page table entry) below SHARED_REGION_BASE_X86_64
129 * minus additional 1Meg (1/2 1st level page table coverage) to allow a redzone after it.
125 * default top of user stack... it grows down from here
130126 */
131#define VM_USRSTACK64 ((user_addr_t) (0x00007FF7C0000000ull - (1024 * 1024)))
127#define VM_USRSTACK64 ((user_addr_t) 0x00007FFEEFC00000ULL)
132128
133129/*
134130 * XXX TODO: Obsolete?
......@@ -158,6 +154,4 @@
158154
159155
160156
161#endif /* defined (__i386__) || defined (__x86_64__) */
162
163157#endif /* _MACH_I386_VM_PARAM_H_ */
\ No newline at end of file
lib/libc/include/x86_64-macos.11-none/mach/i386/vm_types.h+6-11
......@@ -67,13 +67,10 @@
6767#ifndef _MACH_I386_VM_TYPES_H_
6868#define _MACH_I386_VM_TYPES_H_
6969
70#if defined (__i386__) || defined (__x86_64__)
71
7270#ifndef ASSEMBLER
7371
7472#include <i386/_types.h>
7573#include <stdint.h>
76#include <sys/cdefs.h>
7774
7875/*
7976 * natural_t and integer_t are Mach's legacy types for machine-
......@@ -100,9 +97,9 @@ typedef int integer_t;
10097 * e.g. an offset into a virtual memory space.
10198 */
10299#ifdef __LP64__
103typedef uintptr_t vm_offset_t __kernel_ptr_semantics;
100typedef uintptr_t vm_offset_t;
104101#else /* __LP64__ */
105typedef natural_t vm_offset_t __kernel_ptr_semantics;
102typedef natural_t vm_offset_t;
106103#endif /* __LP64__ */
107104
108105/*
......@@ -123,12 +120,12 @@ typedef natural_t vm_size_t;
123120 * where the size of the map is not known - or we don't
124121 * want to have to distinguish.
125122 */
126typedef uint64_t mach_vm_address_t __kernel_ptr_semantics;
127typedef uint64_t mach_vm_offset_t __kernel_ptr_semantics;
123typedef uint64_t mach_vm_address_t;
124typedef uint64_t mach_vm_offset_t;
128125typedef uint64_t mach_vm_size_t;
129126
130typedef uint64_t vm_map_offset_t __kernel_ptr_semantics;
131typedef uint64_t vm_map_address_t __kernel_ptr_semantics;
127typedef uint64_t vm_map_offset_t;
128typedef uint64_t vm_map_address_t;
132129typedef uint64_t vm_map_size_t;
133130
134131typedef mach_vm_address_t mach_port_context_t;
......@@ -141,6 +138,4 @@ typedef mach_vm_address_t mach_port_context_t;
141138 */
142139#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32
143140
144#endif /* defined (__i386__) || defined (__x86_64__) */
145
146141#endif /* _MACH_I386_VM_TYPES_H_ */
\ No newline at end of file