From 2eee0582f8654cb2b344ed8e2c43dcda3424dbe5 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 17 Nov 2020 11:32:12 -0800 Subject: [PATCH] macOS libc headers: downgrade to 10.15.7 (Catalina) See ziglang/fetch-them-macos-headers#2 for more details. The path forward looks like one of the following: * Ony provide headers for the oldest supported macOS (currently 10.13 but soon to be bumped to 10.14). * Provide headers for multiple versions, and select based on the Zig target OS version range minimum. * Don't try to provide macOS headers. If we don't tackle the version problem, we would have to re-introduce the ability to detect and depend on native system headers if we wanted to support C/C++ code that used newer OS definitions. This patch also adds support for `#include `. Also related: #5236 --- .../include/x86_64-macos-gnu/Availability.h | 125 +++++- .../x86_64-macos-gnu/AvailabilityInternal.h | 15 +- .../x86_64-macos-gnu/AvailabilityMacros.h | 8 +- .../x86_64-macos-gnu/AvailabilityVersions.h | 208 ---------- .../x86_64-macos-gnu/TargetConditionals.h | 142 ++++--- lib/libc/include/x86_64-macos-gnu/_ctermid.h | 10 +- lib/libc/include/x86_64-macos-gnu/bsm/audit.h | 23 +- .../include/x86_64-macos-gnu/dispatch/block.h | 4 +- .../x86_64-macos-gnu/dispatch/dispatch.h | 5 - .../include/x86_64-macos-gnu/dispatch/group.h | 2 +- .../x86_64-macos-gnu/dispatch/object.h | 4 +- .../include/x86_64-macos-gnu/dispatch/queue.h | 2 +- .../x86_64-macos-gnu/dispatch/semaphore.h | 6 +- .../x86_64-macos-gnu/dispatch/source.h | 10 +- .../x86_64-macos-gnu/dispatch/workloop.h | 27 -- .../include/x86_64-macos-gnu/i386/_param.h | 4 +- .../include/x86_64-macos-gnu/libDER/DERItem.h | 47 --- .../x86_64-macos-gnu/libDER/libDER_config.h | 121 ------ .../libkern/OSAtomicDeprecated.h | 113 +----- .../x86_64-macos-gnu/libkern/OSAtomicQueue.h | 78 +++- .../x86_64-macos-gnu/libkern/OSByteOrder.h | 26 +- .../x86_64-macos-gnu/libkern/_OSByteOrder.h | 35 +- .../include/x86_64-macos-gnu/mach-o/dyld.h | 9 - .../include/x86_64-macos-gnu/mach-o/loader.h | 38 +- .../x86_64-macos-gnu/mach/i386/_structs.h | 80 ---- .../x86_64-macos-gnu/mach/i386/thread_state.h | 2 +- .../mach/i386/thread_status.h | 19 +- .../x86_64-macos-gnu/mach/i386/vm_param.h | 53 ++- .../x86_64-macos-gnu/mach/i386/vm_types.h | 1 + .../x86_64-macos-gnu/mach/kern_return.h | 4 - .../include/x86_64-macos-gnu/mach/mach_port.h | 14 +- .../include/x86_64-macos-gnu/mach/mach_time.h | 73 ++++ .../x86_64-macos-gnu/mach/mach_traps.h | 6 + .../x86_64-macos-gnu/mach/mach_types.h | 33 +- .../include/x86_64-macos-gnu/mach/machine.h | 20 +- .../x86_64-macos-gnu/mach/machine/_structs.h | 2 - .../x86_64-macos-gnu/mach/machine/boolean.h | 2 - .../x86_64-macos-gnu/mach/machine/exception.h | 2 - .../mach/machine/kern_return.h | 2 - .../mach/machine/processor_info.h | 2 - .../x86_64-macos-gnu/mach/machine/rpc.h | 2 - .../mach/machine/thread_state.h | 2 - .../mach/machine/thread_status.h | 2 - .../x86_64-macos-gnu/mach/machine/vm_param.h | 2 - .../x86_64-macos-gnu/mach/machine/vm_types.h | 2 - .../include/x86_64-macos-gnu/mach/message.h | 8 +- lib/libc/include/x86_64-macos-gnu/mach/port.h | 9 +- .../x86_64-macos-gnu/mach/processor_set.h | 49 +-- lib/libc/include/x86_64-macos-gnu/mach/task.h | 28 +- .../include/x86_64-macos-gnu/mach/task_info.h | 48 +-- .../x86_64-macos-gnu/mach/task_policy.h | 7 +- .../mach/task_special_ports.h | 13 +- .../x86_64-macos-gnu/mach/thread_act.h | 74 +--- .../mach/thread_special_ports.h | 7 +- .../x86_64-macos-gnu/mach/thread_status.h | 3 - .../include/x86_64-macos-gnu/mach/vm_prot.h | 1 - .../x86_64-macos-gnu/mach/vm_statistics.h | 31 +- .../include/x86_64-macos-gnu/mach/vm_types.h | 4 +- .../x86_64-macos-gnu/machine/_mcontext.h | 2 - .../include/x86_64-macos-gnu/machine/_param.h | 4 +- .../include/x86_64-macos-gnu/machine/_types.h | 2 - .../include/x86_64-macos-gnu/machine/endian.h | 2 - .../include/x86_64-macos-gnu/machine/limits.h | 2 - .../include/x86_64-macos-gnu/machine/param.h | 4 +- .../include/x86_64-macos-gnu/machine/signal.h | 2 - .../include/x86_64-macos-gnu/machine/types.h | 2 - .../include/x86_64-macos-gnu/malloc/_malloc.h | 6 +- lib/libc/include/x86_64-macos-gnu/math.h | 4 - lib/libc/include/x86_64-macos-gnu/net/if.h | 2 +- .../include/x86_64-macos-gnu/net/if_var.h | 3 +- .../include/x86_64-macos-gnu/netinet/in.h | 5 +- .../include/x86_64-macos-gnu/netinet/tcp.h | 4 +- .../include/x86_64-macos-gnu/netinet6/in6.h | 28 +- .../include/x86_64-macos-gnu/objc/objc-api.h | 6 - .../include/x86_64-macos-gnu/objc/runtime.h | 71 ++-- lib/libc/include/x86_64-macos-gnu/os/base.h | 57 +-- lib/libc/include/x86_64-macos-gnu/os/clock.h | 18 - lib/libc/include/x86_64-macos-gnu/os/object.h | 44 +-- .../include/x86_64-macos-gnu/os/workgroup.h | 37 -- .../x86_64-macos-gnu/os/workgroup_base.h | 78 ---- .../x86_64-macos-gnu/os/workgroup_interval.h | 155 -------- .../x86_64-macos-gnu/os/workgroup_object.h | 357 ------------------ .../x86_64-macos-gnu/os/workgroup_parallel.h | 74 ---- lib/libc/include/x86_64-macos-gnu/pthread.h | 30 +- .../include/x86_64-macos-gnu/pthread/sched.h | 4 +- .../include/x86_64-macos-gnu/pthread_impl.h | 66 ++++ lib/libc/include/x86_64-macos-gnu/sched.h | 4 +- lib/libc/include/x86_64-macos-gnu/signal.h | 5 + .../include/x86_64-macos-gnu/simd/common.h | 36 +- .../x86_64-macos-gnu/simd/conversion.h | 91 ----- .../include/x86_64-macos-gnu/simd/logic.h | 56 +-- lib/libc/include/x86_64-macos-gnu/simd/math.h | 321 ++++++++-------- .../include/x86_64-macos-gnu/simd/packed.h | 244 ++++++------ .../x86_64-macos-gnu/simd/quaternion.h | 10 +- lib/libc/include/x86_64-macos-gnu/spawn.h | 22 -- lib/libc/include/x86_64-macos-gnu/stdio.h | 2 +- lib/libc/include/x86_64-macos-gnu/stdlib.h | 5 +- lib/libc/include/x86_64-macos-gnu/string.h | 4 - .../sys/_pthread/_pthread_attr_t.h | 12 +- .../sys/_pthread/_pthread_cond_t.h | 8 +- .../sys/_pthread/_pthread_condattr_t.h | 8 +- .../sys/_pthread/_pthread_rwlock_t.h | 8 +- .../sys/_pthread/_pthread_rwlockattr_t.h | 8 +- .../sys/_pthread/_pthread_t.h | 8 +- .../sys/_pthread/_pthread_types.h | 8 +- .../include/x86_64-macos-gnu/sys/_select.h | 5 - .../x86_64-macos-gnu/sys/_symbol_aliasing.h | 36 -- .../x86_64-macos-gnu/sys/_types/_fd_def.h | 9 +- .../x86_64-macos-gnu/sys/_types/_int8_t.h | 2 +- .../x86_64-macos-gnu/sys/_types/_ucontext.h | 1 - lib/libc/include/x86_64-macos-gnu/sys/acl.h | 1 - lib/libc/include/x86_64-macos-gnu/sys/attr.h | 9 +- lib/libc/include/x86_64-macos-gnu/sys/cdefs.h | 43 +-- lib/libc/include/x86_64-macos-gnu/sys/event.h | 2 +- lib/libc/include/x86_64-macos-gnu/sys/fcntl.h | 120 +++--- .../include/x86_64-macos-gnu/sys/ioccom.h | 2 +- lib/libc/include/x86_64-macos-gnu/sys/kauth.h | 3 - lib/libc/include/x86_64-macos-gnu/sys/mman.h | 21 +- lib/libc/include/x86_64-macos-gnu/sys/mount.h | 13 +- lib/libc/include/x86_64-macos-gnu/sys/param.h | 26 +- lib/libc/include/x86_64-macos-gnu/sys/proc.h | 1 - .../include/x86_64-macos-gnu/sys/resource.h | 58 +-- lib/libc/include/x86_64-macos-gnu/sys/shm.h | 4 - .../include/x86_64-macos-gnu/sys/socket.h | 21 +- lib/libc/include/x86_64-macos-gnu/sys/spawn.h | 4 +- lib/libc/include/x86_64-macos-gnu/sys/stat.h | 4 +- .../include/x86_64-macos-gnu/sys/sysctl.h | 18 +- .../include/x86_64-macos-gnu/sys/syslimits.h | 10 +- lib/libc/include/x86_64-macos-gnu/sys/uio.h | 15 +- lib/libc/include/x86_64-macos-gnu/sys/un.h | 1 - .../x86_64-macos-gnu/xlocale/_inttypes.h | 1 - .../include/x86_64-macos-gnu/xlocale/_wchar.h | 2 - .../x86_64-macos-gnu/xpc/availability.h | 4 - lib/libc/include/x86_64-macos-gnu/xpc/base.h | 2 - .../include/x86_64-macos-gnu/xpc/connection.h | 9 +- lib/libc/include/x86_64-macos-gnu/xpc/xpc.h | 46 +-- 136 files changed, 1166 insertions(+), 2925 deletions(-) delete mode 100644 lib/libc/include/x86_64-macos-gnu/AvailabilityVersions.h delete mode 100644 lib/libc/include/x86_64-macos-gnu/libDER/DERItem.h delete mode 100644 lib/libc/include/x86_64-macos-gnu/libDER/libDER_config.h create mode 100644 lib/libc/include/x86_64-macos-gnu/mach/mach_time.h delete mode 100644 lib/libc/include/x86_64-macos-gnu/os/clock.h delete mode 100644 lib/libc/include/x86_64-macos-gnu/os/workgroup.h delete mode 100644 lib/libc/include/x86_64-macos-gnu/os/workgroup_base.h delete mode 100644 lib/libc/include/x86_64-macos-gnu/os/workgroup_interval.h delete mode 100644 lib/libc/include/x86_64-macos-gnu/os/workgroup_object.h delete mode 100644 lib/libc/include/x86_64-macos-gnu/os/workgroup_parallel.h create mode 100644 lib/libc/include/x86_64-macos-gnu/pthread_impl.h diff --git a/lib/libc/include/x86_64-macos-gnu/Availability.h b/lib/libc/include/x86_64-macos-gnu/Availability.h index d57c1ce942..c81a1940fa 100644 --- a/lib/libc/include/x86_64-macos-gnu/Availability.h +++ b/lib/libc/include/x86_64-macos-gnu/Availability.h @@ -132,7 +132,130 @@ #define __API_TO_BE_DEPRECATED 100000 #endif -#include +#ifndef __MAC_10_0 +#define __MAC_10_0 1000 +#define __MAC_10_1 1010 +#define __MAC_10_2 1020 +#define __MAC_10_3 1030 +#define __MAC_10_4 1040 +#define __MAC_10_5 1050 +#define __MAC_10_6 1060 +#define __MAC_10_7 1070 +#define __MAC_10_8 1080 +#define __MAC_10_9 1090 +#define __MAC_10_10 101000 +#define __MAC_10_10_2 101002 +#define __MAC_10_10_3 101003 +#define __MAC_10_11 101100 +#define __MAC_10_11_2 101102 +#define __MAC_10_11_3 101103 +#define __MAC_10_11_4 101104 +#define __MAC_10_12 101200 +#define __MAC_10_12_1 101201 +#define __MAC_10_12_2 101202 +#define __MAC_10_12_4 101204 +#define __MAC_10_13 101300 +#define __MAC_10_13_1 101301 +#define __MAC_10_13_2 101302 +#define __MAC_10_13_4 101304 +#define __MAC_10_14 101400 +#define __MAC_10_14_1 101401 +#define __MAC_10_14_4 101404 +#define __MAC_10_15 101500 +#define __MAC_10_15_1 101501 +#define __MAC_10_15_4 101504 +/* __MAC_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */ + +#define __IPHONE_2_0 20000 +#define __IPHONE_2_1 20100 +#define __IPHONE_2_2 20200 +#define __IPHONE_3_0 30000 +#define __IPHONE_3_1 30100 +#define __IPHONE_3_2 30200 +#define __IPHONE_4_0 40000 +#define __IPHONE_4_1 40100 +#define __IPHONE_4_2 40200 +#define __IPHONE_4_3 40300 +#define __IPHONE_5_0 50000 +#define __IPHONE_5_1 50100 +#define __IPHONE_6_0 60000 +#define __IPHONE_6_1 60100 +#define __IPHONE_7_0 70000 +#define __IPHONE_7_1 70100 +#define __IPHONE_8_0 80000 +#define __IPHONE_8_1 80100 +#define __IPHONE_8_2 80200 +#define __IPHONE_8_3 80300 +#define __IPHONE_8_4 80400 +#define __IPHONE_9_0 90000 +#define __IPHONE_9_1 90100 +#define __IPHONE_9_2 90200 +#define __IPHONE_9_3 90300 +#define __IPHONE_10_0 100000 +#define __IPHONE_10_1 100100 +#define __IPHONE_10_2 100200 +#define __IPHONE_10_3 100300 +#define __IPHONE_11_0 110000 +#define __IPHONE_11_1 110100 +#define __IPHONE_11_2 110200 +#define __IPHONE_11_3 110300 +#define __IPHONE_11_4 110400 +#define __IPHONE_12_0 120000 +#define __IPHONE_12_1 120100 +#define __IPHONE_12_2 120200 +#define __IPHONE_12_3 120300 +#define __IPHONE_13_0 130000 +#define __IPHONE_13_1 130100 +#define __IPHONE_13_2 130200 +#define __IPHONE_13_3 130300 +#define __IPHONE_13_4 130400 +#define __IPHONE_13_5 130500 +#define __IPHONE_13_6 130600 +/* __IPHONE_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */ + +#define __TVOS_9_0 90000 +#define __TVOS_9_1 90100 +#define __TVOS_9_2 90200 +#define __TVOS_10_0 100000 +#define __TVOS_10_0_1 100001 +#define __TVOS_10_1 100100 +#define __TVOS_10_2 100200 +#define __TVOS_11_0 110000 +#define __TVOS_11_1 110100 +#define __TVOS_11_2 110200 +#define __TVOS_11_3 110300 +#define __TVOS_11_4 110400 +#define __TVOS_12_0 120000 +#define __TVOS_12_1 120100 +#define __TVOS_12_2 120200 +#define __TVOS_12_3 120300 +#define __TVOS_13_0 130000 +#define __TVOS_13_2 130200 +#define __TVOS_13_3 130300 +#define __TVOS_13_4 130400 + +#define __WATCHOS_1_0 10000 +#define __WATCHOS_2_0 20000 +#define __WATCHOS_2_1 20100 +#define __WATCHOS_2_2 20200 +#define __WATCHOS_3_0 30000 +#define __WATCHOS_3_1 30100 +#define __WATCHOS_3_1_1 30101 +#define __WATCHOS_3_2 30200 +#define __WATCHOS_4_0 40000 +#define __WATCHOS_4_1 40100 +#define __WATCHOS_4_2 40200 +#define __WATCHOS_4_3 40300 +#define __WATCHOS_5_0 50000 +#define __WATCHOS_5_1 50100 +#define __WATCHOS_5_2 50200 +#define __WATCHOS_6_0 60000 +#define __WATCHOS_6_1 60100 +#define __WATCHOS_6_2 60200 + +#define __DRIVERKIT_19_0 190000 +#endif /* __MAC_10_0 */ + #include #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED diff --git a/lib/libc/include/x86_64-macos-gnu/AvailabilityInternal.h b/lib/libc/include/x86_64-macos-gnu/AvailabilityInternal.h index 7356564c61..92bbd4b36f 100644 --- a/lib/libc/include/x86_64-macos-gnu/AvailabilityInternal.h +++ b/lib/libc/include/x86_64-macos-gnu/AvailabilityInternal.h @@ -45,9 +45,6 @@ #ifdef __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ /* compiler sets __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ when -miphoneos-version-min is used */ #define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ - /* set to 1 when RC_FALLBACK_PLATFORM=iphoneos */ - #elif 0 - #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_14_0 #endif #endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */ @@ -55,7 +52,7 @@ #ifdef __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ /* compiler sets __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ when -mtvos-version-min is used */ #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ - #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_14_2 + #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_13_0 /* for compatibility with existing code. New code should use platform specific checks */ #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000 #endif @@ -65,7 +62,7 @@ #ifdef __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ /* compiler sets __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ when -mwatchos-version-min is used */ #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ - #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_7_1 + #define __WATCH_OS_VERSION_MAX_ALLOWED 60000 /* for compatibility with existing code. New code should use platform specific checks */ #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000 #endif @@ -75,7 +72,7 @@ #ifdef __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ #define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ - #define __BRIDGE_OS_VERSION_MAX_ALLOWED 50000 + #define __BRIDGE_OS_VERSION_MAX_ALLOWED 20000 /* for compatibility with existing code. New code should use platform specific checks */ #define __IPHONE_OS_VERSION_MIN_REQUIRED 110000 #endif @@ -90,14 +87,14 @@ #ifdef __MAC_OS_X_VERSION_MIN_REQUIRED /* make sure a default max version is set */ #ifndef __MAC_OS_X_VERSION_MAX_ALLOWED - #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_11_0 + #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_10_15 #endif #endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */ #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED /* make sure a default max version is set */ #ifndef __IPHONE_OS_VERSION_MAX_ALLOWED - #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_14_2 + #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_13_0 #endif /* make sure a valid min is set */ #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0 @@ -2890,7 +2887,7 @@ #if __has_builtin(__is_target_environment) #if __has_builtin(__is_target_variant_os) #if __has_builtin(__is_target_variant_environment) - #if ((__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi)) + #if (__is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi)) #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION __attribute__((availability(ios,introduced=4.0))) #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION __attribute__((availability(ios,unavailable))) #define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION_MSG(_msg) __attribute__((availability(ios,unavailable))) diff --git a/lib/libc/include/x86_64-macos-gnu/AvailabilityMacros.h b/lib/libc/include/x86_64-macos-gnu/AvailabilityMacros.h index 4fa40fcb36..639955f2f1 100644 --- a/lib/libc/include/x86_64-macos-gnu/AvailabilityMacros.h +++ b/lib/libc/include/x86_64-macos-gnu/AvailabilityMacros.h @@ -117,9 +117,9 @@ #define MAC_OS_X_VERSION_10_14_1 101401 #define MAC_OS_X_VERSION_10_14_4 101404 #define MAC_OS_X_VERSION_10_15 101500 -#define MAC_OS_VERSION_11_0 110000 +#define MAC_OS_X_VERSION_10_15_1 101501 -/* +/* * If min OS not specified, assume 10.4 for intel * Note: compiler driver may set _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ based on MACOSX_DEPLOYMENT_TARGET environment variable */ @@ -144,10 +144,10 @@ * if max OS not specified, assume larger of (10.15, min) */ #ifndef MAC_OS_X_VERSION_MAX_ALLOWED - #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_VERSION_11_0 + #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_15 #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED #else - #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_VERSION_11_0 + #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_15 #endif #endif diff --git a/lib/libc/include/x86_64-macos-gnu/AvailabilityVersions.h b/lib/libc/include/x86_64-macos-gnu/AvailabilityVersions.h deleted file mode 100644 index 5b2c2cce30..0000000000 --- a/lib/libc/include/x86_64-macos-gnu/AvailabilityVersions.h +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2019 by Apple Inc.. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ - -#ifndef __AVAILABILITY_VERSIONS__ -#define __AVAILABILITY_VERSIONS__ - -#define __MAC_10_0 1000 -#define __MAC_10_1 1010 -#define __MAC_10_2 1020 -#define __MAC_10_3 1030 -#define __MAC_10_4 1040 -#define __MAC_10_5 1050 -#define __MAC_10_6 1060 -#define __MAC_10_7 1070 -#define __MAC_10_8 1080 -#define __MAC_10_9 1090 -#define __MAC_10_10 101000 -#define __MAC_10_10_2 101002 -#define __MAC_10_10_3 101003 -#define __MAC_10_11 101100 -#define __MAC_10_11_2 101102 -#define __MAC_10_11_3 101103 -#define __MAC_10_11_4 101104 -#define __MAC_10_12 101200 -#define __MAC_10_12_1 101201 -#define __MAC_10_12_2 101202 -#define __MAC_10_12_4 101204 -#define __MAC_10_13 101300 -#define __MAC_10_13_1 101301 -#define __MAC_10_13_2 101302 -#define __MAC_10_13_4 101304 -#define __MAC_10_14 101400 -#define __MAC_10_14_1 101401 -#define __MAC_10_14_4 101404 -#define __MAC_10_14_6 101406 -#define __MAC_10_15 101500 -#define __MAC_10_15_1 101501 -#define __MAC_10_15_4 101504 -#define __MAC_10_16 101600 -#define __MAC_11_0 110000 -/* __MAC_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ - -#define __IPHONE_2_0 20000 -#define __IPHONE_2_1 20100 -#define __IPHONE_2_2 20200 -#define __IPHONE_3_0 30000 -#define __IPHONE_3_1 30100 -#define __IPHONE_3_2 30200 -#define __IPHONE_4_0 40000 -#define __IPHONE_4_1 40100 -#define __IPHONE_4_2 40200 -#define __IPHONE_4_3 40300 -#define __IPHONE_5_0 50000 -#define __IPHONE_5_1 50100 -#define __IPHONE_6_0 60000 -#define __IPHONE_6_1 60100 -#define __IPHONE_7_0 70000 -#define __IPHONE_7_1 70100 -#define __IPHONE_8_0 80000 -#define __IPHONE_8_1 80100 -#define __IPHONE_8_2 80200 -#define __IPHONE_8_3 80300 -#define __IPHONE_8_4 80400 -#define __IPHONE_9_0 90000 -#define __IPHONE_9_1 90100 -#define __IPHONE_9_2 90200 -#define __IPHONE_9_3 90300 -#define __IPHONE_10_0 100000 -#define __IPHONE_10_1 100100 -#define __IPHONE_10_2 100200 -#define __IPHONE_10_3 100300 -#define __IPHONE_11_0 110000 -#define __IPHONE_11_1 110100 -#define __IPHONE_11_2 110200 -#define __IPHONE_11_3 110300 -#define __IPHONE_11_4 110400 -#define __IPHONE_12_0 120000 -#define __IPHONE_12_1 120100 -#define __IPHONE_12_2 120200 -#define __IPHONE_12_3 120300 -#define __IPHONE_12_4 120400 -#define __IPHONE_13_0 130000 -#define __IPHONE_13_1 130100 -#define __IPHONE_13_2 130200 -#define __IPHONE_13_3 130300 -#define __IPHONE_13_4 130400 -#define __IPHONE_13_5 130500 -#define __IPHONE_13_6 130600 -#define __IPHONE_13_7 130700 -#define __IPHONE_14_0 140000 -#define __IPHONE_14_1 140100 -#define __IPHONE_14_2 140200 -/* __IPHONE_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ - -#define __TVOS_9_0 90000 -#define __TVOS_9_1 90100 -#define __TVOS_9_2 90200 -#define __TVOS_10_0 100000 -#define __TVOS_10_0_1 100001 -#define __TVOS_10_1 100100 -#define __TVOS_10_2 100200 -#define __TVOS_11_0 110000 -#define __TVOS_11_1 110100 -#define __TVOS_11_2 110200 -#define __TVOS_11_3 110300 -#define __TVOS_11_4 110400 -#define __TVOS_12_0 120000 -#define __TVOS_12_1 120100 -#define __TVOS_12_2 120200 -#define __TVOS_12_3 120300 -#define __TVOS_12_4 120400 -#define __TVOS_13_0 130000 -#define __TVOS_13_2 130200 -#define __TVOS_13_3 130300 -#define __TVOS_13_4 130400 -#define __TVOS_14_0 140000 -#define __TVOS_14_1 140100 -#define __TVOS_14_2 140200 - -#define __WATCHOS_1_0 10000 -#define __WATCHOS_2_0 20000 -#define __WATCHOS_2_1 20100 -#define __WATCHOS_2_2 20200 -#define __WATCHOS_3_0 30000 -#define __WATCHOS_3_1 30100 -#define __WATCHOS_3_1_1 30101 -#define __WATCHOS_3_2 30200 -#define __WATCHOS_4_0 40000 -#define __WATCHOS_4_1 40100 -#define __WATCHOS_4_2 40200 -#define __WATCHOS_4_3 40300 -#define __WATCHOS_5_0 50000 -#define __WATCHOS_5_1 50100 -#define __WATCHOS_5_2 50200 -#define __WATCHOS_5_3 50300 -#define __WATCHOS_6_0 60000 -#define __WATCHOS_6_1 60100 -#define __WATCHOS_6_2 60200 -#define __WATCHOS_7_0 70000 -#define __WATCHOS_7_1 70100 - -/* - * Set up standard Mac OS X versions - */ - -#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) - -#define MAC_OS_X_VERSION_10_0 1000 -#define MAC_OS_X_VERSION_10_1 1010 -#define MAC_OS_X_VERSION_10_2 1020 -#define MAC_OS_X_VERSION_10_3 1030 -#define MAC_OS_X_VERSION_10_4 1040 -#define MAC_OS_X_VERSION_10_5 1050 -#define MAC_OS_X_VERSION_10_6 1060 -#define MAC_OS_X_VERSION_10_7 1070 -#define MAC_OS_X_VERSION_10_8 1080 -#define MAC_OS_X_VERSION_10_9 1090 -#define MAC_OS_X_VERSION_10_10 101000 -#define MAC_OS_X_VERSION_10_10_2 101002 -#define MAC_OS_X_VERSION_10_10_3 101003 -#define MAC_OS_X_VERSION_10_11 101100 -#define MAC_OS_X_VERSION_10_11_2 101102 -#define MAC_OS_X_VERSION_10_11_3 101103 -#define MAC_OS_X_VERSION_10_11_4 101104 -#define MAC_OS_X_VERSION_10_12 101200 -#define MAC_OS_X_VERSION_10_12_1 101201 -#define MAC_OS_X_VERSION_10_12_2 101202 -#define MAC_OS_X_VERSION_10_12_4 101204 -#define MAC_OS_X_VERSION_10_13 101300 -#define MAC_OS_X_VERSION_10_13_1 101301 -#define MAC_OS_X_VERSION_10_13_2 101302 -#define MAC_OS_X_VERSION_10_13_4 101304 -#define MAC_OS_X_VERSION_10_14 101400 -#define MAC_OS_X_VERSION_10_14_1 101401 -#define MAC_OS_X_VERSION_10_14_4 101404 -#define MAC_OS_X_VERSION_10_14_6 101406 -#define MAC_OS_X_VERSION_10_15 101500 -#define MAC_OS_X_VERSION_10_15_1 101501 -#define MAC_OS_X_VERSION_10_16 101600 -#define MAC_OS_VERSION_11_0 110000 - -#endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */ - -#define __DRIVERKIT_19_0 190000 -#define __DRIVERKIT_20_0 200000 - -#endif /* __AVAILABILITY_VERSIONS__ */ - diff --git a/lib/libc/include/x86_64-macos-gnu/TargetConditionals.h b/lib/libc/include/x86_64-macos-gnu/TargetConditionals.h index 11880f6fe2..ca021fd11b 100644 --- a/lib/libc/include/x86_64-macos-gnu/TargetConditionals.h +++ b/lib/libc/include/x86_64-macos-gnu/TargetConditionals.h @@ -35,72 +35,71 @@ #ifndef __TARGETCONDITIONALS__ #define __TARGETCONDITIONALS__ -/* - * - * TARGET_CPU_* - * These conditionals specify which microprocessor instruction set is being - * generated. At most one of these is true, the rest are false. - * - * TARGET_CPU_PPC - Compiler is generating PowerPC instructions for 32-bit mode - * TARGET_CPU_PPC64 - Compiler is generating PowerPC instructions for 64-bit mode - * TARGET_CPU_68K - Compiler is generating 680x0 instructions - * TARGET_CPU_X86 - Compiler is generating x86 instructions for 32-bit mode - * TARGET_CPU_X86_64 - Compiler is generating x86 instructions for 64-bit mode - * TARGET_CPU_ARM - Compiler is generating ARM instructions for 32-bit mode - * TARGET_CPU_ARM64 - Compiler is generating ARM instructions for 64-bit mode - * TARGET_CPU_MIPS - Compiler is generating MIPS instructions - * TARGET_CPU_SPARC - Compiler is generating Sparc instructions - * TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions - * - * - * TARGET_OS_* - * These conditionals specify in which Operating System the generated code will - * run. Indention is used to show which conditionals are evolutionary subclasses. - * - * The MAC/WIN32/UNIX conditionals are mutually exclusive. - * The IOS/TV/WATCH conditionals are mutually exclusive. - * - * - * TARGET_OS_WIN32 - Generated code will run under 32-bit Windows - * TARGET_OS_UNIX - Generated code will run under some Unix (not OSX) - * TARGET_OS_MAC - Generated code will run under Mac OS X variant - * TARGET_OS_OSX - Generated code will run under OS X devices - * TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator - * TARGET_OS_IOS - Generated code will run under iOS - * TARGET_OS_TV - Generated code will run under Apple TV OS - * TARGET_OS_WATCH - Generated code will run under Apple Watch OS - * TARGET_OS_BRIDGE - Generated code will run under Bridge devices - * TARGET_OS_MACCATALYST - Generated code will run under macOS - * TARGET_OS_SIMULATOR - Generated code will run under a simulator - * - * TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead - * TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR - * TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH - * - * +---------------------------------------------------------------------+ - * | TARGET_OS_MAC | - * | +---+ +-----------------------------------------------+ +---------+ | - * | | | | TARGET_OS_IPHONE | | | | - * | | | | +---------------+ +----+ +-------+ +--------+ | | | | - * | | | | | IOS | | | | | | | | | | | - * | |OSX| | |+-------------+| | TV | | WATCH | | BRIDGE | | |DRIVERKIT| | - * | | | | || MACCATALYST || | | | | | | | | | | - * | | | | |+-------------+| | | | | | | | | | | - * | | | | +---------------+ +----+ +-------+ +--------+ | | | | - * | +---+ +-----------------------------------------------+ +---------+ | - * +---------------------------------------------------------------------+ - * - * TARGET_RT_* - * These conditionals specify in which runtime the generated code will - * run. This is needed when the OS and CPU support more than one runtime - * (e.g. Mac OS X supports CFM and mach-o). - * - * TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers - * TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers - * TARGET_RT_64_BIT - Generated code uses 64-bit pointers - * TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used - * TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used - */ +/**************************************************************************************************** + + TARGET_CPU_* + These conditionals specify which microprocessor instruction set is being + generated. At most one of these is true, the rest are false. + + TARGET_CPU_PPC - Compiler is generating PowerPC instructions for 32-bit mode + TARGET_CPU_PPC64 - Compiler is generating PowerPC instructions for 64-bit mode + TARGET_CPU_68K - Compiler is generating 680x0 instructions + TARGET_CPU_X86 - Compiler is generating x86 instructions for 32-bit mode + TARGET_CPU_X86_64 - Compiler is generating x86 instructions for 64-bit mode + TARGET_CPU_ARM - Compiler is generating ARM instructions for 32-bit mode + TARGET_CPU_ARM64 - Compiler is generating ARM instructions for 64-bit mode + TARGET_CPU_MIPS - Compiler is generating MIPS instructions + TARGET_CPU_SPARC - Compiler is generating Sparc instructions + TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions + + + TARGET_OS_* + These conditionals specify in which Operating System the generated code will + run. Indention is used to show which conditionals are evolutionary subclasses. + + The MAC/WIN32/UNIX conditionals are mutually exclusive. + The IOS/TV/WATCH conditionals are mutually exclusive. + + + TARGET_OS_WIN32 - Generated code will run under 32-bit Windows + TARGET_OS_UNIX - Generated code will run under some Unix (not OSX) + TARGET_OS_MAC - Generated code will run under Mac OS X variant + TARGET_OS_OSX - Generated code will run under OS X devices + TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator + TARGET_OS_IOS - Generated code will run under iOS + TARGET_OS_TV - Generated code will run under Apple TV OS + TARGET_OS_WATCH - Generated code will run under Apple Watch OS + TARGET_OS_BRIDGE - Generated code will run under Bridge devices + TARGET_OS_MACCATALYST - Generated code will run under macOS + TARGET_OS_SIMULATOR - Generated code will run under a simulator + + TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead + TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR + TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH + + +----------------------------------------------------------------+ + | TARGET_OS_MAC | + | +---+ +-----------------------------------------------------+ | + | | | | TARGET_OS_IPHONE | | + | |OSX| | +-----+ +----+ +-------+ +--------+ +-------------+ | | + | | | | | IOS | | TV | | WATCH | | BRIDGE | | MACCATALYST | | | + | | | | +-----+ +----+ +-------+ +--------+ +-------------+ | | + | +---+ +-----------------------------------------------------+ | + +----------------------------------------------------------------+ + + TARGET_RT_* + These conditionals specify in which runtime the generated code will + run. This is needed when the OS and CPU support more than one runtime + (e.g. Mac OS X supports CFM and mach-o). + + TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers + TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers + TARGET_RT_64_BIT - Generated code uses 64-bit pointers + TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used + TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used + + +****************************************************************************************************/ /* * TARGET_OS conditionals can be enabled via clang preprocessor extensions: @@ -134,9 +133,7 @@ #if __has_builtin(__is_target_environment) /* “-target=x86_64-apple-ios12-macabi” */ - /* “-target=arm64-apple-ios12-macabi” */ - /* “-target=arm64e-apple-ios12-macabi” */ - #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi) + #if __is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi) #define TARGET_OS_OSX 0 #define TARGET_OS_IPHONE 1 #define TARGET_OS_IOS 1 @@ -176,9 +173,7 @@ #endif /* -target=x86_64-apple-driverkit19.0 */ - /* -target=arm64-apple-driverkit19.0 */ - /* -target=arm64e-apple-driverkit19.0 */ - #if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(driverkit) + #if __is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(driverkit) #define TARGET_OS_OSX 0 #define TARGET_OS_IPHONE 0 #define TARGET_OS_IOS 0 @@ -236,8 +231,7 @@ #define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR /* deprecated */ #define TARGET_OS_NANO TARGET_OS_WATCH /* deprecated */ - - #define TARGET_ABI_USES_IOS_VALUES (!TARGET_CPU_X86_64 || (TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST)) + #define TARGET_ABI_USES_IOS_VALUES (TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST) #if defined(__ppc__) #define TARGET_CPU_PPC 1 #define TARGET_CPU_PPC64 0 diff --git a/lib/libc/include/x86_64-macos-gnu/_ctermid.h b/lib/libc/include/x86_64-macos-gnu/_ctermid.h index 5bbd721a0d..540b117622 100644 --- a/lib/libc/include/x86_64-macos-gnu/_ctermid.h +++ b/lib/libc/include/x86_64-macos-gnu/_ctermid.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002-2006, 2008-2010, 2012, 2020 Apple Inc. All rights reserved. + * Copyright (c) 2000, 2002-2006, 2008-2010, 2012 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -23,13 +23,5 @@ #ifndef _CTERMID_H_ #define _CTERMID_H_ - -#include - -__BEGIN_DECLS - char *ctermid(char *); - -__END_DECLS - #endif diff --git a/lib/libc/include/x86_64-macos-gnu/bsm/audit.h b/lib/libc/include/x86_64-macos-gnu/bsm/audit.h index 2a77601093..2bac16e91a 100644 --- a/lib/libc/include/x86_64-macos-gnu/bsm/audit.h +++ b/lib/libc/include/x86_64-macos-gnu/bsm/audit.h @@ -332,24 +332,13 @@ struct au_evclass_map { }; typedef struct au_evclass_map au_evclass_map_t; - -#if !defined(_KERNEL) && !defined(KERNEL) -#include -#define __AUDIT_API_DEPRECATED __API_DEPRECATED("audit is deprecated", macos(10.4, 11.0)) -#else -#define __AUDIT_API_DEPRECATED -#endif - /* * Audit system calls. */ #if !defined(_KERNEL) && !defined(KERNEL) -int audit(const void *, int) -__AUDIT_API_DEPRECATED; -int auditon(int, void *, int) -__AUDIT_API_DEPRECATED; -int auditctl(const char *) -__AUDIT_API_DEPRECATED; +int audit(const void *, int); +int auditon(int, void *, int); +int auditctl(const char *); int getauid(au_id_t *); int setauid(const au_id_t *); int getaudit_addr(struct auditinfo_addr *, int); @@ -371,10 +360,8 @@ __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_2_0, __IPHONE_6_0); #else -int getaudit(struct auditinfo *) -__AUDIT_API_DEPRECATED; -int setaudit(const struct auditinfo *) -__AUDIT_API_DEPRECATED; +int getaudit(struct auditinfo *); +int setaudit(const struct auditinfo *); #endif /* !__APPLE__ */ #ifdef __APPLE_API_PRIVATE diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/block.h b/lib/libc/include/x86_64-macos-gnu/dispatch/block.h index 6aa3c8f2d1..4d6f5b5489 100644 --- a/lib/libc/include/x86_64-macos-gnu/dispatch/block.h +++ b/lib/libc/include/x86_64-macos-gnu/dispatch/block.h @@ -323,7 +323,7 @@ dispatch_block_perform(dispatch_block_flags_t flags, */ API_AVAILABLE(macos(10.10), ios(8.0)) DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW -intptr_t +long dispatch_block_wait(dispatch_block_t block, dispatch_time_t timeout); /*! @@ -416,7 +416,7 @@ dispatch_block_cancel(dispatch_block_t block); API_AVAILABLE(macos(10.10), ios(8.0)) DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW -intptr_t +long dispatch_block_testcancel(dispatch_block_t block); __END_DECLS diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/dispatch.h b/lib/libc/include/x86_64-macos-gnu/dispatch/dispatch.h index 8a22e488c0..df9beb93d4 100644 --- a/lib/libc/include/x86_64-macos-gnu/dispatch/dispatch.h +++ b/lib/libc/include/x86_64-macos-gnu/dispatch/dispatch.h @@ -37,14 +37,10 @@ #include #include #include -#include #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) #include #endif #include -#if defined(_WIN32) -#include -#endif #if (defined(__linux__) || defined(__FreeBSD__)) && defined(__has_feature) #if __has_feature(modules) @@ -61,7 +57,6 @@ #endif #include -#include #include #include #include diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/group.h b/lib/libc/include/x86_64-macos-gnu/dispatch/group.h index 6b30b26c6e..8d74ada2e4 100644 --- a/lib/libc/include/x86_64-macos-gnu/dispatch/group.h +++ b/lib/libc/include/x86_64-macos-gnu/dispatch/group.h @@ -160,7 +160,7 @@ dispatch_group_async_f(dispatch_group_t group, */ API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW -intptr_t +long dispatch_group_wait(dispatch_group_t group, dispatch_time_t timeout); /*! diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/object.h b/lib/libc/include/x86_64-macos-gnu/dispatch/object.h index 3f95f90025..7d7f0d09bb 100644 --- a/lib/libc/include/x86_64-macos-gnu/dispatch/object.h +++ b/lib/libc/include/x86_64-macos-gnu/dispatch/object.h @@ -456,7 +456,7 @@ dispatch_set_qos_class_floor(dispatch_object_t object, */ DISPATCH_UNAVAILABLE DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW -intptr_t +long dispatch_wait(void *object, dispatch_time_t timeout); #if __has_extension(c_generic_selections) #define dispatch_wait(object, timeout) \ @@ -554,7 +554,7 @@ dispatch_cancel(void *object); DISPATCH_UNAVAILABLE DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW -intptr_t +long dispatch_testcancel(void *object); #if __has_extension(c_generic_selections) #define dispatch_testcancel(object) \ diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/queue.h b/lib/libc/include/x86_64-macos-gnu/dispatch/queue.h index e4251fa74d..4ea1bf2eb0 100644 --- a/lib/libc/include/x86_64-macos-gnu/dispatch/queue.h +++ b/lib/libc/include/x86_64-macos-gnu/dispatch/queue.h @@ -661,7 +661,7 @@ typedef long dispatch_queue_priority_t; API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_EXPORT DISPATCH_CONST DISPATCH_WARN_RESULT DISPATCH_NOTHROW dispatch_queue_global_t -dispatch_get_global_queue(intptr_t identifier, uintptr_t flags); +dispatch_get_global_queue(long identifier, unsigned long flags); /*! * @typedef dispatch_queue_attr_t diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/semaphore.h b/lib/libc/include/x86_64-macos-gnu/dispatch/semaphore.h index a6f9394f95..f5394b45dd 100644 --- a/lib/libc/include/x86_64-macos-gnu/dispatch/semaphore.h +++ b/lib/libc/include/x86_64-macos-gnu/dispatch/semaphore.h @@ -61,7 +61,7 @@ API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT DISPATCH_NOTHROW dispatch_semaphore_t -dispatch_semaphore_create(intptr_t value); +dispatch_semaphore_create(long value); /*! * @function dispatch_semaphore_wait @@ -85,7 +85,7 @@ dispatch_semaphore_create(intptr_t value); */ API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW -intptr_t +long dispatch_semaphore_wait(dispatch_semaphore_t dsema, dispatch_time_t timeout); /*! @@ -107,7 +107,7 @@ dispatch_semaphore_wait(dispatch_semaphore_t dsema, dispatch_time_t timeout); */ API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW -intptr_t +long dispatch_semaphore_signal(dispatch_semaphore_t dsema); __END_DECLS diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/source.h b/lib/libc/include/x86_64-macos-gnu/dispatch/source.h index 5ce8260223..40453fa3eb 100644 --- a/lib/libc/include/x86_64-macos-gnu/dispatch/source.h +++ b/lib/libc/include/x86_64-macos-gnu/dispatch/source.h @@ -389,7 +389,7 @@ DISPATCH_NOTHROW dispatch_source_t dispatch_source_create(dispatch_source_type_t type, uintptr_t handle, - uintptr_t mask, + unsigned long mask, dispatch_queue_t _Nullable queue); /*! @@ -537,7 +537,7 @@ dispatch_source_cancel(dispatch_source_t source); API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW -intptr_t +long dispatch_source_testcancel(dispatch_source_t source); /*! @@ -601,7 +601,7 @@ dispatch_source_get_handle(dispatch_source_t source); API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW -uintptr_t +unsigned long dispatch_source_get_mask(dispatch_source_t source); /*! @@ -640,7 +640,7 @@ dispatch_source_get_mask(dispatch_source_t source); API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW -uintptr_t +unsigned long dispatch_source_get_data(dispatch_source_t source); /*! @@ -662,7 +662,7 @@ dispatch_source_get_data(dispatch_source_t source); API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW void -dispatch_source_merge_data(dispatch_source_t source, uintptr_t value); +dispatch_source_merge_data(dispatch_source_t source, unsigned long value); /*! * @function dispatch_source_set_timer diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/workloop.h b/lib/libc/include/x86_64-macos-gnu/dispatch/workloop.h index 58e494fd1c..d0b17c2357 100644 --- a/lib/libc/include/x86_64-macos-gnu/dispatch/workloop.h +++ b/lib/libc/include/x86_64-macos-gnu/dispatch/workloop.h @@ -129,33 +129,6 @@ void dispatch_workloop_set_autorelease_frequency(dispatch_workloop_t workloop, dispatch_autorelease_frequency_t frequency); -/*! - * @function dispatch_workloop_set_os_workgroup - * - * @abstract - * Associates an os_workgroup_t with the specified dispatch workloop. - * - * The worker thread will be a member of the specified os_workgroup_t while executing - * work items submitted to the workloop. - * - * @param workloop - * The dispatch workloop to modify. - * - * This workloop must be inactive, passing an activated object is undefined - * and will cause the process to be terminated. - * - * @param workgroup - * The workgroup to associate with this workloop. - * - * The workgroup specified is retained and the previously associated workgroup - * (if any) is released. - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW -void -dispatch_workloop_set_os_workgroup(dispatch_workloop_t workloop, - os_workgroup_t workgroup); - __END_DECLS DISPATCH_ASSUME_NONNULL_END diff --git a/lib/libc/include/x86_64-macos-gnu/i386/_param.h b/lib/libc/include/x86_64-macos-gnu/i386/_param.h index 1ab450d5d4..3a0ac8bba7 100644 --- a/lib/libc/include/x86_64-macos-gnu/i386/_param.h +++ b/lib/libc/include/x86_64-macos-gnu/i386/_param.h @@ -37,10 +37,10 @@ * cast to any desired pointer type. */ #define __DARWIN_ALIGNBYTES (sizeof(__darwin_size_t) - 1) -#define __DARWIN_ALIGN(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES) +#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES) #define __DARWIN_ALIGNBYTES32 (sizeof(__uint32_t) - 1) -#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32) +#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32) #endif /* _I386__PARAM_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/libDER/DERItem.h b/lib/libc/include/x86_64-macos-gnu/libDER/DERItem.h deleted file mode 100644 index 99d38e8d65..0000000000 --- a/lib/libc/include/x86_64-macos-gnu/libDER/DERItem.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2020 Apple Inc. All Rights Reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ - -#ifndef _DER_ITEM_H_ -#define _DER_ITEM_H_ - -#if __has_include() - #include -#else - #include -#endif - -__BEGIN_DECLS - -/* - * Primary representation of a block of memory. - */ -typedef struct { - DERByte *data; - DERSize length; -} DERItem; - -__END_DECLS - -#endif /* _DER_ITEM_H_ */ - - diff --git a/lib/libc/include/x86_64-macos-gnu/libDER/libDER_config.h b/lib/libc/include/x86_64-macos-gnu/libDER/libDER_config.h deleted file mode 100644 index 8743f4303d..0000000000 --- a/lib/libc/include/x86_64-macos-gnu/libDER/libDER_config.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2005-2007,2011-2012,2014 Apple Inc. All Rights Reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ - - -/* - * libDER_config.h - platform dependent #defines and typedefs for libDER - * - */ - -#ifndef _LIB_DER_CONFIG_H_ -#define _LIB_DER_CONFIG_H_ - -#include -#include -#include - -#if defined(WIN32) && defined(__cplusplus) - -#if !defined(__BEGIN_DECLS) || !defined(__END_DECLS) -#define __BEGIN_DECLS extern "C" { -#define __END_DECLS } -#endif // __BEGIN_DECLS || __END_DECLS - -#else -#include -#endif // defined(WIN32) && defined(__cplusplus) - -__BEGIN_DECLS - -/* - * Basic data types: unsigned 8-bit integer, unsigned 32-bit integer - */ -typedef uint8_t DERByte; -typedef uint16_t DERShort; -typedef size_t DERSize; - - -/* - * Use these #defines of you have memset, memmove, and memcmp; else - * write your own equivalents. - */ - -#define DERMemset(ptr, c, len) memset(ptr, c, len) -#define DERMemmove(dst, src, len) memmove(dst, src, len) -#define DERMemcmp(b1, b2, len) memcmp(b1, b2, len) - - -/*** - *** Compile time options to trim size of the library. - ***/ - -/* enable general DER encode */ -#define DER_ENCODE_ENABLE 1 - -/* enable general DER decode */ -#define DER_DECODE_ENABLE 1 - -#ifndef DER_MULTIBYTE_TAGS -/* enable multibyte tag support. */ -#define DER_MULTIBYTE_TAGS 1 -#endif - -#ifndef DER_TAG_SIZE -/* Iff DER_MULTIBYTE_TAGS is 1 this is the sizeof(DERTag) in bytes. Note that - tags are still encoded and decoded from a minimally encoded DER - represantation. This value maintains compatibility with libImg4Decode/Encode. */ -#define DER_TAG_SIZE 8 -#endif - - -/* ---------------------- Do not edit below this line ---------------------- */ - -/* - * Logical representation of a tag (the encoded representation is always in - * the minimal number of bytes). The top 3 bits encode class and method - * The remaining bits encode the tag value. To obtain smaller DERItemSpecs - * sizes, choose the smallest type that fits your needs. Most standard ASN.1 - * usage only needs single byte tags, but ocasionally custom applications - * require a larger tag namespace. - */ -#if DER_MULTIBYTE_TAGS - -#if DER_TAG_SIZE == 1 -typedef uint8_t DERTag; -#elif DER_TAG_SIZE == 2 -typedef uint16_t DERTag; -#elif DER_TAG_SIZE == 4 -typedef uint32_t DERTag; -#elif DER_TAG_SIZE == 8 -typedef uint64_t DERTag; -#else -#error DER_TAG_SIZE invalid -#endif - -#else /* DER_MULTIBYTE_TAGS */ -typedef DERByte DERTag; -#endif /* !DER_MULTIBYTE_TAGS */ - -__END_DECLS - -#endif /* _LIB_DER_CONFIG_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicDeprecated.h b/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicDeprecated.h index f838a29587..1b0ef91c12 100644 --- a/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicDeprecated.h +++ b/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicDeprecated.h @@ -35,14 +35,13 @@ * is preferred. */ -#include - #if !(defined(OSATOMIC_USE_INLINED) && OSATOMIC_USE_INLINED) #include #include #include #include +#include #ifndef OSATOMIC_DEPRECATED #define OSATOMIC_DEPRECATED 1 @@ -162,7 +161,7 @@ __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) int32_t OSAtomicAdd32Barrier( int32_t __theAmount, volatile int32_t *__theValue ); -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_1 || TARGET_OS_DRIVERKIT +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_1 /*! @abstract Atomically increments a 32-bit value. @result Returns the new value. @@ -249,7 +248,7 @@ int64_t OSAtomicAdd64Barrier( int64_t __theAmount, volatile OSAtomic_int64_aligned64_t *__theValue ); -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_1 || TARGET_OS_DRIVERKIT +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_1 /*! @abstract Atomically increments a 64-bit value. @result Returns the new value. @@ -362,7 +361,7 @@ int32_t OSAtomicOr32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); This function performs the bitwise OR of the value given by __theMask with the value in the memory location referenced by __theValue, storing the result back to that memory location atomically. - + This function is equivalent to {@link OSAtomicOr32Orig} except that it also introduces a barrier. @result Returns the original value referenced by __theValue. @@ -482,7 +481,7 @@ int32_t OSAtomicXor32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_xor) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2) int32_t OSAtomicXor32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); - + /*! @group Compare and swap * Functions in this group return true if the swap occured. There are several versions, @@ -588,7 +587,7 @@ bool OSAtomicCompareAndSwapIntBarrier( int __oldValue, int __newValue, volatile match, this function stores the value from __newValue into that memory location atomically. - This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures, + This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures, or {@link OSAtomicCompareAndSwap64} on 64-bit architectures. @result Returns TRUE on a match, FALSE otherwise. */ @@ -607,7 +606,7 @@ bool OSAtomicCompareAndSwapLong( long __oldValue, long __newValue, volatile long This function is equivalent to {@link OSAtomicCompareAndSwapLong} except that it also introduces a barrier. - This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures, + This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures, or {@link OSAtomicCompareAndSwap64} on 64-bit architectures. @result Returns TRUE on a match, FALSE otherwise. */ @@ -707,7 +706,7 @@ bool OSAtomicTestAndSetBarrier( uint32_t __n, volatile void *__theAddress ); For example, if __theAddress points to a 64-bit value, to compare the value of the most significant bit, you would specify 56 for __n. - + @result Returns the original value of the bit being tested. */ @@ -720,15 +719,15 @@ bool OSAtomicTestAndClear( uint32_t __n, volatile void *__theAddress ); @discussion This function tests a bit in the value referenced by __theAddress and if it is not cleared, clears it. - + The bit is chosen by the value of __n such that the operation will be performed on bit (0x80 >> (__n & 7)) of byte ((char *)__theAddress + (n >> 3)). - + For example, if __theAddress points to a 64-bit value, to compare the value of the most significant bit, you would specify 56 for __n. - + This function is equivalent to {@link OSAtomicTestAndSet} except that it also introduces a barrier. @result @@ -737,7 +736,7 @@ bool OSAtomicTestAndClear( uint32_t __n, volatile void *__theAddress ); OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_and) __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) bool OSAtomicTestAndClearBarrier( uint32_t __n, volatile void *__theAddress ); - + /*! @group Memory barriers */ @@ -1175,92 +1174,4 @@ __END_DECLS #endif // defined(OSATOMIC_USE_INLINED) && OSATOMIC_USE_INLINED -#if TARGET_OS_OSX || TARGET_OS_DRIVERKIT - -__BEGIN_DECLS - -/*! @group Lockless atomic fifo enqueue and dequeue - * These routines manipulate singly-linked FIFO lists. - * - * This API is deprecated and no longer recommended - */ - -/*! @abstract The data structure for a fifo queue head. - @discussion - You should always initialize a fifo queue head structure with the - initialization vector {@link OS_ATOMIC_FIFO_QUEUE_INIT} before use. - */ -#if defined(__LP64__) - -typedef volatile struct { - void *opaque1; - void *opaque2; - int opaque3; -} __attribute__ ((aligned (16))) OSFifoQueueHead; - -#else - -typedef volatile struct { - void *opaque1; - void *opaque2; - int opaque3; -} OSFifoQueueHead; - -#endif -/*! @abstract The initialization vector for a fifo queue head. */ -#define OS_ATOMIC_FIFO_QUEUE_INIT { NULL, NULL, 0 } - -/*! @abstract Enqueue an element onto a list. - @discussion - Memory barriers are incorporated as needed to permit thread-safe access - to the queue element. - @param __list - The list on which you want to enqueue the element. - @param __new - The element to add. - @param __offset - The "offset" parameter is the offset (in bytes) of the link field - from the beginning of the data structure being queued (__new). - The link field should be a pointer type. - The __offset value needs to be same for all enqueuing and - dequeuing operations on the same list, even if different structure types - are enqueued on that list. The use of offsetset(), defined in - stddef.h is the common way to specify the __offset - value. - - @note - This API is deprecated and no longer recommended - */ -__API_DEPRECATED("No longer supported", macos(10.7, 11.0)) -void OSAtomicFifoEnqueue( OSFifoQueueHead *__list, void *__new, size_t __offset); - -/*! @abstract Dequeue an element from a list. - @discussion - Memory barriers are incorporated as needed to permit thread-safe access - to the queue element. - @param __list - The list from which you want to dequeue an element. - @param __offset - The "offset" parameter is the offset (in bytes) of the link field - from the beginning of the data structure being dequeued (__new). - The link field should be a pointer type. - The __offset value needs to be same for all enqueuing and - dequeuing operations on the same list, even if different structure types - are enqueued on that list. The use of offsetset(), defined in - stddef.h is the common way to specify the __offset - value. - @result - Returns the oldest enqueued element, or NULL if the - list is empty. - - @note - This API is deprecated and no longer recommended - */ -__API_DEPRECATED("No longer supported", macos(10.7, 11.0)) -void* OSAtomicFifoDequeue( OSFifoQueueHead *__list, size_t __offset); - -__END_DECLS - -#endif /* TARGET_OS_OSX || TARGET_OS_DRIVERKIT */ - #endif /* _OSATOMIC_DEPRECATED_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicQueue.h b/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicQueue.h index 0ca841ceb3..103f1e86ba 100644 --- a/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicQueue.h +++ b/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicQueue.h @@ -28,7 +28,6 @@ #include #include #include -#include "OSAtomicDeprecated.h" #include @@ -110,6 +109,83 @@ void OSAtomicEnqueue( OSQueueHead *__list, void *__new, size_t __offset); __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_4_0) void* OSAtomicDequeue( OSQueueHead *__list, size_t __offset); +#if defined(__x86_64__) || defined(__i386__) + +/*! @group Lockless atomic fifo enqueue and dequeue + * These routines manipulate singly-linked FIFO lists. + */ + +/*! @abstract The data structure for a fifo queue head. + @discussion + You should always initialize a fifo queue head structure with the + initialization vector {@link OS_ATOMIC_FIFO_QUEUE_INIT} before use. + */ +#if defined(__x86_64__) + +typedef volatile struct { + void *opaque1; + void *opaque2; + int opaque3; +} __attribute__ ((aligned (16))) OSFifoQueueHead; + +#else + +typedef volatile struct { + void *opaque1; + void *opaque2; + int opaque3; +} OSFifoQueueHead; + +#endif + +/*! @abstract The initialization vector for a fifo queue head. */ +#define OS_ATOMIC_FIFO_QUEUE_INIT { NULL, NULL, 0 } + +/*! @abstract Enqueue an element onto a list. + @discussion + Memory barriers are incorporated as needed to permit thread-safe access + to the queue element. + @param __list + The list on which you want to enqueue the element. + @param __new + The element to add. + @param __offset + The "offset" parameter is the offset (in bytes) of the link field + from the beginning of the data structure being queued (__new). + The link field should be a pointer type. + The __offset value needs to be same for all enqueuing and + dequeuing operations on the same list, even if different structure types + are enqueued on that list. The use of offsetset(), defined in + stddef.h is the common way to specify the __offset + value. + */ +__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA) +void OSAtomicFifoEnqueue( OSFifoQueueHead *__list, void *__new, size_t __offset); + +/*! @abstract Dequeue an element from a list. + @discussion + Memory barriers are incorporated as needed to permit thread-safe access + to the queue element. + @param __list + The list from which you want to dequeue an element. + @param __offset + The "offset" parameter is the offset (in bytes) of the link field + from the beginning of the data structure being dequeued (__new). + The link field should be a pointer type. + The __offset value needs to be same for all enqueuing and + dequeuing operations on the same list, even if different structure types + are enqueued on that list. The use of offsetset(), defined in + stddef.h is the common way to specify the __offset + value. + @result + Returns the oldest enqueued element, or NULL if the + list is empty. + */ +__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA) +void* OSAtomicFifoDequeue( OSFifoQueueHead *__list, size_t __offset); + +#endif /* __i386__ || __x86_64__ */ + __END_DECLS #endif /* _OSATOMICQUEUE_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/libkern/OSByteOrder.h b/lib/libc/include/x86_64-macos-gnu/libkern/OSByteOrder.h index 63d67d4496..d9712031e5 100644 --- a/lib/libc/include/x86_64-macos-gnu/libkern/OSByteOrder.h +++ b/lib/libc/include/x86_64-macos-gnu/libkern/OSByteOrder.h @@ -37,22 +37,10 @@ #define OSSwapConstInt32(x) __DARWIN_OSSwapConstInt32(x) #define OSSwapConstInt64(x) __DARWIN_OSSwapConstInt64(x) -#if !defined(__DARWIN_OS_INLINE) -# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -# define __DARWIN_OS_INLINE static inline -# elif defined(__MWERKS__) || defined(__cplusplus) -# define __DARWIN_OS_INLINE static inline -# else -# define __DARWIN_OS_INLINE static __inline__ -# endif -#endif - #if defined(__GNUC__) #if (defined(__i386__) || defined(__x86_64__)) #include -#elif defined (__arm__) || defined(__arm64__) -#include #else #include #endif @@ -73,7 +61,7 @@ enum { OSBigEndian }; -__DARWIN_OS_INLINE +OS_INLINE int32_t OSHostByteOrder(void) { @@ -97,7 +85,7 @@ OSHostByteOrder(void) /* Functions for loading native endian values. */ -__DARWIN_OS_INLINE +OS_INLINE uint16_t _OSReadInt16( const volatile void * base, @@ -107,7 +95,7 @@ _OSReadInt16( return *(volatile uint16_t *)((uintptr_t)base + byteOffset); } -__DARWIN_OS_INLINE +OS_INLINE uint32_t _OSReadInt32( const volatile void * base, @@ -117,7 +105,7 @@ _OSReadInt32( return *(volatile uint32_t *)((uintptr_t)base + byteOffset); } -__DARWIN_OS_INLINE +OS_INLINE uint64_t _OSReadInt64( const volatile void * base, @@ -129,7 +117,7 @@ _OSReadInt64( /* Functions for storing native endian values. */ -__DARWIN_OS_INLINE +OS_INLINE void _OSWriteInt16( volatile void * base, @@ -140,7 +128,7 @@ _OSWriteInt16( *(volatile uint16_t *)((uintptr_t)base + byteOffset) = data; } -__DARWIN_OS_INLINE +OS_INLINE void _OSWriteInt32( volatile void * base, @@ -151,7 +139,7 @@ _OSWriteInt32( *(volatile uint32_t *)((uintptr_t)base + byteOffset) = data; } -__DARWIN_OS_INLINE +OS_INLINE void _OSWriteInt64( volatile void * base, diff --git a/lib/libc/include/x86_64-macos-gnu/libkern/_OSByteOrder.h b/lib/libc/include/x86_64-macos-gnu/libkern/_OSByteOrder.h index db7419df0b..89c2714b3b 100644 --- a/lib/libc/include/x86_64-macos-gnu/libkern/_OSByteOrder.h +++ b/lib/libc/include/x86_64-macos-gnu/libkern/_OSByteOrder.h @@ -41,14 +41,14 @@ /* Macros for swapping constant values in the preprocessing stage. */ #define __DARWIN_OSSwapConstInt16(x) \ - ((__uint16_t)((((__uint16_t)(x) & 0xff00U) >> 8) | \ - (((__uint16_t)(x) & 0x00ffU) << 8))) + ((__uint16_t)((((__uint16_t)(x) & 0xff00) >> 8) | \ + (((__uint16_t)(x) & 0x00ff) << 8))) #define __DARWIN_OSSwapConstInt32(x) \ - ((__uint32_t)((((__uint32_t)(x) & 0xff000000U) >> 24) | \ - (((__uint32_t)(x) & 0x00ff0000U) >> 8) | \ - (((__uint32_t)(x) & 0x0000ff00U) << 8) | \ - (((__uint32_t)(x) & 0x000000ffU) << 24))) + ((__uint32_t)((((__uint32_t)(x) & 0xff000000) >> 24) | \ + (((__uint32_t)(x) & 0x00ff0000) >> 8) | \ + (((__uint32_t)(x) & 0x0000ff00) << 8) | \ + (((__uint32_t)(x) & 0x000000ff) << 24))) #define __DARWIN_OSSwapConstInt64(x) \ ((__uint64_t)((((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) | \ @@ -62,23 +62,10 @@ #if defined(__GNUC__) -#if !defined(__DARWIN_OS_INLINE) -# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -# define __DARWIN_OS_INLINE static inline -# elif defined(__MWERKS__) || defined(__cplusplus) -# define __DARWIN_OS_INLINE static inline -# else -# define __DARWIN_OS_INLINE static __inline__ -# endif -#endif - #if defined(__i386__) || defined(__x86_64__) #include #endif -#if defined (__arm__) || defined(__arm64__) -#include -#endif #define __DARWIN_OSSwapInt16(x) \ @@ -94,6 +81,16 @@ #if defined(__i386__) || defined(__x86_64__) +#if !defined(__DARWIN_OS_INLINE) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define __DARWIN_OS_INLINE static inline +# elif defined(__MWERKS__) || defined(__cplusplus) +# define __DARWIN_OS_INLINE static inline +# else +# define __DARWIN_OS_INLINE static __inline__ +# endif +#endif + __DARWIN_OS_INLINE uint16_t _OSSwapInt16( diff --git a/lib/libc/include/x86_64-macos-gnu/mach-o/dyld.h b/lib/libc/include/x86_64-macos-gnu/mach-o/dyld.h index 7745cc61b0..4e8f31f57a 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach-o/dyld.h +++ b/lib/libc/include/x86_64-macos-gnu/mach-o/dyld.h @@ -112,15 +112,6 @@ extern void _tlv_atexit(void (*termFunc)(void* objAddr), void* objAddr) __O */ extern void _tlv_bootstrap(void) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) DYLD_DRIVERKIT_UNAVAILABLE ; - -/* - * Dylibs that are incorporated into the dyld cache are removed from disk. That means code - * cannot stat() the file to see if it "exists". This function is like a stat() call that checks if a - * path is to a dylib that was removed from disk and is incorporated into the active dyld cache. - */ -extern bool _dyld_shared_cache_contains_path(const char* path) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) DYLD_DRIVERKIT_UNAVAILABLE; - - /* * The following dyld API's are deprecated as of Mac OS X 10.5. They are either * no longer necessary or are superceeded by dlopen and friends in . diff --git a/lib/libc/include/x86_64-macos-gnu/mach-o/loader.h b/lib/libc/include/x86_64-macos-gnu/mach-o/loader.h index e4b1455917..a6bdbcbde3 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach-o/loader.h +++ b/lib/libc/include/x86_64-macos-gnu/mach-o/loader.h @@ -115,14 +115,11 @@ struct mach_header_64 { #define MH_DYLIB 0x6 /* dynamically bound shared library */ #define MH_DYLINKER 0x7 /* dynamic link editor */ #define MH_BUNDLE 0x8 /* dynamically bound bundle file */ -#define MH_DYLIB_STUB 0x9 /* shared library stub for static - linking only, no section contents */ -#define MH_DSYM 0xa /* companion file with only debug - sections */ +#define MH_DYLIB_STUB 0x9 /* shared library stub for static */ + /* linking only, no section contents */ +#define MH_DSYM 0xa /* companion file with only debug */ + /* sections */ #define MH_KEXT_BUNDLE 0xb /* x86_64 kexts */ -#define MH_FILESET 0xc /* a file composed of other Mach-Os to - be run in the same userspace sharing - a single linkedit. */ /* Constants for the flags field of the mach_header */ #define MH_NOUNDEFS 0x1 /* the object file has no undefined @@ -325,7 +322,6 @@ struct load_command { #define LC_BUILD_VERSION 0x32 /* build for platform min OS version */ #define LC_DYLD_EXPORTS_TRIE (0x33 | LC_REQ_DYLD) /* used with linkedit_data_command, payload is trie */ #define LC_DYLD_CHAINED_FIXUPS (0x34 | LC_REQ_DYLD) /* used with linkedit_data_command */ -#define LC_FILESET_ENTRY (0x35 | LC_REQ_DYLD) /* used with fileset_entry_command */ /* * A variable length string in a load command is represented by an lc_str @@ -1269,6 +1265,9 @@ struct build_tool_version { #define PLATFORM_WATCHOS 4 #define PLATFORM_BRIDGEOS 5 #define PLATFORM_MACCATALYST 6 +#if (!defined(PLATFORM_MACCATALYST)) +#define PLATFORM_MACCATALYST 6 +#endif #define PLATFORM_IOSSIMULATOR 7 #define PLATFORM_TVOSSIMULATOR 8 #define PLATFORM_WATCHOSSIMULATOR 9 @@ -1575,27 +1574,4 @@ struct note_command { uint64_t size; /* length of data region */ }; -/* - * LC_FILESET_ENTRY commands describe constituent Mach-O files that are part - * of a fileset. In one implementation, entries are dylibs with individual - * mach headers and repositionable text and data segments. Each entry is - * further described by its own mach header. - */ -struct fileset_entry_command { - uint32_t cmd; /* LC_FILESET_ENTRY */ - uint32_t cmdsize; /* includes entry_id string */ - uint64_t vmaddr; /* memory address of the entry */ - uint64_t fileoff; /* file offset of the entry */ - union lc_str entry_id; /* contained entry id */ - uint32_t reserved; /* reserved */ -}; - -/* - * These deprecated values may still be used within Apple but are mechanically - * removed from public API. The mechanical process may produce unusual results. - */ -#if (!defined(PLATFORM_MACCATALYST)) -#define PLATFORM_MACCATALYST PLATFORM_MACCATALYST -#endif - #endif /* _MACHO_LOADER_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/mach/i386/_structs.h b/lib/libc/include/x86_64-macos-gnu/mach/i386/_structs.h index 2c79050b6d..c9cc8992cf 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/i386/_structs.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/i386/_structs.h @@ -603,48 +603,7 @@ _STRUCT_X86_DEBUG_STATE32 unsigned int __dr6; unsigned int __dr7; }; - -#define _STRUCT_X86_INSTRUCTION_STATE struct __x86_instruction_state -_STRUCT_X86_INSTRUCTION_STATE -{ - int __insn_stream_valid_bytes; - int __insn_offset; - int __out_of_synch; /* - * non-zero when the cacheline that includes the insn_offset - * is replaced in the insn_bytes array due to a mismatch - * detected when comparing it with the same cacheline in memory - */ -#define _X86_INSTRUCTION_STATE_MAX_INSN_BYTES (2448 - 64 - 4) - __uint8_t __insn_bytes[_X86_INSTRUCTION_STATE_MAX_INSN_BYTES]; -#define _X86_INSTRUCTION_STATE_CACHELINE_SIZE 64 - __uint8_t __insn_cacheline[_X86_INSTRUCTION_STATE_CACHELINE_SIZE]; -}; - -#define _STRUCT_LAST_BRANCH_RECORD struct __last_branch_record -_STRUCT_LAST_BRANCH_RECORD -{ - __uint64_t __from_ip; - __uint64_t __to_ip; - __uint32_t __mispredict : 1, - __tsx_abort : 1, - __in_tsx : 1, - __cycle_count: 16, - __reserved : 13; -}; - -#define _STRUCT_LAST_BRANCH_STATE struct __last_branch_state -_STRUCT_LAST_BRANCH_STATE -{ - int __lbr_count; - __uint32_t __lbr_supported_tsx : 1, - __lbr_supported_cycle_count : 1, - __reserved : 30; -#define __LASTBRANCH_MAX 32 - _STRUCT_LAST_BRANCH_RECORD __lbrs[__LASTBRANCH_MAX]; -}; - #else /* !__DARWIN_UNIX03 */ - #define _STRUCT_X86_DEBUG_STATE32 struct x86_debug_state32 _STRUCT_X86_DEBUG_STATE32 { @@ -657,45 +616,6 @@ _STRUCT_X86_DEBUG_STATE32 unsigned int dr6; unsigned int dr7; }; - -#define _STRUCT_X86_INSTRUCTION_STATE struct __x86_instruction_state -_STRUCT_X86_INSTRUCTION_STATE -{ - int insn_stream_valid_bytes; - int insn_offset; - int out_of_synch; /* - * non-zero when the cacheline that includes the insn_offset - * is replaced in the insn_bytes array due to a mismatch - * detected when comparing it with the same cacheline in memory - */ -#define x86_INSTRUCTION_STATE_MAX_INSN_BYTES (2448 - 64 - 4) - __uint8_t insn_bytes[x86_INSTRUCTION_STATE_MAX_INSN_BYTES]; -#define x86_INSTRUCTION_STATE_CACHELINE_SIZE 64 - __uint8_t insn_cacheline[x86_INSTRUCTION_STATE_CACHELINE_SIZE]; -}; - -#define _STRUCT_LAST_BRANCH_RECORD struct __last_branch_record -_STRUCT_LAST_BRANCH_RECORD -{ - __uint64_t from_ip; - __uint64_t to_ip; - __uint32_t mispredict : 1, - tsx_abort : 1, - in_tsx : 1, - cycle_count: 16, - reserved : 13; -}; - -#define _STRUCT_LAST_BRANCH_STATE struct __last_branch_state -_STRUCT_LAST_BRANCH_STATE -{ - int lbr_count; - __uint32_t lbr_supported_tsx : 1, - lbr_supported_cycle_count : 1, - reserved : 30; -#define __LASTBRANCH_MAX 32 - _STRUCT_LAST_BRANCH_RECORD lbrs[__LASTBRANCH_MAX]; -}; #endif /* !__DARWIN_UNIX03 */ #define _STRUCT_X86_PAGEIN_STATE struct __x86_pagein_state diff --git a/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_state.h b/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_state.h index 4cd90fa08f..759489dcf7 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_state.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_state.h @@ -32,7 +32,7 @@ #ifndef _MACH_I386_THREAD_STATE_H_ #define _MACH_I386_THREAD_STATE_H_ -/* Size of maximum exported thread state in 32-bit words */ +/* Size of maximum exported thread state in words */ #define I386_THREAD_STATE_MAX (614) /* Size of biggest state possible */ #if defined (__i386__) || defined(__x86_64__) diff --git a/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_status.h b/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_status.h index ecb4bcae20..105fe352df 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_status.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_status.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2020 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -121,8 +121,6 @@ #define x86_AVX512_STATE (x86_AVX512_STATE32 + 2) #define x86_PAGEIN_STATE 22 #define x86_THREAD_FULL_STATE64 23 -#define x86_INSTRUCTION_STATE 24 -#define x86_LAST_BRANCH_STATE 25 /* * Largest state on this machine: @@ -157,8 +155,6 @@ (x == x86_AVX512_STATE64) || \ (x == x86_AVX512_STATE) || \ (x == x86_PAGEIN_STATE) || \ - (x == x86_INSTRUCTION_STATE) || \ - (x == x86_LAST_BRANCH_STATE) || \ (x == THREAD_STATE_NONE)) struct x86_state_hdr { @@ -263,19 +259,6 @@ typedef _STRUCT_X86_PAGEIN_STATE x86_pagein_state_t; #define X86_PAGEIN_STATE_COUNT x86_PAGEIN_STATE_COUNT -typedef _STRUCT_X86_INSTRUCTION_STATE x86_instruction_state_t; -#define x86_INSTRUCTION_STATE_COUNT \ - ((mach_msg_type_number_t)(sizeof(x86_instruction_state_t) / sizeof(int))) - -#define X86_INSTRUCTION_STATE_COUNT x86_INSTRUCTION_STATE_COUNT - -typedef _STRUCT_LAST_BRANCH_STATE last_branch_state_t; -#define x86_LAST_BRANCH_STATE_COUNT \ - ((mach_msg_type_number_t)(sizeof(last_branch_state_t) / sizeof(int))) - -#define X86_LAST_BRANCH_STATE_COUNT x86_LAST_BRANCH_STATE_COUNT - - /* * Combined thread, float and exception states */ diff --git a/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_param.h b/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_param.h index 7834a85024..fc37cd1d80 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_param.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_param.h @@ -90,34 +90,47 @@ #ifndef _MACH_I386_VM_PARAM_H_ #define _MACH_I386_VM_PARAM_H_ -#if !defined(KERNEL) && !defined(__ASSEMBLER__) - -#include -#endif - #define BYTE_SIZE 8 /* byte size in bits */ #define I386_PGBYTES 4096 /* bytes per 80386 page */ #define I386_PGSHIFT 12 /* bitshift for pages */ - -#if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || (__MAC_OS_X_VERSION_MIN_REQUIRED < 101600) -#define PAGE_SHIFT I386_PGSHIFT #define PAGE_SIZE I386_PGBYTES -#define PAGE_MASK (PAGE_SIZE-1) -#else /* !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || (__MAC_OS_X_VERSION_MIN_REQUIRED < 101600) */ -#define PAGE_SHIFT vm_page_shift -#define PAGE_SIZE vm_page_size -#define PAGE_MASK vm_page_mask -#endif /* !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || (__MAC_OS_X_VERSION_MIN_REQUIRED < 101600) */ +#define PAGE_SHIFT I386_PGSHIFT +#define PAGE_MASK (PAGE_SIZE - 1) -#define PAGE_MAX_SHIFT 14 -#define PAGE_MAX_SIZE (1 << PAGE_MAX_SHIFT) -#define PAGE_MAX_MASK (PAGE_MAX_SIZE-1) +#define PAGE_MAX_SHIFT PAGE_SHIFT +#define PAGE_MAX_SIZE PAGE_SIZE +#define PAGE_MAX_MASK PAGE_MASK + +#define PAGE_MIN_SHIFT PAGE_SHIFT +#define PAGE_MIN_SIZE PAGE_SIZE +#define PAGE_MIN_MASK PAGE_MASK + +#define I386_LPGBYTES 2*1024*1024 /* bytes per large page */ +#define I386_LPGSHIFT 21 /* bitshift for large pages */ +#define I386_LPGMASK (I386_LPGBYTES-1) + +/* + * Convert bytes to pages and convert pages to bytes. + * No rounding is used. + */ + +#define i386_btop(x) ((ppnum_t)((x) >> I386_PGSHIFT)) +#define machine_btop(x) i386_btop(x) +#define i386_ptob(x) (((pmap_paddr_t)(x)) << I386_PGSHIFT) +#define machine_ptob(x) i386_ptob(x) + +/* + * Round off or truncate to the nearest page. These will work + * for either addresses or counts. (i.e. 1 byte rounds to 1 page + * bytes. + */ + +#define i386_round_page(x) ((((pmap_paddr_t)(x)) + I386_PGBYTES - 1) & \ + ~(I386_PGBYTES-1)) +#define i386_trunc_page(x) (((pmap_paddr_t)(x)) & ~(I386_PGBYTES-1)) -#define PAGE_MIN_SHIFT 12 -#define PAGE_MIN_SIZE (1 << PAGE_MIN_SHIFT) -#define PAGE_MIN_MASK (PAGE_MIN_SIZE-1) #define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL) diff --git a/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_types.h b/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_types.h index acf56e0435..f75fd05a91 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_types.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_types.h @@ -70,6 +70,7 @@ #ifndef ASSEMBLER #include +#include #include /* diff --git a/lib/libc/include/x86_64-macos-gnu/mach/kern_return.h b/lib/libc/include/x86_64-macos-gnu/mach/kern_return.h index d321826008..cbc29d9374 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/kern_return.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/kern_return.h @@ -323,10 +323,6 @@ /* The provided buffer is of insufficient size for the requested data. */ -#define KERN_DENIED 53 -/* Denied by security policy - */ - #define KERN_RETURN_MAX 0x100 /* Maximum return value allowable */ diff --git a/lib/libc/include/x86_64-macos-gnu/mach/mach_port.h b/lib/libc/include/x86_64-macos-gnu/mach/mach_port.h index f300e8164b..8f587e3bfa 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/mach_port.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/mach_port.h @@ -226,7 +226,7 @@ extern #endif /* mig_external */ kern_return_t mach_port_get_set_status ( - ipc_space_read_t task, + ipc_space_inspect_t task, mach_port_name_t name, mach_port_name_array_t *members, mach_msg_type_number_t *membersCnt @@ -312,7 +312,7 @@ extern #endif /* mig_external */ kern_return_t mach_port_get_attributes ( - ipc_space_read_t task, + ipc_space_inspect_t task, mach_port_name_t name, mach_port_flavor_t flavor, mach_port_info_t port_info_out, @@ -398,7 +398,7 @@ extern #endif /* mig_external */ kern_return_t mach_port_space_info ( - ipc_space_read_t space, + ipc_space_inspect_t task, ipc_info_space_t *space_info, ipc_info_name_array_t *table_info, mach_msg_type_number_t *table_infoCnt, @@ -428,7 +428,7 @@ extern #endif /* mig_external */ kern_return_t mach_port_kernel_object ( - ipc_space_read_t task, + ipc_space_inspect_t task, mach_port_name_t name, unsigned *object_type, unsigned *object_addr @@ -468,7 +468,7 @@ extern #endif /* mig_external */ kern_return_t mach_port_get_context ( - ipc_space_read_t task, + ipc_space_inspect_t task, mach_port_name_t name, mach_port_context_t *context ); @@ -494,7 +494,7 @@ extern #endif /* mig_external */ kern_return_t mach_port_kobject ( - ipc_space_read_t task, + ipc_space_inspect_t task, mach_port_name_t name, natural_t *object_type, mach_vm_address_t *object_addr @@ -603,7 +603,7 @@ extern #endif /* mig_external */ kern_return_t mach_port_kobject_description ( - ipc_space_read_t task, + ipc_space_inspect_t task, mach_port_name_t name, natural_t *object_type, mach_vm_address_t *object_addr, diff --git a/lib/libc/include/x86_64-macos-gnu/mach/mach_time.h b/lib/libc/include/x86_64-macos-gnu/mach/mach_time.h new file mode 100644 index 0000000000..2853aac32c --- /dev/null +++ b/lib/libc/include/x86_64-macos-gnu/mach/mach_time.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2001-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACH_TIME_H_ +#define _MACH_MACH_TIME_H_ + +#include +#include +#include + +struct mach_timebase_info { + uint32_t numer; + uint32_t denom; +}; + +typedef struct mach_timebase_info *mach_timebase_info_t; +typedef struct mach_timebase_info mach_timebase_info_data_t; + +__BEGIN_DECLS + +kern_return_t mach_timebase_info( + mach_timebase_info_t info); + +kern_return_t mach_wait_until( + uint64_t deadline); + + +uint64_t mach_absolute_time(void); + +__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) +uint64_t mach_approximate_time(void); + +/* + * like mach_absolute_time, but advances during sleep + */ +__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0) +uint64_t mach_continuous_time(void); + +/* + * like mach_approximate_time, but advances during sleep + */ +__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0) +uint64_t mach_continuous_approximate_time(void); + + +__END_DECLS + +#endif /* _MACH_MACH_TIME_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/mach/mach_traps.h b/lib/libc/include/x86_64-macos-gnu/mach/mach_traps.h index 8be7b8968a..e38647c7a6 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/mach_traps.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/mach_traps.h @@ -131,6 +131,12 @@ extern kern_return_t _kernelrpc_mach_port_allocate_trap( mach_port_name_t *name ); + +extern kern_return_t _kernelrpc_mach_port_destroy_trap( + mach_port_name_t target, + mach_port_name_t name + ); + extern kern_return_t _kernelrpc_mach_port_deallocate_trap( mach_port_name_t target, mach_port_name_t name diff --git a/lib/libc/include/x86_64-macos-gnu/mach/mach_types.h b/lib/libc/include/x86_64-macos-gnu/mach/mach_types.h index 103a659070..bd4bc3424c 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/mach_types.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/mach_types.h @@ -117,17 +117,12 @@ */ typedef mach_port_t task_t; typedef mach_port_t task_name_t; -typedef mach_port_t task_policy_set_t; -typedef mach_port_t task_policy_get_t; typedef mach_port_t task_inspect_t; -typedef mach_port_t task_read_t; typedef mach_port_t task_suspension_token_t; typedef mach_port_t thread_t; typedef mach_port_t thread_act_t; typedef mach_port_t thread_inspect_t; -typedef mach_port_t thread_read_t; typedef mach_port_t ipc_space_t; -typedef mach_port_t ipc_space_read_t; typedef mach_port_t ipc_space_inspect_t; typedef mach_port_t coalition_t; typedef mach_port_t host_t; @@ -143,8 +138,6 @@ typedef mach_port_t alarm_t; typedef mach_port_t clock_serv_t; typedef mach_port_t clock_ctrl_t; typedef mach_port_t arcade_register_t; -typedef mach_port_t ipc_eventlink_t; -typedef mach_port_t eventlink_port_pair_t[2]; typedef mach_port_t suid_cred_t; @@ -166,7 +159,6 @@ typedef exception_handler_t *exception_handler_array_t; typedef mach_port_t vm_task_entry_t; typedef mach_port_t io_master_t; typedef mach_port_t UNDServerRef; -typedef mach_port_t mach_eventlink_t; /* * Mig doesn't translate the components of an array. @@ -220,15 +212,12 @@ typedef uint32_t suid_cred_uid_t; #define TASK_NULL ((task_t) 0) #define TASK_NAME_NULL ((task_name_t) 0) -#define TASK_INSPECT_NULL ((task_inspect_t) 0) -#define TASK_READ_NULL ((task_read_t) 0) +#define TASK_INSPECT_NULL ((task_inspect_t) 0) #define THREAD_NULL ((thread_t) 0) #define THREAD_INSPECT_NULL ((thread_inspect_t) 0) -#define THREAD_READ_NULL ((thread_read_t) 0) #define TID_NULL ((uint64_t) 0) #define THR_ACT_NULL ((thread_act_t) 0) #define IPC_SPACE_NULL ((ipc_space_t) 0) -#define IPC_SPACE_READ_NULL ((ipc_space_read_t) 0) #define IPC_SPACE_INSPECT_NULL ((ipc_space_inspect_t) 0) #define COALITION_NULL ((coalition_t) 0) #define HOST_NULL ((host_t) 0) @@ -243,25 +232,7 @@ typedef uint32_t suid_cred_uid_t; #define CLOCK_NULL ((clock_t) 0) #define UND_SERVER_NULL ((UNDServerRef) 0) #define ARCADE_REG_NULL ((arcade_register_t) 0) -#define MACH_EVENTLINK_NULL ((mach_eventlink_t) 0) -#define IPC_EVENTLINK_NULL ((ipc_eventlink_t) 0) -#define SUID_CRED_NULL ((suid_cred_t) 0) - -/* capability strictly _DECREASING_. - * not ordered the other way around because we want TASK_FLAVOR_CONTROL - * to be closest to the itk_lock. see task.h. - */ -typedef unsigned int mach_task_flavor_t; -#define TASK_FLAVOR_CONTROL 0 /* a task_t */ -#define TASK_FLAVOR_READ 1 /* a task_read_t */ -#define TASK_FLAVOR_INSPECT 2 /* a task_inspect_t */ -#define TASK_FLAVOR_NAME 3 /* a task_name_t */ - -/* capability strictly _DECREASING_ */ -typedef unsigned int mach_thread_flavor_t; -#define THREAD_FLAVOR_CONTROL 0 /* a thread_t */ -#define THREAD_FLAVOR_READ 1 /* a thread_read_t */ -#define THREAD_FLAVOR_INSPECT 2 /* a thread_inspect_t */ +#define SUID_CRED_NULL ((suid_cred_t) 0) /* DEPRECATED */ typedef natural_t ledger_item_t; diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine.h b/lib/libc/include/x86_64-macos-gnu/mach/machine.h index 53e12fe99a..a209623264 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/machine.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/machine.h @@ -118,9 +118,6 @@ typedef integer_t cpu_threadtype_t; #define CPU_TYPE_POWERPC ((cpu_type_t) 18) #define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64) /* skip ((cpu_type_t) 19) */ -/* skip ((cpu_type_t) 20 */ -/* skip ((cpu_type_t) 21 */ -/* skip ((cpu_type_t) 22 */ /* * Machine subtypes (these are defined here, instead of in a machine @@ -133,14 +130,7 @@ typedef integer_t cpu_threadtype_t; */ #define CPU_SUBTYPE_MASK 0xff000000 /* mask for feature flags */ #define CPU_SUBTYPE_LIB64 0x80000000 /* 64 bit libraries */ -#define CPU_SUBTYPE_PTRAUTH_ABI 0x80000000 /* pointer authentication with versioned ABI */ -/* - * When selecting a slice, ANY will pick the slice with the best - * grading for the selected cpu_type_t, unlike the "ALL" subtypes, - * which are the slices that can run on any hardware for that cpu type. - */ -#define CPU_SUBTYPE_ANY ((cpu_subtype_t) -1) /* * Object files that are hand-crafted to run on any @@ -375,7 +365,9 @@ typedef integer_t cpu_threadtype_t; #define CPUFAMILY_INTEL_BROADWELL 0x582ed09c #define CPUFAMILY_INTEL_SKYLAKE 0x37fc219f #define CPUFAMILY_INTEL_KABYLAKE 0x0f817246 +#if !defined(RC_HIDE_XNU_ICELAKE) #define CPUFAMILY_INTEL_ICELAKE 0x38435547 +#endif /* not RC_HIDE_XNU_ICELAKE */ #if !defined(RC_HIDE_XNU_COMETLAKE) #define CPUFAMILY_INTEL_COMETLAKE 0x1cf8a03e #endif /* not RC_HIDE_XNU_COMETLAKE */ @@ -394,14 +386,6 @@ typedef integer_t cpu_threadtype_t; #define CPUFAMILY_ARM_MONSOON_MISTRAL 0xe81e7ef6 #define CPUFAMILY_ARM_VORTEX_TEMPEST 0x07d34b9f #define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504d2 -#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3 - -#define CPUSUBFAMILY_UNKNOWN 0 -#define CPUSUBFAMILY_ARM_HP 1 -#define CPUSUBFAMILY_ARM_HG 2 -#define CPUSUBFAMILY_ARM_M 3 -#define CPUSUBFAMILY_ARM_HS 4 -#define CPUSUBFAMILY_ARM_HC_HD 5 /* The following synonyms are deprecated: */ #define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/_structs.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/_structs.h index 858368fc5d..e0bdc10828 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/machine/_structs.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/machine/_structs.h @@ -31,8 +31,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/_structs.h" -#elif defined (__arm__) || defined (__arm64__) -#include "mach/arm/_structs.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/boolean.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/boolean.h index dcc5d133f9..6423078b8b 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/machine/boolean.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/machine/boolean.h @@ -31,8 +31,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/boolean.h" -#elif defined (__arm__) || defined (__arm64__) -#include "mach/arm/boolean.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/exception.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/exception.h index b98d4b0ef7..5a85bd37f3 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/machine/exception.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/machine/exception.h @@ -31,8 +31,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/exception.h" -#elif defined (__arm__) || defined (__arm64__) -#include "mach/arm/exception.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/kern_return.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/kern_return.h index adae6e8bcb..276656cbc5 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/machine/kern_return.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/machine/kern_return.h @@ -31,8 +31,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/kern_return.h" -#elif defined (__arm__) || defined (__arm64__) -#include "mach/arm/kern_return.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/processor_info.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/processor_info.h index 8150d716ac..da865d7fc5 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/machine/processor_info.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/machine/processor_info.h @@ -31,8 +31,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/processor_info.h" -#elif defined (__arm__) || defined (__arm64__) -#include "mach/arm/processor_info.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/rpc.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/rpc.h index 37f9024726..196a1546d6 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/machine/rpc.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/machine/rpc.h @@ -31,8 +31,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/rpc.h" -#elif defined (__arm__) || defined (__arm64__) -#include "mach/arm/rpc.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_state.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_state.h index 06f38104cc..7dbfecefc3 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_state.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_state.h @@ -31,8 +31,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/thread_state.h" -#elif defined (__arm__) || defined (__arm64__) -#include "mach/arm/thread_state.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_status.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_status.h index 3e319e8cef..1c389658b0 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_status.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_status.h @@ -31,8 +31,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/thread_status.h" -#elif defined (__arm__) || defined (__arm64__) -#include "mach/arm/thread_status.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_param.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_param.h index dcc0ec5398..08f4ac5fc9 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_param.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_param.h @@ -31,8 +31,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/vm_param.h" -#elif defined (__arm__) || defined (__arm64__) -#include "mach/arm/vm_param.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_types.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_types.h index 7f1605a277..66cbebfda9 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_types.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_types.h @@ -31,8 +31,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "mach/i386/vm_types.h" -#elif defined (__arm__) || defined (__arm64__) -#include "mach/arm/vm_types.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/mach/message.h b/lib/libc/include/x86_64-macos-gnu/mach/message.h index 7959fc7f26..59e9fa07fb 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/message.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/message.h @@ -228,7 +228,6 @@ typedef unsigned int mach_msg_priority_t; #define MACH_MSG_PRIORITY_UNSPECIFIED (mach_msg_priority_t) 0 - typedef unsigned int mach_msg_type_name_t; #define MACH_MSG_TYPE_MOVE_RECEIVE 16 /* Must hold receive right */ @@ -500,9 +499,6 @@ typedef struct{ mach_port_name_t sender; } msg_labels_t; -typedef int mach_msg_filter_id; -#define MACH_MSG_FILTER_POLICY_ALLOW (mach_msg_filter_id)0 - /* * Trailer type to pass MAC policy label info as a mach message trailer. * @@ -515,7 +511,7 @@ typedef struct{ security_token_t msgh_sender; audit_token_t msgh_audit; mach_port_context_t msgh_context; - mach_msg_filter_id msgh_ad; + int msgh_ad; msg_labels_t msgh_labels; } mach_msg_mac_trailer_t; @@ -803,8 +799,6 @@ typedef kern_return_t mach_msg_return_t; /* compatibility: no longer a returned error */ #define MACH_SEND_NO_GRANT_DEST 0x10000016 /* The destination port doesn't accept ports in body */ -#define MACH_SEND_MSG_FILTERED 0x10000017 -/* Message send was rejected by message filter */ #define MACH_RCV_IN_PROGRESS 0x10004001 /* Thread is waiting for receive. (Internal use only.) */ diff --git a/lib/libc/include/x86_64-macos-gnu/mach/port.h b/lib/libc/include/x86_64-macos-gnu/mach/port.h index 2865602b0c..bd1fc19fd4 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/port.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/port.h @@ -339,9 +339,6 @@ typedef struct mach_port_qos { #define MPO_STRICT 0x20 /* Apply strict guarding for port */ #define MPO_DENAP_RECEIVER 0x40 /* Mark the port as App de-nap receiver */ #define MPO_IMMOVABLE_RECEIVE 0x80 /* Mark the port as immovable; protected by the guard context */ -#define MPO_FILTER_MSG 0x100 /* Allow message filtering */ -#define MPO_TG_BLOCK_TRACKING 0x200 /* Track blocking relationship for thread group during sync IPC */ - /* * Structure to define optional attributes for a newly * constructed port. @@ -349,10 +346,7 @@ typedef struct mach_port_qos { typedef struct mach_port_options { uint32_t flags; /* Flags defining attributes for port */ mach_port_limits_t mpl; /* Message queue limit for port */ - union { - uint64_t reserved[2]; /* Reserved */ - mach_port_name_t work_interval_port; /* Work interval port */ - }; + uint64_t reserved[2]; /* Reserved */ }mach_port_options_t; typedef mach_port_options_t *mach_port_options_ptr_t; @@ -373,7 +367,6 @@ enum mach_port_guard_exception_codes { kGUARD_EXC_INCORRECT_GUARD = 1u << 4, kGUARD_EXC_IMMOVABLE = 1u << 5, kGUARD_EXC_STRICT_REPLY = 1u << 6, - kGUARD_EXC_MSG_FILTERED = 1u << 7, /* start of [optionally] non-fatal guards */ kGUARD_EXC_INVALID_RIGHT = 1u << 8, kGUARD_EXC_INVALID_NAME = 1u << 9, diff --git a/lib/libc/include/x86_64-macos-gnu/mach/processor_set.h b/lib/libc/include/x86_64-macos-gnu/mach/processor_set.h index c840a73fc5..c306155ff2 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/processor_set.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/processor_set.h @@ -49,7 +49,7 @@ typedef function_table_entry *function_table_t; #endif /* AUTOTEST */ #ifndef processor_set_MSG_COUNT -#define processor_set_MSG_COUNT 11 +#define processor_set_MSG_COUNT 10 #endif /* processor_set_MSG_COUNT */ #include @@ -200,20 +200,6 @@ kern_return_t processor_set_info mach_msg_type_number_t *info_outCnt ); -/* Routine processor_set_tasks_with_flavor */ -#ifdef mig_external -mig_external -#else -extern -#endif /* mig_external */ -kern_return_t processor_set_tasks_with_flavor -( - processor_set_t processor_set, - mach_task_flavor_t flavor, - task_array_t *task_list, - mach_msg_type_number_t *task_listCnt -); - __END_DECLS /********************** Caution **************************/ @@ -350,18 +336,6 @@ __END_DECLS #ifdef __MigPackStructs #pragma pack(pop) #endif - -#ifdef __MigPackStructs -#pragma pack(push, 4) -#endif - typedef struct { - mach_msg_header_t Head; - NDR_record_t NDR; - mach_task_flavor_t flavor; - } __Request__processor_set_tasks_with_flavor_t __attribute__((unused)); -#ifdef __MigPackStructs -#pragma pack(pop) -#endif #endif /* !__Request__processor_set_subsystem__defined */ /* union of all requests */ @@ -379,7 +353,6 @@ union __RequestUnion__processor_set_subsystem { __Request__processor_set_policy_control_t Request_processor_set_policy_control; __Request__processor_set_stack_usage_t Request_processor_set_stack_usage; __Request__processor_set_info_t Request_processor_set_info; - __Request__processor_set_tasks_with_flavor_t Request_processor_set_tasks_with_flavor; }; #endif /* !__RequestUnion__processor_set_subsystem__defined */ /* typedefs for all replies */ @@ -526,22 +499,6 @@ union __RequestUnion__processor_set_subsystem { #ifdef __MigPackStructs #pragma pack(pop) #endif - -#ifdef __MigPackStructs -#pragma pack(push, 4) -#endif - typedef struct { - mach_msg_header_t Head; - /* start of the kernel processed data */ - mach_msg_body_t msgh_body; - mach_msg_ool_ports_descriptor_t task_list; - /* end of the kernel processed data */ - NDR_record_t NDR; - mach_msg_type_number_t task_listCnt; - } __Reply__processor_set_tasks_with_flavor_t __attribute__((unused)); -#ifdef __MigPackStructs -#pragma pack(pop) -#endif #endif /* !__Reply__processor_set_subsystem__defined */ /* union of all replies */ @@ -559,7 +516,6 @@ union __ReplyUnion__processor_set_subsystem { __Reply__processor_set_policy_control_t Reply_processor_set_policy_control; __Reply__processor_set_stack_usage_t Reply_processor_set_stack_usage; __Reply__processor_set_info_t Reply_processor_set_info; - __Reply__processor_set_tasks_with_flavor_t Reply_processor_set_tasks_with_flavor; }; #endif /* !__RequestUnion__processor_set_subsystem__defined */ @@ -574,8 +530,7 @@ union __ReplyUnion__processor_set_subsystem { { "processor_set_threads", 4006 },\ { "processor_set_policy_control", 4007 },\ { "processor_set_stack_usage", 4008 },\ - { "processor_set_info", 4009 },\ - { "processor_set_tasks_with_flavor", 4010 } + { "processor_set_info", 4009 } #endif #ifdef __AfterMigUserHeader diff --git a/lib/libc/include/x86_64-macos-gnu/mach/task.h b/lib/libc/include/x86_64-macos-gnu/mach/task.h index 0065500c12..20019654bb 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/task.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/task.h @@ -279,7 +279,7 @@ __WATCHOS_PROHIBITED __TVOS_PROHIBITED kern_return_t task_get_exception_ports ( - task_t task, + task_inspect_t task, exception_mask_t exception_mask, exception_mask_array_t masks, mach_msg_type_number_t *masksCnt, @@ -372,7 +372,7 @@ __WATCHOS_PROHIBITED __TVOS_PROHIBITED kern_return_t task_policy_set ( - task_policy_set_t task, + task_t task, task_policy_flavor_t flavor, task_policy_t policy_info, mach_msg_type_number_t policy_infoCnt @@ -388,7 +388,7 @@ __WATCHOS_PROHIBITED __TVOS_PROHIBITED kern_return_t task_policy_get ( - task_policy_get_t task, + task_t task, task_policy_flavor_t flavor, task_policy_t policy_info, mach_msg_type_number_t *policy_infoCnt, @@ -487,7 +487,7 @@ __WATCHOS_PROHIBITED __TVOS_PROHIBITED kern_return_t task_zone_info ( - task_inspect_t target_task, + task_t target_task, mach_zone_name_array_t *names, mach_msg_type_number_t *namesCnt, task_zone_info_array_t *info, @@ -527,7 +527,7 @@ extern #endif /* mig_external */ kern_return_t task_get_assignment ( - task_inspect_t task, + task_t task, processor_set_name_t *assigned_set ); @@ -559,7 +559,7 @@ __WATCHOS_PROHIBITED __TVOS_PROHIBITED kern_return_t task_get_state ( - task_read_t task, + task_t task, thread_state_flavor_t flavor, thread_state_t old_state, mach_msg_type_number_t *old_stateCnt @@ -631,7 +631,7 @@ extern #endif /* mig_external */ kern_return_t task_purgable_info ( - task_inspect_t task, + task_t task, task_purgable_info_t *stats ); @@ -645,7 +645,7 @@ __WATCHOS_PROHIBITED __TVOS_PROHIBITED kern_return_t task_get_mach_voucher ( - task_read_t task, + task_t task, mach_voucher_selector_t which, ipc_voucher_t *voucher ); @@ -700,7 +700,7 @@ extern kern_return_t task_map_corpse_info ( task_t task, - task_read_t corspe_task, + task_t corspe_task, vm_address_t *kcd_addr_begin, uint32_t *kcd_size ); @@ -739,7 +739,7 @@ extern #endif /* mig_external */ kern_return_t task_get_dyld_image_infos ( - task_read_t task, + task_inspect_t task, dyld_kernel_image_info_array_t *dyld_images, mach_msg_type_number_t *dyld_imagesCnt ); @@ -791,7 +791,7 @@ extern kern_return_t task_map_corpse_info_64 ( task_t task, - task_read_t corspe_task, + task_t corspe_task, mach_vm_address_t *kcd_addr_begin, mach_vm_size_t *kcd_size ); @@ -1022,7 +1022,7 @@ __END_DECLS NDR_record_t NDR; thread_state_flavor_t flavor; mach_msg_type_number_t new_stateCnt; - natural_t new_state[1296]; + natural_t new_state[614]; } __Request__thread_create_running_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) @@ -1331,7 +1331,7 @@ __END_DECLS NDR_record_t NDR; thread_state_flavor_t flavor; mach_msg_type_number_t new_stateCnt; - natural_t new_state[1296]; + natural_t new_state[614]; } __Request__task_set_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) @@ -2111,7 +2111,7 @@ union __RequestUnion__task_subsystem { NDR_record_t NDR; kern_return_t RetCode; mach_msg_type_number_t old_stateCnt; - natural_t old_state[1296]; + natural_t old_state[614]; } __Reply__task_get_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) diff --git a/lib/libc/include/x86_64-macos-gnu/mach/task_info.h b/lib/libc/include/x86_64-macos-gnu/mach/task_info.h index d243343f5f..86cfdb3492 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/task_info.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/task_info.h @@ -112,13 +112,8 @@ typedef struct task_basic_info_32 *task_basic_info_32_t; /* Don't use this, use MACH_TASK_BASIC_INFO instead */ struct task_basic_info_64 { integer_t suspend_count; /* suspend count for task */ -#if defined(__arm__) || defined(__arm64__) mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ mach_vm_size_t resident_size; /* resident memory size (bytes) */ -#else /* defined(__arm__) || defined(__arm64__) */ - mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ - mach_vm_size_t resident_size; /* resident memory size (bytes) */ -#endif /* defined(__arm__) || defined(__arm64__) */ time_value_t user_time; /* total user run time for * terminated threads */ time_value_t system_time; /* total system run time for @@ -128,26 +123,9 @@ struct task_basic_info_64 { typedef struct task_basic_info_64 task_basic_info_64_data_t; typedef struct task_basic_info_64 *task_basic_info_64_t; -#if defined(__arm__) || defined(__arm64__) - #if defined(__arm__) && defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0) -/* - * Note: arm64 can't use the old flavor. If you somehow manage to, - * you can cope with the nonsense data yourself. - */ - #define TASK_BASIC_INFO_64 5 - #define TASK_BASIC_INFO_64_COUNT \ - (sizeof(task_basic_info_64_data_t) / sizeof(natural_t)) - - #else - - #define TASK_BASIC_INFO_64 TASK_BASIC_INFO_64_2 - #define TASK_BASIC_INFO_64_COUNT TASK_BASIC_INFO_64_2_COUNT - #endif -#else /* defined(__arm__) || defined(__arm64__) */ #define TASK_BASIC_INFO_64 5 /* 64-bit capable basic info */ #define TASK_BASIC_INFO_64_COUNT \ (sizeof(task_basic_info_64_data_t) / sizeof(natural_t)) -#endif /* localized structure - cannot be safely passed between tasks of differing sizes */ @@ -271,27 +249,6 @@ typedef struct task_dyld_info *task_dyld_info_t; #define TASK_DYLD_ALL_IMAGE_INFO_32 0 /* format value */ #define TASK_DYLD_ALL_IMAGE_INFO_64 1 /* format value */ -#if defined(__arm__) || defined(__arm64__) - -/* Don't use this, use MACH_TASK_BASIC_INFO instead */ -/* Compatibility for old 32-bit mach_vm_*_t */ -#define TASK_BASIC_INFO_64_2 18 /* 64-bit capable basic info */ - -struct task_basic_info_64_2 { - integer_t suspend_count; /* suspend count for task */ - mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ - mach_vm_size_t resident_size; /* resident memory size (bytes) */ - time_value_t user_time; /* total user run time for - * terminated threads */ - time_value_t system_time; /* total system run time for - * terminated threads */ - policy_t policy; /* default policy for new threads */ -}; -typedef struct task_basic_info_64_2 task_basic_info_64_2_data_t; -typedef struct task_basic_info_64_2 *task_basic_info_64_2_t; -#define TASK_BASIC_INFO_64_2_COUNT \ - (sizeof(task_basic_info_64_2_data_t) / sizeof(natural_t)) -#endif #define TASK_EXTMOD_INFO 19 @@ -420,7 +377,7 @@ typedef struct task_vm_info *task_vm_info_t; typedef struct vm_purgeable_info task_purgable_info_t; -#define TASK_TRACE_MEMORY_INFO 24 /* no longer supported */ +#define TASK_TRACE_MEMORY_INFO 24 struct task_trace_memory_info { uint64_t user_memory_address; /* address of start of trace memory buffer */ uint64_t buffer_size; /* size of buffer in bytes */ @@ -455,9 +412,6 @@ typedef gpu_energy_data *gpu_energy_data_t; struct task_power_info_v2 { task_power_info_data_t cpu_energy; gpu_energy_data gpu_energy; -#if defined(__arm__) || defined(__arm64__) - uint64_t task_energy; -#endif /* defined(__arm__) || defined(__arm64__) */ uint64_t task_ptime; uint64_t task_pset_switches; }; diff --git a/lib/libc/include/x86_64-macos-gnu/mach/task_policy.h b/lib/libc/include/x86_64-macos-gnu/mach/task_policy.h index 9e2cb4e7da..04970a5b63 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/task_policy.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/task_policy.h @@ -110,7 +110,8 @@ typedef integer_t *task_policy_t; #define TASK_BASE_LATENCY_QOS_POLICY 10 #define TASK_BASE_THROUGHPUT_QOS_POLICY 11 -typedef enum task_role { + +enum task_role { TASK_RENICED = -1, TASK_UNSPECIFIED = 0, TASK_FOREGROUND_APPLICATION = 1, @@ -121,7 +122,9 @@ typedef enum task_role { TASK_NONUI_APPLICATION = 6, TASK_DEFAULT_APPLICATION = 7, TASK_DARWINBG_APPLICATION = 8, -} task_role_t; +}; + +typedef integer_t task_role_t; struct task_category_policy { task_role_t role; diff --git a/lib/libc/include/x86_64-macos-gnu/mach/task_special_ports.h b/lib/libc/include/x86_64-macos-gnu/mach/task_special_ports.h index dea0f9d6dc..ded90941a4 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/task_special_ports.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/task_special_ports.h @@ -69,19 +69,18 @@ typedef int task_special_port_t; -#define TASK_KERNEL_PORT 1 /* The full task port for task. */ +#define TASK_KERNEL_PORT 1 /* Represents task to the outside + * world.*/ #define TASK_HOST_PORT 2 /* The host (priv) port for task. */ -#define TASK_NAME_PORT 3 /* The name port for task. */ +#define TASK_NAME_PORT 3 /* the name (unpriv) port for task */ #define TASK_BOOTSTRAP_PORT 4 /* Bootstrap environment for task. */ -#define TASK_INSPECT_PORT 5 /* The inspect port for task. */ - -#define TASK_READ_PORT 6 /* The read port for task. */ - - +/* + * Evolving and likely to change. + */ #define TASK_SEATBELT_PORT 7 /* Seatbelt compiler/DEM port for task. */ diff --git a/lib/libc/include/x86_64-macos-gnu/mach/thread_act.h b/lib/libc/include/x86_64-macos-gnu/mach/thread_act.h index 7f7608476b..5a21aa7e81 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/thread_act.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/thread_act.h @@ -49,7 +49,7 @@ typedef function_table_entry *function_table_t; #endif /* AUTOTEST */ #ifndef thread_act_MSG_COUNT -#define thread_act_MSG_COUNT 29 +#define thread_act_MSG_COUNT 28 #endif /* thread_act_MSG_COUNT */ #include @@ -88,7 +88,7 @@ __WATCHOS_PROHIBITED __TVOS_PROHIBITED kern_return_t act_get_state ( - thread_read_t target_act, + thread_act_t target_act, int flavor, thread_state_t old_state, mach_msg_type_number_t *old_stateCnt @@ -119,7 +119,7 @@ extern __WATCHOS_PROHIBITED kern_return_t thread_get_state ( - thread_read_t target_act, + thread_act_t target_act, thread_state_flavor_t flavor, thread_state_t old_state, mach_msg_type_number_t *old_stateCnt @@ -211,7 +211,7 @@ __WATCHOS_PROHIBITED __TVOS_PROHIBITED kern_return_t thread_get_special_port ( - thread_inspect_t thr_act, + thread_act_t thr_act, int which_port, mach_port_t *special_port ); @@ -272,7 +272,7 @@ __WATCHOS_PROHIBITED __TVOS_PROHIBITED kern_return_t thread_get_exception_ports ( - thread_act_t thread, + thread_inspect_t thread, exception_mask_t exception_mask, exception_mask_array_t masks, mach_msg_type_number_t *masksCnt, @@ -402,7 +402,7 @@ extern #endif /* mig_external */ kern_return_t thread_get_assignment ( - thread_inspect_t thread, + thread_act_t thread, processor_set_name_t *assigned_set ); @@ -433,7 +433,7 @@ __WATCHOS_PROHIBITED __TVOS_PROHIBITED kern_return_t thread_get_mach_voucher ( - thread_read_t thr_act, + thread_act_t thr_act, mach_voucher_selector_t which, ipc_voucher_t *voucher ); @@ -467,23 +467,6 @@ kern_return_t thread_swap_mach_voucher ipc_voucher_t *old_voucher ); -/* Routine thread_convert_thread_state */ -#ifdef mig_external -mig_external -#else -extern -#endif /* mig_external */ -kern_return_t thread_convert_thread_state -( - thread_act_t thread, - int direction, - thread_state_flavor_t flavor, - thread_state_t in_state, - mach_msg_type_number_t in_stateCnt, - thread_state_t out_state, - mach_msg_type_number_t *out_stateCnt -); - __END_DECLS /********************** Caution **************************/ @@ -533,7 +516,7 @@ __END_DECLS NDR_record_t NDR; int flavor; mach_msg_type_number_t new_stateCnt; - natural_t new_state[1296]; + natural_t new_state[614]; } __Request__act_set_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) @@ -560,7 +543,7 @@ __END_DECLS NDR_record_t NDR; thread_state_flavor_t flavor; mach_msg_type_number_t new_stateCnt; - natural_t new_state[1296]; + natural_t new_state[614]; } __Request__thread_set_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) @@ -868,22 +851,6 @@ __END_DECLS #ifdef __MigPackStructs #pragma pack(pop) #endif - -#ifdef __MigPackStructs -#pragma pack(push, 4) -#endif - typedef struct { - mach_msg_header_t Head; - NDR_record_t NDR; - int direction; - thread_state_flavor_t flavor; - mach_msg_type_number_t in_stateCnt; - natural_t in_state[1296]; - mach_msg_type_number_t out_stateCnt; - } __Request__thread_convert_thread_state_t __attribute__((unused)); -#ifdef __MigPackStructs -#pragma pack(pop) -#endif #endif /* !__Request__thread_act_subsystem__defined */ /* union of all requests */ @@ -919,7 +886,6 @@ union __RequestUnion__thread_act_subsystem { __Request__thread_get_mach_voucher_t Request_thread_get_mach_voucher; __Request__thread_set_mach_voucher_t Request_thread_set_mach_voucher; __Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher; - __Request__thread_convert_thread_state_t Request_thread_convert_thread_state; }; #endif /* !__RequestUnion__thread_act_subsystem__defined */ /* typedefs for all replies */ @@ -947,7 +913,7 @@ union __RequestUnion__thread_act_subsystem { NDR_record_t NDR; kern_return_t RetCode; mach_msg_type_number_t old_stateCnt; - natural_t old_state[1296]; + natural_t old_state[614]; } __Reply__act_get_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) @@ -973,7 +939,7 @@ union __RequestUnion__thread_act_subsystem { NDR_record_t NDR; kern_return_t RetCode; mach_msg_type_number_t old_stateCnt; - natural_t old_state[1296]; + natural_t old_state[614]; } __Reply__thread_get_state_t __attribute__((unused)); #ifdef __MigPackStructs #pragma pack(pop) @@ -1293,20 +1259,6 @@ union __RequestUnion__thread_act_subsystem { #ifdef __MigPackStructs #pragma pack(pop) #endif - -#ifdef __MigPackStructs -#pragma pack(push, 4) -#endif - typedef struct { - mach_msg_header_t Head; - NDR_record_t NDR; - kern_return_t RetCode; - mach_msg_type_number_t out_stateCnt; - natural_t out_state[1296]; - } __Reply__thread_convert_thread_state_t __attribute__((unused)); -#ifdef __MigPackStructs -#pragma pack(pop) -#endif #endif /* !__Reply__thread_act_subsystem__defined */ /* union of all replies */ @@ -1342,7 +1294,6 @@ union __ReplyUnion__thread_act_subsystem { __Reply__thread_get_mach_voucher_t Reply_thread_get_mach_voucher; __Reply__thread_set_mach_voucher_t Reply_thread_set_mach_voucher; __Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher; - __Reply__thread_convert_thread_state_t Reply_thread_convert_thread_state; }; #endif /* !__RequestUnion__thread_act_subsystem__defined */ @@ -1375,8 +1326,7 @@ union __ReplyUnion__thread_act_subsystem { { "thread_set_policy", 3624 },\ { "thread_get_mach_voucher", 3625 },\ { "thread_set_mach_voucher", 3626 },\ - { "thread_swap_mach_voucher", 3627 },\ - { "thread_convert_thread_state", 3628 } + { "thread_swap_mach_voucher", 3627 } #endif #ifdef __AfterMigUserHeader diff --git a/lib/libc/include/x86_64-macos-gnu/mach/thread_special_ports.h b/lib/libc/include/x86_64-macos-gnu/mach/thread_special_ports.h index 7bb1bea5ae..02199835a4 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/thread_special_ports.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/thread_special_ports.h @@ -67,11 +67,8 @@ #ifndef _MACH_THREAD_SPECIAL_PORTS_H_ #define _MACH_THREAD_SPECIAL_PORTS_H_ -#define THREAD_KERNEL_PORT 1 /* The full thread port for thread. */ - -#define THREAD_INSPECT_PORT 2 /* The inspect port for thread. */ - -#define THREAD_READ_PORT 3 /* The read port for thread. */ +#define THREAD_KERNEL_PORT 1 /* Represents the thread to the outside + * world.*/ /* * Definitions for ease of use diff --git a/lib/libc/include/x86_64-macos-gnu/mach/thread_status.h b/lib/libc/include/x86_64-macos-gnu/mach/thread_status.h index 7ccb65d6a1..a91b936eba 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/thread_status.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/thread_status.h @@ -94,7 +94,4 @@ typedef natural_t thread_state_data_t[THREAD_STATE_MAX]; typedef int thread_state_flavor_t; typedef thread_state_flavor_t *thread_state_flavor_array_t; -#define THREAD_CONVERT_THREAD_STATE_TO_SELF 1 -#define THREAD_CONVERT_THREAD_STATE_FROM_SELF 2 - #endif /* _MACH_THREAD_STATUS_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/mach/vm_prot.h b/lib/libc/include/x86_64-macos-gnu/mach/vm_prot.h index 5046c6bc7a..8914da2372 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/vm_prot.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/vm_prot.h @@ -149,5 +149,4 @@ typedef int vm_prot_t; #define VM_PROT_STRIP_READ ((vm_prot_t) 0x80) #define VM_PROT_EXECUTE_ONLY (VM_PROT_EXECUTE|VM_PROT_STRIP_READ) - #endif /* _MACH_VM_PROT_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/mach/vm_statistics.h b/lib/libc/include/x86_64-macos-gnu/mach/vm_statistics.h index 1d9ba2a4d1..0a2ee5b74c 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/vm_statistics.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/vm_statistics.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2020 Apple Inc. All rights reserved. + * Copyright (c) 2000-2019 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -66,12 +66,8 @@ #ifndef _MACH_VM_STATISTICS_H_ #define _MACH_VM_STATISTICS_H_ -#ifdef __cplusplus -extern "C" { -#endif - #include -#include + /* * vm_statistics @@ -171,8 +167,6 @@ struct vm_statistics64 { typedef struct vm_statistics64 *vm_statistics64_t; typedef struct vm_statistics64 vm_statistics64_data_t; -kern_return_t vm_stats(void *info, unsigned int *count); - /* * VM_STATISTICS_TRUNCATE_TO_32_BIT * @@ -358,7 +352,6 @@ enum virtual_memory_guard_exception_codes { #define VM_MEMORY_MALLOC_NANO 11 #define VM_MEMORY_MALLOC_MEDIUM 12 -#define VM_MEMORY_MALLOC_PGUARD 13 #define VM_MEMORY_MACH_MSG 20 #define VM_MEMORY_IOKIT 21 @@ -519,22 +512,6 @@ enum virtual_memory_guard_exception_codes { /* memory allocated by CoreMedia for global image registration of frames */ #define VM_MEMORY_CM_REGWARP 101 -/* memory allocated by EmbeddedAcousticRecognition for speech decoder */ -#define VM_MEMORY_EAR_DECODER 102 - -/* CoreUI cached image data */ -#define VM_MEMORY_COREUI_CACHED_IMAGE_DATA 103 - -/* Reserve 230-239 for Rosetta */ -#define VM_MEMORY_ROSETTA 230 -#define VM_MEMORY_ROSETTA_THREAD_CONTEXT 231 -#define VM_MEMORY_ROSETTA_INDIRECT_BRANCH_MAP 232 -#define VM_MEMORY_ROSETTA_RETURN_STACK 233 -#define VM_MEMORY_ROSETTA_EXECUTABLE_HEAP 234 -#define VM_MEMORY_ROSETTA_USER_LDT 235 -#define VM_MEMORY_ROSETTA_ARENA 236 -#define VM_MEMORY_ROSETTA_10 239 - /* Reserve 240-255 for application */ #define VM_MEMORY_APPLICATION_SPECIFIC_1 240 #define VM_MEMORY_APPLICATION_SPECIFIC_16 255 @@ -543,8 +520,4 @@ enum virtual_memory_guard_exception_codes { -#ifdef __cplusplus -} -#endif - #endif /* _MACH_VM_STATISTICS_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/mach/vm_types.h b/lib/libc/include/x86_64-macos-gnu/mach/vm_types.h index b65a36847b..1367f255b0 100644 --- a/lib/libc/include/x86_64-macos-gnu/mach/vm_types.h +++ b/lib/libc/include/x86_64-macos-gnu/mach/vm_types.h @@ -70,12 +70,10 @@ typedef uint32_t ppnum_t; /* Physical page number */ -typedef mach_port_t vm_map_t, vm_map_read_t, vm_map_inspect_t; +typedef mach_port_t vm_map_t; #define VM_MAP_NULL ((vm_map_t) 0) -#define VM_MAP_INSPECT_NULL ((vm_map_inspect_t) 0) -#define VM_MAP_READ_NULL ((vm_map_read_t) 0) /* * Evolving definitions, likely to change. diff --git a/lib/libc/include/x86_64-macos-gnu/machine/_mcontext.h b/lib/libc/include/x86_64-macos-gnu/machine/_mcontext.h index dc98841eb9..27ac45190e 100644 --- a/lib/libc/include/x86_64-macos-gnu/machine/_mcontext.h +++ b/lib/libc/include/x86_64-macos-gnu/machine/_mcontext.h @@ -27,8 +27,6 @@ */ #if defined (__i386__) || defined (__x86_64__) #include "i386/_mcontext.h" -#elif defined (__arm__) || defined (__arm64__) -#include "arm/_mcontext.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/machine/_param.h b/lib/libc/include/x86_64-macos-gnu/machine/_param.h index c6a6028b17..c8e35a1c29 100644 --- a/lib/libc/include/x86_64-macos-gnu/machine/_param.h +++ b/lib/libc/include/x86_64-macos-gnu/machine/_param.h @@ -26,9 +26,7 @@ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #if defined (__i386__) || defined (__x86_64__) -#include -#elif defined (__arm__) || defined (__arm64__) -#include +#include "i386/_param.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/machine/_types.h b/lib/libc/include/x86_64-macos-gnu/machine/_types.h index 47dbe8c188..2873a84a85 100644 --- a/lib/libc/include/x86_64-macos-gnu/machine/_types.h +++ b/lib/libc/include/x86_64-macos-gnu/machine/_types.h @@ -30,8 +30,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "i386/_types.h" -#elif defined (__arm__) || defined (__arm64__) -#include "arm/_types.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/machine/endian.h b/lib/libc/include/x86_64-macos-gnu/machine/endian.h index 682a15155d..4bbc8c4df8 100644 --- a/lib/libc/include/x86_64-macos-gnu/machine/endian.h +++ b/lib/libc/include/x86_64-macos-gnu/machine/endian.h @@ -33,8 +33,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "i386/endian.h" -#elif defined (__arm__) || defined (__arm64__) -#include "arm/endian.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/machine/limits.h b/lib/libc/include/x86_64-macos-gnu/machine/limits.h index 7ae09a12e0..bfe42ba649 100644 --- a/lib/libc/include/x86_64-macos-gnu/machine/limits.h +++ b/lib/libc/include/x86_64-macos-gnu/machine/limits.h @@ -4,8 +4,6 @@ * This file is public domain. */ #if defined (__i386__) || defined(__x86_64__) #include -#elif defined (__arm__) || defined (__arm64__) -#include #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/machine/param.h b/lib/libc/include/x86_64-macos-gnu/machine/param.h index 5b69eeb337..10f8f6332e 100644 --- a/lib/libc/include/x86_64-macos-gnu/machine/param.h +++ b/lib/libc/include/x86_64-macos-gnu/machine/param.h @@ -32,9 +32,7 @@ #define _BSD_MACHINE_PARAM_H_ #if defined (__i386__) || defined(__x86_64__) -#include -#elif defined (__arm__) || defined (__arm64__) -#include +#include "i386/param.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/machine/signal.h b/lib/libc/include/x86_64-macos-gnu/machine/signal.h index d8a6a2433e..def4d744b7 100644 --- a/lib/libc/include/x86_64-macos-gnu/machine/signal.h +++ b/lib/libc/include/x86_64-macos-gnu/machine/signal.h @@ -30,8 +30,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "i386/signal.h" -#elif defined (__arm__) || defined (__arm64__) -#include "arm/signal.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/machine/types.h b/lib/libc/include/x86_64-macos-gnu/machine/types.h index e2241c06c3..a991f733e5 100644 --- a/lib/libc/include/x86_64-macos-gnu/machine/types.h +++ b/lib/libc/include/x86_64-macos-gnu/machine/types.h @@ -33,8 +33,6 @@ #if defined (__i386__) || defined(__x86_64__) #include "i386/types.h" -#elif defined (__arm__) || defined (__arm64__) -#include "arm/types.h" #else #error architecture not supported #endif diff --git a/lib/libc/include/x86_64-macos-gnu/malloc/_malloc.h b/lib/libc/include/x86_64-macos-gnu/malloc/_malloc.h index 8c0d4cadd6..c0270235da 100644 --- a/lib/libc/include/x86_64-macos-gnu/malloc/_malloc.h +++ b/lib/libc/include/x86_64-macos-gnu/malloc/_malloc.h @@ -44,9 +44,9 @@ void *realloc(void *__ptr, size_t __size) __result_use_check __alloc_size(2); #if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) void *valloc(size_t) __alloc_size(1); #endif // !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) -#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ - (defined(__cplusplus) && __cplusplus >= 201703L) +#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) && \ + ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ + (defined(__cplusplus) && __cplusplus >= 201703L)) void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_size(2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0); #endif int posix_memalign(void **__memptr, size_t __alignment, size_t __size) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); diff --git a/lib/libc/include/x86_64-macos-gnu/math.h b/lib/libc/include/x86_64-macos-gnu/math.h index bb92c5ba15..535d7b5976 100644 --- a/lib/libc/include/x86_64-macos-gnu/math.h +++ b/lib/libc/include/x86_64-macos-gnu/math.h @@ -547,7 +547,6 @@ extern long double fmal(long double, long double, long double); #define islessgreater(x, y) __builtin_islessgreater((x),(y)) #define isunordered(x, y) __builtin_isunordered((x),(y)) -#if defined __i386__ || defined __x86_64__ /* Deprecated functions; use the INFINITY and NAN macros instead. */ extern float __inff(void) __API_DEPRECATED("use `(float)INFINITY` instead", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); @@ -557,7 +556,6 @@ extern long double __infl(void) __API_DEPRECATED("use `(long double)INFINITY` instead", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); extern float __nan(void) __API_DEPRECATED("use `NAN` instead", macos(10.0, 10.14)) __API_UNAVAILABLE(ios, watchos, tvos); -#endif /****************************************************************************** * Reentrant variants of lgamma[fl] * @@ -738,7 +736,6 @@ extern int signgam; #define TLOSS 5 #define PLOSS 6 -#if defined __i386__ || defined __x86_64__ /* Legacy BSD API; use the C99 `lrint( )` function instead. */ extern long int rinttol(double) __API_DEPRECATED_WITH_REPLACEMENT("lrint", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); @@ -757,7 +754,6 @@ __API_DEPRECATED_WITH_REPLACEMENT("tgamma", macos(10.0, 10.9)) __API_UNAVAILABLE /* Legacy BSD API; use `2*frexp( )` or `scalbn(x, -ilogb(x))` instead. */ extern double significand(double) __API_DEPRECATED("Use `2*frexp( )` or `scalbn(x, -ilogb(x))` instead.", macos(10.0, 10.9)) __API_UNAVAILABLE(ios, watchos, tvos); -#endif #if !defined __cplusplus struct exception { diff --git a/lib/libc/include/x86_64-macos-gnu/net/if.h b/lib/libc/include/x86_64-macos-gnu/net/if.h index d92581cf2f..946332ff00 100644 --- a/lib/libc/include/x86_64-macos-gnu/net/if.h +++ b/lib/libc/include/x86_64-macos-gnu/net/if.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2020 Apple Inc. All rights reserved. + * Copyright (c) 2000-2019 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * diff --git a/lib/libc/include/x86_64-macos-gnu/net/if_var.h b/lib/libc/include/x86_64-macos-gnu/net/if_var.h index 3e3d801f1e..4787d9e145 100644 --- a/lib/libc/include/x86_64-macos-gnu/net/if_var.h +++ b/lib/libc/include/x86_64-macos-gnu/net/if_var.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2020 Apple Inc. All rights reserved. + * Copyright (c) 2000-2019 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -70,7 +70,6 @@ #include #include /* get TAILQ macros */ #ifdef BSD_KERN_PRIVATE -#include #include #endif diff --git a/lib/libc/include/x86_64-macos-gnu/netinet/in.h b/lib/libc/include/x86_64-macos-gnu/netinet/in.h index bc41ef5563..0fc452a587 100644 --- a/lib/libc/include/x86_64-macos-gnu/netinet/in.h +++ b/lib/libc/include/x86_64-macos-gnu/netinet/in.h @@ -63,14 +63,14 @@ #ifndef _NETINET_IN_H_ #define _NETINET_IN_H_ - #include +#include #include /* uint(8|16|32)_t */ #include - #include + #include /* @@ -435,7 +435,6 @@ struct ip_opts { #define IP_PKTINFO 26 /* get pktinfo on recv socket, set src on sent dgram */ #define IP_RECVPKTINFO IP_PKTINFO /* receive pktinfo w/dgram */ #define IP_RECVTOS 27 /* bool; receive IP TOS w/dgram */ -#define IP_DONTFRAG 28 /* don't fragment packet */ #define IP_FW_ADD 40 /* add a firewall rule to chain */ #define IP_FW_DEL 41 /* delete a firewall rule from chain */ diff --git a/lib/libc/include/x86_64-macos-gnu/netinet/tcp.h b/lib/libc/include/x86_64-macos-gnu/netinet/tcp.h index afd36ffd6f..4a716d498b 100644 --- a/lib/libc/include/x86_64-macos-gnu/netinet/tcp.h +++ b/lib/libc/include/x86_64-macos-gnu/netinet/tcp.h @@ -63,13 +63,11 @@ #ifndef _NETINET_TCP_H_ #define _NETINET_TCP_H_ +#include #include - #include #include /* __uint32_t */ -#include - #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) typedef __uint32_t tcp_seq; typedef __uint32_t tcp_cc; /* connection count per rfc1644 */ diff --git a/lib/libc/include/x86_64-macos-gnu/netinet6/in6.h b/lib/libc/include/x86_64-macos-gnu/netinet6/in6.h index 7f7d3fc75b..fc4550f3fc 100644 --- a/lib/libc/include/x86_64-macos-gnu/netinet6/in6.h +++ b/lib/libc/include/x86_64-macos-gnu/netinet6/in6.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2020 Apple Inc. All rights reserved. + * Copyright (c) 2008-2018 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -98,7 +98,6 @@ #ifndef _NETINET6_IN6_H_ #define _NETINET6_IN6_H_ #include - #include #include @@ -179,7 +178,6 @@ struct sockaddr_in6 { - /* * Definition of some useful macros to handle IP6 addresses */ @@ -208,7 +206,6 @@ struct sockaddr_in6 { #define IN6ADDR_V4MAPPED_INIT \ {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} -#define IN6ADDR_MULTICAST_PREFIX IN6MASK8 #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ extern const struct in6_addr in6addr_any; @@ -300,16 +297,6 @@ extern const struct in6_addr in6addr_linklocal_allv2routers; */ #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) -#define IPV6_ADDR_MC_FLAGS(a) ((a)->s6_addr[1] & 0xf0) - -#define IPV6_ADDR_MC_FLAGS_TRANSIENT 0x10 -#define IPV6_ADDR_MC_FLAGS_PREFIX 0x20 -#define IPV6_ADDR_MC_FLAGS_UNICAST_BASED (IPV6_ADDR_MC_FLAGS_TRANSIENT | IPV6_ADDR_MC_FLAGS_PREFIX) - -#define IN6_IS_ADDR_UNICAST_BASED_MULTICAST(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (IPV6_ADDR_MC_FLAGS(a) == IPV6_ADDR_MC_FLAGS_UNICAST_BASED)) - /* * Unique Local IPv6 Unicast Addresses (per RFC 4193) */ @@ -324,9 +311,8 @@ extern const struct in6_addr in6addr_linklocal_allv2routers; #define IN6_IS_ADDR_MC_NODELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL)) -#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ - (IPV6_ADDR_MC_FLAGS(a) != IPV6_ADDR_MC_FLAGS_UNICAST_BASED) && \ +#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ @@ -383,9 +369,9 @@ extern const struct in6_addr in6addr_linklocal_allv2routers; #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ -#define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */ -#define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */ -#define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 mcast loopback */ +#define IPV6_MULTICAST_IF 9 /* __uint8_t; set/get IP6 multicast i/f */ +#define IPV6_MULTICAST_HOPS 10 /* __uint8_t; set/get IP6 multicast hops */ +#define IPV6_MULTICAST_LOOP 11 /* __uint8_t; set/get IP6 mcast loopback */ #define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */ #define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */ @@ -677,5 +663,5 @@ extern int inet6_rth_segments(const void *); extern struct in6_addr *inet6_rth_getaddr(const void *, int); __END_DECLS -#endif /* PLATFORM_DriverKit */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ #endif /* !_NETINET6_IN6_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/objc/objc-api.h b/lib/libc/include/x86_64-macos-gnu/objc/objc-api.h index d6eb37353d..a098b6afc8 100644 --- a/lib/libc/include/x86_64-macos-gnu/objc/objc-api.h +++ b/lib/libc/include/x86_64-macos-gnu/objc/objc-api.h @@ -96,12 +96,6 @@ # define NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER 1 #endif -/* The arm64 ABI requires proper casting to ensure arguments are passed - * * correctly. */ -#if defined(__arm64__) && !__swift__ -# undef OBJC_OLD_DISPATCH_PROTOTYPES -# define OBJC_OLD_DISPATCH_PROTOTYPES 0 -#endif /* OBJC_OLD_DISPATCH_PROTOTYPES == 0 enforces the rule that the dispatch * functions must be cast to an appropriate function pointer type. */ diff --git a/lib/libc/include/x86_64-macos-gnu/objc/runtime.h b/lib/libc/include/x86_64-macos-gnu/objc/runtime.h index 8f9efb2289..e66756d1b4 100644 --- a/lib/libc/include/x86_64-macos-gnu/objc/runtime.h +++ b/lib/libc/include/x86_64-macos-gnu/objc/runtime.h @@ -1765,6 +1765,43 @@ OBJC_EXPORT void objc_setHook_getClass(objc_hook_getClass _Nonnull newValue, OBJC_AVAILABLE(10.14.4, 12.2, 12.2, 5.2, 3.2); #endif +/** + * Function type for a hook that assists objc_setAssociatedObject(). + * + * @param object The source object for the association. + * @param key The key for the association. + * @param value The value to associate with the key key for object. Pass nil to clear an existing association. + * @param policy The policy for the association. For possible values, see “Associative Object Behaviors.” + * + * @see objc_setAssociatedObject + * @see objc_setHook_setAssociatedObject + */ +typedef void (*objc_hook_setAssociatedObject)(id _Nonnull object, const void * _Nonnull key, + id _Nullable value, objc_AssociationPolicy policy); + +/** + * Install a hook for objc_setAssociatedObject(). + * + * @param newValue The hook function to install. + * @param outOldValue The address of a function pointer variable. On return, + * the old hook function is stored in the variable. + * + * @note The store to *outOldValue is thread-safe: the variable will be + * updated before objc_setAssociatedObject() calls your new hook to read it, + * even if your new hook is called from another thread before this + * setter completes. + * @note Your hook should always call the previous hook. + * + * @see objc_setAssociatedObject + * @see objc_hook_setAssociatedObject + */ +#if !(TARGET_OS_OSX && __i386__) +#define OBJC_SETASSOCIATEDOBJECTHOOK_DEFINED 1 +OBJC_EXPORT void objc_setHook_setAssociatedObject(objc_hook_setAssociatedObject _Nonnull newValue, + objc_hook_setAssociatedObject _Nullable * _Nonnull outOldValue) + OBJC_AVAILABLE(10.15, 13.0, 13.0, 6.0, 4.0); +#endif + /** * Function type for a function that is called when an image is loaded. * @@ -1792,39 +1829,7 @@ typedef void (*objc_func_loadImage)(const struct mach_header * _Nonnull header); OBJC_EXPORT void objc_addLoadImageFunc(objc_func_loadImage _Nonnull func) OBJC_AVAILABLE(10.15, 13.0, 13.0, 6.0, 4.0); -/** - * Function type for a hook that provides a name for lazily named classes. - * - * @param cls The class to generate a name for. - * @return The name of the class, or NULL if the name isn't known or can't me generated. - * - * @see objc_setHook_lazyClassNamer - */ -typedef const char * _Nullable (*objc_hook_lazyClassNamer)(_Nonnull Class cls); - -/** - * Install a hook to provide a name for lazily-named classes. - * - * @param newValue The hook function to install. - * @param outOldValue The address of a function pointer variable. On return, - * the old hook function is stored in the variable. - * - * @note The store to *outOldValue is thread-safe: the variable will be - * updated before objc_getClass() calls your new hook to read it, - * even if your new hook is called from another thread before this - * setter completes. - * @note Your hook must call the previous hook for class names - * that you do not recognize. - */ -#if !(TARGET_OS_OSX && __i386__) -#define OBJC_SETHOOK_LAZYCLASSNAMER_DEFINED 1 -OBJC_EXPORT -void objc_setHook_lazyClassNamer(_Nonnull objc_hook_lazyClassNamer newValue, - _Nonnull objc_hook_lazyClassNamer * _Nonnull oldOutValue) - OBJC_AVAILABLE(11.0, 14.0, 14.0, 7.0, 5.0); -#endif - -/** +/** * Callback from Objective-C to Swift to perform Swift class initialization. */ #if !(TARGET_OS_OSX && __i386__) diff --git a/lib/libc/include/x86_64-macos-gnu/os/base.h b/lib/libc/include/x86_64-macos-gnu/os/base.h index 027bcc8d2b..e8e9059272 100644 --- a/lib/libc/include/x86_64-macos-gnu/os/base.h +++ b/lib/libc/include/x86_64-macos-gnu/os/base.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2020 Apple Inc. All rights reserved. + * Copyright (c) 2008-2013 Apple Inc. All rights reserved. * * @APPLE_APACHE_LICENSE_HEADER_START@ * @@ -23,7 +23,6 @@ #include - #ifndef __has_builtin #define __has_builtin(x) 0 #endif @@ -74,7 +73,7 @@ #define OS_ALWAYS_INLINE __attribute__((__always_inline__)) #define OS_TRANSPARENT_UNION __attribute__((__transparent_union__)) #define OS_ALIGNED(n) __attribute__((__aligned__((n)))) -#define OS_FORMAT_PRINTF(x, y) __attribute__((__format__(printf,x,y))) +#define OS_FORMAT_PRINTF(x,y) __attribute__((__format__(printf,x,y))) #define OS_EXPORT extern __attribute__((__visibility__("default"))) #define OS_INLINE static __inline__ #define OS_EXPECT(x, v) __builtin_expect((x), (v)) @@ -111,7 +110,7 @@ #define OS_ALWAYS_INLINE #define OS_TRANSPARENT_UNION #define OS_ALIGNED(n) -#define OS_FORMAT_PRINTF(x, y) +#define OS_FORMAT_PRINTF(x,y) #define OS_EXPORT extern #define OS_INLINE static inline #define OS_EXPECT(x, v) (x) @@ -125,8 +124,6 @@ #if defined(__cplusplus) && defined(__clang__) #define OS_FALLTHROUGH [[clang::fallthrough]] -#elif __has_attribute(fallthrough) -#define OS_FALLTHROUGH __attribute__((__fallthrough__)) #else #define OS_FALLTHROUGH #endif @@ -167,21 +164,30 @@ * -Wassign-enum prevents you from assigning illegal values to a variable of the * enum type. */ +#ifndef __OPEN_SOURCE__ +/*! + * @internal + * + */ +#endif // __OPEN_SOURCE__ #define __OS_OPTIONS_ATTR __attribute__((flag_enum)) #else #define __OS_OPTIONS_ATTR #endif // __has_attribute(flag_enum) #if __has_feature(objc_fixed_enum) || __has_extension(cxx_fixed_enum) || \ - __has_extension(cxx_strong_enums) + __has_extension(cxx_strong_enums) #define OS_ENUM(_name, _type, ...) \ - typedef enum : _type { __VA_ARGS__ } _name##_t + typedef enum : _type { __VA_ARGS__ } _name##_t #define OS_CLOSED_ENUM(_name, _type, ...) \ - typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR_CLOSED _name##_t + typedef enum : _type { __VA_ARGS__ } \ + __OS_ENUM_ATTR_CLOSED _name##_t #define OS_OPTIONS(_name, _type, ...) \ - typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR __OS_OPTIONS_ATTR _name##_t + typedef enum : _type { __VA_ARGS__ } \ + __OS_ENUM_ATTR __OS_OPTIONS_ATTR _name##_t #define OS_CLOSED_OPTIONS(_name, _type, ...) \ - typedef enum : _type { __VA_ARGS__ } __OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR _name##_t + typedef enum : _type { __VA_ARGS__ } \ + __OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR _name##_t #else /*! * There is unfortunately no good way in plain C to have both fixed-type enums @@ -214,25 +220,25 @@ * When compiling in ObjC or C++, both of the above assignments are illegal. */ #define __OS_ENUM_C_FALLBACK(_name, _type, ...) \ - typedef _type _name##_t; enum _name { __VA_ARGS__ } + typedef _type _name##_t; enum _name { __VA_ARGS__ } #define OS_ENUM(_name, _type, ...) \ - typedef _type _name##_t; enum { __VA_ARGS__ } + typedef _type _name##_t; enum { __VA_ARGS__ } #define OS_CLOSED_ENUM(_name, _type, ...) \ - __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \ - __OS_ENUM_ATTR_CLOSED + __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \ + __OS_ENUM_ATTR_CLOSED #define OS_OPTIONS(_name, _type, ...) \ - __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \ - __OS_ENUM_ATTR __OS_OPTIONS_ATTR + __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \ + __OS_ENUM_ATTR __OS_OPTIONS_ATTR #define OS_CLOSED_OPTIONS(_name, _type, ...) \ - __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \ - __OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR + __OS_ENUM_C_FALLBACK(_name, _type, ## __VA_ARGS__) \ + __OS_ENUM_ATTR_CLOSED __OS_OPTIONS_ATTR #endif // __has_feature(objc_fixed_enum) || __has_extension(cxx_strong_enums) #if __has_feature(attribute_availability_swift) // equivalent to __SWIFT_UNAVAILABLE from Availability.h #define OS_SWIFT_UNAVAILABLE(_msg) \ - __attribute__((__availability__(swift, unavailable, message=_msg))) + __attribute__((__availability__(swift, unavailable, message=_msg))) #else #define OS_SWIFT_UNAVAILABLE(_msg) #endif @@ -256,12 +262,12 @@ #ifdef __GNUC__ #define os_prevent_tail_call_optimization() __asm__("") -#define os_is_compile_time_constant(expr) __builtin_constant_p(expr) -#define os_compiler_barrier() __asm__ __volatile__("" ::: "memory") +#define os_is_compile_time_constant(expr) __builtin_constant_p(expr) +#define os_compiler_barrier() __asm__ __volatile__("" ::: "memory") #else #define os_prevent_tail_call_optimization() do { } while (0) -#define os_is_compile_time_constant(expr) 0 -#define os_compiler_barrier() do { } while (0) +#define os_is_compile_time_constant(expr) 0 +#define os_compiler_barrier() do { } while (0) #endif #if __has_attribute(not_tail_called) @@ -270,7 +276,6 @@ #define OS_NOT_TAIL_CALLED #endif - typedef void (*os_function_t)(void *_Nullable); #ifdef __BLOCKS__ @@ -317,6 +322,4 @@ typedef void (*os_function_t)(void *_Nullable); typedef void (^os_block_t)(void); #endif - - #endif // __OS_BASE__ diff --git a/lib/libc/include/x86_64-macos-gnu/os/clock.h b/lib/libc/include/x86_64-macos-gnu/os/clock.h deleted file mode 100644 index 665e1d8716..0000000000 --- a/lib/libc/include/x86_64-macos-gnu/os/clock.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __OS_CLOCK__ -#define __OS_CLOCK__ - -#include -#include - -/* - * @typedef os_clockid_t - * - * @abstract - * Describes the kind of clock that the workgroup timestamp parameters are - * specified in - */ -OS_ENUM(os_clockid, uint32_t, - OS_CLOCK_MACH_ABSOLUTE_TIME = 32, -); - -#endif /* __OS_CLOCK__ */ diff --git a/lib/libc/include/x86_64-macos-gnu/os/object.h b/lib/libc/include/x86_64-macos-gnu/os/object.h index e2ce3f4677..2979de8919 100644 --- a/lib/libc/include/x86_64-macos-gnu/os/object.h +++ b/lib/libc/include/x86_64-macos-gnu/os/object.h @@ -98,15 +98,6 @@ #endif // __swift__ #endif // OS_OBJECT_SWIFT3 -#if __has_feature(assume_nonnull) -#define OS_OBJECT_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") -#define OS_OBJECT_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") -#else -#define OS_OBJECT_ASSUME_NONNULL_BEGIN -#define OS_OBJECT_ASSUME_NONNULL_END -#endif -#define OS_OBJECT_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) - #if OS_OBJECT_USE_OBJC #import #if __has_attribute(objc_independent_class) @@ -125,9 +116,9 @@ #define OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL(name, proto) \ OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL_IMPL( \ OS_OBJECT_CLASS(name), OS_OBJECT_CLASS(proto)) -#define OS_OBJECT_DECL_IMPL(name, adhere, ...) \ +#define OS_OBJECT_DECL_IMPL(name, ...) \ OS_OBJECT_DECL_PROTOCOL(name, __VA_ARGS__) \ - typedef adhere \ + typedef NSObject \ * OS_OBJC_INDEPENDENT_CLASS name##_t #define OS_OBJECT_DECL_BASE(name, ...) \ @interface OS_OBJECT_CLASS(name) : __VA_ARGS__ \ @@ -138,9 +129,9 @@ typedef OS_OBJECT_CLASS(name) \ * OS_OBJC_INDEPENDENT_CLASS name##_t #define OS_OBJECT_DECL(name, ...) \ - OS_OBJECT_DECL_IMPL(name, NSObject, ) + OS_OBJECT_DECL_IMPL(name, ) #define OS_OBJECT_DECL_SUBCLASS(name, super) \ - OS_OBJECT_DECL_IMPL(name, NSObject, ) + OS_OBJECT_DECL_IMPL(name, ) #if __has_attribute(ns_returns_retained) #define OS_OBJECT_RETURNS_RETAINED __attribute__((__ns_returns_retained__)) #else @@ -158,8 +149,6 @@ #define OS_OBJECT_BRIDGE #define OS_WARN_RESULT_NEEDS_RELEASE OS_WARN_RESULT #endif - - #if __has_attribute(objc_runtime_visible) && \ ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_12) || \ @@ -174,7 +163,7 @@ /* * To provide backward deployment of ObjC objects in Swift on pre-10.12 * SDKs, OS_object classes can be marked as OS_OBJECT_OBJC_RUNTIME_VISIBLE. - * When compiling with a deployment target earlier than OS X 10.12 (iOS 10.0, + * When compiling with a deployment target earlier than OS X 10.12 (iOS 10.0, * tvOS 10.0, watchOS 3.0) the Swift compiler will only refer to this type at * runtime (using the ObjC runtime). */ @@ -198,9 +187,9 @@ #define OS_OBJECT_DECL_SUBCLASS_SWIFT(name, super) \ OS_EXPORT OS_OBJECT_OBJC_RUNTIME_VISIBLE \ OS_OBJECT_DECL_IMPL_CLASS(name, OS_OBJECT_CLASS(super)) -#endif // OS_OBJECT_SWIFT3 OS_EXPORT OS_OBJECT_OBJC_RUNTIME_VISIBLE OS_OBJECT_DECL_BASE(object, NSObject); +#endif // OS_OBJECT_SWIFT3 #else /*! @parseOnly */ #define OS_OBJECT_RETURNS_RETAINED @@ -226,27 +215,6 @@ OS_OBJECT_DECL_BASE(object, NSObject); typedef struct name##_s *name##_t #endif -#if OS_OBJECT_USE_OBJC -/* Declares a class of the specific name and exposes the interface and typedefs - * name##_t to the pointer to the class */ -#define OS_OBJECT_SHOW_CLASS(name, ...) \ - OS_EXPORT OS_OBJECT_OBJC_RUNTIME_VISIBLE \ - OS_OBJECT_DECL_IMPL_CLASS(name, ## __VA_ARGS__ ) -/* Declares a subclass of the same name, and - * subclass adheres to protocol specified. Typedefs baseclass * to subclass##_t */ -#define OS_OBJECT_SHOW_SUBCLASS(subclass_name, super, proto_name) \ - OS_EXPORT OS_OBJECT_OBJC_RUNTIME_VISIBLE \ - OS_OBJECT_DECL_BASE(subclass_name, OS_OBJECT_CLASS(super)); \ - typedef OS_OBJECT_CLASS(super) \ - * OS_OBJC_INDEPENDENT_CLASS subclass_name##_t -#else /* Plain C */ -#define OS_OBJECT_DECL_PROTOCOL(name, ...) -#define OS_OBJECT_SHOW_CLASS(name, ...) \ - typedef struct name##_s *name##_t -#define OS_OBJECT_SHOW_SUBCLASS(name, super, ...) \ - typedef super##_t name##_t -#endif - #define OS_OBJECT_GLOBAL_OBJECT(type, object) ((OS_OBJECT_BRIDGE type)&(object)) __BEGIN_DECLS diff --git a/lib/libc/include/x86_64-macos-gnu/os/workgroup.h b/lib/libc/include/x86_64-macos-gnu/os/workgroup.h deleted file mode 100644 index 96b870c10c..0000000000 --- a/lib/libc/include/x86_64-macos-gnu/os/workgroup.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2020 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -#ifndef __OS_WORKGROUP__ -#define __OS_WORKGROUP__ - -#ifndef __DISPATCH_BUILDING_DISPATCH__ -#ifndef __OS_WORKGROUP_INDIRECT__ -#define __OS_WORKGROUP_INDIRECT__ -#endif /* __OS_WORKGROUP_INDIRECT__ */ - -#include -#include -#include -#include - -#undef __OS_WORKGROUP_INDIRECT__ -#endif /* __DISPATCH_BUILDING_DISPATCH__ */ - -#endif /* __OS_WORKGROUP__ */ diff --git a/lib/libc/include/x86_64-macos-gnu/os/workgroup_base.h b/lib/libc/include/x86_64-macos-gnu/os/workgroup_base.h deleted file mode 100644 index 3983f002ae..0000000000 --- a/lib/libc/include/x86_64-macos-gnu/os/workgroup_base.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef __OS_WORKGROUP_BASE__ -#define __OS_WORKGROUP_BASE__ - -#ifndef __OS_WORKGROUP_INDIRECT__ -#error "Please #include instead of this file directly." -#endif - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#if __has_feature(assume_nonnull) -#define OS_WORKGROUP_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") -#define OS_WORKGROUP_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") -#else -#define OS_WORKGROUP_ASSUME_NONNULL_BEGIN -#define OS_WORKGROUP_ASSUME_NONNULL_END -#endif -#define OS_WORKGROUP_WARN_RESULT __attribute__((__warn_unused_result__)) -#define OS_WORKGROUP_EXPORT OS_EXPORT -#define OS_WORKGROUP_RETURNS_RETAINED OS_OBJECT_RETURNS_RETAINED - -#define OS_WORKGROUP_DECL(name, swift_name) \ - OS_SWIFT_NAME(swift_name) \ - OS_OBJECT_SHOW_CLASS(name, OS_OBJECT_CLASS(object)) - -#if OS_OBJECT_USE_OBJC -#define OS_WORKGROUP_SUBCLASS_DECL_PROTO(name, swift_name, ...) \ - OS_SWIFT_NAME(swift_name) \ - OS_OBJECT_DECL_PROTOCOL(name ## __VA_ARGS__ ) -#else -#define OS_WORKGROUP_SUBCLASS_DECL_PROTO(name, swift_name, ...) -#endif - -#define OS_WORKGROUP_SUBCLASS_DECL(name, super, swift_name, ...) \ - OS_SWIFT_NAME(swift_name) \ - OS_OBJECT_SHOW_SUBCLASS(name, super, name, ## __VA_ARGS__) - -#if defined(__LP64__) -#define __OS_WORKGROUP_ATTR_SIZE__ 60 -#define __OS_WORKGROUP_INTERVAL_DATA_SIZE__ 56 -#define __OS_WORKGROUP_JOIN_TOKEN_SIZE__ 36 -#else -#define __OS_WORKGROUP_ATTR_SIZE__ 60 -#define __OS_WORKGROUP_INTERVAL_DATA_SIZE__ 56 -#define __OS_WORKGROUP_JOIN_TOKEN_SIZE__ 28 -#endif - -#define _OS_WORKGROUP_ATTR_SIG_DEFAULT_INIT 0x2FA863B4 -#define _OS_WORKGROUP_ATTR_SIG_EMPTY_INIT 0x2FA863C4 - -struct OS_REFINED_FOR_SWIFT os_workgroup_attr_opaque_s { - uint32_t sig; - char opaque[__OS_WORKGROUP_ATTR_SIZE__]; -}; - -#define _OS_WORKGROUP_INTERVAL_DATA_SIG_INIT 0x52A74C4D -struct OS_REFINED_FOR_SWIFT os_workgroup_interval_data_opaque_s { - uint32_t sig; - char opaque[__OS_WORKGROUP_INTERVAL_DATA_SIZE__]; -}; - -struct OS_REFINED_FOR_SWIFT os_workgroup_join_token_opaque_s { - uint32_t sig; - char opaque[__OS_WORKGROUP_JOIN_TOKEN_SIZE__]; -}; - -#endif /* __OS_WORKGROUP_BASE__ */ diff --git a/lib/libc/include/x86_64-macos-gnu/os/workgroup_interval.h b/lib/libc/include/x86_64-macos-gnu/os/workgroup_interval.h deleted file mode 100644 index 8594aed529..0000000000 --- a/lib/libc/include/x86_64-macos-gnu/os/workgroup_interval.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2020 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -#ifndef __OS_WORKGROUP_INTERVAL__ -#define __OS_WORKGROUP_INTERVAL__ - -#ifndef __OS_WORKGROUP_INDIRECT__ -#error "Please #include instead of this file directly." -#include // For header doc -#endif - -__BEGIN_DECLS - -OS_WORKGROUP_ASSUME_NONNULL_BEGIN - -/*! - * @typedef os_workgroup_interval_t - * - * @abstract - * A subclass of an os_workgroup_t for tracking work performed as part of - * a repeating interval-driven workload. - */ -OS_WORKGROUP_SUBCLASS_DECL_PROTO(os_workgroup_interval, Repeatable); -OS_WORKGROUP_SUBCLASS_DECL(os_workgroup_interval, os_workgroup, WorkGroupInterval); - -/* During the first instance of this API, the only supported interval - * workgroups are for audio workloads. Please refer to the AudioToolbox - * framework for more information. - */ - -/* - * @typedef os_workgroup_interval_data, os_workgroup_interval_data_t - * - * @abstract - * An opaque structure containing additional configuration for the workgroup - * interval. - */ -typedef struct os_workgroup_interval_data_opaque_s os_workgroup_interval_data_s; -typedef struct os_workgroup_interval_data_opaque_s *os_workgroup_interval_data_t; -#define OS_WORKGROUP_INTERVAL_DATA_INITIALIZER \ - { .sig = _OS_WORKGROUP_INTERVAL_DATA_SIG_INIT } - -/*! - * @function os_workgroup_interval_start - * - * @abstract - * Indicates to the system that the member threads of this - * os_workgroup_interval_t have begun working on an instance of the repeatable - * interval workload with the specified timestamps. This function is real time - * safe. - * - * This function will set and return an errno in the following cases: - * - * - The current thread is not a member of the os_workgroup_interval_t - * - The os_workgroup_interval_t has been cancelled - * - The timestamps passed in are malformed - * - os_workgroup_interval_start() was previously called on the - * os_workgroup_interval_t without an intervening os_workgroup_interval_finish() - * - A concurrent workgroup interval configuration operation is taking place. - * - * @param start - * Start timestamp specified in the os_clockid_t with which the - * os_workgroup_interval_t was created. This is generally a time in the past and - * indicates when the workgroup started working on an interval period - * - * @param deadline - * Deadline timestamp specified in the os_clockid_t with which the - * os_workgroup_interval_t was created. This specifies the deadline which the - * interval period would like to meet. - * - * @param data - * This field is currently unused and should be NULL - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT -int -os_workgroup_interval_start(os_workgroup_interval_t wg, uint64_t start, uint64_t - deadline, os_workgroup_interval_data_t _Nullable data); - -/*! - * @function os_workgroup_interval_update - * - * @abstract - * Updates an already started interval workgroup to have the new - * deadline specified. This function is real time safe. - * - * This function will return an error in the following cases: - * - The current thread is not a member of the os_workgroup_interval_t - * - The os_workgroup_interval_t has been cancelled - * - The timestamp passed in is malformed - * - os_workgroup_interval_start() was not previously called on the - * os_workgroup_interval_t or was already matched with an - * os_workgroup_interval_finish() - * - A concurrent workgroup interval configuration operation is taking place - * - * @param deadline - * Timestamp specified in the os_clockid_t with - * which the os_workgroup_interval_t was created. - * - * @param data - * This field is currently unused and should be NULL - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT -int -os_workgroup_interval_update(os_workgroup_interval_t wg, uint64_t deadline, - os_workgroup_interval_data_t _Nullable data); - -/*! - * @function os_workgroup_interval_finish - * - * @abstract - * Indicates to the system that the member threads of - * this os_workgroup_interval_t have finished working on the current instance - * of the interval workload. This function is real time safe. - * - * This function will return an error in the following cases: - * - The current thread is not a member of the os_workgroup_interval_t - * - os_workgroup_interval_start() was not previously called on the - * os_workgroup_interval_t or was already matched with an - * os_workgroup_interval_finish() - * - A concurrent workgroup interval configuration operation is taking place. - * - * @param data - * This field is currently unused and should be NULL - * - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT -int -os_workgroup_interval_finish(os_workgroup_interval_t wg, - os_workgroup_interval_data_t _Nullable data); - -OS_WORKGROUP_ASSUME_NONNULL_END - -__END_DECLS - -#endif /* __OS_WORKGROUP_INTERVAL__ */ diff --git a/lib/libc/include/x86_64-macos-gnu/os/workgroup_object.h b/lib/libc/include/x86_64-macos-gnu/os/workgroup_object.h deleted file mode 100644 index 984d3e2e80..0000000000 --- a/lib/libc/include/x86_64-macos-gnu/os/workgroup_object.h +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright (c) 2020 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -#ifndef __OS_WORKGROUP_OBJECT__ -#define __OS_WORKGROUP_OBJECT__ - -#ifndef __OS_WORKGROUP_INDIRECT__ -#error "Please #include instead of this file directly." -#include // For header doc -#endif - -__BEGIN_DECLS - -OS_WORKGROUP_ASSUME_NONNULL_BEGIN - -/*! - * @typedef os_workgroup_t - * - * @abstract - * A reference counted os object representing a workload that needs to - * be distinctly recognized and tracked by the system. The workgroup - * tracks a collection of threads all working cooperatively. An os_workgroup - * object - when not an instance of a specific os_workgroup_t subclass - - * represents a generic workload and makes no assumptions about the kind of - * work done. - * - * @discussion - * Threads can explicitly join an os_workgroup_t to mark themselves as - * participants in the workload. - */ -OS_WORKGROUP_DECL(os_workgroup, WorkGroup); - - -/* Attribute creation and specification */ - -/*! - * @typedef os_workgroup_attr_t - * - * @abstract - * Pointer to an opaque structure for describing attributes that can be - * configured on a workgroup at creation. - */ -typedef struct os_workgroup_attr_opaque_s os_workgroup_attr_s; -typedef struct os_workgroup_attr_opaque_s *os_workgroup_attr_t; - -/* os_workgroup_t attributes need to be initialized before use. This initializer - * allows you to create a workgroup with the system default attributes. */ -#define OS_WORKGROUP_ATTR_INITIALIZER_DEFAULT \ - { .sig = _OS_WORKGROUP_ATTR_SIG_DEFAULT_INIT } - - - -/* The main use of the workgroup API is through instantiations of the concrete - * subclasses - please refer to os/workgroup_interval.h and - * os/workgroup_parallel.h for more information on creating workgroups. - * - * The functions below operate on all subclasses of os_workgroup_t. - */ - -/*! - * @function os_workgroup_copy_port - * - * @abstract - * Returns a reference to a send right representing this workgroup that is to be - * sent to other processes. This port is to be passed to - * os_workgroup_create_with_port() to create a workgroup object. - * - * It is the client's responsibility to release the send right reference. - * - * If an error is encountered, errno is set and returned. - */ -API_AVAILABLE(macos(11.0)) -API_UNAVAILABLE(ios, tvos, watchos) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT -int -os_workgroup_copy_port(os_workgroup_t wg, mach_port_t *mach_port_out); - -/*! - * @function os_workgroup_create_with_port - * - * @abstract - * Create an os_workgroup_t object from a send right returned by a previous - * call to os_workgroup_copy_port, potentially in a different process. - * - * A newly created os_workgroup_t has no initial member threads - in particular - * the creating thread does not join the os_workgroup_t implicitly. - * - * @param name - * A client specified string for labelling the workgroup. This parameter is - * optional and can be NULL. - * - * @param mach_port - * The send right to create the workgroup from. No reference is consumed - * on the specified send right. - */ -API_AVAILABLE(macos(11.0)) -API_UNAVAILABLE(ios, tvos, watchos) -OS_SWIFT_NAME(WorkGroup.init(__name:port:)) OS_WORKGROUP_EXPORT OS_WORKGROUP_RETURNS_RETAINED -os_workgroup_t _Nullable -os_workgroup_create_with_port(const char *_Nullable name, mach_port_t mach_port); - -/*! - * @function os_workgroup_create_with_workgroup - * - * @abstract - * Create a new os_workgroup object from an existing os_workgroup. - * - * The newly created os_workgroup has no initial member threads - in particular - * the creating threaad does not join the os_workgroup_t implicitly. - * - * @param name - * A client specified string for labelling the workgroup. This parameter is - * optional and can be NULL. - * - * @param wg - * The existing workgroup to create a new workgroup object from. - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_RETURNS_RETAINED -os_workgroup_t _Nullable -os_workgroup_create_with_workgroup(const char * _Nullable name, os_workgroup_t wg); - -/*! - * @typedef os_workgroup_join_token, os_workgroup_join_token_t - * - * @abstract - * An opaque join token which the client needs to pass to os_workgroup_join - * and os_workgroup_leave - */ -OS_REFINED_FOR_SWIFT -typedef struct os_workgroup_join_token_opaque_s os_workgroup_join_token_s; -OS_REFINED_FOR_SWIFT -typedef struct os_workgroup_join_token_opaque_s *os_workgroup_join_token_t; - - -/*! - * @function os_workgroup_join - * - * @abstract - * Joins the current thread to the specified workgroup and populates the join - * token that has been passed in. This API is real-time safe. - * - * @param wg - * The workgroup that the current thread would like to join - * - * @param token_out - * Pointer to a client allocated struct which the function will populate - * with the join token. This token must be passed in by the thread when it calls - * os_workgroup_leave(). - * - * Errors will be returned in the following cases: - * - * EALREADY The thread is already part of a workgroup that the specified - * workgroup does not nest with - * EINVAL The workgroup has been cancelled - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT -int -os_workgroup_join(os_workgroup_t wg, os_workgroup_join_token_t token_out); - -/*! - * @function os_workgroup_leave - * - * @abstract - * This removes the current thread from a workgroup it has previously - * joined. Threads must leave all workgroups in the reverse order that they - * have joined them. Failing to do so before exiting will result in undefined - * behavior. - * - * If the join token is malformed, the process will be aborted. - * - * This API is real time safe. - * - * @param wg - * The workgroup that the current thread would like to leave. - * - * @param token - * This is the join token populated by the most recent call to - * os_workgroup_join(). - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT -void -os_workgroup_leave(os_workgroup_t wg, os_workgroup_join_token_t token); - -/* Working Arena index of a thread in a workgroup */ -typedef uint32_t os_workgroup_index; -/* Destructor for Working Arena */ -typedef void (*os_workgroup_working_arena_destructor_t)(void * _Nullable); - -/*! - * @function os_workgroup_set_working_arena - * - * @abstract - * Associates a client defined working arena with the workgroup. The arena - * is local to the workgroup object in the process. This is intended for - * distributing a manually managed memory allocation between member threads - * of the workgroup. - * - * This function can be called multiple times and the client specified - * destructor will be called on the previously assigned arena, if any. This - * function can only be called when no threads have currently joined the - * workgroup and all workloops associated with the workgroup are idle. - * - * @param wg - * The workgroup to associate the working arena with - * - * @param arena - * The client managed arena to associate with the workgroup. This value can - * be NULL. - * - * @param max_workers - * The maximum number of threads that will ever query the workgroup for the - * arena and request an index into it. If the arena is not used to partition - * work amongst member threads, then this field can be 0. - * - * @param destructor - * A destructor to call on the previously assigned working arena, if any - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT OS_WORKGROUP_WARN_RESULT -int -os_workgroup_set_working_arena(os_workgroup_t wg, void * _Nullable arena, - uint32_t max_workers, os_workgroup_working_arena_destructor_t destructor); - -/*! - * @function os_workgroup_get_working_arena - * - * @abstract - * Returns the working arena associated with the workgroup and the current - * thread's index in the workgroup. This function can only be called by a member - * of the workgroup. Multiple calls to this API by a member thread will return - * the same arena and index until the thread leaves the workgroup. - * - * For workloops with an associated workgroup, every work item on the workloop - * will receive the same index in the arena. - * - * This method returns NULL if no arena is set on the workgroup. The index - * returned by this function is zero-based and is namespaced per workgroup - * object in the process. The indices provided are strictly monotonic and never - * reused until a future call to os_workgroup_set_working_arena. - * - * @param wg - * The workgroup to get the working arena from. - * - * @param index_out - * A pointer to a os_workgroup_index which will be populated by the caller's - * index in the workgroup. - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT -void * _Nullable -os_workgroup_get_working_arena(os_workgroup_t wg, - os_workgroup_index * _Nullable index_out); - -/*! - * @function os_workgroup_cancel - * - * @abstract - * This API invalidates a workgroup and indicates to the system that the - * workload is no longer relevant to the caller. - * - * No new work should be initiated for a cancelled workgroup and - * work that is already underway should periodically check for - * cancellation with os_workgroup_testcancel and initiate cleanup if needed. - * - * Threads currently in the workgroup continue to be tracked together but no - * new threads may join this workgroup - the only possible operation allowed is - * to leave the workgroup. Other actions may have undefined behavior or - * otherwise fail. - * - * This API is idempotent. Cancellation is local to the workgroup object - * it is called on and does not affect other workgroups. - * - * @param wg - * The workgroup that that the thread would like to cancel - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT -void -os_workgroup_cancel(os_workgroup_t wg); - -/*! - * @function os_workgroup_testcancel - * - * @abstract - * Returns true if the workgroup object has been cancelled. See also - * os_workgroup_cancel - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT -bool -os_workgroup_testcancel(os_workgroup_t wg); - -/*! - * @typedef os_workgroup_max_parallel_threads_attr_t - * - * @abstract - * A pointer to a structure describing the set of properties of a workgroup to - * override with the explicitly specified values in the structure. - * - * See also os_workgroup_max_parallel_threads. - */ -OS_REFINED_FOR_SWIFT -typedef struct os_workgroup_max_parallel_threads_attr_s os_workgroup_mpt_attr_s; -OS_REFINED_FOR_SWIFT -typedef struct os_workgroup_max_parallel_threads_attr_s *os_workgroup_mpt_attr_t; - -/*! - * @function os_workgroup_max_parallel_threads - * - * @abstract - * Returns the system's recommendation for maximum number of threads the client - * should make for a multi-threaded workload in a given workgroup. - * - * This API takes into consideration the current hardware the code is running on - * and the attributes of the workgroup. It does not take into consideration the - * current load of the system and therefore always provides the most optimal - * recommendation for the workload. - * - * @param wg - * The workgroup in which the multi-threaded workload will be performed in. The - * threads performing the multi-threaded workload are expected to join this - * workgroup. - * - * @param attr - * This value is currently unused and should be NULL. - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_REFINED_FOR_SWIFT OS_WORKGROUP_EXPORT -int -os_workgroup_max_parallel_threads(os_workgroup_t wg, os_workgroup_mpt_attr_t - _Nullable attr); - -OS_WORKGROUP_ASSUME_NONNULL_END - -__END_DECLS - -#endif /* __OS_WORKGROUP_OBJECT__ */ diff --git a/lib/libc/include/x86_64-macos-gnu/os/workgroup_parallel.h b/lib/libc/include/x86_64-macos-gnu/os/workgroup_parallel.h deleted file mode 100644 index 48d232e47a..0000000000 --- a/lib/libc/include/x86_64-macos-gnu/os/workgroup_parallel.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2020 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -#ifndef __OS_WORKGROUP_PARALLEL__ -#define __OS_WORKGROUP_PARALLEL__ - -#ifndef __OS_WORKGROUP_INDIRECT__ -#error "Please #include instead of this file directly." -#include // For header doc -#endif - -#include - -__BEGIN_DECLS - -OS_WORKGROUP_ASSUME_NONNULL_BEGIN - -/*! - * @typedef os_workgroup_parallel_t - * - * @abstract - * A subclass of an os_workgroup_t for tracking parallel work. - */ -OS_WORKGROUP_SUBCLASS_DECL_PROTO(os_workgroup_parallel, Parallelizable); -OS_WORKGROUP_SUBCLASS_DECL(os_workgroup_parallel, os_workgroup, WorkGroupParallel); - -/*! - * @function os_workgroup_parallel_create - * - * @abstract - * Creates an os_workgroup_t which tracks a parallel workload. - * A newly created os_workgroup_interval_t has no initial member threads - - * in particular the creating thread does not join the os_workgroup_parallel_t - * implicitly. - * - * See also os_workgroup_max_parallel_threads(). - * - * @param name - * A client specified string for labelling the workgroup. This parameter is - * optional and can be NULL. - * - * @param attr - * The requested set of workgroup attributes. NULL is to be specified for the - * default set of attributes. - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -OS_WORKGROUP_EXPORT OS_WORKGROUP_RETURNS_RETAINED -OS_SWIFT_NAME(WorkGroupParallel.init(__name:attr:)) -os_workgroup_parallel_t _Nullable -os_workgroup_parallel_create(const char * _Nullable name, - os_workgroup_attr_t _Nullable attr); - -OS_WORKGROUP_ASSUME_NONNULL_END - -__END_DECLS - -#endif /* __OS_WORKGROUP_PARALLEL__ */ diff --git a/lib/libc/include/x86_64-macos-gnu/pthread.h b/lib/libc/include/x86_64-macos-gnu/pthread.h index c6490770be..a042c82aed 100644 --- a/lib/libc/include/x86_64-macos-gnu/pthread.h +++ b/lib/libc/include/x86_64-macos-gnu/pthread.h @@ -53,6 +53,9 @@ #define _PTHREAD_H #include <_types.h> +#ifndef __POSIX_LIB__ +#include +#endif #include #include #include @@ -556,33 +559,6 @@ int pthread_sigmask(int, const sigset_t * _Nullable, sigset_t * _Nullable) __API_AVAILABLE(macos(10.4), ios(2.0)) void pthread_yield_np(void); -__API_AVAILABLE(macos(11.0)) -__API_UNAVAILABLE(ios, tvos, watchos) -void pthread_jit_write_protect_np(int enabled); - -__API_AVAILABLE(macos(11.0)) -__API_UNAVAILABLE(ios, tvos, watchos) -int pthread_jit_write_protect_supported_np(void); - -/*! - * @function pthread_cpu_number_np - * - * @param cpu_number_out - * The CPU number that the thread was running on at the time of query. - * This cpu number is in the interval [0, ncpus) (from sysctlbyname("hw.ncpu")) - * - * @result - * This function returns 0 or the value of errno if an error occurred. - * - * @note - * Optimizations of per-CPU datastructures based on the result of this function - * still require synchronization since it is not guaranteed that the thread will - * still be on the same CPU by the time the function returns. - */ -__API_AVAILABLE(macos(11.0), ios(14.2), tvos(14.2), watchos(7.1)) -int -pthread_cpu_number_np(size_t *cpu_number_out); - #endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE || __cplusplus */ __END_DECLS #if __has_feature(assume_nonnull) diff --git a/lib/libc/include/x86_64-macos-gnu/pthread/sched.h b/lib/libc/include/x86_64-macos-gnu/pthread/sched.h index 2ef6e2b8ab..91efb4eae3 100644 --- a/lib/libc/include/x86_64-macos-gnu/pthread/sched.h +++ b/lib/libc/include/x86_64-macos-gnu/pthread/sched.h @@ -25,7 +25,7 @@ #define _SCHED_H_ #include -#include +#include __BEGIN_DECLS /* @@ -33,8 +33,6 @@ __BEGIN_DECLS */ #ifndef __POSIX_LIB__ struct sched_param { int sched_priority; char __opaque[__SCHED_PARAM_SIZE__]; }; -#else -struct sched_param; #endif extern int sched_yield(void); diff --git a/lib/libc/include/x86_64-macos-gnu/pthread_impl.h b/lib/libc/include/x86_64-macos-gnu/pthread_impl.h new file mode 100644 index 0000000000..35d32d3021 --- /dev/null +++ b/lib/libc/include/x86_64-macos-gnu/pthread_impl.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _PTHREAD_IMPL_H_ +#define _PTHREAD_IMPL_H_ +/* + * Internal implementation details + */ + +/* This whole header file will disappear, so don't depend on it... */ + +#if __has_feature(assume_nonnull) +_Pragma("clang assume_nonnull begin") +#endif + +#ifndef __POSIX_LIB__ + +/* + * [Internal] data structure signatures + */ +#define _PTHREAD_MUTEX_SIG_init 0x32AAABA7 + +#define _PTHREAD_ERRORCHECK_MUTEX_SIG_init 0x32AAABA1 +#define _PTHREAD_RECURSIVE_MUTEX_SIG_init 0x32AAABA2 +#define _PTHREAD_FIRSTFIT_MUTEX_SIG_init 0x32AAABA3 + +#define _PTHREAD_COND_SIG_init 0x3CB0B1BB +#define _PTHREAD_ONCE_SIG_init 0x30B1BCBA +#define _PTHREAD_RWLOCK_SIG_init 0x2DA8B3B4 + +/* + * POSIX scheduling policies + */ +#define SCHED_OTHER 1 +#define SCHED_FIFO 4 +#define SCHED_RR 2 + +#define __SCHED_PARAM_SIZE__ 4 + +#endif /* __POSIX_LIB__ */ + +#if __has_feature(assume_nonnull) +_Pragma("clang assume_nonnull end") +#endif + +#endif /* _PTHREAD_IMPL_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/sched.h b/lib/libc/include/x86_64-macos-gnu/sched.h index 2ef6e2b8ab..91efb4eae3 100644 --- a/lib/libc/include/x86_64-macos-gnu/sched.h +++ b/lib/libc/include/x86_64-macos-gnu/sched.h @@ -25,7 +25,7 @@ #define _SCHED_H_ #include -#include +#include __BEGIN_DECLS /* @@ -33,8 +33,6 @@ __BEGIN_DECLS */ #ifndef __POSIX_LIB__ struct sched_param { int sched_priority; char __opaque[__SCHED_PARAM_SIZE__]; }; -#else -struct sched_param; #endif extern int sched_yield(void); diff --git a/lib/libc/include/x86_64-macos-gnu/signal.h b/lib/libc/include/x86_64-macos-gnu/signal.h index 8727cefdba..94c4c1bb4d 100644 --- a/lib/libc/include/x86_64-macos-gnu/signal.h +++ b/lib/libc/include/x86_64-macos-gnu/signal.h @@ -108,11 +108,16 @@ int sigvec(int, struct sigvec *, struct sigvec *); __END_DECLS /* List definitions after function declarations, or Reiser cpp gets upset. */ +#if defined(__i386__) || defined(__x86_64__) +/* The left shift operator on intel is modulo 32 */ __header_always_inline int __sigbits(int __signo) { return __signo > __DARWIN_NSIG ? 0 : (1 << (__signo - 1)); } +#else /* !__i386__ && !__x86_64__ */ +#define __sigbits(signo) (1 << ((signo) - 1)) +#endif /* __i386__ || __x86_64__ */ #define sigaddset(set, signo) (*(set) |= __sigbits(signo), 0) #define sigdelset(set, signo) (*(set) &= ~__sigbits(signo), 0) diff --git a/lib/libc/include/x86_64-macos-gnu/simd/common.h b/lib/libc/include/x86_64-macos-gnu/simd/common.h index c23c323590..059e852e37 100644 --- a/lib/libc/include/x86_64-macos-gnu/simd/common.h +++ b/lib/libc/include/x86_64-macos-gnu/simd/common.h @@ -1977,7 +1977,7 @@ static inline SIMD_CFUNC simd_char16 simd_abs(simd_char16 x) { #if defined __arm__ || defined __arm64__ return vabsq_s8(x); #elif defined __SSE4_1__ - return (simd_char16) _mm_abs_epi8((__m128i)x); + return _mm_abs_epi8(x); #else simd_char16 mask = x >> 7; return (x ^ mask) - mask; #endif @@ -2019,7 +2019,7 @@ static inline SIMD_CFUNC simd_short8 simd_abs(simd_short8 x) { #if defined __arm__ || defined __arm64__ return vabsq_s16(x); #elif defined __SSE4_1__ - return (simd_short8) _mm_abs_epi16((__m128i)x); + return _mm_abs_epi16(x); #else simd_short8 mask = x >> 15; return (x ^ mask) - mask; #endif @@ -2057,7 +2057,7 @@ static inline SIMD_CFUNC simd_int4 simd_abs(simd_int4 x) { #if defined __arm__ || defined __arm64__ return vabsq_s32(x); #elif defined __SSE4_1__ - return (simd_int4) _mm_abs_epi32((__m128i)x); + return _mm_abs_epi32(x); #else simd_int4 mask = x >> 31; return (x ^ mask) - mask; #endif @@ -2103,7 +2103,7 @@ static inline SIMD_CFUNC simd_long2 simd_abs(simd_long2 x) { #if defined __arm64__ return vabsq_s64(x); #elif defined __SSE4_1__ - return (simd_long2) _mm_abs_epi64((__m128i)x); + return _mm_abs_epi64(x); #else simd_long2 mask = x >> 63; return (x ^ mask) - mask; #endif @@ -2170,7 +2170,7 @@ static inline SIMD_CFUNC simd_char16 simd_min(simd_char16 x, simd_char16 y) { #if defined __arm__ || defined __arm64__ return vminq_s8(x, y); #elif defined __SSE4_1__ - return (simd_char16) _mm_min_epi8((__m128i)x, (__m128i)y); + return _mm_min_epi8(x, y); #else return simd_bitselect(x, y, y < x); #endif @@ -2217,7 +2217,7 @@ static inline SIMD_CFUNC simd_uchar16 simd_min(simd_uchar16 x, simd_uchar16 y) { #if defined __arm__ || defined __arm64__ return vminq_u8(x, y); #elif defined __SSE4_1__ - return (simd_uchar16) _mm_min_epu8((__m128i)x, (__m128i)y); + return _mm_min_epu8(x, y); #else return simd_bitselect(x, y, y < x); #endif @@ -2260,7 +2260,7 @@ static inline SIMD_CFUNC simd_short8 simd_min(simd_short8 x, simd_short8 y) { #if defined __arm__ || defined __arm64__ return vminq_s16(x, y); #elif defined __SSE4_1__ - return (simd_short8) _mm_min_epi16((__m128i)x, (__m128i)y); + return _mm_min_epi16(x, y); #else return simd_bitselect(x, y, y < x); #endif @@ -2303,7 +2303,7 @@ static inline SIMD_CFUNC simd_ushort8 simd_min(simd_ushort8 x, simd_ushort8 y) { #if defined __arm__ || defined __arm64__ return vminq_u16(x, y); #elif defined __SSE4_1__ - return (simd_ushort8) _mm_min_epu16((__m128i)x, (__m128i)y); + return _mm_min_epu16(x, y); #else return simd_bitselect(x, y, y < x); #endif @@ -2342,7 +2342,7 @@ static inline SIMD_CFUNC simd_int4 simd_min(simd_int4 x, simd_int4 y) { #if defined __arm__ || defined __arm64__ return vminq_s32(x, y); #elif defined __SSE4_1__ - return (simd_int4) _mm_min_epi32((__m128i)x, (__m128i)y); + return _mm_min_epi32(x, y); #else return simd_bitselect(x, y, y < x); #endif @@ -2381,7 +2381,7 @@ static inline SIMD_CFUNC simd_uint4 simd_min(simd_uint4 x, simd_uint4 y) { #if defined __arm__ || defined __arm64__ return vminq_u32(x, y); #elif defined __SSE4_1__ - return (simd_uint4) _mm_min_epu32((__m128i)x, (__m128i)y); + return _mm_min_epu32(x, y); #else return simd_bitselect(x, y, y < x); #endif @@ -2528,7 +2528,7 @@ static inline SIMD_CFUNC simd_char16 simd_max(simd_char16 x, simd_char16 y) { #if defined __arm__ || defined __arm64__ return vmaxq_s8(x, y); #elif defined __SSE4_1__ - return (simd_char16) _mm_max_epi8((__m128i)x, (__m128i)y); + return _mm_max_epi8(x, y); #else return simd_bitselect(x, y, x < y); #endif @@ -2575,7 +2575,7 @@ static inline SIMD_CFUNC simd_uchar16 simd_max(simd_uchar16 x, simd_uchar16 y) { #if defined __arm__ || defined __arm64__ return vmaxq_u8(x, y); #elif defined __SSE4_1__ - return (simd_uchar16) _mm_max_epu8((__m128i)x, (__m128i)y); + return _mm_max_epu8(x, y); #else return simd_bitselect(x, y, x < y); #endif @@ -2618,7 +2618,7 @@ static inline SIMD_CFUNC simd_short8 simd_max(simd_short8 x, simd_short8 y) { #if defined __arm__ || defined __arm64__ return vmaxq_s16(x, y); #elif defined __SSE4_1__ - return (simd_short8) _mm_max_epi16((__m128i)x, (__m128i)y); + return _mm_max_epi16(x, y); #else return simd_bitselect(x, y, x < y); #endif @@ -2661,7 +2661,7 @@ static inline SIMD_CFUNC simd_ushort8 simd_max(simd_ushort8 x, simd_ushort8 y) { #if defined __arm__ || defined __arm64__ return vmaxq_u16(x, y); #elif defined __SSE4_1__ - return (simd_ushort8) _mm_max_epu16((__m128i)x, (__m128i)y); + return _mm_max_epu16(x, y); #else return simd_bitselect(x, y, x < y); #endif @@ -2700,7 +2700,7 @@ static inline SIMD_CFUNC simd_int4 simd_max(simd_int4 x, simd_int4 y) { #if defined __arm__ || defined __arm64__ return vmaxq_s32(x, y); #elif defined __SSE4_1__ - return (simd_int4) _mm_max_epi32((__m128i)x, (__m128i)y); + return _mm_max_epi32(x, y); #else return simd_bitselect(x, y, x < y); #endif @@ -2739,7 +2739,7 @@ static inline SIMD_CFUNC simd_uint4 simd_max(simd_uint4 x, simd_uint4 y) { #if defined __arm__ || defined __arm64__ return vmaxq_u32(x, y); #elif defined __SSE4_1__ - return (simd_uint4) _mm_max_epu32((__m128i)x, (__m128i)y); + return _mm_max_epu32(x, y); #else return simd_bitselect(x, y, x < y); #endif @@ -3083,7 +3083,7 @@ static inline SIMD_CFUNC simd_double8 simd_clamp(simd_double8 x, simd_double8 mi static inline SIMD_CFUNC float simd_sign(float x) { - return (x == 0 | x != x) ? 0 : copysign(1,x); + return x == 0 | x != x ? 0 : copysign(1,x); } static inline SIMD_CFUNC simd_float2 simd_sign(simd_float2 x) { @@ -3107,7 +3107,7 @@ static inline SIMD_CFUNC simd_float16 simd_sign(simd_float16 x) { } static inline SIMD_CFUNC double simd_sign(double x) { - return (x == 0 | x != x) ? 0 : copysign(1,x); + return x == 0 | x != x ? 0 : copysign(1,x); } static inline SIMD_CFUNC simd_double2 simd_sign(simd_double2 x) { diff --git a/lib/libc/include/x86_64-macos-gnu/simd/conversion.h b/lib/libc/include/x86_64-macos-gnu/simd/conversion.h index b4d2c20552..184358e258 100644 --- a/lib/libc/include/x86_64-macos-gnu/simd/conversion.h +++ b/lib/libc/include/x86_64-macos-gnu/simd/conversion.h @@ -559,11 +559,6 @@ static simd_int2 SIMD_CFUNC simd_int_sat(simd_ulong2 __x); static simd_int3 SIMD_CFUNC simd_int_sat(simd_ulong3 __x); static simd_int4 SIMD_CFUNC simd_int_sat(simd_ulong4 __x); static simd_int8 SIMD_CFUNC simd_int_sat(simd_ulong8 __x); -static simd_int2 SIMD_CFUNC simd_int_rte(simd_float2 __x); -static simd_int3 SIMD_CFUNC simd_int_rte(simd_float3 __x); -static simd_int4 SIMD_CFUNC simd_int_rte(simd_float4 __x); -static simd_int8 SIMD_CFUNC simd_int_rte(simd_float8 __x); -static simd_int16 SIMD_CFUNC simd_int_rte(simd_float16 __x); #define vector_int simd_int #define vector_int_sat simd_int_sat @@ -793,10 +788,6 @@ static simd_long2 SIMD_CFUNC simd_long_sat(simd_ulong2 __x); static simd_long3 SIMD_CFUNC simd_long_sat(simd_ulong3 __x); static simd_long4 SIMD_CFUNC simd_long_sat(simd_ulong4 __x); static simd_long8 SIMD_CFUNC simd_long_sat(simd_ulong8 __x); -static simd_long2 SIMD_CFUNC simd_long_rte(simd_double2 __x); -static simd_long3 SIMD_CFUNC simd_long_rte(simd_double3 __x); -static simd_long4 SIMD_CFUNC simd_long_rte(simd_double4 __x); -static simd_long8 SIMD_CFUNC simd_long_rte(simd_double8 __x); #define vector_long simd_long #define vector_long_sat simd_long_sat @@ -1120,7 +1111,6 @@ static simd_char2 SIMD_CFUNC simd_char_sat(simd_ulong2 __x) { return simd_cha static simd_char3 SIMD_CFUNC simd_char_sat(simd_ulong3 __x) { return simd_char(simd_min(__x,0x7f)); } static simd_char4 SIMD_CFUNC simd_char_sat(simd_ulong4 __x) { return simd_char(simd_min(__x,0x7f)); } static simd_char8 SIMD_CFUNC simd_char_sat(simd_ulong8 __x) { return simd_char(simd_min(__x,0x7f)); } - static simd_uchar2 SIMD_CFUNC simd_uchar(simd_char2 __x) { return (simd_uchar2)__x; } static simd_uchar3 SIMD_CFUNC simd_uchar(simd_char3 __x) { return (simd_uchar3)__x; } @@ -1225,7 +1215,6 @@ static simd_uchar2 SIMD_CFUNC simd_uchar_sat(simd_ulong2 __x) { return simd_u static simd_uchar3 SIMD_CFUNC simd_uchar_sat(simd_ulong3 __x) { return simd_uchar(simd_min(__x,0xff)); } static simd_uchar4 SIMD_CFUNC simd_uchar_sat(simd_ulong4 __x) { return simd_uchar(simd_min(__x,0xff)); } static simd_uchar8 SIMD_CFUNC simd_uchar_sat(simd_ulong8 __x) { return simd_uchar(simd_min(__x,0xff)); } - static simd_short2 SIMD_CFUNC simd_short(simd_char2 __x) { return __builtin_convertvector(__x, simd_short2); } static simd_short3 SIMD_CFUNC simd_short(simd_char3 __x) { return __builtin_convertvector(__x, simd_short3); } @@ -1330,7 +1319,6 @@ static simd_short2 SIMD_CFUNC simd_short_sat(simd_ulong2 __x) { return simd_s static simd_short3 SIMD_CFUNC simd_short_sat(simd_ulong3 __x) { return simd_short(simd_min(__x,0x7fff)); } static simd_short4 SIMD_CFUNC simd_short_sat(simd_ulong4 __x) { return simd_short(simd_min(__x,0x7fff)); } static simd_short8 SIMD_CFUNC simd_short_sat(simd_ulong8 __x) { return simd_short(simd_min(__x,0x7fff)); } - static simd_ushort2 SIMD_CFUNC simd_ushort(simd_char2 __x) { return simd_ushort(simd_short(__x)); } static simd_ushort3 SIMD_CFUNC simd_ushort(simd_char3 __x) { return simd_ushort(simd_short(__x)); } @@ -1435,7 +1423,6 @@ static simd_ushort2 SIMD_CFUNC simd_ushort_sat(simd_ulong2 __x) { return simd static simd_ushort3 SIMD_CFUNC simd_ushort_sat(simd_ulong3 __x) { return simd_ushort(simd_min(__x, 0xffff)); } static simd_ushort4 SIMD_CFUNC simd_ushort_sat(simd_ulong4 __x) { return simd_ushort(simd_min(__x, 0xffff)); } static simd_ushort8 SIMD_CFUNC simd_ushort_sat(simd_ulong8 __x) { return simd_ushort(simd_min(__x, 0xffff)); } - static simd_int2 SIMD_CFUNC simd_int(simd_char2 __x) { return __builtin_convertvector(__x, simd_int2); } static simd_int3 SIMD_CFUNC simd_int(simd_char3 __x) { return __builtin_convertvector(__x, simd_int3); } @@ -1532,46 +1519,6 @@ static simd_int2 SIMD_CFUNC simd_int_sat(simd_ulong2 __x) { return simd_int(s static simd_int3 SIMD_CFUNC simd_int_sat(simd_ulong3 __x) { return simd_int(simd_min(__x,0x7fffffff)); } static simd_int4 SIMD_CFUNC simd_int_sat(simd_ulong4 __x) { return simd_int(simd_min(__x,0x7fffffff)); } static simd_int8 SIMD_CFUNC simd_int_sat(simd_ulong8 __x) { return simd_int(simd_min(__x,0x7fffffff)); } - -static simd_int2 SIMD_CFUNC simd_int_rte(simd_float2 __x) { -#if defined __arm64__ - return vcvtn_s32_f32(__x); -#else - return simd_make_int2(simd_int_rte(simd_make_float4_undef(__x))); -#endif -} - -static simd_int3 SIMD_CFUNC simd_int_rte(simd_float3 __x) { - return simd_make_int3(simd_int_rte(simd_make_float4_undef(__x))); -} - -static simd_int4 SIMD_CFUNC simd_int_rte(simd_float4 __x) { -#if defined __SSE2__ - return _mm_cvtps_epi32(__x); -#elif defined __arm64__ - return vcvtnq_s32_f32(__x); -#else - simd_float4 magic = __tg_copysign(0x1.0p23, __x); - simd_int4 x_is_small = __tg_fabs(__x) < 0x1.0p23; - return __builtin_convertvector(simd_bitselect(__x, (__x + magic) - magic, x_is_small & 0x7fffffff), simd_int4); -#endif -} - -static simd_int8 SIMD_CFUNC simd_int_rte(simd_float8 __x) { -#if defined __AVX__ - return _mm256_cvtps_epi32(__x); -#else - return simd_make_int8(simd_int_rte(__x.lo), simd_int_rte(__x.hi)); -#endif -} - -static simd_int16 SIMD_CFUNC simd_int_rte(simd_float16 __x) { -#if defined __AVX512F__ - return _mm512_cvt_roundps_epi32(__x, _MM_FROUND_RINT); -#else - return simd_make_int16(simd_int_rte(__x.lo), simd_int_rte(__x.hi)); -#endif -} static simd_uint2 SIMD_CFUNC simd_uint(simd_char2 __x) { return simd_uint(simd_int(__x)); } static simd_uint3 SIMD_CFUNC simd_uint(simd_char3 __x) { return simd_uint(simd_int(__x)); } @@ -1668,7 +1615,6 @@ static simd_uint2 SIMD_CFUNC simd_uint_sat(simd_ulong2 __x) { return simd_uin static simd_uint3 SIMD_CFUNC simd_uint_sat(simd_ulong3 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } static simd_uint4 SIMD_CFUNC simd_uint_sat(simd_ulong4 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } static simd_uint8 SIMD_CFUNC simd_uint_sat(simd_ulong8 __x) { return simd_uint(simd_clamp(__x,0,0xffffffff)); } - static simd_float2 SIMD_CFUNC simd_float(simd_char2 __x) { return (simd_float2)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } static simd_float3 SIMD_CFUNC simd_float(simd_char3 __x) { return (simd_float3)(simd_int(__x) + 0x4b400000) - 0x1.8p23f; } @@ -1717,7 +1663,6 @@ static simd_float2 SIMD_CFUNC simd_float(simd_double2 __x) { return __builtin_ static simd_float3 SIMD_CFUNC simd_float(simd_double3 __x) { return __builtin_convertvector(__x,simd_float3); } static simd_float4 SIMD_CFUNC simd_float(simd_double4 __x) { return __builtin_convertvector(__x,simd_float4); } static simd_float8 SIMD_CFUNC simd_float(simd_double8 __x) { return __builtin_convertvector(__x,simd_float8); } - static simd_long2 SIMD_CFUNC simd_long(simd_char2 __x) { return __builtin_convertvector(__x,simd_long2); } static simd_long3 SIMD_CFUNC simd_long(simd_char3 __x) { return __builtin_convertvector(__x,simd_long3); } @@ -1800,39 +1745,6 @@ static simd_long2 SIMD_CFUNC simd_long_sat(simd_ulong2 __x) { return simd_lon static simd_long3 SIMD_CFUNC simd_long_sat(simd_ulong3 __x) { return simd_long(simd_min(__x,0x7fffffffffffffff)); } static simd_long4 SIMD_CFUNC simd_long_sat(simd_ulong4 __x) { return simd_long(simd_min(__x,0x7fffffffffffffff)); } static simd_long8 SIMD_CFUNC simd_long_sat(simd_ulong8 __x) { return simd_long(simd_min(__x,0x7fffffffffffffff)); } - -static simd_long2 SIMD_CFUNC simd_long_rte(simd_double2 __x) { -#if defined __AVX512F__ - return _mm_cvtpd_epi64(__x); -#elif defined __arm64__ - return vcvtnq_s64_f64(__x); -#else - simd_double2 magic = __tg_copysign(0x1.0p52, __x); - simd_long2 x_is_small = __tg_fabs(__x) < 0x1.0p52; - return __builtin_convertvector(simd_bitselect(__x, (__x + magic) - magic, x_is_small & 0x7fffffffffffffff), simd_long2); -#endif -} - -static simd_long3 SIMD_CFUNC simd_long_rte(simd_double3 __x) { - return simd_make_long3(simd_long_rte(simd_make_double4_undef(__x))); -} - -static simd_long4 SIMD_CFUNC simd_long_rte(simd_double4 __x) { -#if defined __AVX512F__ - return _mm256_cvtpd_epi64(__x); -#else - return simd_make_long4(simd_long_rte(__x.lo), simd_long_rte(__x.hi)); -#endif -} - -static simd_long8 SIMD_CFUNC simd_long_rte(simd_double8 __x) { -#if defined __AVX512F__ - return _mm512_cvt_roundpd_epi64(__x, _MM_FROUND_RINT); -#else - return simd_make_long8(simd_long_rte(__x.lo), simd_long_rte(__x.hi)); -#endif -} - static simd_ulong2 SIMD_CFUNC simd_ulong(simd_char2 __x) { return simd_ulong(simd_long(__x)); } static simd_ulong3 SIMD_CFUNC simd_ulong(simd_char3 __x) { return simd_ulong(simd_long(__x)); } @@ -1915,7 +1827,6 @@ static simd_ulong2 SIMD_CFUNC simd_ulong_sat(simd_ulong2 __x) { return __x; } static simd_ulong3 SIMD_CFUNC simd_ulong_sat(simd_ulong3 __x) { return __x; } static simd_ulong4 SIMD_CFUNC simd_ulong_sat(simd_ulong4 __x) { return __x; } static simd_ulong8 SIMD_CFUNC simd_ulong_sat(simd_ulong8 __x) { return __x; } - static simd_double2 SIMD_CFUNC simd_double(simd_char2 __x) { return simd_double(simd_int(__x)); } static simd_double3 SIMD_CFUNC simd_double(simd_char3 __x) { return simd_double(simd_int(__x)); } @@ -1957,11 +1868,9 @@ static simd_double2 SIMD_CFUNC simd_double(simd_double2 __x) { return __builti static simd_double3 SIMD_CFUNC simd_double(simd_double3 __x) { return __builtin_convertvector(__x, simd_double3); } static simd_double4 SIMD_CFUNC simd_double(simd_double4 __x) { return __builtin_convertvector(__x, simd_double4); } static simd_double8 SIMD_CFUNC simd_double(simd_double8 __x) { return __builtin_convertvector(__x, simd_double8); } - #ifdef __cplusplus } #endif #endif // SIMD_COMPILER_HAS_REQUIRED_FEATURES #endif // __SIMD_CONVERSION_HEADER__ - diff --git a/lib/libc/include/x86_64-macos-gnu/simd/logic.h b/lib/libc/include/x86_64-macos-gnu/simd/logic.h index 0d447a910c..ef5b125e34 100644 --- a/lib/libc/include/x86_64-macos-gnu/simd/logic.h +++ b/lib/libc/include/x86_64-macos-gnu/simd/logic.h @@ -628,7 +628,7 @@ extern "C" { static inline SIMD_CFUNC simd_bool simd_any(simd_char2 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x3); + return (_mm_movemask_epi8(simd_make_char16_undef(x)) & 0x3); #elif defined __arm64__ return simd_any(x.xyxy); #else @@ -638,7 +638,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char2 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_char3 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x7); + return (_mm_movemask_epi8(simd_make_char16_undef(x)) & 0x7); #elif defined __arm64__ return simd_any(x.xyzz); #else @@ -648,7 +648,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char3 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_char4 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xf); + return (_mm_movemask_epi8(simd_make_char16_undef(x)) & 0xf); #elif defined __arm64__ return simd_any(x.xyzwxyzw); #else @@ -658,7 +658,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char4 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_char8 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xff); + return (_mm_movemask_epi8(simd_make_char16_undef(x)) & 0xff); #elif defined __arm64__ return vmaxv_u8(x) & 0x80; #else @@ -668,7 +668,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_char8 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_char16 x) { #if defined __SSE2__ - return _mm_movemask_epi8((__m128i)x); + return _mm_movemask_epi8(x); #elif defined __arm64__ return vmaxvq_u8(x) & 0x80; #else @@ -708,7 +708,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_uchar64 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_short2 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xa); + return (_mm_movemask_epi8(simd_make_short8_undef(x)) & 0xa); #elif defined __arm64__ return simd_any(x.xyxy); #else @@ -718,7 +718,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_short2 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_short3 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0x2a); + return (_mm_movemask_epi8(simd_make_short8_undef(x)) & 0x2a); #elif defined __arm64__ return simd_any(x.xyzz); #else @@ -728,7 +728,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_short3 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_short4 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xaa); + return (_mm_movemask_epi8(simd_make_short8_undef(x)) & 0xaa); #elif defined __arm64__ return vmaxv_u16(x) & 0x8000; #else @@ -738,7 +738,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_short4 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_short8 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)x) & 0xaaaa); + return (_mm_movemask_epi8(x) & 0xaaaa); #elif defined __arm64__ return vmaxvq_u16(x) & 0x8000; #else @@ -775,7 +775,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_ushort32 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_int2 x) { #if defined __SSE2__ - return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x3); + return (_mm_movemask_ps(simd_make_int4_undef(x)) & 0x3); #elif defined __arm64__ return vmaxv_u32(x) & 0x80000000; #else @@ -785,7 +785,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_int2 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_int3 x) { #if defined __SSE2__ - return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x7); + return (_mm_movemask_ps(simd_make_int4_undef(x)) & 0x7); #elif defined __arm64__ return simd_any(x.xyzz); #else @@ -794,7 +794,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_int3 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_int4 x) { #if defined __SSE2__ - return _mm_movemask_ps((__m128)x); + return _mm_movemask_ps(x); #elif defined __arm64__ return vmaxvq_u32(x) & 0x80000000; #else @@ -828,7 +828,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_uint16 x) { } static inline SIMD_CFUNC simd_bool simd_any(simd_long2 x) { #if defined __SSE2__ - return _mm_movemask_pd((__m128d)x); + return _mm_movemask_pd(x); #elif defined __arm64__ return (x.x | x.y) & 0x8000000000000000U; #else @@ -867,7 +867,7 @@ static inline SIMD_CFUNC simd_bool simd_any(simd_ulong8 x) { static inline SIMD_CFUNC simd_bool simd_all(simd_char2 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x3) == 0x3; + return (_mm_movemask_epi8(simd_make_char16_undef(x)) & 0x3) == 0x3; #elif defined __arm64__ return simd_all(x.xyxy); #else @@ -877,7 +877,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char2 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_char3 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0x7) == 0x7; + return (_mm_movemask_epi8(simd_make_char16_undef(x)) & 0x7) == 0x7; #elif defined __arm64__ return simd_all(x.xyzz); #else @@ -887,7 +887,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char3 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_char4 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xf) == 0xf; + return (_mm_movemask_epi8(simd_make_char16_undef(x)) & 0xf) == 0xf; #elif defined __arm64__ return simd_all(x.xyzwxyzw); #else @@ -897,7 +897,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char4 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_char8 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_char16_undef(x)) & 0xff) == 0xff; + return (_mm_movemask_epi8(simd_make_char16_undef(x)) & 0xff) == 0xff; #elif defined __arm64__ return vminv_u8(x) & 0x80; #else @@ -907,7 +907,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_char8 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_char16 x) { #if defined __SSE2__ - return _mm_movemask_epi8((__m128i)x) == 0xffff; + return _mm_movemask_epi8(x) == 0xffff; #elif defined __arm64__ return vminvq_u8(x) & 0x80; #else @@ -947,7 +947,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_uchar64 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_short2 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xa) == 0xa; + return (_mm_movemask_epi8(simd_make_short8_undef(x)) & 0xa) == 0xa; #elif defined __arm64__ return simd_all(x.xyxy); #else @@ -957,7 +957,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_short2 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_short3 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0x2a) == 0x2a; + return (_mm_movemask_epi8(simd_make_short8_undef(x)) & 0x2a) == 0x2a; #elif defined __arm64__ return simd_all(x.xyzz); #else @@ -967,7 +967,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_short3 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_short4 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)simd_make_short8_undef(x)) & 0xaa) == 0xaa; + return (_mm_movemask_epi8(simd_make_short8_undef(x)) & 0xaa) == 0xaa; #elif defined __arm64__ return vminv_u16(x) & 0x8000; #else @@ -977,7 +977,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_short4 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_short8 x) { #if defined __SSE2__ - return (_mm_movemask_epi8((__m128i)x) & 0xaaaa) == 0xaaaa; + return (_mm_movemask_epi8(x) & 0xaaaa) == 0xaaaa; #elif defined __arm64__ return vminvq_u16(x) & 0x8000; #else @@ -1014,7 +1014,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_ushort32 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_int2 x) { #if defined __SSE2__ - return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x3) == 0x3; + return (_mm_movemask_ps(simd_make_int4_undef(x)) & 0x3) == 0x3; #elif defined __arm64__ return vminv_u32(x) & 0x80000000; #else @@ -1024,7 +1024,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_int2 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_int3 x) { #if defined __SSE2__ - return (_mm_movemask_ps((__m128)simd_make_int4_undef(x)) & 0x7) == 0x7; + return (_mm_movemask_ps(simd_make_int4_undef(x)) & 0x7) == 0x7; #elif defined __arm64__ return simd_all(x.xyzz); #else @@ -1033,7 +1033,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_int3 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_int4 x) { #if defined __SSE2__ - return _mm_movemask_ps((__m128)x) == 0xf; + return _mm_movemask_ps(x) == 0xf; #elif defined __arm64__ return vminvq_u32(x) & 0x80000000; #else @@ -1067,7 +1067,7 @@ static inline SIMD_CFUNC simd_bool simd_all(simd_uint16 x) { } static inline SIMD_CFUNC simd_bool simd_all(simd_long2 x) { #if defined __SSE2__ - return _mm_movemask_pd((__m128d)x) == 0x3; + return _mm_movemask_pd(x) == 0x3; #elif defined __arm64__ return (x.x & x.y) & 0x8000000000000000U; #else @@ -1112,7 +1112,7 @@ static inline SIMD_CFUNC simd_float3 simd_select(simd_float3 x, simd_float3 y, s } static inline SIMD_CFUNC simd_float4 simd_select(simd_float4 x, simd_float4 y, simd_int4 mask) { #if defined __SSE4_1__ - return _mm_blendv_ps(x, y, (__m128)mask); + return _mm_blendv_ps(x, y, mask); #else return simd_bitselect(x, y, mask >> 31); #endif @@ -1129,7 +1129,7 @@ static inline SIMD_CFUNC simd_float16 simd_select(simd_float16 x, simd_float16 y } static inline SIMD_CFUNC simd_double2 simd_select(simd_double2 x, simd_double2 y, simd_long2 mask) { #if defined __SSE4_1__ - return _mm_blendv_pd(x, y, (__m128d)mask); + return _mm_blendv_pd(x, y, mask); #else return simd_bitselect(x, y, mask >> 63); #endif diff --git a/lib/libc/include/x86_64-macos-gnu/simd/math.h b/lib/libc/include/x86_64-macos-gnu/simd/math.h index 9f3894dd6d..7443b51fc9 100644 --- a/lib/libc/include/x86_64-macos-gnu/simd/math.h +++ b/lib/libc/include/x86_64-macos-gnu/simd/math.h @@ -1886,7 +1886,6 @@ static inline SIMD_CFUNC double __tg_exp10(double x) { return __exp10(x); } * and doubles as provided by ``. */ #define exp10(__x) __tg_exp10(__tg_promote1((__x))(__x)) #endif - #endif /* !__cplusplus */ @@ -1947,11 +1946,11 @@ static SIMD_CFUNC simd_float8 __tg_fmin(simd_float8 x, simd_float8 y) { } static SIMD_CFUNC simd_float16 __tg_fmin(simd_float16 x, simd_float16 y) { -#if defined __x86_64__ && defined __AVX512DQ__ && !__FINITE_MATH_ONLY__ +#if defined __AVX512DQ__ && !__FINITE_MATH_ONLY__ return _mm512_range_ps(x, y, 4); -#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__ +#elif defined __AVX512F__ && __FINITE_MATH_ONLY__ return _mm512_min_ps(x, y); -#elif defined __x86_64__ && defined __AVX512F__ +#elif defined __AVX512F__ return simd_bitselect(_mm512_min_ps(x, y), x, y != y); #else return simd_make_float16(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi)); @@ -1989,11 +1988,11 @@ static SIMD_CFUNC simd_double4 __tg_fmin(simd_double4 x, simd_double4 y) { } static SIMD_CFUNC simd_double8 __tg_fmin(simd_double8 x, simd_double8 y) { -#if defined __x86_64__ && defined __AVX512DQ__ +#if defined __AVX512DQ__ return _mm512_range_pd(x, y, 4); -#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__ +#elif defined __AVX512F__ && __FINITE_MATH_ONLY__ return _mm512_min_pd(x, y); -#elif defined __x86_64__ && defined __AVX512F__ +#elif defined __AVX512F__ return simd_bitselect(_mm512_min_pd(x, y), x, y != y); #else return simd_make_double8(__tg_fmin(x.lo, y.lo), __tg_fmin(x.hi, y.hi)); @@ -2045,11 +2044,11 @@ static SIMD_CFUNC simd_float8 __tg_fmax(simd_float8 x, simd_float8 y) { } static SIMD_CFUNC simd_float16 __tg_fmax(simd_float16 x, simd_float16 y) { -#if defined __x86_64__ && defined __AVX512DQ__ && !__FINITE_MATH_ONLY__ +#if defined __AVX512DQ__ && !__FINITE_MATH_ONLY__ return _mm512_range_ps(x, y, 5); -#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__ +#elif defined __AVX512F__ && __FINITE_MATH_ONLY__ return _mm512_max_ps(x, y); -#elif defined __x86_64__ && defined __AVX512F__ +#elif defined __AVX512F__ return simd_bitselect(_mm512_max_ps(x, y), x, y != y); #else return simd_make_float16(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi)); @@ -2087,11 +2086,11 @@ static SIMD_CFUNC simd_double4 __tg_fmax(simd_double4 x, simd_double4 y) { } static SIMD_CFUNC simd_double8 __tg_fmax(simd_double8 x, simd_double8 y) { -#if defined __x86_64__ && defined __AVX512DQ__ +#if defined __AVX512DQ__ return _mm512_range_pd(x, y, 5); -#elif defined __x86_64__ && defined __AVX512F__ && __FINITE_MATH_ONLY__ +#elif defined __AVX512F__ && __FINITE_MATH_ONLY__ return _mm512_max_pd(x, y); -#elif defined __x86_64__ && defined __AVX512F__ +#elif defined __AVX512F__ return simd_bitselect(_mm512_max_pd(x, y), x, y != y); #else return simd_make_double8(__tg_fmax(x.lo, y.lo), __tg_fmax(x.hi, y.hi)); @@ -2143,7 +2142,7 @@ static SIMD_CFUNC simd_float8 __tg_sqrt(simd_float8 x) { } static SIMD_CFUNC simd_float16 __tg_sqrt(simd_float16 x) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_sqrt_ps(x); #else return simd_make_float16(__tg_sqrt(x.lo), __tg_sqrt(x.hi)); @@ -2173,7 +2172,7 @@ static SIMD_CFUNC simd_double4 __tg_sqrt(simd_double4 x) { } static SIMD_CFUNC simd_double8 __tg_sqrt(simd_double8 x) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_sqrt_pd(x); #else return simd_make_double8(__tg_sqrt(x.lo), __tg_sqrt(x.hi)); @@ -2220,7 +2219,7 @@ static SIMD_CFUNC simd_float8 __tg_ceil(simd_float8 x) { } static SIMD_CFUNC simd_float16 __tg_ceil(simd_float16 x) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_roundscale_ps(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); #else return simd_make_float16(__tg_ceil(x.lo), __tg_ceil(x.hi)); @@ -2258,7 +2257,7 @@ static SIMD_CFUNC simd_double4 __tg_ceil(simd_double4 x) { } static SIMD_CFUNC simd_double8 __tg_ceil(simd_double8 x) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_roundscale_pd(x, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); #else return simd_make_double8(__tg_ceil(x.lo), __tg_ceil(x.hi)); @@ -2304,7 +2303,7 @@ static SIMD_CFUNC simd_float8 __tg_floor(simd_float8 x) { } static SIMD_CFUNC simd_float16 __tg_floor(simd_float16 x) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_roundscale_ps(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); #else return simd_make_float16(__tg_floor(x.lo), __tg_floor(x.hi)); @@ -2342,7 +2341,7 @@ static SIMD_CFUNC simd_double4 __tg_floor(simd_double4 x) { } static SIMD_CFUNC simd_double8 __tg_floor(simd_double8 x) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_roundscale_pd(x, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); #else return simd_make_double8(__tg_floor(x.lo), __tg_floor(x.hi)); @@ -2388,7 +2387,7 @@ static SIMD_CFUNC simd_float8 __tg_rint(simd_float8 x) { } static SIMD_CFUNC simd_float16 __tg_rint(simd_float16 x) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_roundscale_ps(x, _MM_FROUND_RINT); #else return simd_make_float16(__tg_rint(x.lo), __tg_rint(x.hi)); @@ -2426,7 +2425,7 @@ static SIMD_CFUNC simd_double4 __tg_rint(simd_double4 x) { } static SIMD_CFUNC simd_double8 __tg_rint(simd_double8 x) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_roundscale_pd(x, _MM_FROUND_RINT); #else return simd_make_double8(__tg_rint(x.lo), __tg_rint(x.hi)); @@ -2473,7 +2472,7 @@ static SIMD_CFUNC simd_float8 __tg_trunc(simd_float8 x) { } static SIMD_CFUNC simd_float16 __tg_trunc(simd_float16 x) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_roundscale_ps(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); #else return simd_make_float16(__tg_trunc(x.lo), __tg_trunc(x.hi)); @@ -2512,7 +2511,7 @@ static SIMD_CFUNC simd_double4 __tg_trunc(simd_double4 x) { } static SIMD_CFUNC simd_double8 __tg_trunc(simd_double8 x) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_roundscale_pd(x, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); #else return simd_make_double8(__tg_trunc(x.lo), __tg_trunc(x.hi)); @@ -2544,7 +2543,7 @@ static inline SIMD_CFUNC simd_float4 __tg_sin(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_sin_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x) { return _simd_sin_f8(x); @@ -2555,7 +2554,7 @@ static inline SIMD_CFUNC simd_float8 __tg_sin(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_sin_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_sin(simd_float16 x) { return _simd_sin_f16(x); @@ -2586,7 +2585,7 @@ static inline SIMD_CFUNC simd_double3 __tg_sin(simd_double3 x) { return simd_make_double3(__tg_sin(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_sin_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x) { return _simd_sin_d4(x); @@ -2597,7 +2596,7 @@ static inline SIMD_CFUNC simd_double4 __tg_sin(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_sin_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_sin(simd_double8 x) { return _simd_sin_d8(x); @@ -2632,7 +2631,7 @@ static inline SIMD_CFUNC simd_float4 __tg_cos(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_cos_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x) { return _simd_cos_f8(x); @@ -2643,7 +2642,7 @@ static inline SIMD_CFUNC simd_float8 __tg_cos(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_cos_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_cos(simd_float16 x) { return _simd_cos_f16(x); @@ -2674,7 +2673,7 @@ static inline SIMD_CFUNC simd_double3 __tg_cos(simd_double3 x) { return simd_make_double3(__tg_cos(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_cos_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x) { return _simd_cos_d4(x); @@ -2685,7 +2684,7 @@ static inline SIMD_CFUNC simd_double4 __tg_cos(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_cos_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_cos(simd_double8 x) { return _simd_cos_d8(x); @@ -2717,7 +2716,7 @@ static inline SIMD_CFUNC simd_float4 __tg_acos(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_acos_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x) { return _simd_acos_f8(x); @@ -2728,7 +2727,7 @@ static inline SIMD_CFUNC simd_float8 __tg_acos(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_acos_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_acos(simd_float16 x) { return _simd_acos_f16(x); @@ -2754,7 +2753,7 @@ static inline SIMD_CFUNC simd_double3 __tg_acos(simd_double3 x) { return simd_make_double3(__tg_acos(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_acos_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x) { return _simd_acos_d4(x); @@ -2765,7 +2764,7 @@ static inline SIMD_CFUNC simd_double4 __tg_acos(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_acos_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_acos(simd_double8 x) { return _simd_acos_d8(x); @@ -2796,7 +2795,7 @@ static inline SIMD_CFUNC simd_float4 __tg_asin(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_asin_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x) { return _simd_asin_f8(x); @@ -2807,7 +2806,7 @@ static inline SIMD_CFUNC simd_float8 __tg_asin(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_asin_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_asin(simd_float16 x) { return _simd_asin_f16(x); @@ -2833,7 +2832,7 @@ static inline SIMD_CFUNC simd_double3 __tg_asin(simd_double3 x) { return simd_make_double3(__tg_asin(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_asin_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x) { return _simd_asin_d4(x); @@ -2844,7 +2843,7 @@ static inline SIMD_CFUNC simd_double4 __tg_asin(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_asin_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_asin(simd_double8 x) { return _simd_asin_d8(x); @@ -2875,7 +2874,7 @@ static inline SIMD_CFUNC simd_float4 __tg_atan(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_atan_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x) { return _simd_atan_f8(x); @@ -2886,7 +2885,7 @@ static inline SIMD_CFUNC simd_float8 __tg_atan(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_atan_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_atan(simd_float16 x) { return _simd_atan_f16(x); @@ -2912,7 +2911,7 @@ static inline SIMD_CFUNC simd_double3 __tg_atan(simd_double3 x) { return simd_make_double3(__tg_atan(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_atan_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x) { return _simd_atan_d4(x); @@ -2923,7 +2922,7 @@ static inline SIMD_CFUNC simd_double4 __tg_atan(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_atan_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_atan(simd_double8 x) { return _simd_atan_d8(x); @@ -2954,7 +2953,7 @@ static inline SIMD_CFUNC simd_float4 __tg_tan(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_tan_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x) { return _simd_tan_f8(x); @@ -2965,7 +2964,7 @@ static inline SIMD_CFUNC simd_float8 __tg_tan(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_tan_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_tan(simd_float16 x) { return _simd_tan_f16(x); @@ -2991,7 +2990,7 @@ static inline SIMD_CFUNC simd_double3 __tg_tan(simd_double3 x) { return simd_make_double3(__tg_tan(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_tan_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x) { return _simd_tan_d4(x); @@ -3002,7 +3001,7 @@ static inline SIMD_CFUNC simd_double4 __tg_tan(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_tan_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_tan(simd_double8 x) { return _simd_tan_d8(x); @@ -3034,7 +3033,7 @@ static inline SIMD_CFUNC simd_float4 __tg_cospi(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_cospi_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x) { return _simd_cospi_f8(x); @@ -3045,7 +3044,7 @@ static inline SIMD_CFUNC simd_float8 __tg_cospi(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_cospi_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_cospi(simd_float16 x) { return _simd_cospi_f16(x); @@ -3071,7 +3070,7 @@ static inline SIMD_CFUNC simd_double3 __tg_cospi(simd_double3 x) { return simd_make_double3(__tg_cospi(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_cospi_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x) { return _simd_cospi_d4(x); @@ -3082,7 +3081,7 @@ static inline SIMD_CFUNC simd_double4 __tg_cospi(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_cospi_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_cospi(simd_double8 x) { return _simd_cospi_d8(x); @@ -3115,7 +3114,7 @@ static inline SIMD_CFUNC simd_float4 __tg_sinpi(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_sinpi_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x) { return _simd_sinpi_f8(x); @@ -3126,7 +3125,7 @@ static inline SIMD_CFUNC simd_float8 __tg_sinpi(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_sinpi_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_sinpi(simd_float16 x) { return _simd_sinpi_f16(x); @@ -3152,7 +3151,7 @@ static inline SIMD_CFUNC simd_double3 __tg_sinpi(simd_double3 x) { return simd_make_double3(__tg_sinpi(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_sinpi_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x) { return _simd_sinpi_d4(x); @@ -3163,7 +3162,7 @@ static inline SIMD_CFUNC simd_double4 __tg_sinpi(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_sinpi_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_sinpi(simd_double8 x) { return _simd_sinpi_d8(x); @@ -3196,7 +3195,7 @@ static inline SIMD_CFUNC simd_float4 __tg_tanpi(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_tanpi_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x) { return _simd_tanpi_f8(x); @@ -3207,7 +3206,7 @@ static inline SIMD_CFUNC simd_float8 __tg_tanpi(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_tanpi_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_tanpi(simd_float16 x) { return _simd_tanpi_f16(x); @@ -3233,7 +3232,7 @@ static inline SIMD_CFUNC simd_double3 __tg_tanpi(simd_double3 x) { return simd_make_double3(__tg_tanpi(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_tanpi_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x) { return _simd_tanpi_d4(x); @@ -3244,7 +3243,7 @@ static inline SIMD_CFUNC simd_double4 __tg_tanpi(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_tanpi_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_tanpi(simd_double8 x) { return _simd_tanpi_d8(x); @@ -3276,7 +3275,7 @@ static inline SIMD_CFUNC simd_float4 __tg_acosh(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_acosh_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x) { return _simd_acosh_f8(x); @@ -3287,7 +3286,7 @@ static inline SIMD_CFUNC simd_float8 __tg_acosh(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_acosh_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_acosh(simd_float16 x) { return _simd_acosh_f16(x); @@ -3313,7 +3312,7 @@ static inline SIMD_CFUNC simd_double3 __tg_acosh(simd_double3 x) { return simd_make_double3(__tg_acosh(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_acosh_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x) { return _simd_acosh_d4(x); @@ -3324,7 +3323,7 @@ static inline SIMD_CFUNC simd_double4 __tg_acosh(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_acosh_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_acosh(simd_double8 x) { return _simd_acosh_d8(x); @@ -3355,7 +3354,7 @@ static inline SIMD_CFUNC simd_float4 __tg_asinh(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_asinh_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x) { return _simd_asinh_f8(x); @@ -3366,7 +3365,7 @@ static inline SIMD_CFUNC simd_float8 __tg_asinh(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_asinh_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_asinh(simd_float16 x) { return _simd_asinh_f16(x); @@ -3392,7 +3391,7 @@ static inline SIMD_CFUNC simd_double3 __tg_asinh(simd_double3 x) { return simd_make_double3(__tg_asinh(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_asinh_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x) { return _simd_asinh_d4(x); @@ -3403,7 +3402,7 @@ static inline SIMD_CFUNC simd_double4 __tg_asinh(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_asinh_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_asinh(simd_double8 x) { return _simd_asinh_d8(x); @@ -3434,7 +3433,7 @@ static inline SIMD_CFUNC simd_float4 __tg_atanh(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_atanh_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x) { return _simd_atanh_f8(x); @@ -3445,7 +3444,7 @@ static inline SIMD_CFUNC simd_float8 __tg_atanh(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_atanh_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_atanh(simd_float16 x) { return _simd_atanh_f16(x); @@ -3471,7 +3470,7 @@ static inline SIMD_CFUNC simd_double3 __tg_atanh(simd_double3 x) { return simd_make_double3(__tg_atanh(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_atanh_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x) { return _simd_atanh_d4(x); @@ -3482,7 +3481,7 @@ static inline SIMD_CFUNC simd_double4 __tg_atanh(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_atanh_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_atanh(simd_double8 x) { return _simd_atanh_d8(x); @@ -3513,7 +3512,7 @@ static inline SIMD_CFUNC simd_float4 __tg_cosh(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_cosh_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x) { return _simd_cosh_f8(x); @@ -3524,7 +3523,7 @@ static inline SIMD_CFUNC simd_float8 __tg_cosh(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_cosh_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_cosh(simd_float16 x) { return _simd_cosh_f16(x); @@ -3550,7 +3549,7 @@ static inline SIMD_CFUNC simd_double3 __tg_cosh(simd_double3 x) { return simd_make_double3(__tg_cosh(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_cosh_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x) { return _simd_cosh_d4(x); @@ -3561,7 +3560,7 @@ static inline SIMD_CFUNC simd_double4 __tg_cosh(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_cosh_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_cosh(simd_double8 x) { return _simd_cosh_d8(x); @@ -3592,7 +3591,7 @@ static inline SIMD_CFUNC simd_float4 __tg_sinh(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_sinh_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x) { return _simd_sinh_f8(x); @@ -3603,7 +3602,7 @@ static inline SIMD_CFUNC simd_float8 __tg_sinh(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_sinh_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_sinh(simd_float16 x) { return _simd_sinh_f16(x); @@ -3629,7 +3628,7 @@ static inline SIMD_CFUNC simd_double3 __tg_sinh(simd_double3 x) { return simd_make_double3(__tg_sinh(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_sinh_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x) { return _simd_sinh_d4(x); @@ -3640,7 +3639,7 @@ static inline SIMD_CFUNC simd_double4 __tg_sinh(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_sinh_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_sinh(simd_double8 x) { return _simd_sinh_d8(x); @@ -3671,7 +3670,7 @@ static inline SIMD_CFUNC simd_float4 __tg_tanh(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_tanh_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x) { return _simd_tanh_f8(x); @@ -3682,7 +3681,7 @@ static inline SIMD_CFUNC simd_float8 __tg_tanh(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_tanh_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_tanh(simd_float16 x) { return _simd_tanh_f16(x); @@ -3708,7 +3707,7 @@ static inline SIMD_CFUNC simd_double3 __tg_tanh(simd_double3 x) { return simd_make_double3(__tg_tanh(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_tanh_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x) { return _simd_tanh_d4(x); @@ -3719,7 +3718,7 @@ static inline SIMD_CFUNC simd_double4 __tg_tanh(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_tanh_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_tanh(simd_double8 x) { return _simd_tanh_d8(x); @@ -3750,7 +3749,7 @@ static inline SIMD_CFUNC simd_float4 __tg_exp(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_exp_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x) { return _simd_exp_f8(x); @@ -3761,7 +3760,7 @@ static inline SIMD_CFUNC simd_float8 __tg_exp(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_exp_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_exp(simd_float16 x) { return _simd_exp_f16(x); @@ -3787,7 +3786,7 @@ static inline SIMD_CFUNC simd_double3 __tg_exp(simd_double3 x) { return simd_make_double3(__tg_exp(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_exp_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x) { return _simd_exp_d4(x); @@ -3798,7 +3797,7 @@ static inline SIMD_CFUNC simd_double4 __tg_exp(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_exp_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_exp(simd_double8 x) { return _simd_exp_d8(x); @@ -3829,7 +3828,7 @@ static inline SIMD_CFUNC simd_float4 __tg_exp2(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_exp2_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x) { return _simd_exp2_f8(x); @@ -3840,7 +3839,7 @@ static inline SIMD_CFUNC simd_float8 __tg_exp2(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_exp2_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_exp2(simd_float16 x) { return _simd_exp2_f16(x); @@ -3866,7 +3865,7 @@ static inline SIMD_CFUNC simd_double3 __tg_exp2(simd_double3 x) { return simd_make_double3(__tg_exp2(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_exp2_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x) { return _simd_exp2_d4(x); @@ -3877,7 +3876,7 @@ static inline SIMD_CFUNC simd_double4 __tg_exp2(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_exp2_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_exp2(simd_double8 x) { return _simd_exp2_d8(x); @@ -3909,7 +3908,7 @@ static inline SIMD_CFUNC simd_float4 __tg_exp10(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_exp10_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x) { return _simd_exp10_f8(x); @@ -3920,7 +3919,7 @@ static inline SIMD_CFUNC simd_float8 __tg_exp10(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_exp10_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_exp10(simd_float16 x) { return _simd_exp10_f16(x); @@ -3946,7 +3945,7 @@ static inline SIMD_CFUNC simd_double3 __tg_exp10(simd_double3 x) { return simd_make_double3(__tg_exp10(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_exp10_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x) { return _simd_exp10_d4(x); @@ -3957,7 +3956,7 @@ static inline SIMD_CFUNC simd_double4 __tg_exp10(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_exp10_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_exp10(simd_double8 x) { return _simd_exp10_d8(x); @@ -3989,7 +3988,7 @@ static inline SIMD_CFUNC simd_float4 __tg_expm1(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_expm1_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x) { return _simd_expm1_f8(x); @@ -4000,7 +3999,7 @@ static inline SIMD_CFUNC simd_float8 __tg_expm1(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_expm1_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_expm1(simd_float16 x) { return _simd_expm1_f16(x); @@ -4026,7 +4025,7 @@ static inline SIMD_CFUNC simd_double3 __tg_expm1(simd_double3 x) { return simd_make_double3(__tg_expm1(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_expm1_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x) { return _simd_expm1_d4(x); @@ -4037,7 +4036,7 @@ static inline SIMD_CFUNC simd_double4 __tg_expm1(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_expm1_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_expm1(simd_double8 x) { return _simd_expm1_d8(x); @@ -4068,7 +4067,7 @@ static inline SIMD_CFUNC simd_float4 __tg_log(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_log_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x) { return _simd_log_f8(x); @@ -4079,7 +4078,7 @@ static inline SIMD_CFUNC simd_float8 __tg_log(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_log_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_log(simd_float16 x) { return _simd_log_f16(x); @@ -4105,7 +4104,7 @@ static inline SIMD_CFUNC simd_double3 __tg_log(simd_double3 x) { return simd_make_double3(__tg_log(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_log_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x) { return _simd_log_d4(x); @@ -4116,7 +4115,7 @@ static inline SIMD_CFUNC simd_double4 __tg_log(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_log_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_log(simd_double8 x) { return _simd_log_d8(x); @@ -4147,7 +4146,7 @@ static inline SIMD_CFUNC simd_float4 __tg_log2(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_log2_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x) { return _simd_log2_f8(x); @@ -4158,7 +4157,7 @@ static inline SIMD_CFUNC simd_float8 __tg_log2(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_log2_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_log2(simd_float16 x) { return _simd_log2_f16(x); @@ -4184,7 +4183,7 @@ static inline SIMD_CFUNC simd_double3 __tg_log2(simd_double3 x) { return simd_make_double3(__tg_log2(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_log2_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x) { return _simd_log2_d4(x); @@ -4195,7 +4194,7 @@ static inline SIMD_CFUNC simd_double4 __tg_log2(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_log2_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_log2(simd_double8 x) { return _simd_log2_d8(x); @@ -4226,7 +4225,7 @@ static inline SIMD_CFUNC simd_float4 __tg_log10(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_log10_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x) { return _simd_log10_f8(x); @@ -4237,7 +4236,7 @@ static inline SIMD_CFUNC simd_float8 __tg_log10(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_log10_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_log10(simd_float16 x) { return _simd_log10_f16(x); @@ -4263,7 +4262,7 @@ static inline SIMD_CFUNC simd_double3 __tg_log10(simd_double3 x) { return simd_make_double3(__tg_log10(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_log10_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x) { return _simd_log10_d4(x); @@ -4274,7 +4273,7 @@ static inline SIMD_CFUNC simd_double4 __tg_log10(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_log10_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_log10(simd_double8 x) { return _simd_log10_d8(x); @@ -4305,7 +4304,7 @@ static inline SIMD_CFUNC simd_float4 __tg_log1p(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_log1p_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x) { return _simd_log1p_f8(x); @@ -4316,7 +4315,7 @@ static inline SIMD_CFUNC simd_float8 __tg_log1p(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_log1p_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_log1p(simd_float16 x) { return _simd_log1p_f16(x); @@ -4342,7 +4341,7 @@ static inline SIMD_CFUNC simd_double3 __tg_log1p(simd_double3 x) { return simd_make_double3(__tg_log1p(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_log1p_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x) { return _simd_log1p_d4(x); @@ -4353,7 +4352,7 @@ static inline SIMD_CFUNC simd_double4 __tg_log1p(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_log1p_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_log1p(simd_double8 x) { return _simd_log1p_d8(x); @@ -4384,7 +4383,7 @@ static inline SIMD_CFUNC simd_float4 __tg_cbrt(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_cbrt_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x) { return _simd_cbrt_f8(x); @@ -4395,7 +4394,7 @@ static inline SIMD_CFUNC simd_float8 __tg_cbrt(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_cbrt_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_cbrt(simd_float16 x) { return _simd_cbrt_f16(x); @@ -4421,7 +4420,7 @@ static inline SIMD_CFUNC simd_double3 __tg_cbrt(simd_double3 x) { return simd_make_double3(__tg_cbrt(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_cbrt_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x) { return _simd_cbrt_d4(x); @@ -4432,7 +4431,7 @@ static inline SIMD_CFUNC simd_double4 __tg_cbrt(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_cbrt_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_cbrt(simd_double8 x) { return _simd_cbrt_d8(x); @@ -4463,7 +4462,7 @@ static inline SIMD_CFUNC simd_float4 __tg_erf(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_erf_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x) { return _simd_erf_f8(x); @@ -4474,7 +4473,7 @@ static inline SIMD_CFUNC simd_float8 __tg_erf(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_erf_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_erf(simd_float16 x) { return _simd_erf_f16(x); @@ -4500,7 +4499,7 @@ static inline SIMD_CFUNC simd_double3 __tg_erf(simd_double3 x) { return simd_make_double3(__tg_erf(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_erf_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x) { return _simd_erf_d4(x); @@ -4511,7 +4510,7 @@ static inline SIMD_CFUNC simd_double4 __tg_erf(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_erf_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_erf(simd_double8 x) { return _simd_erf_d8(x); @@ -4542,7 +4541,7 @@ static inline SIMD_CFUNC simd_float4 __tg_erfc(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_erfc_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x) { return _simd_erfc_f8(x); @@ -4553,7 +4552,7 @@ static inline SIMD_CFUNC simd_float8 __tg_erfc(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_erfc_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_erfc(simd_float16 x) { return _simd_erfc_f16(x); @@ -4579,7 +4578,7 @@ static inline SIMD_CFUNC simd_double3 __tg_erfc(simd_double3 x) { return simd_make_double3(__tg_erfc(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_erfc_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x) { return _simd_erfc_d4(x); @@ -4590,7 +4589,7 @@ static inline SIMD_CFUNC simd_double4 __tg_erfc(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_erfc_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_erfc(simd_double8 x) { return _simd_erfc_d8(x); @@ -4621,7 +4620,7 @@ static inline SIMD_CFUNC simd_float4 __tg_tgamma(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_tgamma_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x) { return _simd_tgamma_f8(x); @@ -4632,7 +4631,7 @@ static inline SIMD_CFUNC simd_float8 __tg_tgamma(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_tgamma_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_tgamma(simd_float16 x) { return _simd_tgamma_f16(x); @@ -4658,7 +4657,7 @@ static inline SIMD_CFUNC simd_double3 __tg_tgamma(simd_double3 x) { return simd_make_double3(__tg_tgamma(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_tgamma_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x) { return _simd_tgamma_d4(x); @@ -4669,7 +4668,7 @@ static inline SIMD_CFUNC simd_double4 __tg_tgamma(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_tgamma_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_tgamma(simd_double8 x) { return _simd_tgamma_d8(x); @@ -4704,7 +4703,7 @@ static inline SIMD_CFUNC simd_float4 __tg_round(simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_round_f8(simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x) { return _simd_round_f8(x); @@ -4715,7 +4714,7 @@ static inline SIMD_CFUNC simd_float8 __tg_round(simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_round_f16(simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_round(simd_float16 x) { return _simd_round_f16(x); @@ -4745,7 +4744,7 @@ static inline SIMD_CFUNC simd_double3 __tg_round(simd_double3 x) { return simd_make_double3(__tg_round(simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_round_d4(simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x) { return _simd_round_d4(x); @@ -4756,7 +4755,7 @@ static inline SIMD_CFUNC simd_double4 __tg_round(simd_double4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_round_d8(simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_round(simd_double8 x) { return _simd_round_d8(x); @@ -4787,7 +4786,7 @@ static inline SIMD_CFUNC simd_float4 __tg_atan2(simd_float4 y, simd_float4 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_atan2_f8(simd_float8 y, simd_float8 x); static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x) { return _simd_atan2_f8(y, x); @@ -4798,7 +4797,7 @@ static inline SIMD_CFUNC simd_float8 __tg_atan2(simd_float8 y, simd_float8 x) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_atan2_f16(simd_float16 y, simd_float16 x); static inline SIMD_CFUNC simd_float16 __tg_atan2(simd_float16 y, simd_float16 x) { return _simd_atan2_f16(y, x); @@ -4824,7 +4823,7 @@ static inline SIMD_CFUNC simd_double3 __tg_atan2(simd_double3 y, simd_double3 x) return simd_make_double3(__tg_atan2(simd_make_double4(y), simd_make_double4(x))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_atan2_d4(simd_double4 y, simd_double4 x); static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x) { return _simd_atan2_d4(y, x); @@ -4835,7 +4834,7 @@ static inline SIMD_CFUNC simd_double4 __tg_atan2(simd_double4 y, simd_double4 x) } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_atan2_d8(simd_double8 y, simd_double8 x); static inline SIMD_CFUNC simd_double8 __tg_atan2(simd_double8 y, simd_double8 x) { return _simd_atan2_d8(y, x); @@ -4866,7 +4865,7 @@ static inline SIMD_CFUNC simd_float4 __tg_hypot(simd_float4 x, simd_float4 y) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_hypot_f8(simd_float8 x, simd_float8 y); static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y) { return _simd_hypot_f8(x, y); @@ -4877,7 +4876,7 @@ static inline SIMD_CFUNC simd_float8 __tg_hypot(simd_float8 x, simd_float8 y) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_hypot_f16(simd_float16 x, simd_float16 y); static inline SIMD_CFUNC simd_float16 __tg_hypot(simd_float16 x, simd_float16 y) { return _simd_hypot_f16(x, y); @@ -4903,7 +4902,7 @@ static inline SIMD_CFUNC simd_double3 __tg_hypot(simd_double3 x, simd_double3 y) return simd_make_double3(__tg_hypot(simd_make_double4(x), simd_make_double4(y))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_hypot_d4(simd_double4 x, simd_double4 y); static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y) { return _simd_hypot_d4(x, y); @@ -4914,7 +4913,7 @@ static inline SIMD_CFUNC simd_double4 __tg_hypot(simd_double4 x, simd_double4 y) } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_hypot_d8(simd_double8 x, simd_double8 y); static inline SIMD_CFUNC simd_double8 __tg_hypot(simd_double8 x, simd_double8 y) { return _simd_hypot_d8(x, y); @@ -4945,7 +4944,7 @@ static inline SIMD_CFUNC simd_float4 __tg_pow(simd_float4 x, simd_float4 y) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_pow_f8(simd_float8 x, simd_float8 y); static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y) { return _simd_pow_f8(x, y); @@ -4956,7 +4955,7 @@ static inline SIMD_CFUNC simd_float8 __tg_pow(simd_float8 x, simd_float8 y) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_pow_f16(simd_float16 x, simd_float16 y); static inline SIMD_CFUNC simd_float16 __tg_pow(simd_float16 x, simd_float16 y) { return _simd_pow_f16(x, y); @@ -4982,7 +4981,7 @@ static inline SIMD_CFUNC simd_double3 __tg_pow(simd_double3 x, simd_double3 y) { return simd_make_double3(__tg_pow(simd_make_double4(x), simd_make_double4(y))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_pow_d4(simd_double4 x, simd_double4 y); static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y) { return _simd_pow_d4(x, y); @@ -4993,7 +4992,7 @@ static inline SIMD_CFUNC simd_double4 __tg_pow(simd_double4 x, simd_double4 y) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_pow_d8(simd_double8 x, simd_double8 y); static inline SIMD_CFUNC simd_double8 __tg_pow(simd_double8 x, simd_double8 y) { return _simd_pow_d8(x, y); @@ -5024,7 +5023,7 @@ static inline SIMD_CFUNC simd_float4 __tg_fmod(simd_float4 x, simd_float4 y) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_fmod_f8(simd_float8 x, simd_float8 y); static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y) { return _simd_fmod_f8(x, y); @@ -5035,7 +5034,7 @@ static inline SIMD_CFUNC simd_float8 __tg_fmod(simd_float8 x, simd_float8 y) { } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_fmod_f16(simd_float16 x, simd_float16 y); static inline SIMD_CFUNC simd_float16 __tg_fmod(simd_float16 x, simd_float16 y) { return _simd_fmod_f16(x, y); @@ -5061,7 +5060,7 @@ static inline SIMD_CFUNC simd_double3 __tg_fmod(simd_double3 x, simd_double3 y) return simd_make_double3(__tg_fmod(simd_make_double4(x), simd_make_double4(y))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_fmod_d4(simd_double4 x, simd_double4 y); static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y) { return _simd_fmod_d4(x, y); @@ -5072,7 +5071,7 @@ static inline SIMD_CFUNC simd_double4 __tg_fmod(simd_double4 x, simd_double4 y) } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_fmod_d8(simd_double8 x, simd_double8 y); static inline SIMD_CFUNC simd_double8 __tg_fmod(simd_double8 x, simd_double8 y) { return _simd_fmod_d8(x, y); @@ -5103,7 +5102,7 @@ static inline SIMD_CFUNC simd_float4 __tg_remainder(simd_float4 x, simd_float4 y } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_remainder_f8(simd_float8 x, simd_float8 y); static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y) { return _simd_remainder_f8(x, y); @@ -5114,7 +5113,7 @@ static inline SIMD_CFUNC simd_float8 __tg_remainder(simd_float8 x, simd_float8 y } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_remainder_f16(simd_float16 x, simd_float16 y); static inline SIMD_CFUNC simd_float16 __tg_remainder(simd_float16 x, simd_float16 y) { return _simd_remainder_f16(x, y); @@ -5140,7 +5139,7 @@ static inline SIMD_CFUNC simd_double3 __tg_remainder(simd_double3 x, simd_double return simd_make_double3(__tg_remainder(simd_make_double4(x), simd_make_double4(y))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_remainder_d4(simd_double4 x, simd_double4 y); static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double4 y) { return _simd_remainder_d4(x, y); @@ -5151,7 +5150,7 @@ static inline SIMD_CFUNC simd_double4 __tg_remainder(simd_double4 x, simd_double } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_remainder_d8(simd_double8 x, simd_double8 y); static inline SIMD_CFUNC simd_double8 __tg_remainder(simd_double8 x, simd_double8 y) { return _simd_remainder_d8(x, y); @@ -5182,7 +5181,7 @@ static inline SIMD_CFUNC simd_float4 __tg_nextafter(simd_float4 x, simd_float4 y } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_float8 _simd_nextafter_f8(simd_float8 x, simd_float8 y); static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y) { return _simd_nextafter_f8(x, y); @@ -5193,7 +5192,7 @@ static inline SIMD_CFUNC simd_float8 __tg_nextafter(simd_float8 x, simd_float8 y } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_float16 _simd_nextafter_f16(simd_float16 x, simd_float16 y); static inline SIMD_CFUNC simd_float16 __tg_nextafter(simd_float16 x, simd_float16 y) { return _simd_nextafter_f16(x, y); @@ -5219,7 +5218,7 @@ static inline SIMD_CFUNC simd_double3 __tg_nextafter(simd_double3 x, simd_double return simd_make_double3(__tg_nextafter(simd_make_double4(x), simd_make_double4(y))); } -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX2__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX2__ extern simd_double4 _simd_nextafter_d4(simd_double4 x, simd_double4 y); static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double4 y) { return _simd_nextafter_d4(x, y); @@ -5230,7 +5229,7 @@ static inline SIMD_CFUNC simd_double4 __tg_nextafter(simd_double4 x, simd_double } #endif -#if SIMD_LIBRARY_VERSION >= 3 && defined __x86_64__ && defined __AVX512F__ +#if SIMD_LIBRARY_VERSION >= 3 && defined __AVX512F__ extern simd_double8 _simd_nextafter_d8(simd_double8 x, simd_double8 y); static inline SIMD_CFUNC simd_double8 __tg_nextafter(simd_double8 x, simd_double8 y) { return _simd_nextafter_d8(x, y); @@ -5287,7 +5286,7 @@ static inline SIMD_CFUNC simd_float8 __tg_fma(simd_float8 x, simd_float8 y, simd } static inline SIMD_CFUNC simd_float16 __tg_fma(simd_float16 x, simd_float16 y, simd_float16 z) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_fmadd_ps(x, y, z); #else return simd_make_float16(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi)); @@ -5322,7 +5321,7 @@ static inline SIMD_CFUNC simd_double4 __tg_fma(simd_double4 x, simd_double4 y, s } static inline SIMD_CFUNC simd_double8 __tg_fma(simd_double8 x, simd_double8 y, simd_double8 z) { -#if defined __x86_64__ && defined __AVX512F__ +#if defined __AVX512F__ return _mm512_fmadd_pd(x, y, z); #else return simd_make_double8(__tg_fma(x.lo, y.lo, z.lo), __tg_fma(x.hi, y.hi, z.hi)); diff --git a/lib/libc/include/x86_64-macos-gnu/simd/packed.h b/lib/libc/include/x86_64-macos-gnu/simd/packed.h index aac9259370..435608df73 100644 --- a/lib/libc/include/x86_64-macos-gnu/simd/packed.h +++ b/lib/libc/include/x86_64-macos-gnu/simd/packed.h @@ -35,22 +35,22 @@ /*! @abstract A vector of two 8-bit signed (twos-complement) integers with * relaxed alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::char2. The alignment of this type is that of the - * underlying scalar element type, so you can use it to load or store from - * an array of that type. */ + * simd::packed_char2. The alignment of this type is that of the underlying + * scalar element type, so you can use it to load or store from an array of + * that type. */ typedef __attribute__((__ext_vector_type__(2),__aligned__(1))) char simd_packed_char2; /*! @abstract A vector of four 8-bit signed (twos-complement) integers with * relaxed alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::char4. The alignment of this type is that of the - * underlying scalar element type, so you can use it to load or store from - * an array of that type. */ + * simd::packed_char4. The alignment of this type is that of the underlying + * scalar element type, so you can use it to load or store from an array of + * that type. */ typedef __attribute__((__ext_vector_type__(4),__aligned__(1))) char simd_packed_char4; /*! @abstract A vector of eight 8-bit signed (twos-complement) integers with * relaxed alignment. - * @description In C++ this type is also available as simd::packed::char8. + * @description In C++ this type is also available as simd::packed_char8. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -58,7 +58,7 @@ typedef __attribute__((__ext_vector_type__(8),__aligned__(1))) char simd_packed_ /*! @abstract A vector of sixteen 8-bit signed (twos-complement) integers * with relaxed alignment. - * @description In C++ this type is also available as simd::packed::char16. + * @description In C++ this type is also available as simd::packed_char16. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -66,7 +66,7 @@ typedef __attribute__((__ext_vector_type__(16),__aligned__(1))) char simd_packed /*! @abstract A vector of thirty-two 8-bit signed (twos-complement) integers * with relaxed alignment. - * @description In C++ this type is also available as simd::packed::char32. + * @description In C++ this type is also available as simd::packed_char32. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -74,7 +74,7 @@ typedef __attribute__((__ext_vector_type__(32),__aligned__(1))) char simd_packed /*! @abstract A vector of sixty-four 8-bit signed (twos-complement) integers * with relaxed alignment. - * @description In C++ this type is also available as simd::packed::char64. + * @description In C++ this type is also available as simd::packed_char64. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -83,7 +83,7 @@ typedef __attribute__((__ext_vector_type__(64),__aligned__(1))) char simd_packed /*! @abstract A vector of two 8-bit unsigned integers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::uchar2. The alignment of this type is that of the + * simd::packed_uchar2. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ typedef __attribute__((__ext_vector_type__(2),__aligned__(1))) unsigned char simd_packed_uchar2; @@ -91,14 +91,14 @@ typedef __attribute__((__ext_vector_type__(2),__aligned__(1))) unsigned char sim /*! @abstract A vector of four 8-bit unsigned integers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::uchar4. The alignment of this type is that of the + * simd::packed_uchar4. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ typedef __attribute__((__ext_vector_type__(4),__aligned__(1))) unsigned char simd_packed_uchar4; /*! @abstract A vector of eight 8-bit unsigned integers with relaxed * alignment. - * @description In C++ this type is also available as simd::packed::uchar8. + * @description In C++ this type is also available as simd::packed_uchar8. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -106,32 +106,32 @@ typedef __attribute__((__ext_vector_type__(8),__aligned__(1))) unsigned char sim /*! @abstract A vector of sixteen 8-bit unsigned integers with relaxed * alignment. - * @description In C++ this type is also available as - * simd::packed::uchar16. This type is not available in Metal. The - * alignment of this type is only that of the underlying scalar element - * type, so you can use it to load or store from an array of that type. */ + * @description In C++ this type is also available as simd::packed_uchar16. + * This type is not available in Metal. The alignment of this type is only + * that of the underlying scalar element type, so you can use it to load or + * store from an array of that type. */ typedef __attribute__((__ext_vector_type__(16),__aligned__(1))) unsigned char simd_packed_uchar16; /*! @abstract A vector of thirty-two 8-bit unsigned integers with relaxed * alignment. - * @description In C++ this type is also available as - * simd::packed::uchar32. This type is not available in Metal. The - * alignment of this type is only that of the underlying scalar element - * type, so you can use it to load or store from an array of that type. */ + * @description In C++ this type is also available as simd::packed_uchar32. + * This type is not available in Metal. The alignment of this type is only + * that of the underlying scalar element type, so you can use it to load or + * store from an array of that type. */ typedef __attribute__((__ext_vector_type__(32),__aligned__(1))) unsigned char simd_packed_uchar32; /*! @abstract A vector of sixty-four 8-bit unsigned integers with relaxed * alignment. - * @description In C++ this type is also available as - * simd::packed::uchar64. This type is not available in Metal. The - * alignment of this type is only that of the underlying scalar element - * type, so you can use it to load or store from an array of that type. */ + * @description In C++ this type is also available as simd::packed_uchar64. + * This type is not available in Metal. The alignment of this type is only + * that of the underlying scalar element type, so you can use it to load or + * store from an array of that type. */ typedef __attribute__((__ext_vector_type__(64),__aligned__(1))) unsigned char simd_packed_uchar64; /*! @abstract A vector of two 16-bit signed (twos-complement) integers with * relaxed alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::short2. The alignment of this type is that of the + * simd::packed_short2. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ typedef __attribute__((__ext_vector_type__(2),__aligned__(2))) short simd_packed_short2; @@ -139,14 +139,14 @@ typedef __attribute__((__ext_vector_type__(2),__aligned__(2))) short simd_packed /*! @abstract A vector of four 16-bit signed (twos-complement) integers with * relaxed alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::short4. The alignment of this type is that of the + * simd::packed_short4. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ typedef __attribute__((__ext_vector_type__(4),__aligned__(2))) short simd_packed_short4; /*! @abstract A vector of eight 16-bit signed (twos-complement) integers * with relaxed alignment. - * @description In C++ this type is also available as simd::packed::short8. + * @description In C++ this type is also available as simd::packed_short8. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -154,24 +154,24 @@ typedef __attribute__((__ext_vector_type__(8),__aligned__(2))) short simd_packed /*! @abstract A vector of sixteen 16-bit signed (twos-complement) integers * with relaxed alignment. - * @description In C++ this type is also available as - * simd::packed::short16. This type is not available in Metal. The - * alignment of this type is only that of the underlying scalar element - * type, so you can use it to load or store from an array of that type. */ + * @description In C++ this type is also available as simd::packed_short16. + * This type is not available in Metal. The alignment of this type is only + * that of the underlying scalar element type, so you can use it to load or + * store from an array of that type. */ typedef __attribute__((__ext_vector_type__(16),__aligned__(2))) short simd_packed_short16; /*! @abstract A vector of thirty-two 16-bit signed (twos-complement) * integers with relaxed alignment. - * @description In C++ this type is also available as - * simd::packed::short32. This type is not available in Metal. The - * alignment of this type is only that of the underlying scalar element - * type, so you can use it to load or store from an array of that type. */ + * @description In C++ this type is also available as simd::packed_short32. + * This type is not available in Metal. The alignment of this type is only + * that of the underlying scalar element type, so you can use it to load or + * store from an array of that type. */ typedef __attribute__((__ext_vector_type__(32),__aligned__(2))) short simd_packed_short32; /*! @abstract A vector of two 16-bit unsigned integers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::ushort2. The alignment of this type is that of the + * simd::packed_ushort2. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ typedef __attribute__((__ext_vector_type__(2),__aligned__(2))) unsigned short simd_packed_ushort2; @@ -179,23 +179,23 @@ typedef __attribute__((__ext_vector_type__(2),__aligned__(2))) unsigned short si /*! @abstract A vector of four 16-bit unsigned integers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::ushort4. The alignment of this type is that of the + * simd::packed_ushort4. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ typedef __attribute__((__ext_vector_type__(4),__aligned__(2))) unsigned short simd_packed_ushort4; /*! @abstract A vector of eight 16-bit unsigned integers with relaxed * alignment. - * @description In C++ this type is also available as - * simd::packed::ushort8. This type is not available in Metal. The - * alignment of this type is only that of the underlying scalar element - * type, so you can use it to load or store from an array of that type. */ + * @description In C++ this type is also available as simd::packed_ushort8. + * This type is not available in Metal. The alignment of this type is only + * that of the underlying scalar element type, so you can use it to load or + * store from an array of that type. */ typedef __attribute__((__ext_vector_type__(8),__aligned__(2))) unsigned short simd_packed_ushort8; /*! @abstract A vector of sixteen 16-bit unsigned integers with relaxed * alignment. * @description In C++ this type is also available as - * simd::packed::ushort16. This type is not available in Metal. The + * simd::packed_ushort16. This type is not available in Metal. The * alignment of this type is only that of the underlying scalar element * type, so you can use it to load or store from an array of that type. */ typedef __attribute__((__ext_vector_type__(16),__aligned__(2))) unsigned short simd_packed_ushort16; @@ -203,7 +203,7 @@ typedef __attribute__((__ext_vector_type__(16),__aligned__(2))) unsigned short s /*! @abstract A vector of thirty-two 16-bit unsigned integers with relaxed * alignment. * @description In C++ this type is also available as - * simd::packed::ushort32. This type is not available in Metal. The + * simd::packed_ushort32. This type is not available in Metal. The * alignment of this type is only that of the underlying scalar element * type, so you can use it to load or store from an array of that type. */ typedef __attribute__((__ext_vector_type__(32),__aligned__(2))) unsigned short simd_packed_ushort32; @@ -211,7 +211,7 @@ typedef __attribute__((__ext_vector_type__(32),__aligned__(2))) unsigned short s /*! @abstract A vector of two 32-bit signed (twos-complement) integers with * relaxed alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::int2. The alignment of this type is that of the underlying + * simd::packed_int2. The alignment of this type is that of the underlying * scalar element type, so you can use it to load or store from an array of * that type. */ typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) int simd_packed_int2; @@ -219,14 +219,14 @@ typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) int simd_packed_i /*! @abstract A vector of four 32-bit signed (twos-complement) integers with * relaxed alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::int4. The alignment of this type is that of the underlying + * simd::packed_int4. The alignment of this type is that of the underlying * scalar element type, so you can use it to load or store from an array of * that type. */ typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) int simd_packed_int4; /*! @abstract A vector of eight 32-bit signed (twos-complement) integers * with relaxed alignment. - * @description In C++ this type is also available as simd::packed::int8. + * @description In C++ this type is also available as simd::packed_int8. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -234,7 +234,7 @@ typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) int simd_packed_i /*! @abstract A vector of sixteen 32-bit signed (twos-complement) integers * with relaxed alignment. - * @description In C++ this type is also available as simd::packed::int16. + * @description In C++ this type is also available as simd::packed_int16. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -243,22 +243,22 @@ typedef __attribute__((__ext_vector_type__(16),__aligned__(4))) int simd_packed_ /*! @abstract A vector of two 32-bit unsigned integers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::uint2. The alignment of this type is that of the - * underlying scalar element type, so you can use it to load or store from - * an array of that type. */ + * simd::packed_uint2. The alignment of this type is that of the underlying + * scalar element type, so you can use it to load or store from an array of + * that type. */ typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) unsigned int simd_packed_uint2; /*! @abstract A vector of four 32-bit unsigned integers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::uint4. The alignment of this type is that of the - * underlying scalar element type, so you can use it to load or store from - * an array of that type. */ + * simd::packed_uint4. The alignment of this type is that of the underlying + * scalar element type, so you can use it to load or store from an array of + * that type. */ typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) unsigned int simd_packed_uint4; /*! @abstract A vector of eight 32-bit unsigned integers with relaxed * alignment. - * @description In C++ this type is also available as simd::packed::uint8. + * @description In C++ this type is also available as simd::packed_uint8. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -266,7 +266,7 @@ typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) unsigned int simd /*! @abstract A vector of sixteen 32-bit unsigned integers with relaxed * alignment. - * @description In C++ this type is also available as simd::packed::uint16. + * @description In C++ this type is also available as simd::packed_uint16. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -275,7 +275,7 @@ typedef __attribute__((__ext_vector_type__(16),__aligned__(4))) unsigned int sim /*! @abstract A vector of two 32-bit floating-point numbers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::float2. The alignment of this type is that of the + * simd::packed_float2. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) float simd_packed_float2; @@ -283,14 +283,14 @@ typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) float simd_packed /*! @abstract A vector of four 32-bit floating-point numbers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::float4. The alignment of this type is that of the + * simd::packed_float4. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) float simd_packed_float4; /*! @abstract A vector of eight 32-bit floating-point numbers with relaxed * alignment. - * @description In C++ this type is also available as simd::packed::float8. + * @description In C++ this type is also available as simd::packed_float8. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -298,18 +298,18 @@ typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) float simd_packed /*! @abstract A vector of sixteen 32-bit floating-point numbers with relaxed * alignment. - * @description In C++ this type is also available as - * simd::packed::float16. This type is not available in Metal. The - * alignment of this type is only that of the underlying scalar element - * type, so you can use it to load or store from an array of that type. */ + * @description In C++ this type is also available as simd::packed_float16. + * This type is not available in Metal. The alignment of this type is only + * that of the underlying scalar element type, so you can use it to load or + * store from an array of that type. */ typedef __attribute__((__ext_vector_type__(16),__aligned__(4))) float simd_packed_float16; /*! @abstract A vector of two 64-bit signed (twos-complement) integers with * relaxed alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::long2. The alignment of this type is that of the - * underlying scalar element type, so you can use it to load or store from - * an array of that type. */ + * simd::packed_long2. The alignment of this type is that of the underlying + * scalar element type, so you can use it to load or store from an array of + * that type. */ #if defined __LP64__ typedef __attribute__((__ext_vector_type__(2),__aligned__(8))) simd_long1 simd_packed_long2; #else @@ -319,9 +319,9 @@ typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) simd_long1 simd_p /*! @abstract A vector of four 64-bit signed (twos-complement) integers with * relaxed alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::long4. The alignment of this type is that of the - * underlying scalar element type, so you can use it to load or store from - * an array of that type. */ + * simd::packed_long4. The alignment of this type is that of the underlying + * scalar element type, so you can use it to load or store from an array of + * that type. */ #if defined __LP64__ typedef __attribute__((__ext_vector_type__(4),__aligned__(8))) simd_long1 simd_packed_long4; #else @@ -330,7 +330,7 @@ typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) simd_long1 simd_p /*! @abstract A vector of eight 64-bit signed (twos-complement) integers * with relaxed alignment. - * @description In C++ this type is also available as simd::packed::long8. + * @description In C++ this type is also available as simd::packed_long8. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -343,7 +343,7 @@ typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) simd_long1 simd_p /*! @abstract A vector of two 64-bit unsigned integers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::ulong2. The alignment of this type is that of the + * simd::packed_ulong2. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ #if defined __LP64__ @@ -355,7 +355,7 @@ typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) simd_ulong1 simd_ /*! @abstract A vector of four 64-bit unsigned integers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::ulong4. The alignment of this type is that of the + * simd::packed_ulong4. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ #if defined __LP64__ @@ -366,7 +366,7 @@ typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) simd_ulong1 simd_ /*! @abstract A vector of eight 64-bit unsigned integers with relaxed * alignment. - * @description In C++ this type is also available as simd::packed::ulong8. + * @description In C++ this type is also available as simd::packed_ulong8. * This type is not available in Metal. The alignment of this type is only * that of the underlying scalar element type, so you can use it to load or * store from an array of that type. */ @@ -379,7 +379,7 @@ typedef __attribute__((__ext_vector_type__(8),__aligned__(4))) simd_ulong1 simd_ /*! @abstract A vector of two 64-bit floating-point numbers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::double2. The alignment of this type is that of the + * simd::packed_double2. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ #if defined __LP64__ @@ -391,7 +391,7 @@ typedef __attribute__((__ext_vector_type__(2),__aligned__(4))) double simd_packe /*! @abstract A vector of four 64-bit floating-point numbers with relaxed * alignment. * @description In C++ and Metal, this type is also available as - * simd::packed::double4. The alignment of this type is that of the + * simd::packed_double4. The alignment of this type is that of the * underlying scalar element type, so you can use it to load or store from * an array of that type. */ #if defined __LP64__ @@ -402,10 +402,10 @@ typedef __attribute__((__ext_vector_type__(4),__aligned__(4))) double simd_packe /*! @abstract A vector of eight 64-bit floating-point numbers with relaxed * alignment. - * @description In C++ this type is also available as - * simd::packed::double8. This type is not available in Metal. The - * alignment of this type is only that of the underlying scalar element - * type, so you can use it to load or store from an array of that type. */ + * @description In C++ this type is also available as simd::packed_double8. + * This type is not available in Metal. The alignment of this type is only + * that of the underlying scalar element type, so you can use it to load or + * store from an array of that type. */ #if defined __LP64__ typedef __attribute__((__ext_vector_type__(8),__aligned__(8))) double simd_packed_double8; #else @@ -772,259 +772,259 @@ typedef ::simd_packed_double8 double8; /*! @abstract A vector of two 8-bit signed (twos-complement) integers with * relaxed alignment. * @description This type is deprecated; you should use simd_packed_char2 - * or simd::packed::char2 instead. */ + * or simd::packed_char2 instead. */ typedef simd_packed_char2 packed_char2; /*! @abstract A vector of four 8-bit signed (twos-complement) integers with * relaxed alignment. * @description This type is deprecated; you should use simd_packed_char4 - * or simd::packed::char4 instead. */ + * or simd::packed_char4 instead. */ typedef simd_packed_char4 packed_char4; /*! @abstract A vector of eight 8-bit signed (twos-complement) integers with * relaxed alignment. * @description This type is deprecated; you should use simd_packed_char8 - * or simd::packed::char8 instead. */ + * or simd::packed_char8 instead. */ typedef simd_packed_char8 packed_char8; /*! @abstract A vector of sixteen 8-bit signed (twos-complement) integers * with relaxed alignment. * @description This type is deprecated; you should use simd_packed_char16 - * or simd::packed::char16 instead. */ + * or simd::packed_char16 instead. */ typedef simd_packed_char16 packed_char16; /*! @abstract A vector of thirty-two 8-bit signed (twos-complement) integers * with relaxed alignment. * @description This type is deprecated; you should use simd_packed_char32 - * or simd::packed::char32 instead. */ + * or simd::packed_char32 instead. */ typedef simd_packed_char32 packed_char32; /*! @abstract A vector of sixty-four 8-bit signed (twos-complement) integers * with relaxed alignment. * @description This type is deprecated; you should use simd_packed_char64 - * or simd::packed::char64 instead. */ + * or simd::packed_char64 instead. */ typedef simd_packed_char64 packed_char64; /*! @abstract A vector of two 8-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_uchar2 - * or simd::packed::uchar2 instead. */ + * or simd::packed_uchar2 instead. */ typedef simd_packed_uchar2 packed_uchar2; /*! @abstract A vector of four 8-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_uchar4 - * or simd::packed::uchar4 instead. */ + * or simd::packed_uchar4 instead. */ typedef simd_packed_uchar4 packed_uchar4; /*! @abstract A vector of eight 8-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_uchar8 - * or simd::packed::uchar8 instead. */ + * or simd::packed_uchar8 instead. */ typedef simd_packed_uchar8 packed_uchar8; /*! @abstract A vector of sixteen 8-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_uchar16 - * or simd::packed::uchar16 instead. */ + * or simd::packed_uchar16 instead. */ typedef simd_packed_uchar16 packed_uchar16; /*! @abstract A vector of thirty-two 8-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_uchar32 - * or simd::packed::uchar32 instead. */ + * or simd::packed_uchar32 instead. */ typedef simd_packed_uchar32 packed_uchar32; /*! @abstract A vector of sixty-four 8-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_uchar64 - * or simd::packed::uchar64 instead. */ + * or simd::packed_uchar64 instead. */ typedef simd_packed_uchar64 packed_uchar64; /*! @abstract A vector of two 16-bit signed (twos-complement) integers with * relaxed alignment. * @description This type is deprecated; you should use simd_packed_short2 - * or simd::packed::short2 instead. */ + * or simd::packed_short2 instead. */ typedef simd_packed_short2 packed_short2; /*! @abstract A vector of four 16-bit signed (twos-complement) integers with * relaxed alignment. * @description This type is deprecated; you should use simd_packed_short4 - * or simd::packed::short4 instead. */ + * or simd::packed_short4 instead. */ typedef simd_packed_short4 packed_short4; /*! @abstract A vector of eight 16-bit signed (twos-complement) integers * with relaxed alignment. * @description This type is deprecated; you should use simd_packed_short8 - * or simd::packed::short8 instead. */ + * or simd::packed_short8 instead. */ typedef simd_packed_short8 packed_short8; /*! @abstract A vector of sixteen 16-bit signed (twos-complement) integers * with relaxed alignment. * @description This type is deprecated; you should use simd_packed_short16 - * or simd::packed::short16 instead. */ + * or simd::packed_short16 instead. */ typedef simd_packed_short16 packed_short16; /*! @abstract A vector of thirty-two 16-bit signed (twos-complement) * integers with relaxed alignment. * @description This type is deprecated; you should use simd_packed_short32 - * or simd::packed::short32 instead. */ + * or simd::packed_short32 instead. */ typedef simd_packed_short32 packed_short32; /*! @abstract A vector of two 16-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_ushort2 - * or simd::packed::ushort2 instead. */ + * or simd::packed_ushort2 instead. */ typedef simd_packed_ushort2 packed_ushort2; /*! @abstract A vector of four 16-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_ushort4 - * or simd::packed::ushort4 instead. */ + * or simd::packed_ushort4 instead. */ typedef simd_packed_ushort4 packed_ushort4; /*! @abstract A vector of eight 16-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_ushort8 - * or simd::packed::ushort8 instead. */ + * or simd::packed_ushort8 instead. */ typedef simd_packed_ushort8 packed_ushort8; /*! @abstract A vector of sixteen 16-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use - * simd_packed_ushort16 or simd::packed::ushort16 instead. */ + * simd_packed_ushort16 or simd::packed_ushort16 instead. */ typedef simd_packed_ushort16 packed_ushort16; /*! @abstract A vector of thirty-two 16-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use - * simd_packed_ushort32 or simd::packed::ushort32 instead. */ + * simd_packed_ushort32 or simd::packed_ushort32 instead. */ typedef simd_packed_ushort32 packed_ushort32; /*! @abstract A vector of two 32-bit signed (twos-complement) integers with * relaxed alignment. * @description This type is deprecated; you should use simd_packed_int2 or - * simd::packed::int2 instead. */ + * simd::packed_int2 instead. */ typedef simd_packed_int2 packed_int2; /*! @abstract A vector of four 32-bit signed (twos-complement) integers with * relaxed alignment. * @description This type is deprecated; you should use simd_packed_int4 or - * simd::packed::int4 instead. */ + * simd::packed_int4 instead. */ typedef simd_packed_int4 packed_int4; /*! @abstract A vector of eight 32-bit signed (twos-complement) integers * with relaxed alignment. * @description This type is deprecated; you should use simd_packed_int8 or - * simd::packed::int8 instead. */ + * simd::packed_int8 instead. */ typedef simd_packed_int8 packed_int8; /*! @abstract A vector of sixteen 32-bit signed (twos-complement) integers * with relaxed alignment. * @description This type is deprecated; you should use simd_packed_int16 - * or simd::packed::int16 instead. */ + * or simd::packed_int16 instead. */ typedef simd_packed_int16 packed_int16; /*! @abstract A vector of two 32-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_uint2 - * or simd::packed::uint2 instead. */ + * or simd::packed_uint2 instead. */ typedef simd_packed_uint2 packed_uint2; /*! @abstract A vector of four 32-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_uint4 - * or simd::packed::uint4 instead. */ + * or simd::packed_uint4 instead. */ typedef simd_packed_uint4 packed_uint4; /*! @abstract A vector of eight 32-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_uint8 - * or simd::packed::uint8 instead. */ + * or simd::packed_uint8 instead. */ typedef simd_packed_uint8 packed_uint8; /*! @abstract A vector of sixteen 32-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_uint16 - * or simd::packed::uint16 instead. */ + * or simd::packed_uint16 instead. */ typedef simd_packed_uint16 packed_uint16; /*! @abstract A vector of two 32-bit floating-point numbers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_float2 - * or simd::packed::float2 instead. */ + * or simd::packed_float2 instead. */ typedef simd_packed_float2 packed_float2; /*! @abstract A vector of four 32-bit floating-point numbers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_float4 - * or simd::packed::float4 instead. */ + * or simd::packed_float4 instead. */ typedef simd_packed_float4 packed_float4; /*! @abstract A vector of eight 32-bit floating-point numbers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_float8 - * or simd::packed::float8 instead. */ + * or simd::packed_float8 instead. */ typedef simd_packed_float8 packed_float8; /*! @abstract A vector of sixteen 32-bit floating-point numbers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_float16 - * or simd::packed::float16 instead. */ + * or simd::packed_float16 instead. */ typedef simd_packed_float16 packed_float16; /*! @abstract A vector of two 64-bit signed (twos-complement) integers with * relaxed alignment. * @description This type is deprecated; you should use simd_packed_long2 - * or simd::packed::long2 instead. */ + * or simd::packed_long2 instead. */ typedef simd_packed_long2 packed_long2; /*! @abstract A vector of four 64-bit signed (twos-complement) integers with * relaxed alignment. * @description This type is deprecated; you should use simd_packed_long4 - * or simd::packed::long4 instead. */ + * or simd::packed_long4 instead. */ typedef simd_packed_long4 packed_long4; /*! @abstract A vector of eight 64-bit signed (twos-complement) integers * with relaxed alignment. * @description This type is deprecated; you should use simd_packed_long8 - * or simd::packed::long8 instead. */ + * or simd::packed_long8 instead. */ typedef simd_packed_long8 packed_long8; /*! @abstract A vector of two 64-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_ulong2 - * or simd::packed::ulong2 instead. */ + * or simd::packed_ulong2 instead. */ typedef simd_packed_ulong2 packed_ulong2; /*! @abstract A vector of four 64-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_ulong4 - * or simd::packed::ulong4 instead. */ + * or simd::packed_ulong4 instead. */ typedef simd_packed_ulong4 packed_ulong4; /*! @abstract A vector of eight 64-bit unsigned integers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_ulong8 - * or simd::packed::ulong8 instead. */ + * or simd::packed_ulong8 instead. */ typedef simd_packed_ulong8 packed_ulong8; /*! @abstract A vector of two 64-bit floating-point numbers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_double2 - * or simd::packed::double2 instead. */ + * or simd::packed_double2 instead. */ typedef simd_packed_double2 packed_double2; /*! @abstract A vector of four 64-bit floating-point numbers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_double4 - * or simd::packed::double4 instead. */ + * or simd::packed_double4 instead. */ typedef simd_packed_double4 packed_double4; /*! @abstract A vector of eight 64-bit floating-point numbers with relaxed * alignment. * @description This type is deprecated; you should use simd_packed_double8 - * or simd::packed::double8 instead. */ + * or simd::packed_double8 instead. */ typedef simd_packed_double8 packed_double8; # endif /* SIMD_COMPILER_HAS_REQUIRED_FEATURES */ diff --git a/lib/libc/include/x86_64-macos-gnu/simd/quaternion.h b/lib/libc/include/x86_64-macos-gnu/simd/quaternion.h index 5f386dea16..a1b46be335 100644 --- a/lib/libc/include/x86_64-macos-gnu/simd/quaternion.h +++ b/lib/libc/include/x86_64-macos-gnu/simd/quaternion.h @@ -435,7 +435,7 @@ static SIMD_NOINLINE simd_quatf simd_quaternion(simd_float3 from, simd_float3 to // Because from and to are more than 90 degrees apart, we compute the // rotation in two stages (from -> half), (half -> to) to preserve numerical // accuracy. - simd_float3 half = from + to; + simd_float3 half = simd_normalize(from + to); if (simd_length_squared(half) == 0) { // half is nearly zero, so from and to point in nearly opposite directions @@ -449,9 +449,8 @@ static SIMD_NOINLINE simd_quatf simd_quaternion(simd_float3 from, simd_float3 to else return _simd_quaternion(simd_normalize(simd_cross(from, (simd_float3){0,0,1})), 0.f); } - + // Compute the two-step rotation. */ - half = simd_normalize(half); return simd_mul(_simd_quaternion_reduced(from, half), _simd_quaternion_reduced(half, to)); } @@ -1021,7 +1020,7 @@ static SIMD_NOINLINE simd_quatd simd_quaternion(simd_double3 from, simd_double3 // Because from and to are more than 90 degrees apart, we compute the // rotation in two stages (from -> half), (half -> to) to preserve numerical // accuracy. - simd_double3 half = from + to; + simd_double3 half = simd_normalize(from + to); if (simd_length_squared(half) == 0) { // half is nearly zero, so from and to point in nearly opposite directions @@ -1035,9 +1034,8 @@ static SIMD_NOINLINE simd_quatd simd_quaternion(simd_double3 from, simd_double3 else return _simd_quaternion(simd_normalize(simd_cross(from, (simd_double3){0,0,1})), 0.f); } - + // Compute the two-step rotation. */ - half = simd_normalize(half); return simd_mul(_simd_quaternion_reduced(from, half), _simd_quaternion_reduced(half, to)); } diff --git a/lib/libc/include/x86_64-macos-gnu/spawn.h b/lib/libc/include/x86_64-macos-gnu/spawn.h index 667447b08c..a80f4d936a 100644 --- a/lib/libc/include/x86_64-macos-gnu/spawn.h +++ b/lib/libc/include/x86_64-macos-gnu/spawn.h @@ -135,18 +135,12 @@ __BEGIN_DECLS int posix_spawnattr_getbinpref_np(const posix_spawnattr_t * __restrict, size_t, cpu_type_t *__restrict, size_t *__restrict) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); -int posix_spawnattr_getarchpref_np(const posix_spawnattr_t * __restrict, - size_t, cpu_type_t *__restrict, cpu_subtype_t *__restrict, size_t *__restrict) __API_AVAILABLE(macos(11.0), ios(14.0)) __API_UNAVAILABLE(watchos, tvos); - int posix_spawnattr_setauditsessionport_np(posix_spawnattr_t * __restrict, mach_port_t) __API_AVAILABLE(macos(10.6), ios(3.2)); int posix_spawnattr_setbinpref_np(posix_spawnattr_t * __restrict, size_t, cpu_type_t *__restrict, size_t *__restrict) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); -int posix_spawnattr_setarchpref_np(posix_spawnattr_t * __restrict, - size_t, cpu_type_t *__restrict, cpu_subtype_t *__restrict, size_t *__restrict) __API_AVAILABLE(macos(11.0), ios(14.0)) __API_UNAVAILABLE(watchos, tvos); - int posix_spawnattr_setexceptionports_np(posix_spawnattr_t * __restrict, exception_mask_t, mach_port_t, exception_behavior_t, thread_state_flavor_t) __API_AVAILABLE(macos(10.5), ios(2.0)) __API_UNAVAILABLE(watchos, tvos); @@ -156,22 +150,6 @@ int posix_spawnattr_setspecialport_np(posix_spawnattr_t * __restrict, int posix_spawnattr_setsuidcredport_np(posix_spawnattr_t * __restrict, mach_port_t) __API_UNAVAILABLE(ios, macos); -int posix_spawnattr_setnosmt_np(const posix_spawnattr_t * __restrict attr) __API_AVAILABLE(macos(11.0)); - -/* - * Set CPU Security Mitigation on the spawned process - * This attribute affects all threads and is inherited on fork and exec - */ -int posix_spawnattr_set_csm_np(const posix_spawnattr_t * __restrict attr, uint32_t flags) __API_AVAILABLE(macos(11.0)); -/* - * flags for CPU Security Mitigation attribute - * POSIX_SPAWN_NP_CSM_ALL should be used in most cases, - * the individual flags are provided only for performance evaluation etc - */ -#define POSIX_SPAWN_NP_CSM_ALL 0x0001 -#define POSIX_SPAWN_NP_CSM_NOSMT 0x0002 -#define POSIX_SPAWN_NP_CSM_TECS 0x0004 - int posix_spawn_file_actions_addinherit_np(posix_spawn_file_actions_t *, int) __API_AVAILABLE(macos(10.7), ios(4.3)) __API_UNAVAILABLE(watchos, tvos); diff --git a/lib/libc/include/x86_64-macos-gnu/stdio.h b/lib/libc/include/x86_64-macos-gnu/stdio.h index f4d489a946..ab46f071ea 100644 --- a/lib/libc/include/x86_64-macos-gnu/stdio.h +++ b/lib/libc/include/x86_64-macos-gnu/stdio.h @@ -217,7 +217,7 @@ __END_DECLS /* Additional functionality provided by: * POSIX.2-1992 C Language Binding Option */ -#if TARGET_OS_IPHONE +#if TARGET_OS_EMBEDDED #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) #else #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg) diff --git a/lib/libc/include/x86_64-macos-gnu/stdlib.h b/lib/libc/include/x86_64-macos-gnu/stdlib.h index 825d8a52ff..035e6c0adc 100644 --- a/lib/libc/include/x86_64-macos-gnu/stdlib.h +++ b/lib/libc/include/x86_64-macos-gnu/stdlib.h @@ -178,7 +178,7 @@ unsigned long long strtoull(const char *__str, char **__endptr, int __base); #endif /* !__DARWIN_NO_LONG_LONG */ -#if TARGET_OS_IPHONE +#if TARGET_OS_EMBEDDED #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) #else #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg) @@ -347,9 +347,6 @@ int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__ void sranddev(void); void srandomdev(void); void *reallocf(void *__ptr, size_t __size) __alloc_size(2); -long long - strtonum(const char *__numstr, long long __minval, long long __maxval, const char **__errstrp) - __API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)); #if !__DARWIN_NO_LONG_LONG long long strtoq(const char *__str, char **__endptr, int __base); diff --git a/lib/libc/include/x86_64-macos-gnu/string.h b/lib/libc/include/x86_64-macos-gnu/string.h index f0c7fc602e..6329c62d8b 100644 --- a/lib/libc/include/x86_64-macos-gnu/string.h +++ b/lib/libc/include/x86_64-macos-gnu/string.h @@ -170,10 +170,6 @@ void swab(const void * __restrict, void * __restrict, ssize_t); __OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1) __TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1) int timingsafe_bcmp(const void *__b1, const void *__b2, size_t __len); - -__OSX_AVAILABLE(11.0) __IOS_AVAILABLE(14.0) -__TVOS_AVAILABLE(14.0) __WATCHOS_AVAILABLE(7.0) -int strsignal_r(int __sig, char *__strsignalbuf, size_t __buflen); __END_DECLS /* Some functions historically defined in string.h were placed in strings.h diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_attr_t.h b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_attr_t.h index 94db17084d..cba5882afb 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_attr_t.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_attr_t.h @@ -2,7 +2,7 @@ * Copyright (c) 2003-2012 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,11 +22,11 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ -#ifndef _PTHREAD_ATTR_T -#define _PTHREAD_ATTR_T +#ifndef _PTHREAD_ATTR_T +#define _PTHREAD_ATTR_T #include /* __darwin_pthread_attr_t */ typedef __darwin_pthread_attr_t pthread_attr_t; #endif /* _PTHREAD_ATTR_T */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_cond_t.h b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_cond_t.h index 4f9a05fc32..b6a7b42f4a 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_cond_t.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_cond_t.h @@ -2,7 +2,7 @@ * Copyright (c) 2003-2012 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _PTHREAD_COND_T diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_condattr_t.h b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_condattr_t.h index a18e5a814e..6e9227a8a3 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_condattr_t.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_condattr_t.h @@ -2,7 +2,7 @@ * Copyright (c) 2003-2012 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _PTHREAD_CONDATTR_T diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_rwlock_t.h b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_rwlock_t.h index 0c61c8964e..75c4e350b4 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_rwlock_t.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_rwlock_t.h @@ -2,7 +2,7 @@ * Copyright (c) 2003-2012 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _PTHREAD_RWLOCK_T diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_rwlockattr_t.h b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_rwlockattr_t.h index 936a565638..6ccd234725 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_rwlockattr_t.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_rwlockattr_t.h @@ -2,7 +2,7 @@ * Copyright (c) 2003-2012 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _PTHREAD_RWLOCKATTR_T diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_t.h b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_t.h index 519f6e0bdc..4d9e3dac95 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_t.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_t.h @@ -2,7 +2,7 @@ * Copyright (c) 2003-2012 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _PTHREAD_T diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_types.h b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_types.h index 123c31a583..d9d51b89ea 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_types.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_pthread/_pthread_types.h @@ -2,7 +2,7 @@ * Copyright (c) 2003-2013 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_select.h b/lib/libc/include/x86_64-macos-gnu/sys/_select.h index 174814916d..567d621856 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_select.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_select.h @@ -36,13 +36,8 @@ #ifndef _SYS__SELECT_H_ #define _SYS__SELECT_H_ -#include /* __DARWIN_EXTSN_C, __DARWIN_1050, __DARWIN_ALIAS_C */ -#include /* fd_set */ -#include /* struct timeval */ - int select(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, struct timeval * __restrict) - #if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT) __DARWIN_EXTSN_C(select) #else /* !_DARWIN_C_SOURCE && !_DARWIN_UNLIMITED_SELECT */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_symbol_aliasing.h b/lib/libc/include/x86_64-macos-gnu/sys/_symbol_aliasing.h index cf75ecec51..1bbcd58ebd 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_symbol_aliasing.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_symbol_aliasing.h @@ -305,30 +305,6 @@ #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_6(x) #endif -#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130700 -#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_7(x) x -#else -#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_13_7(x) -#endif - -#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 140000 -#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_0(x) x -#else -#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_0(x) -#endif - -#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 140100 -#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_1(x) x -#else -#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_1(x) -#endif - -#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 140200 -#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_2(x) x -#else -#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_14_2(x) -#endif - #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000 #define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x #else @@ -521,15 +497,3 @@ #define __DARWIN_ALIAS_STARTING_MAC___MAC_10_15_1(x) #endif -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101600 -#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_16(x) x -#else -#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_16(x) -#endif - -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 110000 -#define __DARWIN_ALIAS_STARTING_MAC___MAC_11_0(x) x -#else -#define __DARWIN_ALIAS_STARTING_MAC___MAC_11_0(x) -#endif - diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_types/_fd_def.h b/lib/libc/include/x86_64-macos-gnu/sys/_types/_fd_def.h index 1a933496a2..daadcfe6ec 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_types/_fd_def.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_types/_fd_def.h @@ -51,16 +51,12 @@ typedef struct fd_set { __int32_t fds_bits[__DARWIN_howmany(__DARWIN_FD_SETSIZE, __DARWIN_NFDBITS)]; } fd_set; -int __darwin_check_fd_set_overflow(int, const void *, int) __API_AVAILABLE(macosx(11.0), ios(14.0), tvos(14.0), watchos(7.0)); +int __darwin_check_fd_set_overflow(int, const void *, int) __attribute__((__weak_import__)); __END_DECLS __header_always_inline int __darwin_check_fd_set(int _a, const void *_b) { -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunguarded-availability-new" -#endif if ((uintptr_t)&__darwin_check_fd_set_overflow != (uintptr_t) 0) { #if defined(_DARWIN_UNLIMITED_SELECT) || defined(_DARWIN_C_SOURCE) return __darwin_check_fd_set_overflow(_a, _b, 1); @@ -70,9 +66,6 @@ __darwin_check_fd_set(int _a, const void *_b) } else { return 1; } -#ifdef __clang__ -#pragma clang diagnostic pop -#endif } /* This inline avoids argument side-effect issues with FD_ISSET() */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_types/_int8_t.h b/lib/libc/include/x86_64-macos-gnu/sys/_types/_int8_t.h index 14eb9f7ea0..9176298a5f 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_types/_int8_t.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_types/_int8_t.h @@ -27,5 +27,5 @@ */ #ifndef _INT8_T #define _INT8_T -typedef signed char int8_t; +typedef __signed char int8_t; #endif /* _INT8_T */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/_types/_ucontext.h b/lib/libc/include/x86_64-macos-gnu/sys/_types/_ucontext.h index 2360422938..65184e44e4 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/_types/_ucontext.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/_types/_ucontext.h @@ -38,7 +38,6 @@ #include /* __darwin_size_t */ #include /* _STRUCT_MCONTEXT */ #include /* __darwin_sigset_t */ -#include /* _STRUCT_SIGALTSTACK */ _STRUCT_UCONTEXT { diff --git a/lib/libc/include/x86_64-macos-gnu/sys/acl.h b/lib/libc/include/x86_64-macos-gnu/sys/acl.h index fce4eafd0a..62240bfc87 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/acl.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/acl.h @@ -25,7 +25,6 @@ #include #include -#include #define __DARWIN_ACL_READ_DATA (1<<1) #define __DARWIN_ACL_LIST_DIRECTORY __DARWIN_ACL_READ_DATA diff --git a/lib/libc/include/x86_64-macos-gnu/sys/attr.h b/lib/libc/include/x86_64-macos-gnu/sys/attr.h index 6ee6fca4ed..c9b825b0ae 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/attr.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/attr.h @@ -51,7 +51,6 @@ #define FSOPT_ATTR_CMN_EXTENDED 0x00000020 -#define FSOPT_RETURN_REALDEV 0x00000200 /* we currently aren't anywhere near this amount for a valid * fssearchblock.sizeofsearchparams1 or fssearchblock.sizeofsearchparams2 @@ -240,10 +239,6 @@ typedef struct vol_capabilities_attr { * that implies multiple volumes must be mounted in order to boot and root the * operating system. Typically, this means a read-only system volume and a * writable data volume. - * - * VOL_CAP_FMT_SEALED: When set, this volume is cryptographically sealed. - * Any modifications to volume data or metadata will be detected and may - * render the volume unusable. */ #define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001 #define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002 @@ -270,7 +265,6 @@ typedef struct vol_capabilities_attr { #define VOL_CAP_FMT_NO_PERMISSIONS 0x00400000 #define VOL_CAP_FMT_SHARED_SPACE 0x00800000 #define VOL_CAP_FMT_VOL_GROUPS 0x01000000 -#define VOL_CAP_FMT_SEALED 0x02000000 /* * VOL_CAP_INT_SEARCHFS: When set, the volume implements the @@ -521,9 +515,8 @@ typedef struct vol_attributes_attr { #define ATTR_CMNEXT_REALFSID 0x00000080 #define ATTR_CMNEXT_CLONEID 0x00000100 #define ATTR_CMNEXT_EXT_FLAGS 0x00000200 -#define ATTR_CMNEXT_RECURSIVE_GENCOUNT 0x00000400 -#define ATTR_CMNEXT_VALIDMASK 0x000007fc +#define ATTR_CMNEXT_VALIDMASK 0x000003fc #define ATTR_CMNEXT_SETMASK 0x00000000 /* Deprecated fork attributes */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/cdefs.h b/lib/libc/include/x86_64-macos-gnu/sys/cdefs.h index bf259fe23f..443b7496a5 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/cdefs.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/cdefs.h @@ -174,15 +174,6 @@ #define __cold #endif -/* __exported denotes symbols that should be exported even when symbols - * are hidden by default. - * __exported_push/_exported_pop are pragmas used to delimit a range of - * symbols that should be exported even when symbols are hidden by default. - */ -#define __exported __attribute__((__visibility__("default"))) -#define __exported_push _Pragma("GCC visibility push(default)") -#define __exported_pop _Pragma("GCC visibility pop") - /* __deprecated causes the compiler to produce a warning when encountering * code using the deprecated functionality. * __deprecated_msg() does the same, and compilers that support it will print @@ -211,17 +202,9 @@ #define __kpi_deprecated(_msg) /* __unavailable causes the compiler to error out when encountering - * code using the tagged function + * code using the tagged function of variable. */ -#if __has_attribute(unavailable) -#define __unavailable __attribute__((__unavailable__)) -#else -#define __unavailable -#endif - -#define __kpi_unavailable - -#define __kpi_deprecated_arm64_macos_unavailable +#define __unavailable __attribute__((__unavailable__)) /* Delete pseudo-keywords wherever they are not available or needed. */ #ifndef __dead @@ -488,19 +471,9 @@ /* These settings are particular to each product. */ /* Platform: MacOSX */ -#if defined(__i386__) #define __DARWIN_ONLY_64_BIT_INO_T 0 -#define __DARWIN_ONLY_UNIX_CONFORMANCE 0 +/* #undef __DARWIN_ONLY_UNIX_CONFORMANCE (automatically set for 64-bit) */ #define __DARWIN_ONLY_VERS_1050 0 -#elif defined(__x86_64__) -#define __DARWIN_ONLY_64_BIT_INO_T 0 -#define __DARWIN_ONLY_UNIX_CONFORMANCE 1 -#define __DARWIN_ONLY_VERS_1050 0 -#else -#define __DARWIN_ONLY_64_BIT_INO_T 1 -#define __DARWIN_ONLY_UNIX_CONFORMANCE 1 -#define __DARWIN_ONLY_VERS_1050 1 -#endif /* * The __DARWIN_ALIAS macros are used to do symbol renaming; they allow @@ -520,6 +493,14 @@ * pre-10.5, and it is the default compilation environment, revert the * compilation environment to pre-__DARWIN_UNIX03. */ +#if !defined(__DARWIN_ONLY_UNIX_CONFORMANCE) +# if defined(__LP64__) +# define __DARWIN_ONLY_UNIX_CONFORMANCE 1 +# else /* !__LP64__ */ +# define __DARWIN_ONLY_UNIX_CONFORMANCE 0 +# endif /* __LP64__ */ +#endif /* !__DARWIN_ONLY_UNIX_CONFORMANCE */ + #if !defined(__DARWIN_UNIX03) # if __DARWIN_ONLY_UNIX_CONFORMANCE # if defined(_NONSTD_SOURCE) @@ -822,8 +803,6 @@ */ #if !defined(__sys_cdefs_arch_unknown__) && defined(__i386__) #elif !defined(__sys_cdefs_arch_unknown__) && defined(__x86_64__) -#elif !defined(__sys_cdefs_arch_unknown__) && defined(__arm__) -#elif !defined(__sys_cdefs_arch_unknown__) && defined(__arm64__) #else #error Unsupported architecture #endif diff --git a/lib/libc/include/x86_64-macos-gnu/sys/event.h b/lib/libc/include/x86_64-macos-gnu/sys/event.h index d6e1b18e94..de14e54236 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/event.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/event.h @@ -262,7 +262,7 @@ enum { #define NOTE_EXEC 0x20000000 /* process exec'd */ #define NOTE_REAP ((unsigned int)eNoteReapDeprecated /* 0x10000000 */ ) /* process reaped */ #define NOTE_SIGNAL 0x08000000 /* shared with EVFILT_SIGNAL */ -#define NOTE_EXITSTATUS 0x04000000 /* exit status to be returned, valid for child process or when allowed to signal target pid */ +#define NOTE_EXITSTATUS 0x04000000 /* exit status to be returned, valid for child process only */ #define NOTE_EXIT_DETAIL 0x02000000 /* provide details on reasons for exit */ #define NOTE_PDATAMASK 0x000fffff /* mask for signal & exit status */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/fcntl.h b/lib/libc/include/x86_64-macos-gnu/sys/fcntl.h index f6665cee43..ef0db5a3cf 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/fcntl.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/fcntl.h @@ -107,51 +107,24 @@ * which was documented to use FREAD/FWRITE, continues to work. */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) -#define FREAD 0x00000001 -#define FWRITE 0x00000002 +#define FREAD 0x0001 +#define FWRITE 0x0002 #endif -#define O_NONBLOCK 0x00000004 /* no delay */ -#define O_APPEND 0x00000008 /* set append mode */ +#define O_NONBLOCK 0x0004 /* no delay */ +#define O_APPEND 0x0008 /* set append mode */ #include #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) -#define O_SHLOCK 0x00000010 /* open with shared file lock */ -#define O_EXLOCK 0x00000020 /* open with exclusive file lock */ -#define O_ASYNC 0x00000040 /* signal pgrp when data ready */ +#define O_SHLOCK 0x0010 /* open with shared file lock */ +#define O_EXLOCK 0x0020 /* open with exclusive file lock */ +#define O_ASYNC 0x0040 /* signal pgrp when data ready */ #define O_FSYNC O_SYNC /* source compatibility: do not use */ -#define O_NOFOLLOW 0x00000100 /* don't follow symlinks */ +#define O_NOFOLLOW 0x0100 /* don't follow symlinks */ #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ -#define O_CREAT 0x00000200 /* create if nonexistant */ -#define O_TRUNC 0x00000400 /* truncate to zero length */ -#define O_EXCL 0x00000800 /* error if already exists */ - -#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) -#define O_EVTONLY 0x00008000 /* descriptor requested for event notifications only */ -#endif - - -#define O_NOCTTY 0x00020000 /* don't assign controlling terminal */ - - -#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) -#define O_DIRECTORY 0x00100000 -#define O_SYMLINK 0x00200000 /* allow open of a symlink */ -#endif - -// O_DSYNC 0x00400000 /* synch I/O data integrity */ -#include - - -#if __DARWIN_C_LEVEL >= 200809L -#define O_CLOEXEC 0x01000000 /* implicitly set FD_CLOEXEC */ -#endif - - -#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL -#define O_NOFOLLOW_ANY 0x20000000 /* no symlinks allowed in path */ -#endif - +#define O_CREAT 0x0200 /* create if nonexistant */ +#define O_TRUNC 0x0400 /* truncate to zero length */ +#define O_EXCL 0x0800 /* error if already exists */ #if __DARWIN_C_LEVEL >= 200809L /* @@ -172,6 +145,30 @@ #endif #endif +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define O_EVTONLY 0x8000 /* descriptor requested for event notifications only */ +#endif + + +#define O_NOCTTY 0x20000 /* don't assign controlling terminal */ + + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define O_DIRECTORY 0x100000 +#define O_SYMLINK 0x200000 /* allow open of a symlink */ +#endif + +#include + + +#if __DARWIN_C_LEVEL >= 200809L +#define O_CLOEXEC 0x1000000 /* implicitly set FD_CLOEXEC */ +#endif + + + + + /* Data Protection Flags */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define O_DP_GETRAWENCRYPTED 0x0001 @@ -227,7 +224,7 @@ #define F_FLUSH_DATA 40 #define F_CHKCLEAN 41 /* Used for regression test */ #define F_PREALLOCATE 42 /* Preallocate storage */ -#define F_SETSIZE 43 /* Truncate a file. Equivalent to calling truncate(2) */ +#define F_SETSIZE 43 /* Truncate a file without zeroing space */ #define F_RDADVISE 44 /* Issue an advisory read async with no copy to user */ #define F_RDAHEAD 45 /* turn read ahead off/on for this fd */ /* @@ -296,10 +293,6 @@ #define F_GETPATH_NOFIRMLINK 102 /* return the full path without firmlinks of the fd */ -#define F_ADDFILESIGS_INFO 103 /* Add signature from same file, return information */ -#define F_ADDFILESUPPL 104 /* Add supplemental signature from same file with fd reference to original */ -#define F_GETSIGSINFO 105 /* Look up code signature information attached to a file or slice */ - // FS-specific fcntl()'s numbers begin at 0x00010000 and go up #define FCNTL_FS_SPECIFIC_BASE 0x00010000 @@ -381,34 +374,30 @@ struct radvisory { }; +/** Information the user passes in to get the codeblobs out of the kernel */ +typedef struct fcodeblobs { + void *f_cd_hash; + size_t f_hash_size; + void *f_cd_buffer; + size_t f_cd_size; + unsigned int *f_out_size; + int f_arch; + int __padding; +} fcodeblobs_t; + + /* * detached code signatures data type - * information passed by user to system used by F_ADDSIGS and F_ADDFILESIGS. * F_ADDFILESIGS is a shortcut for files that contain their own signature and * doesn't require mapping of the file in order to load the signature. */ -#define USER_FSIGNATURES_CDHASH_LEN 20 typedef struct fsignatures { off_t fs_file_start; void *fs_blob_start; size_t fs_blob_size; - - /* The following fields are only applicable to F_ADDFILESIGS_INFO (64bit only). */ - /* Prior to F_ADDFILESIGS_INFO, this struct ended after fs_blob_size. */ - size_t fs_fsignatures_size;// input: size of this struct (for compatibility) - char fs_cdhash[USER_FSIGNATURES_CDHASH_LEN]; // output: cdhash - int fs_hash_type;// output: hash algorithm type for cdhash } fsignatures_t; -typedef struct fsupplement { - off_t fs_file_start; /* offset of Mach-O image in FAT file */ - off_t fs_blob_start; /* offset of signature in Mach-O image */ - size_t fs_blob_size; /* signature blob size */ - int fs_orig_fd; /* address of original image */ -} fsupplement_t; - - - /* * DYLD needs to check if the object is allowed to be combined * into the main binary. This is done between the code signature @@ -426,19 +415,6 @@ typedef struct fchecklv { } fchecklv_t; -/* At this time F_GETSIGSINFO can only indicate platformness. - * As additional requestable information is defined, new keys will be added and the - * fgetsigsinfo_t structure will be lengthened to add space for the additional information - */ -#define GETSIGSINFO_PLATFORM_BINARY 1 - -/* fgetsigsinfo_t used by F_GETSIGSINFO command */ -typedef struct fgetsigsinfo { - off_t fg_file_start; /* IN: Offset in the file to look for a signature, -1 for any signature */ - int fg_info_request; /* IN: Key indicating the info requested */ - int fg_sig_is_platform; /* OUT: 1 if the signature is a plat form binary, 0 if not */ -} fgetsigsinfo_t; - /* lock operations for flock(2) */ #define LOCK_SH 0x01 /* shared file lock */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/ioccom.h b/lib/libc/include/x86_64-macos-gnu/sys/ioccom.h index f9d23260e3..cabce8cf7e 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/ioccom.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/ioccom.h @@ -83,7 +83,7 @@ #define IOC_OUT (__uint32_t)0x40000000 /* copy parameters in */ #define IOC_IN (__uint32_t)0x80000000 -/* copy parameters in and out */ +/* copy paramters in and out */ #define IOC_INOUT (IOC_IN|IOC_OUT) /* mask for IN/OUT/VOID */ #define IOC_DIRMASK (__uint32_t)0xe0000000 diff --git a/lib/libc/include/x86_64-macos-gnu/sys/kauth.h b/lib/libc/include/x86_64-macos-gnu/sys/kauth.h index c620159658..d2f1916262 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/kauth.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/kauth.h @@ -38,10 +38,7 @@ #include #include #include -#include /* u_int8_t, etc. */ #include /* __offsetof() */ -#include /* uid_t */ -#include /* gid_t */ #include /* NGROUPS_MAX */ #ifdef __APPLE_API_EVOLVING diff --git a/lib/libc/include/x86_64-macos-gnu/sys/mman.h b/lib/libc/include/x86_64-macos-gnu/sys/mman.h index 3eaab26d53..45ed2b8f8c 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/mman.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/mman.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2020 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2019 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -89,10 +89,6 @@ #include #include -#if __DARWIN_C_LEVEL >= 200809L -#include -#endif /* __DARWIN_C_LEVEL */ - /* * Protections are chosen from these bits, or-ed together */ @@ -149,17 +145,9 @@ #define MAP_RESILIENT_CODESIGN 0x2000 /* no code-signing failures */ #define MAP_RESILIENT_MEDIA 0x4000 /* no backing-store failures */ -#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 -#define MAP_32BIT 0x8000 /* Return virtual addresses <4G only */ -#endif /* defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 */ - - -/* - * Flags used to support translated processes. - */ -#define MAP_TRANSLATED_ALLOW_EXECUTE 0x20000 /* allow execute in translated processes */ - -#define MAP_UNIX03 0x40000 /* UNIX03 compliance */ +#if !defined(CONFIG_EMBEDDED) +#define MAP_32BIT 0x8000 /* Return virtual addresses <4G only: Requires entitlement */ +#endif /* !defined(CONFIG_EMBEDDED) */ #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ @@ -225,7 +213,6 @@ - __BEGIN_DECLS /* [ML] */ int mlockall(int); diff --git a/lib/libc/include/x86_64-macos-gnu/sys/mount.h b/lib/libc/include/x86_64-macos-gnu/sys/mount.h index 543af06a3c..b1d5386eae 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/mount.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/mount.h @@ -324,7 +324,7 @@ struct vfsidctl { * New style VFS sysctls, do not reuse/conflict with the namespace for * private sysctls. */ -#define VFS_CTL_OSTATFS 0x00010001 /* old legacy statfs */ +#define VFS_CTL_STATFS 0x00010001 /* statfs */ #define VFS_CTL_UMOUNT 0x00010002 /* unmount */ #define VFS_CTL_QUERY 0x00010003 /* anything wrong? (vfsquery) */ #define VFS_CTL_NEWADDR 0x00010004 /* reconnect to new address */ @@ -334,17 +334,6 @@ struct vfsidctl { #define VFS_CTL_DISC 0x00010008 /* server disconnected */ #define VFS_CTL_SERVERINFO 0x00010009 /* information about fs server */ #define VFS_CTL_NSTATUS 0x0001000A /* netfs mount status */ -#define VFS_CTL_STATFS64 0x0001000B /* statfs64 */ - -/* - * Automatically select the correct VFS_CTL_*STATFS* flavor based - * on what "struct statfs" layout the client will use. - */ -#if __DARWIN_64_BIT_INO_T -#define VFS_CTL_STATFS VFS_CTL_STATFS64 -#else -#define VFS_CTL_STATFS VFS_CTL_OSTATFS -#endif struct vfsquery { u_int32_t vq_flags; diff --git a/lib/libc/include/x86_64-macos-gnu/sys/param.h b/lib/libc/include/x86_64-macos-gnu/sys/param.h index 8540595d3c..e271b592b3 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/param.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/param.h @@ -197,10 +197,10 @@ #define MAXSYMLINKS 32 /* Bit map related macros. */ -#define setbit(a, i) (((unsigned char *)(a))[(i)/NBBY] |= 1u<<((i)%NBBY)) -#define clrbit(a, i) (((unsigned char *)(a))[(i)/NBBY] &= ~(1u<<((i)%NBBY))) -#define isset(a, i) (((unsigned char *)(a))[(i)/NBBY] & (1u<<((i)%NBBY))) -#define isclr(a, i) ((((unsigned char *)(a))[(i)/NBBY] & (1u<<((i)%NBBY))) == 0) +#define setbit(a, i) (((char *)(a))[(i)/NBBY] |= 1<<((i)%NBBY)) +#define clrbit(a, i) (((char *)(a))[(i)/NBBY] &= ~(1<<((i)%NBBY))) +#define isset(a, i) (((char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) +#define isclr(a, i) ((((char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) == 0) /* Macros for counting and rounding. */ #ifndef howmany @@ -218,6 +218,24 @@ #define MAX(a, b) (((a)>(b))?(a):(b)) #endif /* MAX */ +/* + * Constants for setting the parameters of the kernel memory allocator. + * + * 2 ** MINBUCKET is the smallest unit of memory that will be + * allocated. It must be at least large enough to hold a pointer. + * + * Units of memory less or equal to MAXALLOCSAVE will permanently + * allocate physical memory; requests for these size pieces of + * memory are quite fast. Allocations greater than MAXALLOCSAVE must + * always allocate and free physical memory; requests for these + * size allocations should be done infrequently as they will be slow. + * + * Constraints: CLBYTES <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and + * MAXALLOCSIZE must be a power of two. + */ +#define MINBUCKET 4 /* 4 => min allocation of 16 bytes */ +#define MAXALLOCSAVE (2 * CLBYTES) + /* * Scale factor for scaled integers used to count %cpu time and load avgs. * diff --git a/lib/libc/include/x86_64-macos-gnu/sys/proc.h b/lib/libc/include/x86_64-macos-gnu/sys/proc.h index 1ecbc39518..ff25bdd61b 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/proc.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/proc.h @@ -84,7 +84,6 @@ struct session; struct pgrp; struct proc; -struct proc_ident; /* Exported fields for kern sysctls */ struct extern_proc { diff --git a/lib/libc/include/x86_64-macos-gnu/sys/resource.h b/lib/libc/include/x86_64-macos-gnu/sys/resource.h index f3dbca00e0..a1d512cb2e 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/resource.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/resource.h @@ -188,13 +188,7 @@ struct rusage { #define RUSAGE_INFO_V2 2 #define RUSAGE_INFO_V3 3 #define RUSAGE_INFO_V4 4 -#define RUSAGE_INFO_V5 5 -#define RUSAGE_INFO_CURRENT RUSAGE_INFO_V5 - -/* - * Flags for RUSAGE_INFO_V5 - */ -#define RU_PROC_RUNS_RESLIDE 0x00000001 /* proc has reslid shared cache */ +#define RUSAGE_INFO_CURRENT RUSAGE_INFO_V4 typedef void *rusage_info_t; @@ -324,47 +318,7 @@ struct rusage_info_v4 { uint64_t ri_runnable_time; }; -struct rusage_info_v5 { - uint8_t ri_uuid[16]; - uint64_t ri_user_time; - uint64_t ri_system_time; - uint64_t ri_pkg_idle_wkups; - uint64_t ri_interrupt_wkups; - uint64_t ri_pageins; - uint64_t ri_wired_size; - uint64_t ri_resident_size; - uint64_t ri_phys_footprint; - uint64_t ri_proc_start_abstime; - uint64_t ri_proc_exit_abstime; - uint64_t ri_child_user_time; - uint64_t ri_child_system_time; - uint64_t ri_child_pkg_idle_wkups; - uint64_t ri_child_interrupt_wkups; - uint64_t ri_child_pageins; - uint64_t ri_child_elapsed_abstime; - uint64_t ri_diskio_bytesread; - uint64_t ri_diskio_byteswritten; - uint64_t ri_cpu_time_qos_default; - uint64_t ri_cpu_time_qos_maintenance; - uint64_t ri_cpu_time_qos_background; - uint64_t ri_cpu_time_qos_utility; - uint64_t ri_cpu_time_qos_legacy; - uint64_t ri_cpu_time_qos_user_initiated; - uint64_t ri_cpu_time_qos_user_interactive; - uint64_t ri_billed_system_time; - uint64_t ri_serviced_system_time; - uint64_t ri_logical_writes; - uint64_t ri_lifetime_max_phys_footprint; - uint64_t ri_instructions; - uint64_t ri_cycles; - uint64_t ri_billed_energy; - uint64_t ri_serviced_energy; - uint64_t ri_interval_max_phys_footprint; - uint64_t ri_runnable_time; - uint64_t ri_flags; -}; - -typedef struct rusage_info_v5 rusage_info_current; +typedef struct rusage_info_v4 rusage_info_current; #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ @@ -455,8 +409,6 @@ struct proc_rlimit_control_wakeupmon { #define IOPOL_TYPE_VFS_ATIME_UPDATES 2 #define IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES 3 #define IOPOL_TYPE_VFS_STATFS_NO_DATA_VOLUME 4 -#define IOPOL_TYPE_VFS_TRIGGER_RESOLVE 5 -#define IOPOL_TYPE_VFS_IGNORE_CONTENT_PROTECTION 6 /* scope */ #define IOPOL_SCOPE_PROCESS 0 @@ -486,12 +438,6 @@ struct proc_rlimit_control_wakeupmon { #define IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT 0 #define IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME 1 -#define IOPOL_VFS_TRIGGER_RESOLVE_DEFAULT 0 -#define IOPOL_VFS_TRIGGER_RESOLVE_OFF 1 - -#define IOPOL_VFS_CONTENT_PROTECTION_DEFAULT 0 -#define IOPOL_VFS_CONTENT_PROTECTION_IGNORE 1 - #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/shm.h b/lib/libc/include/x86_64-macos-gnu/sys/shm.h index 634858abe2..ab138cf564 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/shm.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/shm.h @@ -109,11 +109,7 @@ typedef unsigned short shmatt_t; * headers at this time, to avoid the resulting namespace * pollution, which is why we discourages its use. */ -#if __arm64__ -#define SHMLBA (16*1024) /* [XSI] Segment low boundary address multiple*/ -#else /* __arm64__ */ #define SHMLBA 4096 /* [XSI] Segment low boundary address multiple*/ -#endif /* __arm64__ */ /* "official" access mode definitions; somewhat braindead since you have * to specify (SHM_* >> 3) for group and (SHM_* >> 6) for world permissions */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/socket.h b/lib/libc/include/x86_64-macos-gnu/sys/socket.h index 4e1ff6e503..eb4bf144a1 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/socket.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/socket.h @@ -160,8 +160,8 @@ #define SO_ERROR 0x1007 /* get error status and clear */ #define SO_TYPE 0x1008 /* get socket type */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) -#define SO_LABEL 0x1010 /* deprecated */ -#define SO_PEERLABEL 0x1011 /* deprecated */ +#define SO_LABEL 0x1010 /* socket's MAC label */ +#define SO_PEERLABEL 0x1011 /* socket's peer MAC label */ #ifdef __APPLE__ #define SO_NREAD 0x1020 /* APPLE: get 1st-packet byte count */ #define SO_NKE 0x1021 /* APPLE: Install socket-level NKE */ @@ -182,7 +182,7 @@ #define SO_NET_SERVICE_TYPE 0x1116 /* Network service type */ -#define SO_NETSVC_MARKING_LEVEL 0x1119 /* Get QoS marking in effect for socket */ +#define SO_NETSVC_MARKING_LEVEL 0x1119 /* Get QoS marking in effect for socket */ /* * Network Service Type for option SO_NET_SERVICE_TYPE @@ -398,8 +398,7 @@ struct so_np_extensions { #define AF_RESERVED_36 36 /* Reserved for internal usage */ #define AF_IEEE80211 37 /* IEEE 802.11 protocol */ #define AF_UTUN 38 -#define AF_VSOCK 40 /* VM Sockets */ -#define AF_MAX 41 +#define AF_MAX 40 #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ /* @@ -487,7 +486,6 @@ struct sockaddr_storage { #define PF_PPP AF_PPP #define PF_RESERVED_36 AF_RESERVED_36 #define PF_UTUN AF_UTUN -#define PF_VSOCK AF_VSOCK #define PF_MAX AF_MAX /* @@ -580,13 +578,6 @@ struct msghdr { #define MSG_NEEDSA 0x10000 /* Fail receive if socket address cannot be allocated */ #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ -#if __DARWIN_C_LEVEL >= 200809L -#define MSG_NOSIGNAL 0x80000 /* do not generate SIGPIPE on EOF */ -#endif /* __DARWIN_C_LEVEL */ - -#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) -#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ - /* * Header for ancillary data objects in msg_control buffer. * Used for additional information with/about a datagram @@ -680,7 +671,7 @@ struct cmsgcred { #define SHUT_WR 1 /* shut down the writing side */ #define SHUT_RDWR 2 /* shut down both sides */ -#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#if !defined(_POSIX_C_SOURCE) /* * sendfile(2) header/trailer struct */ @@ -692,7 +683,7 @@ struct sf_hdtr { }; -#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_POSIX_C_SOURCE */ __BEGIN_DECLS diff --git a/lib/libc/include/x86_64-macos-gnu/sys/spawn.h b/lib/libc/include/x86_64-macos-gnu/sys/spawn.h index 2ec5ce26c0..498e6a9476 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/spawn.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/spawn.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006-2020 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -61,8 +61,6 @@ #define POSIX_SPAWN_SETSID 0x0400 #define POSIX_SPAWN_CLOEXEC_DEFAULT 0x4000 -#define _POSIX_SPAWN_RESLIDE 0x0800 - /* * Possible values to be set for the process control actions on resource starvation. * POSIX_SPAWN_PCONTROL_THROTTLE indicates that the process is to be throttled on starvation. diff --git a/lib/libc/include/x86_64-macos-gnu/sys/stat.h b/lib/libc/include/x86_64-macos-gnu/sys/stat.h index 27cf31a498..79dbd1dc95 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/stat.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/stat.h @@ -361,7 +361,6 @@ struct stat64 __DARWIN_STRUCT_STAT64; #endif -#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL /* * Extended flags ("EF") returned by ATTR_CMNEXT_EXT_FLAGS from getattrlist/getattrlistbulk */ @@ -370,8 +369,7 @@ struct stat64 __DARWIN_STRUCT_STAT64; #define EF_IS_SYNC_ROOT 0x00000004 /* file is a sync root for iCloud */ #define EF_IS_PURGEABLE 0x00000008 /* file is purgeable */ #define EF_IS_SPARSE 0x00000010 /* file has at least one sparse region */ -#define EF_IS_SYNTHETIC 0x00000020 /* a synthetic directory/symlink */ -#endif + diff --git a/lib/libc/include/x86_64-macos-gnu/sys/sysctl.h b/lib/libc/include/x86_64-macos-gnu/sys/sysctl.h index e11a2eb4f7..73293ac8f4 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/sysctl.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/sysctl.h @@ -553,8 +553,8 @@ extern struct loadavg averunnable; /* * CTL_HW identifiers */ -#define HW_MACHINE 1 /* string: machine class (deprecated: use HW_PRODUCT) */ -#define HW_MODEL 2 /* string: specific machine model (deprecated: use HW_TARGET) */ +#define HW_MACHINE 1 /* string: machine class */ +#define HW_MODEL 2 /* string: specific machine model */ #define HW_NCPU 3 /* int: number of cpus */ #define HW_BYTEORDER 4 /* int: machine byte order */ #define HW_PHYSMEM 5 /* int: total memory */ @@ -578,14 +578,12 @@ extern struct loadavg averunnable; #define HW_TB_FREQ 23 /* int: Bus Frequency */ #define HW_MEMSIZE 24 /* uint64_t: physical ram size */ #define HW_AVAILCPU 25 /* int: number of available CPUs */ -#define HW_TARGET 26 /* string: model identifier */ -#define HW_PRODUCT 27 /* string: product identifier */ -#define HW_MAXID 28 /* number of valid hw ids */ +#define HW_MAXID 26 /* number of valid hw ids */ #define CTL_HW_NAMES { \ { 0, 0 }, \ - { "machine", CTLTYPE_STRING }, /* Deprecated: use hw.product */ \ - { "model", CTLTYPE_STRING }, /* Deprecated: use hw.target */ \ + { "machine", CTLTYPE_STRING }, \ + { "model", CTLTYPE_STRING }, \ { "ncpu", CTLTYPE_INT }, \ { "byteorder", CTLTYPE_INT }, \ { "physmem", CTLTYPE_INT }, \ @@ -608,9 +606,7 @@ extern struct loadavg averunnable; { "l3cachesize", CTLTYPE_INT }, \ { "tbfrequency", CTLTYPE_INT }, \ { "memsize", CTLTYPE_QUAD }, \ - { "availcpu", CTLTYPE_INT }, \ - { "target", CTLTYPE_STRING }, \ - { "product", CTLTYPE_STRING }, \ + { "availcpu", CTLTYPE_INT } \ } /* @@ -759,7 +755,7 @@ extern struct loadavg averunnable; #define CTL_DEBUG_MAXID 20 -#if (CTL_MAXID != 9) || (KERN_MAXID != 72) || (VM_MAXID != 6) || (HW_MAXID != 28) || (USER_MAXID != 21) || (CTL_DEBUG_MAXID != 20) +#if (CTL_MAXID != 9) || (KERN_MAXID != 72) || (VM_MAXID != 6) || (HW_MAXID != 26) || (USER_MAXID != 21) || (CTL_DEBUG_MAXID != 20) #error Use the SYSCTL_*() macros and OID_AUTO instead! #endif diff --git a/lib/libc/include/x86_64-macos-gnu/sys/syslimits.h b/lib/libc/include/x86_64-macos-gnu/sys/syslimits.h index 1c2aa9a18c..28424700fa 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/syslimits.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/syslimits.h @@ -68,19 +68,11 @@ #include #if !defined(_ANSI_SOURCE) - -/* max bytes for an exec function */ -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) -#define ARG_MAX (1024 * 1024) -#else -#define ARG_MAX (256 * 1024) -#endif - /* * Note: CHILD_MAX *must* be less than hard_maxproc, which is set at * compile time; you *cannot* set it higher than the hard limit!! */ - +#define ARG_MAX (256 * 1024) /* max bytes for an exec function */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define CHILD_MAX 266 /* max simultaneous processes */ #define GID_MAX 2147483647U /* max value for a gid_t (2^31-2) */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/uio.h b/lib/libc/include/x86_64-macos-gnu/sys/uio.h index 3edd282425..40305923fa 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/uio.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/uio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2019 Apple Inc. All rights reserved. + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -64,10 +64,8 @@ #ifndef _SYS_UIO_H_ #define _SYS_UIO_H_ -#include #include #include -#include /* * [XSI] The ssize_t and size_t types shall be defined as described @@ -78,7 +76,7 @@ /* * [XSI] Structure whose address is passed as the second parameter to the - * readv(), preadv(), writev() and pwritev() functions. + * readv() and writev() functions. */ #include @@ -97,15 +95,6 @@ enum uio_rw { UIO_READ, UIO_WRITE }; __BEGIN_DECLS ssize_t readv(int, const struct iovec *, int) __DARWIN_ALIAS_C(readv); ssize_t writev(int, const struct iovec *, int) __DARWIN_ALIAS_C(writev); - -#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) - -ssize_t preadv(int, const struct iovec *, int, off_t) __DARWIN_NOCANCEL(preadv) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)); -ssize_t pwritev(int, const struct iovec *, int, off_t) __DARWIN_NOCANCEL(pwritev) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)); - -#endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */ - __END_DECLS - #endif /* !_SYS_UIO_H_ */ diff --git a/lib/libc/include/x86_64-macos-gnu/sys/un.h b/lib/libc/include/x86_64-macos-gnu/sys/un.h index 6d91a9ad88..93d37f9e6e 100644 --- a/lib/libc/include/x86_64-macos-gnu/sys/un.h +++ b/lib/libc/include/x86_64-macos-gnu/sys/un.h @@ -90,7 +90,6 @@ struct sockaddr_un { #define LOCAL_PEEREPID 0x003 /* retrieve eff. peer pid */ #define LOCAL_PEERUUID 0x004 /* retrieve peer UUID */ #define LOCAL_PEEREUUID 0x005 /* retrieve eff. peer UUID */ -#define LOCAL_PEERTOKEN 0x006 /* retrieve peer audit token */ #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ diff --git a/lib/libc/include/x86_64-macos-gnu/xlocale/_inttypes.h b/lib/libc/include/x86_64-macos-gnu/xlocale/_inttypes.h index 8a7f563e37..db72853f86 100644 --- a/lib/libc/include/x86_64-macos-gnu/xlocale/_inttypes.h +++ b/lib/libc/include/x86_64-macos-gnu/xlocale/_inttypes.h @@ -26,7 +26,6 @@ #include #include -#include /* wchar_t */ #include <_xlocale.h> __BEGIN_DECLS diff --git a/lib/libc/include/x86_64-macos-gnu/xlocale/_wchar.h b/lib/libc/include/x86_64-macos-gnu/xlocale/_wchar.h index b8eb41e096..260f540bd6 100644 --- a/lib/libc/include/x86_64-macos-gnu/xlocale/_wchar.h +++ b/lib/libc/include/x86_64-macos-gnu/xlocale/_wchar.h @@ -27,8 +27,6 @@ #include <_stdio.h> #include <_xlocale.h> #include -#include -#include /* wchar_t */ /* Initially added in Issue 4 */ __BEGIN_DECLS diff --git a/lib/libc/include/x86_64-macos-gnu/xpc/availability.h b/lib/libc/include/x86_64-macos-gnu/xpc/availability.h index 27650a5e53..a8339935bc 100644 --- a/lib/libc/include/x86_64-macos-gnu/xpc/availability.h +++ b/lib/libc/include/x86_64-macos-gnu/xpc/availability.h @@ -6,10 +6,6 @@ // Certain parts of the project use all the project's headers but have to build // against newer OSX SDKs than ebuild uses -- liblaunch_host being the example. // So we need to define these. -#ifndef __MAC_10_16 -#define __MAC_10_16 101600 -#endif // __MAC_10_16 - #ifndef __MAC_10_15 #define __MAC_10_15 101500 #define __AVAILABILITY_INTERNAL__MAC_10_15 \ diff --git a/lib/libc/include/x86_64-macos-gnu/xpc/base.h b/lib/libc/include/x86_64-macos-gnu/xpc/base.h index 3b265efd0a..830ae5b36b 100644 --- a/lib/libc/include/x86_64-macos-gnu/xpc/base.h +++ b/lib/libc/include/x86_64-macos-gnu/xpc/base.h @@ -29,8 +29,6 @@ __BEGIN_DECLS #include #endif // __has_include() -#include - #ifndef __XPC_INDIRECT__ #error "Please #include instead of this file directly." #endif // __XPC_INDIRECT__ diff --git a/lib/libc/include/x86_64-macos-gnu/xpc/connection.h b/lib/libc/include/x86_64-macos-gnu/xpc/connection.h index 02d7e16d85..4afa6c5a48 100644 --- a/lib/libc/include/x86_64-macos-gnu/xpc/connection.h +++ b/lib/libc/include/x86_64-macos-gnu/xpc/connection.h @@ -542,11 +542,10 @@ xpc_connection_send_message_with_reply(xpc_connection_t connection, * You are responsible for releasing the returned object. * * @discussion - * This API supports priority inversion avoidance, and should be used instead of - * combining xpc_connection_send_message_with_reply() with a semaphore. - * - * Invoking this API from a queue that is a part of the target queue hierarchy - * results in deadlocks under certain conditions. + * This API is primarily for transitional purposes. Its implementation is + * conceptually equivalent to calling xpc_connection_send_message_with_reply() + * and then immediately blocking the calling thread on a semaphore and + * signaling the semaphore from the reply block. * * Be judicious about your use of this API. It can block indefinitely, so if you * are using it to implement an API that can be called from the main thread, you diff --git a/lib/libc/include/x86_64-macos-gnu/xpc/xpc.h b/lib/libc/include/x86_64-macos-gnu/xpc/xpc.h index 3e6d38960d..48ab7c8d65 100644 --- a/lib/libc/include/x86_64-macos-gnu/xpc/xpc.h +++ b/lib/libc/include/x86_64-macos-gnu/xpc/xpc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2020 Apple Inc. All rights reserved. +// Copyright (c) 2009-2011 Apple Inc. All rights reserved. #ifndef __XPC_H__ #define __XPC_H__ @@ -37,7 +37,7 @@ __BEGIN_DECLS #define __OSX_AVAILABLE_STARTING(x, y) #endif // __OSX_AVAILABLE_STARTING -#define XPC_API_VERSION 20200610 +#define XPC_API_VERSION 20121012 /*! * @typedef xpc_type_t @@ -76,7 +76,8 @@ OS_OBJECT_DECL(xpc_object); XPC_INLINE XPC_NONNULL_ALL void _xpc_object_validate(xpc_object_t object) { - (void)*(unsigned long volatile *)(OS_OBJECT_BRIDGE void *)object; + void *isa = *(void * volatile *)(OS_OBJECT_BRIDGE void *)object; + (void)isa; } #else // OS_OBJECT_USE_OBJC typedef void * xpc_object_t; @@ -1168,23 +1169,6 @@ XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT xpc_object_t xpc_array_create(const xpc_object_t _Nonnull * _Nullable objects, size_t count); -/*! - * @function xpc_array_create_empty - * - * @abstract - * Creates an XPC object representing an array of XPC objects. - * - * @result - * A new array object. - * - * @see - * xpc_array_create - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT -xpc_object_t -xpc_array_create_empty(void); - /*! * @function xpc_array_set_value * @@ -1914,24 +1898,6 @@ xpc_object_t xpc_dictionary_create(const char * _Nonnull const * _Nullable keys, const xpc_object_t _Nullable * _Nullable values, size_t count); -/*! - * @function xpc_dictionary_create_empty - * - * @abstract - * Creates an XPC object representing a dictionary of XPC objects keyed to - * C-strings. - * - * @result - * The new dictionary object. - * - * @see - * xpc_dictionary_create - */ -API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0)) -XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT -xpc_object_t -xpc_dictionary_create_empty(void); - /*! * @function xpc_dictionary_create_reply * @@ -2682,10 +2648,6 @@ xpc_transaction_end(void); * @discussion * Multiple calls to this function for the same event stream will result in * undefined behavior. - * - * There is no API to pause delivery of XPC events. If a process that - * has set an XPC event handler exits, events may be dropped due to races - * between the event handler running and the process exiting. */ #if __BLOCKS__ __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)