macos: vendored libc: combine headers: part 1

- combine *-macos-* → any-macos-any
- SDK headers as a single tree support targeting multiple arch/versions
- bump to SDK 14.0 (release candidate)
This commit is contained in:
Michael Dusan 2023-09-15 01:05:14 -04:00
parent f3ff0b6e6d
commit 52e8354926
No known key found for this signature in database
GPG Key ID: ED4C5BA849FA1B74
833 changed files with 5119 additions and 168352 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
/*
* Copyright (c) 2004-2007 Apple Inc. All rights reserved.
*/
#ifndef _ARM__LIMITS_H_
#define _ARM__LIMITS_H_
#define __DARWIN_CLK_TCK 100 /* ticks per second */
#endif /* _ARM__LIMITS_H_ */

View File

@ -1,91 +0,0 @@
/*
* 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
* 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 __ARM_MCONTEXT_H_
#define __ARM_MCONTEXT_H_
#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
#include <sys/appleapiopts.h>
#include <mach/machine/_structs.h>
#ifndef _STRUCT_MCONTEXT32
#if __DARWIN_UNIX03
#define _STRUCT_MCONTEXT32 struct __darwin_mcontext32
_STRUCT_MCONTEXT32
{
_STRUCT_ARM_EXCEPTION_STATE __es;
_STRUCT_ARM_THREAD_STATE __ss;
_STRUCT_ARM_VFP_STATE __fs;
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_MCONTEXT32 struct mcontext32
_STRUCT_MCONTEXT32
{
_STRUCT_ARM_EXCEPTION_STATE es;
_STRUCT_ARM_THREAD_STATE ss;
_STRUCT_ARM_VFP_STATE fs;
};
#endif /* __DARWIN_UNIX03 */
#endif /* _STRUCT_MCONTEXT32 */
#ifndef _STRUCT_MCONTEXT64
#if __DARWIN_UNIX03
#define _STRUCT_MCONTEXT64 struct __darwin_mcontext64
_STRUCT_MCONTEXT64
{
_STRUCT_ARM_EXCEPTION_STATE64 __es;
_STRUCT_ARM_THREAD_STATE64 __ss;
_STRUCT_ARM_NEON_STATE64 __ns;
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_MCONTEXT64 struct mcontext64
_STRUCT_MCONTEXT64
{
_STRUCT_ARM_EXCEPTION_STATE64 es;
_STRUCT_ARM_THREAD_STATE64 ss;
_STRUCT_ARM_NEON_STATE64 ns;
};
#endif /* __DARWIN_UNIX03 */
#endif /* _STRUCT_MCONTEXT32 */
#ifndef _MCONTEXT_T
#define _MCONTEXT_T
#if defined(__arm64__)
typedef _STRUCT_MCONTEXT64 *mcontext_t;
#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT64
#else
typedef _STRUCT_MCONTEXT32 *mcontext_t;
#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT32
#endif
#endif /* _MCONTEXT_T */
#endif /* __ARM_MCONTEXT_H_ */

View File

@ -1,22 +0,0 @@
/*
* Copyright (c) 2006-2007 Apple Inc. All rights reserved.
*/
#ifndef _ARM__PARAM_H_
#define _ARM__PARAM_H_
#include <arm/_types.h>
/*
* Round p (pointer or byte index) up to a correctly-aligned value for all
* data types (int, long, ...). The result is unsigned int and must be
* 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_ALIGNBYTES32 (sizeof(__uint32_t) - 1)
#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32)
#endif /* _ARM__PARAM_H_ */

View File

@ -1,98 +0,0 @@
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
#ifndef _BSD_ARM__TYPES_H_
#define _BSD_ARM__TYPES_H_
/*
* This header file contains integer types. It's intended to also contain
* flotaing point and other arithmetic types, as needed, later.
*/
#ifdef __GNUC__
typedef __signed char __int8_t;
#else /* !__GNUC__ */
typedef char __int8_t;
#endif /* !__GNUC__ */
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
typedef long __darwin_intptr_t;
typedef unsigned int __darwin_natural_t;
/*
* The rune type below is declared to be an ``int'' instead of the more natural
* ``unsigned long'' or ``long''. Two things are happening here. It is not
* unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
* it looks like 10646 will be a 31 bit standard. This means that if your
* ints cannot hold 32 bits, you will be in trouble. The reason an int was
* chosen over a long is that the is*() and to*() routines take ints (says
* ANSI C), but they use __darwin_ct_rune_t instead of int. By changing it
* here, you lose a bit of ANSI conformance, but your programs will still
* work.
*
* NOTE: rune_t is not covered by ANSI nor other standards, and should not
* be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
* rune_t must be the same type. Also wint_t must be no narrower than
* wchar_t, and should also be able to hold all members of the largest
* character set plus one extra value (WEOF). wint_t must be at least 16 bits.
*/
typedef int __darwin_ct_rune_t; /* ct_rune_t */
/*
* mbstate_t is an opaque object to keep conversion state, during multibyte
* stream conversions. The content must not be referenced by user programs.
*/
typedef union {
char __mbstate8[128];
long long _mbstateL; /* for alignment */
} __mbstate_t;
typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */
#if defined(__PTRDIFF_TYPE__)
typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */
#elif defined(__LP64__)
typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
#else
typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */
#endif /* __GNUC__ */
#if defined(__SIZE_TYPE__)
typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */
#else
typedef unsigned long __darwin_size_t; /* sizeof() */
#endif
#if (__GNUC__ > 2)
typedef __builtin_va_list __darwin_va_list; /* va_list */
#else
typedef void * __darwin_va_list; /* va_list */
#endif
#if defined(__WCHAR_TYPE__)
typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */
#else
typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */
#endif
typedef __darwin_wchar_t __darwin_rune_t; /* rune_t */
#if defined(__WINT_TYPE__)
typedef __WINT_TYPE__ __darwin_wint_t; /* wint_t */
#else
typedef __darwin_ct_rune_t __darwin_wint_t; /* wint_t */
#endif
typedef unsigned long __darwin_clock_t; /* clock() */
typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
typedef long __darwin_ssize_t; /* byte count or error */
typedef long __darwin_time_t; /* time() */
#endif /* _BSD_ARM__TYPES_H_ */

View File

@ -1,67 +0,0 @@
/*
* Copyright (c) 2007 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
* 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 _ARM_ARCH_H
#define _ARM_ARCH_H
/* Collect the __ARM_ARCH_*__ compiler flags into something easier to use. */
#if defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7S__) || defined (__ARM_ARCH_7F__) || defined (__ARM_ARCH_7K__)
#define _ARM_ARCH_7
#endif
#if defined (_ARM_ARCH_7) || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__)
#define _ARM_ARCH_6K
#endif
#if defined (_ARM_ARCH_7) || defined (__ARM_ARCH_6Z__) || defined (__ARM_ARCH_6ZK__)
#define _ARM_ARCH_6Z
#endif
#if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) || \
defined (_ARM_ARCH_6Z) || defined (_ARM_ARCH_6K)
#define _ARM_ARCH_6
#endif
#if defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5E__) || \
defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5TEJ__)
#define _ARM_ARCH_5E
#endif
#if defined (_ARM_ARCH_5E) || defined (__ARM_ARCH_5__) || \
defined (__ARM_ARCH_5T__)
#define _ARM_ARCH_5
#endif
#if defined (_ARM_ARCH_5) || defined (__ARM_ARCH_4T__)
#define _ARM_ARCH_4T
#endif
#if defined (_ARM_ARCH_4T) || defined (__ARM_ARCH_4__)
#define _ARM_ARCH_4
#endif
#endif

View File

@ -1,78 +0,0 @@
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/*
* Copyright 1995 NeXT Computer, Inc. All rights reserved.
*/
/*
* Copyright (c) 1987, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)endian.h 8.1 (Berkeley) 6/11/93
*/
#ifndef _ARM__ENDIAN_H_
#define _ARM__ENDIAN_H_
#include <sys/cdefs.h>
/*
* Define _NOQUAD if the compiler does NOT support 64-bit integers.
*/
/* #define _NOQUAD */
/*
* Define the order of 32-bit words in 64-bit words.
*/
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0
/*
* Definitions for byte order, according to byte significance from low
* address to high.
*/
#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
#define BIG_ENDIAN __DARWIN_BIG_ENDIAN
#define PDP_ENDIAN __DARWIN_PDP_ENDIAN
#define BYTE_ORDER __DARWIN_BYTE_ORDER
#include <sys/_endian.h>
#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
#endif /* !_ARM__ENDIAN_H_ */

View File

@ -1,110 +0,0 @@
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)limits.h 8.3 (Berkeley) 1/4/94
*/
#ifndef _ARM_LIMITS_H_
#define _ARM_LIMITS_H_
#include <sys/cdefs.h>
#include <arm/_limits.h>
#define CHAR_BIT 8 /* number of bits in a char */
#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#define CLK_TCK __DARWIN_CLK_TCK /* ticks per second */
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
/*
* According to ANSI (section 2.2.4.2), the values below must be usable by
* #if preprocessing directives. Additionally, the expression must have the
* same type as would an expression that is an object of the corresponding
* type converted according to the integral promotions. The subtraction for
* INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an
* unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
* These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values
* are written as hex so that GCC will be quiet about large integer constants.
*/
#define SCHAR_MAX 127 /* min value for a signed char */
#define SCHAR_MIN (-128) /* max value for a signed char */
#define UCHAR_MAX 255 /* max value for an unsigned char */
#define CHAR_MAX 127 /* max value for a char */
#define CHAR_MIN (-128) /* min value for a char */
#define USHRT_MAX 65535 /* max value for an unsigned short */
#define SHRT_MAX 32767 /* max value for a short */
#define SHRT_MIN (-32768) /* min value for a short */
#define UINT_MAX 0xffffffff /* max value for an unsigned int */
#define INT_MAX 2147483647 /* max value for an int */
#define INT_MIN (-2147483647-1) /* min value for an int */
#ifdef __LP64__
#define ULONG_MAX 0xffffffffffffffffUL /* max unsigned long */
#define LONG_MAX 0x7fffffffffffffffL /* max signed long */
#define LONG_MIN (-0x7fffffffffffffffL-1) /* min signed long */
#else /* !__LP64__ */
#define ULONG_MAX 0xffffffffUL /* max unsigned long */
#define LONG_MAX 2147483647L /* max signed long */
#define LONG_MIN (-2147483647L-1) /* min signed long */
#endif /* __LP64__ */
#define ULLONG_MAX 0xffffffffffffffffULL /* max unsigned long long */
#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */
#if !defined(_ANSI_SOURCE)
#ifdef __LP64__
#define LONG_BIT 64
#else /* !__LP64__ */
#define LONG_BIT 32
#endif /* __LP64__ */
#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */
#define WORD_BIT 32
#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */
#define UQUAD_MAX ULLONG_MAX
#define QUAD_MAX LLONG_MAX
#define QUAD_MIN LLONG_MIN
#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
#endif /* !_ANSI_SOURCE */
#endif /* _ARM_LIMITS_H_ */

View File

@ -1,147 +0,0 @@
/*
* Copyright (c) 2000-2010 Apple Inc. All rights reserved.
*/
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)param.h 8.1 (Berkeley) 4/4/95
*/
/*
* Machine dependent constants for ARM
*/
#ifndef _ARM_PARAM_H_
#define _ARM_PARAM_H_
#include <arm/_param.h>
/*
* Round p (pointer or byte index) up to a correctly-aligned value for all
* data types (int, long, ...). The result is unsigned int and must be
* cast to any desired pointer type.
*/
#define ALIGNBYTES __DARWIN_ALIGNBYTES
#define ALIGN(p) __DARWIN_ALIGN(p)
#define NBPG 4096 /* bytes/page */
#define PGOFSET (NBPG-1) /* byte offset into page */
#define PGSHIFT 12 /* LOG2(NBPG) */
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#define CLSIZE 1
#define CLSIZELOG2 0
/*
* Constants related to network buffer management.
* MCLBYTES must be no larger than CLBYTES (the software page size), and,
* on machines that exchange pages of input or output buffers with mbuf
* clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
* of the hardware page size.
*/
#define MSIZESHIFT 8 /* 256 */
#define MSIZE (1 << MSIZESHIFT) /* size of an mbuf */
#define MCLSHIFT 11 /* 2048 */
#define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */
#define MBIGCLSHIFT 12 /* 4096 */
#define MBIGCLBYTES (1 << MBIGCLSHIFT) /* size of a big cluster */
#define M16KCLSHIFT 14 /* 16384 */
#define M16KCLBYTES (1 << M16KCLSHIFT) /* size of a jumbo cluster */
#define MCLOFSET (MCLBYTES - 1)
#ifndef NMBCLUSTERS
#define NMBCLUSTERS CONFIG_NMBCLUSTERS /* cl map size */
#endif
/*
* Some macros for units conversion
*/
/* Core clicks (NeXT_page_size bytes) to segments and vice versa */
#define ctos(x) (x)
#define stoc(x) (x)
/* Core clicks (4096 bytes) to disk blocks */
#define ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT))
#define dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT))
#define dtob(x) ((x)<<DEV_BSHIFT)
/* clicks to bytes */
#define ctob(x) ((x)<<PGSHIFT)
/* bytes to clicks */
#define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT)
#ifdef __APPLE__
#define btodb(bytes, devBlockSize) \
((unsigned)(bytes) / devBlockSize)
#define dbtob(db, devBlockSize) \
((unsigned)(db) * devBlockSize)
#else
#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
((unsigned)(bytes) >> DEV_BSHIFT)
#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
((unsigned)(db) << DEV_BSHIFT)
#endif
/*
* Map a ``block device block'' to a file system block.
* This should be device dependent, and will be if we
* add an entry to cdevsw/bdevsw for that purpose.
* For now though just use DEV_BSIZE.
*/
#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
/*
* Macros to decode (and encode) processor status word.
*/
#define STATUS_WORD(rpl, ipl) (((ipl) << 8) | (rpl))
#define USERMODE(x) (((x) & 3) == 3)
#define BASEPRI(x) (((x) & (255 << 8)) == 0)
#if defined(KERNEL) || defined(STANDALONE)
#define DELAY(n) delay(n)
#else /* defined(KERNEL) || defined(STANDALONE) */
#define DELAY(n) { int N = (n); while (--N > 0); }
#endif /* defined(KERNEL) || defined(STANDALONE) */
#endif /* _ARM_PARAM_H_ */

View File

@ -1,18 +0,0 @@
/*
* Copyright (c) 2000-2009 Apple, Inc. All rights reserved.
*/
/*
* Copyright (c) 1992 NeXT Computer, Inc.
*
*/
#ifndef _ARM_SIGNAL_
#define _ARM_SIGNAL_ 1
#include <sys/cdefs.h>
#ifndef _ANSI_SOURCE
typedef int sig_atomic_t;
#endif /* ! _ANSI_SOURCE */
#endif /* _ARM_SIGNAL_ */

View File

@ -1,107 +0,0 @@
/*
* Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*/
/*
* Copyright 1995 NeXT Computer, Inc. All rights reserved.
*/
/*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)types.h 8.3 (Berkeley) 1/5/94
*/
#ifndef _MACHTYPES_H_
#define _MACHTYPES_H_
#ifndef __ASSEMBLER__
#include <arm/_types.h>
#include <sys/cdefs.h>
/*
* Basic integral types. Omit the typedef if
* not possible for a machine/compiler combination.
*/
#include <sys/_types/_int8_t.h>
#include <sys/_types/_int16_t.h>
#include <sys/_types/_int32_t.h>
#include <sys/_types/_int64_t.h>
#include <sys/_types/_u_int8_t.h>
#include <sys/_types/_u_int16_t.h>
#include <sys/_types/_u_int32_t.h>
#include <sys/_types/_u_int64_t.h>
#if __LP64__
typedef int64_t register_t;
#else
typedef int32_t register_t;
#endif
#include <sys/_types/_intptr_t.h>
#include <sys/_types/_uintptr_t.h>
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
/* These types are used for reserving the largest possible size. */
#ifdef __arm64__
typedef u_int64_t user_addr_t;
typedef u_int64_t user_size_t;
typedef int64_t user_ssize_t;
typedef int64_t user_long_t;
typedef u_int64_t user_ulong_t;
typedef int64_t user_time_t;
typedef int64_t user_off_t;
#else
typedef u_int32_t user_addr_t;
typedef u_int32_t user_size_t;
typedef int32_t user_ssize_t;
typedef int32_t user_long_t;
typedef u_int32_t user_ulong_t;
typedef int32_t user_time_t;
typedef int64_t user_off_t;
#endif
#define USER_ADDR_NULL ((user_addr_t) 0)
#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
/* This defines the size of syscall arguments after copying into the kernel: */
#if defined(__arm__)
typedef u_int32_t syscall_arg_t;
#elif defined(__arm64__)
typedef u_int64_t syscall_arg_t;
#else
#error Unknown architecture.
#endif
#endif /* __ASSEMBLER__ */
#endif /* _MACHTYPES_H_ */

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 2004-2016 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 _OSATOMIC_H_
#define _OSATOMIC_H_
/*! @header
* These are deprecated legacy interfaces for atomic and synchronization
* operations.
*
* Define OSATOMIC_USE_INLINED=1 to get inline implementations of the
* OSAtomic interfaces in terms of the <stdatomic.h> primitives.
*
* Define OSSPINLOCK_USE_INLINED=1 to get inline implementations of the
* OSSpinLock interfaces in terms of the <os/lock.h> primitives.
*
* These are intended as a transition convenience, direct use of those
* primitives should be preferred.
*/
#include <sys/cdefs.h>
#include "OSAtomicDeprecated.h"
#include "OSSpinLockDeprecated.h"
#include "OSAtomicQueue.h"
#endif /* _OSATOMIC_H_ */

View File

@ -1,115 +0,0 @@
/*
* Copyright (c) 2004-2016 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 _OSATOMICQUEUE_H_
#define _OSATOMICQUEUE_H_
#include <stddef.h>
#include <sys/cdefs.h>
#include <stdint.h>
#include <stdbool.h>
#include "OSAtomicDeprecated.h"
#include <Availability.h>
/*! @header Lockless atomic enqueue and dequeue
* These routines manipulate singly-linked LIFO lists.
*/
__BEGIN_DECLS
/*! @abstract The data structure for a queue head.
@discussion
You should always initialize a queue head structure with the
initialization vector {@link OS_ATOMIC_QUEUE_INIT} before use.
*/
#if defined(__LP64__)
typedef volatile struct {
void *opaque1;
long opaque2;
} __attribute__ ((aligned (16))) OSQueueHead;
#else
typedef volatile struct {
void *opaque1;
long opaque2;
} OSQueueHead;
#endif
/*! @abstract The initialization vector for a queue head. */
#define OS_ATOMIC_QUEUE_INIT { 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 (<code>__new</code>).
The link field should be a pointer type.
The <code>__offset</code> 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 <code>offsetset()</code>, defined in
<code>stddef.h</code> is the common way to specify the <code>__offset</code>
value.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_4_0)
void OSAtomicEnqueue( OSQueueHead *__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 (<code>__new</code>).
The link field should be a pointer type.
The <code>__offset</code> 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 <code>offsetset()</code>, defined in
<code>stddef.h</code> is the common way to specify the <code>__offset</code>
value.
IMPORTANT: the memory backing the link field of a queue element must not be
unmapped after OSAtomicDequeue() returns until all concurrent calls to
OSAtomicDequeue() for the same list on other threads have also returned,
as they may still be accessing that memory location.
@result
Returns the most recently enqueued element, or <code>NULL</code> if the
list is empty.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_4_0)
void* OSAtomicDequeue( OSQueueHead *__list, size_t __offset);
__END_DECLS
#endif /* _OSATOMICQUEUE_H_ */

View File

@ -1,645 +0,0 @@
/*
* Copyright (c) 2004-2007 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
* 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@
*/
/*
* @OSF_COPYRIGHT@
*/
#ifndef _MACH_ARM__STRUCTS_H_
#define _MACH_ARM__STRUCTS_H_
#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
#include <machine/types.h> /* __uint32_t */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_EXCEPTION_STATE struct __darwin_arm_exception_state
_STRUCT_ARM_EXCEPTION_STATE
{
__uint32_t __exception; /* number of arm exception taken */
__uint32_t __fsr; /* Fault status */
__uint32_t __far; /* Virtual Fault Address */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_EXCEPTION_STATE struct arm_exception_state
_STRUCT_ARM_EXCEPTION_STATE
{
__uint32_t exception; /* number of arm exception taken */
__uint32_t fsr; /* Fault status */
__uint32_t far; /* Virtual Fault Address */
};
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_EXCEPTION_STATE64 struct __darwin_arm_exception_state64
_STRUCT_ARM_EXCEPTION_STATE64
{
__uint64_t __far; /* Virtual Fault Address */
__uint32_t __esr; /* Exception syndrome */
__uint32_t __exception; /* number of arm exception taken */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_EXCEPTION_STATE64 struct arm_exception_state64
_STRUCT_ARM_EXCEPTION_STATE64
{
__uint64_t far; /* Virtual Fault Address */
__uint32_t esr; /* Exception syndrome */
__uint32_t exception; /* number of arm exception taken */
};
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_THREAD_STATE struct __darwin_arm_thread_state
_STRUCT_ARM_THREAD_STATE
{
__uint32_t __r[13]; /* General purpose register r0-r12 */
__uint32_t __sp; /* Stack pointer r13 */
__uint32_t __lr; /* Link register r14 */
__uint32_t __pc; /* Program counter r15 */
__uint32_t __cpsr; /* Current program status register */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_THREAD_STATE struct arm_thread_state
_STRUCT_ARM_THREAD_STATE
{
__uint32_t r[13]; /* General purpose register r0-r12 */
__uint32_t sp; /* Stack pointer r13 */
__uint32_t lr; /* Link register r14 */
__uint32_t pc; /* Program counter r15 */
__uint32_t cpsr; /* Current program status register */
};
#endif /* __DARWIN_UNIX03 */
/*
* By default, the pointer fields in the arm_thread_state64_t structure are
* opaque on the arm64e architecture and require the use of accessor macros.
* This mode can also be enabled on the arm64 architecture by building with
* -D__DARWIN_OPAQUE_ARM_THREAD_STATE64=1.
*/
#if defined(__arm64__) && defined(__LP64__)
#if __has_feature(ptrauth_calls)
#define __DARWIN_OPAQUE_ARM_THREAD_STATE64 1
#define __DARWIN_PTRAUTH_ARM_THREAD_STATE64 1
#endif /* __has_feature(ptrauth_calls) */
#ifndef __DARWIN_OPAQUE_ARM_THREAD_STATE64
#define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0
#endif
#else /* defined(__arm64__) && defined(__LP64__) */
#undef __DARWIN_OPAQUE_ARM_THREAD_STATE64
#define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0
#endif /* defined(__arm64__) && defined(__LP64__) */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_THREAD_STATE64 struct __darwin_arm_thread_state64
#if __DARWIN_OPAQUE_ARM_THREAD_STATE64
_STRUCT_ARM_THREAD_STATE64
{
__uint64_t __x[29]; /* General purpose registers x0-x28 */
void* __opaque_fp; /* Frame pointer x29 */
void* __opaque_lr; /* Link register x30 */
void* __opaque_sp; /* Stack pointer x31 */
void* __opaque_pc; /* Program counter */
__uint32_t __cpsr; /* Current program status register */
__uint32_t __opaque_flags; /* Flags describing structure format */
};
#else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
_STRUCT_ARM_THREAD_STATE64
{
__uint64_t __x[29]; /* General purpose registers x0-x28 */
__uint64_t __fp; /* Frame pointer x29 */
__uint64_t __lr; /* Link register x30 */
__uint64_t __sp; /* Stack pointer x31 */
__uint64_t __pc; /* Program counter */
__uint32_t __cpsr; /* Current program status register */
__uint32_t __pad; /* Same size for 32-bit or 64-bit clients */
};
#endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_THREAD_STATE64 struct arm_thread_state64
#if __DARWIN_OPAQUE_ARM_THREAD_STATE64
_STRUCT_ARM_THREAD_STATE64
{
__uint64_t x[29]; /* General purpose registers x0-x28 */
void* __opaque_fp; /* Frame pointer x29 */
void* __opaque_lr; /* Link register x30 */
void* __opaque_sp; /* Stack pointer x31 */
void* __opaque_pc; /* Program counter */
__uint32_t cpsr; /* Current program status register */
__uint32_t __opaque_flags; /* Flags describing structure format */
};
#else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
_STRUCT_ARM_THREAD_STATE64
{
__uint64_t x[29]; /* General purpose registers x0-x28 */
__uint64_t fp; /* Frame pointer x29 */
__uint64_t lr; /* Link register x30 */
__uint64_t sp; /* Stack pointer x31 */
__uint64_t pc; /* Program counter */
__uint32_t cpsr; /* Current program status register */
__uint32_t __pad; /* Same size for 32-bit or 64-bit clients */
};
#endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__)
/* Accessor macros for arm_thread_state64_t pointer fields */
#if __has_feature(ptrauth_calls) && defined(__LP64__)
#include <ptrauth.h>
#if !__DARWIN_OPAQUE_ARM_THREAD_STATE64 || !__DARWIN_PTRAUTH_ARM_THREAD_STATE64
#error "Invalid configuration"
#endif
#define __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH 0x1
#define __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR 0x2
/* Return pc field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_pc(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(uintptr_t)(__tsp->__opaque_pc && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_auth_data(__tsp->__opaque_pc, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("pc")) : __tsp->__opaque_pc); })
/* Return pc field of arm_thread_state64_t as a function pointer. May return
* NULL if a valid function pointer cannot be constructed, the caller should
* fall back to the __darwin_arm_thread_state64_get_pc() macro in that case. */
#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(__tsp->__opaque_pc && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_auth_function(__tsp->__opaque_pc, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("pc")) : NULL); })
/* Set pc field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
__typeof__(fptr) __f = (fptr); __tsp->__opaque_pc = \
(__f ? (!(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_auth_and_resign(__f, ptrauth_key_function_pointer, 0, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("pc")) : ptrauth_auth_data(__f, \
ptrauth_key_function_pointer, 0)) : __f); })
/* Return lr field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_lr(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(uintptr_t)(__tsp->__opaque_lr && !(__tsp->__opaque_flags & ( \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH | \
__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR)) ? \
ptrauth_auth_data(__tsp->__opaque_lr, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("lr")) : __tsp->__opaque_lr); })
/* Return lr field of arm_thread_state64_t as a function pointer. May return
* NULL if a valid function pointer cannot be constructed, the caller should
* fall back to the __darwin_arm_thread_state64_get_lr() macro in that case. */
#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(__tsp->__opaque_lr && !(__tsp->__opaque_flags & ( \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH | \
__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR)) ? \
ptrauth_auth_function(__tsp->__opaque_lr, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("lr")) : NULL); })
/* Set lr field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
__typeof__(fptr) __f = (fptr); __tsp->__opaque_lr = \
(__f ? (!(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? (__tsp->__opaque_flags \
&= ~__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR , \
ptrauth_auth_and_resign(__f, ptrauth_key_function_pointer, 0, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("lr"))) : ptrauth_auth_data(__f, \
ptrauth_key_function_pointer, 0)) : __f); })
/* Return sp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_sp(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(uintptr_t)(__tsp->__opaque_sp && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_auth_data(__tsp->__opaque_sp, \
ptrauth_key_process_independent_data, \
ptrauth_string_discriminator("sp")) : __tsp->__opaque_sp); })
/* Set sp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
void *__p = (void*)(uintptr_t)(ptr); __tsp->__opaque_sp = \
(__p && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_sign_unauthenticated(__p, \
ptrauth_key_process_independent_data, \
ptrauth_string_discriminator("sp")) : __p); })
/* Return fp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_fp(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(uintptr_t)(__tsp->__opaque_fp && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_auth_data(__tsp->__opaque_fp, \
ptrauth_key_process_independent_data, \
ptrauth_string_discriminator("fp")) : __tsp->__opaque_fp); })
/* Set fp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
void *__p = (void*)(uintptr_t)(ptr); __tsp->__opaque_fp = \
(__p && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_sign_unauthenticated(__p, \
ptrauth_key_process_independent_data, \
ptrauth_string_discriminator("fp")) : __p); })
/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
__tsp->__opaque_pc = ((__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? __tsp->__opaque_pc : \
ptrauth_strip(__tsp->__opaque_pc, ptrauth_key_process_independent_code)); \
__tsp->__opaque_lr = ((__tsp->__opaque_flags & \
(__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH | \
__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR)) ? __tsp->__opaque_lr : \
ptrauth_strip(__tsp->__opaque_lr, ptrauth_key_process_independent_code)); \
__tsp->__opaque_sp = ((__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? __tsp->__opaque_sp : \
ptrauth_strip(__tsp->__opaque_sp, ptrauth_key_process_independent_data)); \
__tsp->__opaque_fp = ((__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? __tsp->__opaque_fp : \
ptrauth_strip(__tsp->__opaque_fp, ptrauth_key_process_independent_data)); \
__tsp->__opaque_flags |= \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH; })
#else /* __has_feature(ptrauth_calls) && defined(__LP64__) */
#if __DARWIN_OPAQUE_ARM_THREAD_STATE64
#ifndef __LP64__
#error "Invalid configuration"
#endif
/* Return pc field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_pc(ts) \
((uintptr_t)((ts).__opaque_pc))
/* Return pc field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
((ts).__opaque_pc)
/* Set pc field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
((ts).__opaque_pc = (fptr))
/* Return lr field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_lr(ts) \
((uintptr_t)((ts).__opaque_lr))
/* Return lr field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
((ts).__opaque_lr)
/* Set lr field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
((ts).__opaque_lr = (fptr))
/* Return sp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_sp(ts) \
((uintptr_t)((ts).__opaque_sp))
/* Set sp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
((ts).__opaque_sp = (void*)(uintptr_t)(ptr))
/* Return fp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_fp(ts) \
((uintptr_t)((ts).__opaque_fp))
/* Set fp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
((ts).__opaque_fp = (void*)(uintptr_t)(ptr))
/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
(void)(ts)
#else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
#if __DARWIN_UNIX03
/* Return pc field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_pc(ts) \
((ts).__pc)
/* Return pc field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
((void*)(uintptr_t)((ts).__pc))
/* Set pc field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
((ts).__pc = (uintptr_t)(fptr))
/* Return lr field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_lr(ts) \
((ts).__lr)
/* Return lr field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
((void*)(uintptr_t)((ts).__lr))
/* Set lr field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
((ts).__lr = (uintptr_t)(fptr))
/* Return sp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_sp(ts) \
((ts).__sp)
/* Set sp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
((ts).__sp = (uintptr_t)(ptr))
/* Return fp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_fp(ts) \
((ts).__fp)
/* Set fp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
((ts).__fp = (uintptr_t)(ptr))
/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
(void)(ts)
#else /* __DARWIN_UNIX03 */
/* Return pc field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_pc(ts) \
((ts).pc)
/* Return pc field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
((void*)(uintptr_t)((ts).pc))
/* Set pc field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
((ts).pc = (uintptr_t)(fptr))
/* Return lr field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_lr(ts) \
((ts).lr)
/* Return lr field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
((void*)(uintptr_t)((ts).lr))
/* Set lr field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
((ts).lr = (uintptr_t)(fptr))
/* Return sp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_sp(ts) \
((ts).sp)
/* Set sp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
((ts).sp = (uintptr_t)(ptr))
/* Return fp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_fp(ts) \
((ts).fp)
/* Set fp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
((ts).fp = (uintptr_t)(ptr))
/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
(void)(ts)
#endif /* __DARWIN_UNIX03 */
#endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
#endif /* __has_feature(ptrauth_calls) && defined(__LP64__) */
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__) */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_VFP_STATE struct __darwin_arm_vfp_state
_STRUCT_ARM_VFP_STATE
{
__uint32_t __r[64];
__uint32_t __fpscr;
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_VFP_STATE struct arm_vfp_state
_STRUCT_ARM_VFP_STATE
{
__uint32_t r[64];
__uint32_t fpscr;
};
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_NEON_STATE64 struct __darwin_arm_neon_state64
#define _STRUCT_ARM_NEON_STATE struct __darwin_arm_neon_state
#if defined(__arm64__)
_STRUCT_ARM_NEON_STATE64
{
__uint128_t __v[32];
__uint32_t __fpsr;
__uint32_t __fpcr;
};
_STRUCT_ARM_NEON_STATE
{
__uint128_t __v[16];
__uint32_t __fpsr;
__uint32_t __fpcr;
};
#elif defined(__arm__)
/*
* No 128-bit intrinsic for ARM; leave it opaque for now.
*/
_STRUCT_ARM_NEON_STATE64
{
char opaque[(32 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));
_STRUCT_ARM_NEON_STATE
{
char opaque[(16 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));
#else
#error Unknown architecture.
#endif
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_NEON_STATE64 struct arm_neon_state64
#define _STRUCT_ARM_NEON_STATE struct arm_neon_state
#if defined(__arm64__)
_STRUCT_ARM_NEON_STATE64
{
__uint128_t q[32];
uint32_t fpsr;
uint32_t fpcr;
};
_STRUCT_ARM_NEON_STATE
{
__uint128_t q[16];
uint32_t fpsr;
uint32_t fpcr;
};
#elif defined(__arm__)
/*
* No 128-bit intrinsic for ARM; leave it opaque for now.
*/
_STRUCT_ARM_NEON_STATE64
{
char opaque[(32 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));
_STRUCT_ARM_NEON_STATE
{
char opaque[(16 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));
#else
#error Unknown architecture.
#endif
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_AMX_STATE_V1 struct __darwin_arm_amx_state_v1
_STRUCT_ARM_AMX_STATE_V1
{
__uint8_t __x[8][64]; /* 8 64-byte registers */
__uint8_t __y[8][64]; /* 8 64-byte registers */
__uint8_t __z[64][64]; /* 64 64-byte registers in an M-by-N matrix */
__uint64_t __amx_state_t_el1; /* AMX_STATE_T_EL1 value */
} __attribute__((aligned(64)));
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_AMX_STATE_V1 struct arm_amx_state_v1
_STRUCT_ARM_AMX_STATE_V1
{
__uint8_t x[8][64]; /* 8 64-byte registers */
__uint8_t y[8][64]; /* 8 64-byte registers */
__uint8_t z[64][64]; /* 64 64-byte registers in an M-by-N matrix */
__uint64_t amx_state_t_el1; /* AMX_STATE_T_EL1 value. */
} __attribute__((aligned(64)));
#endif /* __DARWIN_UNIX03 */
#define _STRUCT_ARM_PAGEIN_STATE struct __arm_pagein_state
_STRUCT_ARM_PAGEIN_STATE
{
int __pagein_error;
};
/*
* Debug State
*/
#if defined(__arm__)
/* Old-fashioned debug state is only for ARM */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_DEBUG_STATE struct __darwin_arm_debug_state
_STRUCT_ARM_DEBUG_STATE
{
__uint32_t __bvr[16];
__uint32_t __bcr[16];
__uint32_t __wvr[16];
__uint32_t __wcr[16];
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_DEBUG_STATE struct arm_debug_state
_STRUCT_ARM_DEBUG_STATE
{
__uint32_t bvr[16];
__uint32_t bcr[16];
__uint32_t wvr[16];
__uint32_t wcr[16];
};
#endif /* __DARWIN_UNIX03 */
#elif defined(__arm64__)
/* ARM's arm_debug_state is ARM64's arm_legacy_debug_state */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_LEGACY_DEBUG_STATE struct __arm_legacy_debug_state
_STRUCT_ARM_LEGACY_DEBUG_STATE
{
__uint32_t __bvr[16];
__uint32_t __bcr[16];
__uint32_t __wvr[16];
__uint32_t __wcr[16];
};
#else /* __DARWIN_UNIX03 */
#define _STRUCT_ARM_LEGACY_DEBUG_STATE struct arm_legacy_debug_state
_STRUCT_ARM_LEGACY_DEBUG_STATE
{
__uint32_t bvr[16];
__uint32_t bcr[16];
__uint32_t wvr[16];
__uint32_t wcr[16];
};
#endif /* __DARWIN_UNIX03 */
#else
#error unknown architecture
#endif
#if __DARWIN_UNIX03
#define _STRUCT_ARM_DEBUG_STATE32 struct __darwin_arm_debug_state32
_STRUCT_ARM_DEBUG_STATE32
{
__uint32_t __bvr[16];
__uint32_t __bcr[16];
__uint32_t __wvr[16];
__uint32_t __wcr[16];
__uint64_t __mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
};
#define _STRUCT_ARM_DEBUG_STATE64 struct __darwin_arm_debug_state64
_STRUCT_ARM_DEBUG_STATE64
{
__uint64_t __bvr[16];
__uint64_t __bcr[16];
__uint64_t __wvr[16];
__uint64_t __wcr[16];
__uint64_t __mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_DEBUG_STATE32 struct arm_debug_state32
_STRUCT_ARM_DEBUG_STATE32
{
__uint32_t bvr[16];
__uint32_t bcr[16];
__uint32_t wvr[16];
__uint32_t wcr[16];
__uint64_t mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
};
#define _STRUCT_ARM_DEBUG_STATE64 struct arm_debug_state64
_STRUCT_ARM_DEBUG_STATE64
{
__uint64_t bvr[16];
__uint64_t bcr[16];
__uint64_t wvr[16];
__uint64_t wcr[16];
__uint64_t mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
};
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_CPMU_STATE64 struct __darwin_arm_cpmu_state64
_STRUCT_ARM_CPMU_STATE64
{
__uint64_t __ctrs[16];
};
#else /* __DARWIN_UNIX03 */
#define _STRUCT_ARM_CPMU_STATE64 struct arm_cpmu_state64
_STRUCT_ARM_CPMU_STATE64
{
__uint64_t ctrs[16];
};
#endif /* !__DARWIN_UNIX03 */
#endif /* _MACH_ARM__STRUCTS_H_ */

View File

@ -1,70 +0,0 @@
/*
* Copyright (c) 2000-2007 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
* 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@
*/
/*
* @OSF_COPYRIGHT@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
*/
/*
* File: boolean.h
*
* Boolean type, for ARM.
*/
#ifndef _MACH_ARM_BOOLEAN_H_
#define _MACH_ARM_BOOLEAN_H_
typedef int boolean_t;
#endif /* _MACH_ARM_BOOLEAN_H_ */

View File

@ -1,79 +0,0 @@
/*
* Copyright (c) 2007 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
* 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_ARM_EXCEPTION_H_
#define _MACH_ARM_EXCEPTION_H_
#define EXC_TYPES_COUNT 14 /* incl. illegal exception 0 */
#define EXC_MASK_MACHINE 0
#define EXCEPTION_CODE_MAX 2 /* code and subcode */
/*
* Trap numbers as defined by the hardware exception vectors.
*/
/*
* EXC_BAD_INSTRUCTION
*/
#define EXC_ARM_UNDEFINED 1 /* Undefined */
/*
* EXC_ARITHMETIC
*/
#define EXC_ARM_FP_UNDEFINED 0 /* Undefined Floating Point Exception */
#define EXC_ARM_FP_IO 1 /* Invalid Floating Point Operation */
#define EXC_ARM_FP_DZ 2 /* Floating Point Divide by Zero */
#define EXC_ARM_FP_OF 3 /* Floating Point Overflow */
#define EXC_ARM_FP_UF 4 /* Floating Point Underflow */
#define EXC_ARM_FP_IX 5 /* Inexact Floating Point Result */
#define EXC_ARM_FP_ID 6 /* Floating Point Denormal Input */
/*
* EXC_BAD_ACCESS
* Note: do not conflict with kern_return_t values returned by vm_fault
*/
#define EXC_ARM_DA_ALIGN 0x101 /* Alignment Fault */
#define EXC_ARM_DA_DEBUG 0x102 /* Debug (watch/break) Fault */
#define EXC_ARM_SP_ALIGN 0x103 /* SP Alignment Fault */
#define EXC_ARM_SWP 0x104 /* SWP instruction */
#define EXC_ARM_PAC_FAIL 0x105 /* PAC authentication failure */
/*
* EXC_BREAKPOINT
*/
#define EXC_ARM_BREAKPOINT 1 /* breakpoint trap */
#endif /* _MACH_ARM_EXCEPTION_H_ */

View File

@ -1,74 +0,0 @@
/*
* Copyright (c) 2000-2007 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
* 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@
*/
/*
* @OSF_COPYRIGHT@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
*/
/*
* File: kern_return.h
* Author: Avadis Tevanian, Jr., Michael Wayne Young
* Date: 1985
*
* Machine-dependent kernel return definitions.
*/
#ifndef _MACH_ARM_KERN_RETURN_H_
#define _MACH_ARM_KERN_RETURN_H_
#ifndef ASSEMBLER
typedef int kern_return_t;
#endif /* ASSEMBLER */
#endif /* _MACH_ARM_KERN_RETURN_H_ */

View File

@ -1,72 +0,0 @@
/*
* Copyright (c) 2007-2018 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
* 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_ARM_PROCESSOR_INFO_H_
#define _MACH_ARM_PROCESSOR_INFO_H_
#define PROCESSOR_CPU_STAT 0x10000003 /* Low-level CPU statistics */
#define PROCESSOR_CPU_STAT64 0x10000004 /* Low-level CPU statistics, in full 64-bit */
#include <stdint.h> /* uint32_t, uint64_t */
struct processor_cpu_stat {
uint32_t irq_ex_cnt;
uint32_t ipi_cnt;
uint32_t timer_cnt;
uint32_t undef_ex_cnt;
uint32_t unaligned_cnt;
uint32_t vfp_cnt;
uint32_t vfp_shortv_cnt;
uint32_t data_ex_cnt;
uint32_t instr_ex_cnt;
};
typedef struct processor_cpu_stat processor_cpu_stat_data_t;
typedef struct processor_cpu_stat *processor_cpu_stat_t;
#define PROCESSOR_CPU_STAT_COUNT ((mach_msg_type_number_t) \
(sizeof(processor_cpu_stat_data_t) / sizeof(natural_t)))
struct processor_cpu_stat64 {
uint64_t irq_ex_cnt;
uint64_t ipi_cnt;
uint64_t timer_cnt;
uint64_t undef_ex_cnt;
uint64_t unaligned_cnt;
uint64_t vfp_cnt;
uint64_t vfp_shortv_cnt;
uint64_t data_ex_cnt;
uint64_t instr_ex_cnt;
uint64_t pmi_cnt;
} __attribute__((packed, aligned(4)));
typedef struct processor_cpu_stat64 processor_cpu_stat64_data_t;
typedef struct processor_cpu_stat64 *processor_cpu_stat64_t;
#define PROCESSOR_CPU_STAT64_COUNT ((mach_msg_type_number_t) \
(sizeof(processor_cpu_stat64_data_t) / sizeof(integer_t)))
#endif /* _MACH_ARM_PROCESSOR_INFO_H_ */

View File

@ -1,44 +0,0 @@
/*
* Copyright (c) 2000-2007 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
* 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@
*/
/*
* @OSF_COPYRIGHT@
*/
#ifndef _MACH_ARM_THREAD_STATE_H_
#define _MACH_ARM_THREAD_STATE_H_
/* Size of maximum exported thread state in words */
#define ARM_THREAD_STATE_MAX (1296) /* Size of biggest state possible */
#if defined (__arm__) || defined(__arm64__)
#define THREAD_STATE_MAX ARM_THREAD_STATE_MAX
#else
#error Unsupported arch
#endif
#endif /* _MACH_ARM_THREAD_STATE_H_ */

View File

@ -1,249 +0,0 @@
/*
* Copyright (c) 2007 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
* 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@
*/
/*
* FILE_ID: thread_status.h
*/
#ifndef _ARM_THREAD_STATUS_H_
#define _ARM_THREAD_STATUS_H_
#include <mach/machine/_structs.h>
#include <mach/message.h>
#include <mach/vm_types.h>
#include <mach/arm/thread_state.h>
/*
* Support for determining the state of a thread
*/
/*
* Flavors
*/
#define ARM_THREAD_STATE 1
#define ARM_UNIFIED_THREAD_STATE ARM_THREAD_STATE
#define ARM_VFP_STATE 2
#define ARM_EXCEPTION_STATE 3
#define ARM_DEBUG_STATE 4 /* pre-armv8 */
#define THREAD_STATE_NONE 5
#define ARM_THREAD_STATE64 6
#define ARM_EXCEPTION_STATE64 7
// ARM_THREAD_STATE_LAST 8 /* legacy */
#define ARM_THREAD_STATE32 9
/* API */
#define ARM_DEBUG_STATE32 14
#define ARM_DEBUG_STATE64 15
#define ARM_NEON_STATE 16
#define ARM_NEON_STATE64 17
#define ARM_CPMU_STATE64 18
/* API */
#define ARM_AMX_STATE 24
#define ARM_AMX_STATE_V1 25
#define ARM_STATE_FLAVOR_IS_OTHER_VALID(_flavor_) \
((_flavor_) == ARM_AMX_STATE_V1)
#define ARM_PAGEIN_STATE 27
#define VALID_THREAD_STATE_FLAVOR(x) \
((x == ARM_THREAD_STATE) || \
(x == ARM_VFP_STATE) || \
(x == ARM_EXCEPTION_STATE) || \
(x == ARM_DEBUG_STATE) || \
(x == THREAD_STATE_NONE) || \
(x == ARM_THREAD_STATE32) || \
(x == ARM_THREAD_STATE64) || \
(x == ARM_EXCEPTION_STATE64) || \
(x == ARM_NEON_STATE) || \
(x == ARM_NEON_STATE64) || \
(x == ARM_DEBUG_STATE32) || \
(x == ARM_DEBUG_STATE64) || \
(x == ARM_PAGEIN_STATE) || \
(ARM_STATE_FLAVOR_IS_OTHER_VALID(x)))
struct arm_state_hdr {
uint32_t flavor;
uint32_t count;
};
typedef struct arm_state_hdr arm_state_hdr_t;
typedef _STRUCT_ARM_THREAD_STATE arm_thread_state_t;
typedef _STRUCT_ARM_THREAD_STATE arm_thread_state32_t;
typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t;
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__)
/* Accessor macros for arm_thread_state64_t pointer fields */
/* Return pc field of arm_thread_state64_t as a data pointer value */
#define arm_thread_state64_get_pc(ts) \
__darwin_arm_thread_state64_get_pc(ts)
/* Return pc field of arm_thread_state64_t as a function pointer. May return
* NULL if a valid function pointer cannot be constructed, the caller should
* fall back to the arm_thread_state64_get_pc() macro in that case. */
#define arm_thread_state64_get_pc_fptr(ts) \
__darwin_arm_thread_state64_get_pc_fptr(ts)
/* Set pc field of arm_thread_state64_t to a function pointer */
#define arm_thread_state64_set_pc_fptr(ts, fptr) \
__darwin_arm_thread_state64_set_pc_fptr(ts, fptr)
/* Return lr field of arm_thread_state64_t as a data pointer value */
#define arm_thread_state64_get_lr(ts) \
__darwin_arm_thread_state64_get_lr(ts)
/* Return lr field of arm_thread_state64_t as a function pointer. May return
* NULL if a valid function pointer cannot be constructed, the caller should
* fall back to the arm_thread_state64_get_lr() macro in that case. */
#define arm_thread_state64_get_lr_fptr(ts) \
__darwin_arm_thread_state64_get_lr_fptr(ts)
/* Set lr field of arm_thread_state64_t to a function pointer */
#define arm_thread_state64_set_lr_fptr(ts, fptr) \
__darwin_arm_thread_state64_set_lr_fptr(ts, fptr)
/* Return sp field of arm_thread_state64_t as a data pointer value */
#define arm_thread_state64_get_sp(ts) \
__darwin_arm_thread_state64_get_sp(ts)
/* Set sp field of arm_thread_state64_t to a data pointer value */
#define arm_thread_state64_set_sp(ts, ptr) \
__darwin_arm_thread_state64_set_sp(ts, ptr)
/* Return fp field of arm_thread_state64_t as a data pointer value */
#define arm_thread_state64_get_fp(ts) \
__darwin_arm_thread_state64_get_fp(ts)
/* Set fp field of arm_thread_state64_t to a data pointer value */
#define arm_thread_state64_set_fp(ts, ptr) \
__darwin_arm_thread_state64_set_fp(ts, ptr)
/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
#define arm_thread_state64_ptrauth_strip(ts) \
__darwin_arm_thread_state64_ptrauth_strip(ts)
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__) */
struct arm_unified_thread_state {
arm_state_hdr_t ash;
union {
arm_thread_state32_t ts_32;
arm_thread_state64_t ts_64;
} uts;
};
#define ts_32 uts.ts_32
#define ts_64 uts.ts_64
typedef struct arm_unified_thread_state arm_unified_thread_state_t;
#define ARM_THREAD_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_thread_state_t)/sizeof(uint32_t)))
#define ARM_THREAD_STATE32_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_thread_state32_t)/sizeof(uint32_t)))
#define ARM_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_thread_state64_t)/sizeof(uint32_t)))
#define ARM_UNIFIED_THREAD_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_unified_thread_state_t)/sizeof(uint32_t)))
typedef _STRUCT_ARM_VFP_STATE arm_vfp_state_t;
typedef _STRUCT_ARM_NEON_STATE arm_neon_state_t;
typedef _STRUCT_ARM_NEON_STATE arm_neon_state32_t;
typedef _STRUCT_ARM_NEON_STATE64 arm_neon_state64_t;
typedef _STRUCT_ARM_AMX_STATE_V1 arm_amx_state_v1_t;
typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state_t;
typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state32_t;
typedef _STRUCT_ARM_EXCEPTION_STATE64 arm_exception_state64_t;
typedef _STRUCT_ARM_DEBUG_STATE32 arm_debug_state32_t;
typedef _STRUCT_ARM_DEBUG_STATE64 arm_debug_state64_t;
typedef _STRUCT_ARM_PAGEIN_STATE arm_pagein_state_t;
/*
* Otherwise not ARM64 kernel and we must preserve legacy ARM definitions of
* arm_debug_state for binary compatability of userland consumers of this file.
*/
#if defined(__arm__)
typedef _STRUCT_ARM_DEBUG_STATE arm_debug_state_t;
#elif defined(__arm64__)
typedef _STRUCT_ARM_LEGACY_DEBUG_STATE arm_debug_state_t;
#else /* defined(__arm__) */
#error Undefined architecture
#endif /* defined(__arm__) */
#define ARM_VFP_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_vfp_state_t)/sizeof(uint32_t)))
#define ARM_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_exception_state_t)/sizeof(uint32_t)))
#define ARM_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_exception_state64_t)/sizeof(uint32_t)))
#define ARM_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_debug_state_t)/sizeof(uint32_t)))
#define ARM_DEBUG_STATE32_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_debug_state32_t)/sizeof(uint32_t)))
#define ARM_PAGEIN_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_pagein_state_t)/sizeof(uint32_t)))
#define ARM_DEBUG_STATE64_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_debug_state64_t)/sizeof(uint32_t)))
#define ARM_NEON_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_neon_state_t)/sizeof(uint32_t)))
#define ARM_NEON_STATE64_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_neon_state64_t)/sizeof(uint32_t)))
#define MACHINE_THREAD_STATE ARM_THREAD_STATE
#define MACHINE_THREAD_STATE_COUNT ARM_UNIFIED_THREAD_STATE_COUNT
struct arm_amx_state {
arm_state_hdr_t ash;
union {
arm_amx_state_v1_t as_v1;
} uas;
};
#define as_v1 uas.as_v1
typedef struct arm_amx_state arm_amx_state_t;
#define ARM_AMX_STATE_V1_COUNT ((mach_msg_type_number_t) \
(sizeof(arm_amx_state_v1_t)/sizeof(unsigned int)))
#define ARM_AMX_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof(arm_amx_state_t)/sizeof(unsigned int)))
/*
* Largest state on this machine:
*/
#define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX
#endif /* _ARM_THREAD_STATUS_H_ */

View File

@ -1,107 +0,0 @@
/*
* Copyright (c) 2007 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
* 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@
*/
/*
* FILE_ID: vm_param.h
*/
/*
* ARM machine dependent virtual memory parameters.
*/
#ifndef _MACH_ARM_VM_PARAM_H_
#define _MACH_ARM_VM_PARAM_H_
#if !defined (KERNEL) && !defined (__ASSEMBLER__)
#include <mach/vm_page_size.h>
#endif
#define BYTE_SIZE 8 /* byte size in bits */
#define PAGE_SHIFT vm_page_shift
#define PAGE_SIZE vm_page_size
#define PAGE_MASK vm_page_mask
#define VM_PAGE_SIZE vm_page_size
#define machine_ptob(x) ((x) << PAGE_SHIFT)
#define PAGE_MAX_SHIFT 14
#define PAGE_MAX_SIZE (1 << PAGE_MAX_SHIFT)
#define PAGE_MAX_MASK (PAGE_MAX_SIZE-1)
#define PAGE_MIN_SHIFT 12
#define PAGE_MIN_SIZE (1 << PAGE_MIN_SHIFT)
#define PAGE_MIN_MASK (PAGE_MIN_SIZE-1)
#define VM_MAX_PAGE_ADDRESS MACH_VM_MAX_ADDRESS
#ifndef __ASSEMBLER__
#if defined (__arm__)
#define VM_MIN_ADDRESS ((vm_address_t) 0x00000000)
#define VM_MAX_ADDRESS ((vm_address_t) 0x80000000)
/* system-wide values */
#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0)
#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_ADDRESS)
#elif defined (__arm64__)
#define VM_MIN_ADDRESS ((vm_address_t) 0x0000000000000000ULL)
#define VM_MAX_ADDRESS ((vm_address_t) 0x0000000080000000ULL)
/* system-wide values */
#define MACH_VM_MIN_ADDRESS_RAW 0x0ULL
#define MACH_VM_MAX_ADDRESS_RAW 0x00007FFFFE000000ULL
#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) MACH_VM_MIN_ADDRESS_RAW)
#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) MACH_VM_MAX_ADDRESS_RAW)
#define MACH_VM_MIN_GPU_CARVEOUT_ADDRESS_RAW 0x0000001000000000ULL
#define MACH_VM_MAX_GPU_CARVEOUT_ADDRESS_RAW 0x0000007000000000ULL
#define MACH_VM_MIN_GPU_CARVEOUT_ADDRESS ((mach_vm_offset_t) MACH_VM_MIN_GPU_CARVEOUT_ADDRESS_RAW)
#define MACH_VM_MAX_GPU_CARVEOUT_ADDRESS ((mach_vm_offset_t) MACH_VM_MAX_GPU_CARVEOUT_ADDRESS_RAW)
#else /* defined(__arm64__) */
#error architecture not supported
#endif
#define VM_MAP_MIN_ADDRESS VM_MIN_ADDRESS
#define VM_MAP_MAX_ADDRESS VM_MAX_ADDRESS
#endif /* !__ASSEMBLER__ */
#define SWI_SYSCALL 0x80
#endif /* _MACH_ARM_VM_PARAM_H_ */

View File

@ -1,157 +0,0 @@
/*
* Copyright (c) 2000-2007 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
* 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@
*/
/*
* @OSF_COPYRIGHT@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
*/
/*
* File: vm_types.h
* Author: Avadis Tevanian, Jr.
* Date: 1985
*
* Header file for VM data types. ARM version.
*/
#ifndef _MACH_ARM_VM_TYPES_H_
#define _MACH_ARM_VM_TYPES_H_
#ifndef ASSEMBLER
#include <arm/_types.h>
#include <stdint.h>
#include <Availability.h>
/*
* natural_t and integer_t are Mach's legacy types for machine-
* independent integer types (unsigned, and signed, respectively).
* Their original purpose was to define other types in a machine/
* compiler independent way.
*
* They also had an implicit "same size as pointer" characteristic
* to them (i.e. Mach's traditional types are very ILP32 or ILP64
* centric). We will likely support x86 ABIs that do not follow
* either ofthese models (specifically LP64). Therefore, we had to
* make a choice between making these types scale with pointers or stay
* tied to integers. Because their use is predominantly tied to
* to the size of an integer, we are keeping that association and
* breaking free from pointer size guarantees.
*
* New use of these types is discouraged.
*/
typedef __darwin_natural_t natural_t;
typedef int integer_t;
/*
* A vm_offset_t is a type-neutral pointer,
* e.g. an offset into a virtual memory space.
*/
#ifdef __LP64__
typedef uintptr_t vm_offset_t;
typedef uintptr_t vm_size_t;
typedef uint64_t mach_vm_address_t;
typedef uint64_t mach_vm_offset_t;
typedef uint64_t mach_vm_size_t;
typedef uint64_t vm_map_offset_t;
typedef uint64_t vm_map_address_t;
typedef uint64_t vm_map_size_t;
#else
typedef natural_t vm_offset_t;
/*
* A vm_size_t is the proper type for e.g.
* expressing the difference between two
* vm_offset_t entities.
*/
typedef natural_t vm_size_t;
/*
* This new type is independent of a particular vm map's
* implementation size - and represents appropriate types
* for all possible maps. This is used for interfaces
* where the size of the map is not known - or we don't
* want to have to distinguish.
*/
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0)
typedef uint32_t mach_vm_address_t;
typedef uint32_t mach_vm_offset_t;
typedef uint32_t mach_vm_size_t;
#else
typedef uint64_t mach_vm_address_t;
typedef uint64_t mach_vm_offset_t;
typedef uint64_t mach_vm_size_t;
#endif
typedef uint32_t vm_map_offset_t;
typedef uint32_t vm_map_address_t;
typedef uint32_t vm_map_size_t;
#endif /* __LP64__ */
typedef uint32_t vm32_offset_t;
typedef uint32_t vm32_address_t;
typedef uint32_t vm32_size_t;
typedef vm_offset_t mach_port_context_t;
#endif /* ASSEMBLER */
/*
* If composing messages by hand (please do not)
*/
#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32
#endif /* _MACH_ARM_VM_TYPES_H_ */

View File

@ -1,13 +0,0 @@
/*
* Copyright (c) 2004-2007 Apple Inc. All rights reserved.
*/
#ifndef _ARM__LIMITS_H_
#define _ARM__LIMITS_H_
#if defined (__arm__) || defined (__arm64__)
#define __DARWIN_CLK_TCK 100 /* ticks per second */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM__LIMITS_H_ */

View File

@ -1,25 +0,0 @@
/*
* Copyright (c) 2006-2007 Apple Inc. All rights reserved.
*/
#ifndef _ARM__PARAM_H_
#define _ARM__PARAM_H_
#if defined (__arm__) || defined (__arm64__)
#include <arm/_types.h>
/*
* Round p (pointer or byte index) up to a correctly-aligned value for all
* data types (int, long, ...). The result is unsigned int and must be
* 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_ALIGNBYTES32 (sizeof(__uint32_t) - 1)
#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32)
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM__PARAM_H_ */

View File

@ -1,71 +0,0 @@
/*
* Copyright (c) 2007 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
* 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 _ARM_ARCH_H
#define _ARM_ARCH_H
#if defined (__arm__) || defined (__arm64__)
/* Collect the __ARM_ARCH_*__ compiler flags into something easier to use. */
#if defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7S__) || defined (__ARM_ARCH_7F__) || defined (__ARM_ARCH_7K__)
#define _ARM_ARCH_7
#endif
#if defined (_ARM_ARCH_7) || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__)
#define _ARM_ARCH_6K
#endif
#if defined (_ARM_ARCH_7) || defined (__ARM_ARCH_6Z__) || defined (__ARM_ARCH_6ZK__)
#define _ARM_ARCH_6Z
#endif
#if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) || \
defined (_ARM_ARCH_6Z) || defined (_ARM_ARCH_6K)
#define _ARM_ARCH_6
#endif
#if defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5E__) || \
defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5TEJ__)
#define _ARM_ARCH_5E
#endif
#if defined (_ARM_ARCH_5E) || defined (__ARM_ARCH_5__) || \
defined (__ARM_ARCH_5T__)
#define _ARM_ARCH_5
#endif
#if defined (_ARM_ARCH_5) || defined (__ARM_ARCH_4T__)
#define _ARM_ARCH_4T
#endif
#if defined (_ARM_ARCH_4T) || defined (__ARM_ARCH_4__)
#define _ARM_ARCH_4
#endif
#endif /* defined (__arm__) || defined (__arm64__) */
#endif

View File

@ -1,114 +0,0 @@
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)limits.h 8.3 (Berkeley) 1/4/94
*/
#ifndef _ARM_LIMITS_H_
#define _ARM_LIMITS_H_
#if defined (__arm__) || defined (__arm64__)
#include <sys/cdefs.h>
#include <arm/_limits.h>
#define CHAR_BIT 8 /* number of bits in a char */
#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#define CLK_TCK __DARWIN_CLK_TCK /* ticks per second */
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
/*
* According to ANSI (section 2.2.4.2), the values below must be usable by
* #if preprocessing directives. Additionally, the expression must have the
* same type as would an expression that is an object of the corresponding
* type converted according to the integral promotions. The subtraction for
* INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an
* unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
* These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values
* are written as hex so that GCC will be quiet about large integer constants.
*/
#define SCHAR_MAX 127 /* min value for a signed char */
#define SCHAR_MIN (-128) /* max value for a signed char */
#define UCHAR_MAX 255 /* max value for an unsigned char */
#define CHAR_MAX 127 /* max value for a char */
#define CHAR_MIN (-128) /* min value for a char */
#define USHRT_MAX 65535 /* max value for an unsigned short */
#define SHRT_MAX 32767 /* max value for a short */
#define SHRT_MIN (-32768) /* min value for a short */
#define UINT_MAX 0xffffffff /* max value for an unsigned int */
#define INT_MAX 2147483647 /* max value for an int */
#define INT_MIN (-2147483647-1) /* min value for an int */
#ifdef __LP64__
#define ULONG_MAX 0xffffffffffffffffUL /* max unsigned long */
#define LONG_MAX 0x7fffffffffffffffL /* max signed long */
#define LONG_MIN (-0x7fffffffffffffffL-1) /* min signed long */
#else /* !__LP64__ */
#define ULONG_MAX 0xffffffffUL /* max unsigned long */
#define LONG_MAX 2147483647L /* max signed long */
#define LONG_MIN (-2147483647L-1) /* min signed long */
#endif /* __LP64__ */
#define ULLONG_MAX 0xffffffffffffffffULL /* max unsigned long long */
#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */
#if !defined(_ANSI_SOURCE)
#ifdef __LP64__
#define LONG_BIT 64
#else /* !__LP64__ */
#define LONG_BIT 32
#endif /* __LP64__ */
#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */
#define WORD_BIT 32
#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */
#define UQUAD_MAX ULLONG_MAX
#define QUAD_MAX LLONG_MAX
#define QUAD_MIN LLONG_MIN
#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
#endif /* !_ANSI_SOURCE */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM_LIMITS_H_ */

View File

@ -1,22 +0,0 @@
/*
* Copyright (c) 2000-2009 Apple, Inc. All rights reserved.
*/
/*
* Copyright (c) 1992 NeXT Computer, Inc.
*
*/
#ifndef _ARM_SIGNAL_
#define _ARM_SIGNAL_ 1
#if defined (__arm__) || defined (__arm64__)
#include <sys/cdefs.h>
#ifndef _ANSI_SOURCE
typedef int sig_atomic_t;
#endif /* ! _ANSI_SOURCE */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM_SIGNAL_ */

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 2004-2016 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 _OSATOMIC_H_
#define _OSATOMIC_H_
/*! @header
* These are deprecated legacy interfaces for atomic and synchronization
* operations.
*
* Define OSATOMIC_USE_INLINED=1 to get inline implementations of the
* OSAtomic interfaces in terms of the <stdatomic.h> primitives.
*
* Define OSSPINLOCK_USE_INLINED=1 to get inline implementations of the
* OSSpinLock interfaces in terms of the <os/lock.h> primitives.
*
* These are intended as a transition convenience, direct use of those
* primitives should be preferred.
*/
#include <sys/cdefs.h>
#include "OSAtomicDeprecated.h"
#include "OSSpinLockDeprecated.h"
#include "OSAtomicQueue.h"
#endif /* _OSATOMIC_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,212 +0,0 @@
/*
* Copyright (c) 2004-2016 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 _OSSPINLOCK_DEPRECATED_H_
#define _OSSPINLOCK_DEPRECATED_H_
/*! @header
* These are deprecated legacy interfaces for userspace spinlocks.
*
* These interfaces should no longer be used, particularily in situations where
* threads of differing priorities may contend on the same spinlock.
*
* The interfaces in <os/lock.h> should be used instead in cases where a very
* low-level lock primitive is required. In general however, using higher level
* synchronization primitives such as those provided by the pthread or dispatch
* subsystems should be preferred.
*
* Define OSSPINLOCK_USE_INLINED=1 to get inline implementations of these
* interfaces in terms of the <os/lock.h> primitives. This is intended as a
* transition convenience, direct use of those primitives is preferred.
*/
#ifndef OSSPINLOCK_DEPRECATED
#define OSSPINLOCK_DEPRECATED 1
#define OSSPINLOCK_DEPRECATED_MSG(_r) "Use " #_r "() from <os/lock.h> instead"
#define OSSPINLOCK_DEPRECATED_REPLACE_WITH(_r) \
__OS_AVAILABILITY_MSG(macosx, deprecated=10.12, OSSPINLOCK_DEPRECATED_MSG(_r)) \
__OS_AVAILABILITY_MSG(ios, deprecated=10.0, OSSPINLOCK_DEPRECATED_MSG(_r)) \
__OS_AVAILABILITY_MSG(tvos, deprecated=10.0, OSSPINLOCK_DEPRECATED_MSG(_r)) \
__OS_AVAILABILITY_MSG(watchos, deprecated=3.0, OSSPINLOCK_DEPRECATED_MSG(_r))
#else
#undef OSSPINLOCK_DEPRECATED
#define OSSPINLOCK_DEPRECATED 0
#define OSSPINLOCK_DEPRECATED_REPLACE_WITH(_r)
#endif
#if !(defined(OSSPINLOCK_USE_INLINED) && OSSPINLOCK_USE_INLINED)
#include <sys/cdefs.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <Availability.h>
__BEGIN_DECLS
/*! @abstract The default value for an <code>OSSpinLock</code>.
@discussion
The convention is that unlocked is zero, locked is nonzero.
*/
#define OS_SPINLOCK_INIT 0
/*! @abstract Data type for a spinlock.
@discussion
You should always initialize a spinlock to {@link OS_SPINLOCK_INIT} before
using it.
*/
typedef int32_t OSSpinLock OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock);
/*! @abstract Locks a spinlock if it would not block
@result
Returns <code>false</code> if the lock was already held by another thread,
<code>true</code> if it took the lock successfully.
*/
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_trylock)
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
bool OSSpinLockTry( volatile OSSpinLock *__lock );
/*! @abstract Locks a spinlock
@discussion
Although the lock operation spins, it employs various strategies to back
off if the lock is held.
*/
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_lock)
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
void OSSpinLockLock( volatile OSSpinLock *__lock );
/*! @abstract Unlocks a spinlock */
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_unlock)
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
void OSSpinLockUnlock( volatile OSSpinLock *__lock );
__END_DECLS
#else /* OSSPINLOCK_USE_INLINED */
/*
* Inline implementations of the legacy OSSpinLock interfaces in terms of the
* of the <os/lock.h> primitives. Direct use of those primitives is preferred.
*
* NOTE: the locked value of os_unfair_lock is implementation defined and
* subject to change, code that relies on the specific locked value used by the
* legacy OSSpinLock interface WILL break when using these inline
* implementations in terms of os_unfair_lock.
*/
#if !OSSPINLOCK_USE_INLINED_TRANSPARENT
#include <os/lock.h>
__BEGIN_DECLS
#if __has_attribute(always_inline)
#define OSSPINLOCK_INLINE static __inline
#else
#define OSSPINLOCK_INLINE static __inline __attribute__((__always_inline__))
#endif
#define OS_SPINLOCK_INIT 0
typedef int32_t OSSpinLock;
#if __has_extension(c_static_assert)
_Static_assert(sizeof(OSSpinLock) == sizeof(os_unfair_lock),
"Incompatible os_unfair_lock type");
#endif
OSSPINLOCK_INLINE
void
OSSpinLockLock(volatile OSSpinLock *__lock)
{
os_unfair_lock_t lock = (os_unfair_lock_t)__lock;
return os_unfair_lock_lock(lock);
}
OSSPINLOCK_INLINE
bool
OSSpinLockTry(volatile OSSpinLock *__lock)
{
os_unfair_lock_t lock = (os_unfair_lock_t)__lock;
return os_unfair_lock_trylock(lock);
}
OSSPINLOCK_INLINE
void
OSSpinLockUnlock(volatile OSSpinLock *__lock)
{
os_unfair_lock_t lock = (os_unfair_lock_t)__lock;
return os_unfair_lock_unlock(lock);
}
#undef OSSPINLOCK_INLINE
__END_DECLS
#else /* OSSPINLOCK_USE_INLINED_TRANSPARENT */
#include <sys/cdefs.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <Availability.h>
#define OS_NOSPIN_LOCK_AVAILABILITY \
__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) \
__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
__BEGIN_DECLS
#define OS_SPINLOCK_INIT 0
typedef int32_t OSSpinLock OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock);
typedef volatile OSSpinLock *_os_nospin_lock_t
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_t);
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_lock)
OS_NOSPIN_LOCK_AVAILABILITY
void _os_nospin_lock_lock(_os_nospin_lock_t lock);
#undef OSSpinLockLock
#define OSSpinLockLock(lock) _os_nospin_lock_lock(lock)
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_trylock)
OS_NOSPIN_LOCK_AVAILABILITY
bool _os_nospin_lock_trylock(_os_nospin_lock_t lock);
#undef OSSpinLockTry
#define OSSpinLockTry(lock) _os_nospin_lock_trylock(lock)
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_unlock)
OS_NOSPIN_LOCK_AVAILABILITY
void _os_nospin_lock_unlock(_os_nospin_lock_t lock);
#undef OSSpinLockUnlock
#define OSSpinLockUnlock(lock) _os_nospin_lock_unlock(lock)
__END_DECLS
#endif /* OSSPINLOCK_USE_INLINED_TRANSPARENT */
#endif /* OSSPINLOCK_USE_INLINED */
#endif /* _OSSPINLOCK_DEPRECATED_H_ */

View File

@ -1,216 +0,0 @@
/*
* Copyright (c) 1999-2007 Apple Inc. All rights reserved.
*/
#ifndef _OS_OSBYTEORDERARM_H
#define _OS_OSBYTEORDERARM_H
#include <stdint.h>
#include <arm/arch.h> /* for _ARM_ARCH_6 */
/* Generic byte swapping functions. */
__DARWIN_OS_INLINE
uint16_t
_OSSwapInt16(
uint16_t _data
)
{
/* Reduces to 'rev16' with clang */
return (uint16_t)(_data << 8 | _data >> 8);
}
__DARWIN_OS_INLINE
uint32_t
_OSSwapInt32(
uint32_t _data
)
{
#if defined(__llvm__)
_data = __builtin_bswap32(_data);
#else
/* This actually generates the best code */
_data = (((_data ^ (_data >> 16 | (_data << 16))) & 0xFF00FFFF) >> 8) ^ (_data >> 8 | _data << 24);
#endif
return _data;
}
__DARWIN_OS_INLINE
uint64_t
_OSSwapInt64(
uint64_t _data
)
{
#if defined(__llvm__)
return __builtin_bswap64(_data);
#else
union {
uint64_t _ull;
uint32_t _ul[2];
} _u;
/* This actually generates the best code */
_u._ul[0] = (uint32_t)(_data >> 32);
_u._ul[1] = (uint32_t)(_data & 0xffffffff);
_u._ul[0] = _OSSwapInt32(_u._ul[0]);
_u._ul[1] = _OSSwapInt32(_u._ul[1]);
return _u._ull;
#endif
}
/* Functions for byte reversed loads. */
struct _OSUnalignedU16 {
volatile uint16_t __val;
} __attribute__((__packed__));
struct _OSUnalignedU32 {
volatile uint32_t __val;
} __attribute__((__packed__));
struct _OSUnalignedU64 {
volatile uint64_t __val;
} __attribute__((__packed__));
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
uint16_t
_OSReadSwapInt16(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt16(((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val);
}
#else
__DARWIN_OS_INLINE
uint16_t
OSReadSwapInt16(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt16(((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val);
}
#endif
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
uint32_t
_OSReadSwapInt32(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt32(((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val);
}
#else
__DARWIN_OS_INLINE
uint32_t
OSReadSwapInt32(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt32(((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val);
}
#endif
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
uint64_t
_OSReadSwapInt64(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt64(((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val);
}
#else
__DARWIN_OS_INLINE
uint64_t
OSReadSwapInt64(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt64(((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val);
}
#endif
/* Functions for byte reversed stores. */
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
void
_OSWriteSwapInt16(
volatile void * _base,
uintptr_t _offset,
uint16_t _data
)
{
((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt16(_data);
}
#else
__DARWIN_OS_INLINE
void
OSWriteSwapInt16(
volatile void * _base,
uintptr_t _offset,
uint16_t _data
)
{
((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt16(_data);
}
#endif
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
void
_OSWriteSwapInt32(
volatile void * _base,
uintptr_t _offset,
uint32_t _data
)
{
((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt32(_data);
}
#else
__DARWIN_OS_INLINE
void
OSWriteSwapInt32(
volatile void * _base,
uintptr_t _offset,
uint32_t _data
)
{
((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt32(_data);
}
#endif
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
void
_OSWriteSwapInt64(
volatile void * _base,
uintptr_t _offset,
uint64_t _data
)
{
((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt64(_data);
}
#else
__DARWIN_OS_INLINE
void
OSWriteSwapInt64(
volatile void * _base,
uintptr_t _offset,
uint64_t _data
)
{
((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt64(_data);
}
#endif
#endif /* ! _OS_OSBYTEORDERARM_H */

View File

@ -1,639 +0,0 @@
/*
* Copyright (c) 2004-2007 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
* 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@
*/
/*
* @OSF_COPYRIGHT@
*/
#ifndef _MACH_ARM__STRUCTS_H_
#define _MACH_ARM__STRUCTS_H_
#if defined (__arm__) || defined (__arm64__)
#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
#include <machine/types.h> /* __uint32_t */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_EXCEPTION_STATE struct __darwin_arm_exception_state
_STRUCT_ARM_EXCEPTION_STATE
{
__uint32_t __exception; /* number of arm exception taken */
__uint32_t __fsr; /* Fault status */
__uint32_t __far; /* Virtual Fault Address */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_EXCEPTION_STATE struct arm_exception_state
_STRUCT_ARM_EXCEPTION_STATE
{
__uint32_t exception; /* number of arm exception taken */
__uint32_t fsr; /* Fault status */
__uint32_t far; /* Virtual Fault Address */
};
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_EXCEPTION_STATE64 struct __darwin_arm_exception_state64
_STRUCT_ARM_EXCEPTION_STATE64
{
__uint64_t __far; /* Virtual Fault Address */
__uint32_t __esr; /* Exception syndrome */
__uint32_t __exception; /* number of arm exception taken */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_EXCEPTION_STATE64 struct arm_exception_state64
_STRUCT_ARM_EXCEPTION_STATE64
{
__uint64_t far; /* Virtual Fault Address */
__uint32_t esr; /* Exception syndrome */
__uint32_t exception; /* number of arm exception taken */
};
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_THREAD_STATE struct __darwin_arm_thread_state
_STRUCT_ARM_THREAD_STATE
{
__uint32_t __r[13]; /* General purpose register r0-r12 */
__uint32_t __sp; /* Stack pointer r13 */
__uint32_t __lr; /* Link register r14 */
__uint32_t __pc; /* Program counter r15 */
__uint32_t __cpsr; /* Current program status register */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_THREAD_STATE struct arm_thread_state
_STRUCT_ARM_THREAD_STATE
{
__uint32_t r[13]; /* General purpose register r0-r12 */
__uint32_t sp; /* Stack pointer r13 */
__uint32_t lr; /* Link register r14 */
__uint32_t pc; /* Program counter r15 */
__uint32_t cpsr; /* Current program status register */
};
#endif /* __DARWIN_UNIX03 */
/*
* By default, the pointer fields in the arm_thread_state64_t structure are
* opaque on the arm64e architecture and require the use of accessor macros.
* This mode can also be enabled on the arm64 architecture by building with
* -D__DARWIN_OPAQUE_ARM_THREAD_STATE64=1.
*/
#if defined(__arm64__) && defined(__LP64__)
#if __has_feature(ptrauth_calls)
#define __DARWIN_OPAQUE_ARM_THREAD_STATE64 1
#define __DARWIN_PTRAUTH_ARM_THREAD_STATE64 1
#endif /* __has_feature(ptrauth_calls) */
#ifndef __DARWIN_OPAQUE_ARM_THREAD_STATE64
#define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0
#endif
#else /* defined(__arm64__) && defined(__LP64__) */
#undef __DARWIN_OPAQUE_ARM_THREAD_STATE64
#define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0
#endif /* defined(__arm64__) && defined(__LP64__) */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_THREAD_STATE64 struct __darwin_arm_thread_state64
#if __DARWIN_OPAQUE_ARM_THREAD_STATE64
_STRUCT_ARM_THREAD_STATE64
{
__uint64_t __x[29]; /* General purpose registers x0-x28 */
void* __opaque_fp; /* Frame pointer x29 */
void* __opaque_lr; /* Link register x30 */
void* __opaque_sp; /* Stack pointer x31 */
void* __opaque_pc; /* Program counter */
__uint32_t __cpsr; /* Current program status register */
__uint32_t __opaque_flags; /* Flags describing structure format */
};
#else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
_STRUCT_ARM_THREAD_STATE64
{
__uint64_t __x[29]; /* General purpose registers x0-x28 */
__uint64_t __fp; /* Frame pointer x29 */
__uint64_t __lr; /* Link register x30 */
__uint64_t __sp; /* Stack pointer x31 */
__uint64_t __pc; /* Program counter */
__uint32_t __cpsr; /* Current program status register */
__uint32_t __pad; /* Same size for 32-bit or 64-bit clients */
};
#endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_THREAD_STATE64 struct arm_thread_state64
#if __DARWIN_OPAQUE_ARM_THREAD_STATE64
_STRUCT_ARM_THREAD_STATE64
{
__uint64_t x[29]; /* General purpose registers x0-x28 */
void* __opaque_fp; /* Frame pointer x29 */
void* __opaque_lr; /* Link register x30 */
void* __opaque_sp; /* Stack pointer x31 */
void* __opaque_pc; /* Program counter */
__uint32_t cpsr; /* Current program status register */
__uint32_t __opaque_flags; /* Flags describing structure format */
};
#else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
_STRUCT_ARM_THREAD_STATE64
{
__uint64_t x[29]; /* General purpose registers x0-x28 */
__uint64_t fp; /* Frame pointer x29 */
__uint64_t lr; /* Link register x30 */
__uint64_t sp; /* Stack pointer x31 */
__uint64_t pc; /* Program counter */
__uint32_t cpsr; /* Current program status register */
__uint32_t __pad; /* Same size for 32-bit or 64-bit clients */
};
#endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__)
/* Accessor macros for arm_thread_state64_t pointer fields */
#if __has_feature(ptrauth_calls) && defined(__LP64__)
#include <ptrauth.h>
#if !__DARWIN_OPAQUE_ARM_THREAD_STATE64 || !__DARWIN_PTRAUTH_ARM_THREAD_STATE64
#error "Invalid configuration"
#endif
#define __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH 0x1
#define __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR 0x2
#define __DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED 0x4
/* Return pc field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_pc(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(uintptr_t)(__tsp->__opaque_pc && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_auth_data(__tsp->__opaque_pc, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("pc")) : __tsp->__opaque_pc); })
/* Return pc field of arm_thread_state64_t as a function pointer. May return
* NULL if a valid function pointer cannot be constructed, the caller should
* fall back to the __darwin_arm_thread_state64_get_pc() macro in that case. */
#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(__tsp->__opaque_pc && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_auth_function(__tsp->__opaque_pc, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("pc")) : NULL); })
/* Set pc field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
__typeof__(fptr) __f = (fptr); __tsp->__opaque_pc = \
(__f ? (!(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_auth_and_resign(__f, ptrauth_key_function_pointer, 0, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("pc")) : ptrauth_auth_data(__f, \
ptrauth_key_function_pointer, 0)) : __f); \
__tsp->__opaque_flags &= \
~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED; })
/* Return lr field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_lr(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(uintptr_t)(__tsp->__opaque_lr && !(__tsp->__opaque_flags & ( \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH | \
__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR)) ? \
ptrauth_auth_data(__tsp->__opaque_lr, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("lr")) : __tsp->__opaque_lr); })
/* Return lr field of arm_thread_state64_t as a function pointer. May return
* NULL if a valid function pointer cannot be constructed, the caller should
* fall back to the __darwin_arm_thread_state64_get_lr() macro in that case. */
#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(__tsp->__opaque_lr && !(__tsp->__opaque_flags & ( \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH | \
__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR)) ? \
ptrauth_auth_function(__tsp->__opaque_lr, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("lr")) : NULL); })
/* Set lr field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
__typeof__(fptr) __f = (fptr); __tsp->__opaque_lr = \
(__f ? (!(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? (__tsp->__opaque_flags \
&= ~__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR , \
ptrauth_auth_and_resign(__f, ptrauth_key_function_pointer, 0, \
ptrauth_key_process_independent_code, \
ptrauth_string_discriminator("lr"))) : ptrauth_auth_data(__f, \
ptrauth_key_function_pointer, 0)) : __f); __tsp->__opaque_flags &= \
~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED; })
/* Return sp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_sp(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(uintptr_t)(__tsp->__opaque_sp && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_auth_data(__tsp->__opaque_sp, \
ptrauth_key_process_independent_data, \
ptrauth_string_discriminator("sp")) : __tsp->__opaque_sp); })
/* Set sp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
void *__p = (void*)(uintptr_t)(ptr); __tsp->__opaque_sp = \
(__p && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_sign_unauthenticated(__p, \
ptrauth_key_process_independent_data, \
ptrauth_string_discriminator("sp")) : __p); \
__tsp->__opaque_flags &= \
~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED; })
/* Return fp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_fp(ts) \
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
(uintptr_t)(__tsp->__opaque_fp && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_auth_data(__tsp->__opaque_fp, \
ptrauth_key_process_independent_data, \
ptrauth_string_discriminator("fp")) : __tsp->__opaque_fp); })
/* Set fp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
void *__p = (void*)(uintptr_t)(ptr); __tsp->__opaque_fp = \
(__p && !(__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
ptrauth_sign_unauthenticated(__p, \
ptrauth_key_process_independent_data, \
ptrauth_string_discriminator("fp")) : __p); \
__tsp->__opaque_flags &= \
~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED; })
/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
__tsp->__opaque_pc = ((__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? __tsp->__opaque_pc : \
ptrauth_strip(__tsp->__opaque_pc, ptrauth_key_process_independent_code)); \
__tsp->__opaque_lr = ((__tsp->__opaque_flags & \
(__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH | \
__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR)) ? __tsp->__opaque_lr : \
ptrauth_strip(__tsp->__opaque_lr, ptrauth_key_process_independent_code)); \
__tsp->__opaque_sp = ((__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? __tsp->__opaque_sp : \
ptrauth_strip(__tsp->__opaque_sp, ptrauth_key_process_independent_data)); \
__tsp->__opaque_fp = ((__tsp->__opaque_flags & \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? __tsp->__opaque_fp : \
ptrauth_strip(__tsp->__opaque_fp, ptrauth_key_process_independent_data)); \
__tsp->__opaque_flags |= \
__DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH; __tsp->__opaque_flags &= \
~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED; })
#else /* __has_feature(ptrauth_calls) && defined(__LP64__) */
#if __DARWIN_OPAQUE_ARM_THREAD_STATE64
#ifndef __LP64__
#error "Invalid configuration"
#endif
/* Return pc field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_pc(ts) \
((uintptr_t)((ts).__opaque_pc))
/* Return pc field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
((ts).__opaque_pc)
/* Set pc field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
((ts).__opaque_pc = (fptr))
/* Return lr field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_lr(ts) \
((uintptr_t)((ts).__opaque_lr))
/* Return lr field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
((ts).__opaque_lr)
/* Set lr field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
((ts).__opaque_lr = (fptr))
/* Return sp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_sp(ts) \
((uintptr_t)((ts).__opaque_sp))
/* Set sp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
((ts).__opaque_sp = (void*)(uintptr_t)(ptr))
/* Return fp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_fp(ts) \
((uintptr_t)((ts).__opaque_fp))
/* Set fp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
((ts).__opaque_fp = (void*)(uintptr_t)(ptr))
/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
(void)(ts)
#else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
#if __DARWIN_UNIX03
/* Return pc field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_pc(ts) \
((ts).__pc)
/* Return pc field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
((void*)(uintptr_t)((ts).__pc))
/* Set pc field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
((ts).__pc = (uintptr_t)(fptr))
/* Return lr field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_lr(ts) \
((ts).__lr)
/* Return lr field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
((void*)(uintptr_t)((ts).__lr))
/* Set lr field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
((ts).__lr = (uintptr_t)(fptr))
/* Return sp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_sp(ts) \
((ts).__sp)
/* Set sp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
((ts).__sp = (uintptr_t)(ptr))
/* Return fp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_fp(ts) \
((ts).__fp)
/* Set fp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
((ts).__fp = (uintptr_t)(ptr))
/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
(void)(ts)
#else /* __DARWIN_UNIX03 */
/* Return pc field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_pc(ts) \
((ts).pc)
/* Return pc field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_pc_fptr(ts) \
((void*)(uintptr_t)((ts).pc))
/* Set pc field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
((ts).pc = (uintptr_t)(fptr))
/* Return lr field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_lr(ts) \
((ts).lr)
/* Return lr field of arm_thread_state64_t as a function pointer */
#define __darwin_arm_thread_state64_get_lr_fptr(ts) \
((void*)(uintptr_t)((ts).lr))
/* Set lr field of arm_thread_state64_t to a function pointer */
#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
((ts).lr = (uintptr_t)(fptr))
/* Return sp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_sp(ts) \
((ts).sp)
/* Set sp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_sp(ts, ptr) \
((ts).sp = (uintptr_t)(ptr))
/* Return fp field of arm_thread_state64_t as a data pointer value */
#define __darwin_arm_thread_state64_get_fp(ts) \
((ts).fp)
/* Set fp field of arm_thread_state64_t to a data pointer value */
#define __darwin_arm_thread_state64_set_fp(ts, ptr) \
((ts).fp = (uintptr_t)(ptr))
/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
#define __darwin_arm_thread_state64_ptrauth_strip(ts) \
(void)(ts)
#endif /* __DARWIN_UNIX03 */
#endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
#endif /* __has_feature(ptrauth_calls) && defined(__LP64__) */
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__) */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_VFP_STATE struct __darwin_arm_vfp_state
_STRUCT_ARM_VFP_STATE
{
__uint32_t __r[64];
__uint32_t __fpscr;
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_VFP_STATE struct arm_vfp_state
_STRUCT_ARM_VFP_STATE
{
__uint32_t r[64];
__uint32_t fpscr;
};
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_NEON_STATE64 struct __darwin_arm_neon_state64
#define _STRUCT_ARM_NEON_STATE struct __darwin_arm_neon_state
#if defined(__arm64__)
_STRUCT_ARM_NEON_STATE64
{
__uint128_t __v[32];
__uint32_t __fpsr;
__uint32_t __fpcr;
};
_STRUCT_ARM_NEON_STATE
{
__uint128_t __v[16];
__uint32_t __fpsr;
__uint32_t __fpcr;
};
#elif defined(__arm__)
/*
* No 128-bit intrinsic for ARM; leave it opaque for now.
*/
_STRUCT_ARM_NEON_STATE64
{
char opaque[(32 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));
_STRUCT_ARM_NEON_STATE
{
char opaque[(16 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));
#else
#error Unknown architecture.
#endif
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_NEON_STATE64 struct arm_neon_state64
#define _STRUCT_ARM_NEON_STATE struct arm_neon_state
#if defined(__arm64__)
_STRUCT_ARM_NEON_STATE64
{
__uint128_t q[32];
uint32_t fpsr;
uint32_t fpcr;
};
_STRUCT_ARM_NEON_STATE
{
__uint128_t q[16];
uint32_t fpsr;
uint32_t fpcr;
};
#elif defined(__arm__)
/*
* No 128-bit intrinsic for ARM; leave it opaque for now.
*/
_STRUCT_ARM_NEON_STATE64
{
char opaque[(32 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));
_STRUCT_ARM_NEON_STATE
{
char opaque[(16 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));
#else
#error Unknown architecture.
#endif
#endif /* __DARWIN_UNIX03 */
#define _STRUCT_ARM_PAGEIN_STATE struct __arm_pagein_state
_STRUCT_ARM_PAGEIN_STATE
{
int __pagein_error;
};
/*
* Debug State
*/
#if defined(__arm__)
/* Old-fashioned debug state is only for ARM */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_DEBUG_STATE struct __darwin_arm_debug_state
_STRUCT_ARM_DEBUG_STATE
{
__uint32_t __bvr[16];
__uint32_t __bcr[16];
__uint32_t __wvr[16];
__uint32_t __wcr[16];
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_DEBUG_STATE struct arm_debug_state
_STRUCT_ARM_DEBUG_STATE
{
__uint32_t bvr[16];
__uint32_t bcr[16];
__uint32_t wvr[16];
__uint32_t wcr[16];
};
#endif /* __DARWIN_UNIX03 */
#elif defined(__arm64__)
/* ARM's arm_debug_state is ARM64's arm_legacy_debug_state */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_LEGACY_DEBUG_STATE struct __arm_legacy_debug_state
_STRUCT_ARM_LEGACY_DEBUG_STATE
{
__uint32_t __bvr[16];
__uint32_t __bcr[16];
__uint32_t __wvr[16];
__uint32_t __wcr[16];
};
#else /* __DARWIN_UNIX03 */
#define _STRUCT_ARM_LEGACY_DEBUG_STATE struct arm_legacy_debug_state
_STRUCT_ARM_LEGACY_DEBUG_STATE
{
__uint32_t bvr[16];
__uint32_t bcr[16];
__uint32_t wvr[16];
__uint32_t wcr[16];
};
#endif /* __DARWIN_UNIX03 */
#else
#error unknown architecture
#endif
#if __DARWIN_UNIX03
#define _STRUCT_ARM_DEBUG_STATE32 struct __darwin_arm_debug_state32
_STRUCT_ARM_DEBUG_STATE32
{
__uint32_t __bvr[16];
__uint32_t __bcr[16];
__uint32_t __wvr[16];
__uint32_t __wcr[16];
__uint64_t __mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
};
#define _STRUCT_ARM_DEBUG_STATE64 struct __darwin_arm_debug_state64
_STRUCT_ARM_DEBUG_STATE64
{
__uint64_t __bvr[16];
__uint64_t __bcr[16];
__uint64_t __wvr[16];
__uint64_t __wcr[16];
__uint64_t __mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_ARM_DEBUG_STATE32 struct arm_debug_state32
_STRUCT_ARM_DEBUG_STATE32
{
__uint32_t bvr[16];
__uint32_t bcr[16];
__uint32_t wvr[16];
__uint32_t wcr[16];
__uint64_t mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
};
#define _STRUCT_ARM_DEBUG_STATE64 struct arm_debug_state64
_STRUCT_ARM_DEBUG_STATE64
{
__uint64_t bvr[16];
__uint64_t bcr[16];
__uint64_t wvr[16];
__uint64_t wcr[16];
__uint64_t mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
};
#endif /* __DARWIN_UNIX03 */
#if __DARWIN_UNIX03
#define _STRUCT_ARM_CPMU_STATE64 struct __darwin_arm_cpmu_state64
_STRUCT_ARM_CPMU_STATE64
{
__uint64_t __ctrs[16];
};
#else /* __DARWIN_UNIX03 */
#define _STRUCT_ARM_CPMU_STATE64 struct arm_cpmu_state64
_STRUCT_ARM_CPMU_STATE64
{
__uint64_t ctrs[16];
};
#endif /* !__DARWIN_UNIX03 */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _MACH_ARM__STRUCTS_H_ */

View File

@ -1,74 +0,0 @@
/*
* Copyright (c) 2000-2007 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
* 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@
*/
/*
* @OSF_COPYRIGHT@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
*/
/*
* File: boolean.h
*
* Boolean type, for ARM.
*/
#ifndef _MACH_ARM_BOOLEAN_H_
#define _MACH_ARM_BOOLEAN_H_
#if defined (__arm__) || defined (__arm64__)
typedef int boolean_t;
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _MACH_ARM_BOOLEAN_H_ */

View File

@ -1,78 +0,0 @@
/*
* Copyright (c) 2000-2007 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
* 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@
*/
/*
* @OSF_COPYRIGHT@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
*/
/*
* File: kern_return.h
* Author: Avadis Tevanian, Jr., Michael Wayne Young
* Date: 1985
*
* Machine-dependent kernel return definitions.
*/
#ifndef _MACH_ARM_KERN_RETURN_H_
#define _MACH_ARM_KERN_RETURN_H_
#if defined (__arm__) || defined (__arm64__)
#ifndef ASSEMBLER
typedef int kern_return_t;
#endif /* ASSEMBLER */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _MACH_ARM_KERN_RETURN_H_ */

View File

@ -1,39 +0,0 @@
/*
* Copyright (c) 2000-2007 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
* 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@
*/
/*
* @OSF_COPYRIGHT@
*/
#ifndef _MACH_ARM_RPC_H_
#define _MACH_ARM_RPC_H_
#if defined (__arm__) || defined (__arm64__)
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _MACH_ARM_RPC_H_ */

View File

@ -1,42 +0,0 @@
/*
* Copyright (c) 2000-2007 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
* 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@
*/
/*
* @OSF_COPYRIGHT@
*/
#ifndef _MACH_ARM_THREAD_STATE_H_
#define _MACH_ARM_THREAD_STATE_H_
#if defined (__arm__) || defined (__arm64__)
/* Size of maximum exported thread state in words */
#define ARM_THREAD_STATE_MAX (1296) /* Size of biggest state possible */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _MACH_ARM_THREAD_STATE_H_ */

View File

@ -1,235 +0,0 @@
/*
* Copyright (c) 2007 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
* 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@
*/
/*
* FILE_ID: thread_status.h
*/
#ifndef _ARM_THREAD_STATUS_H_
#define _ARM_THREAD_STATUS_H_
#if defined (__arm__) || defined (__arm64__)
#include <mach/machine/_structs.h>
#include <mach/machine/thread_state.h>
#include <mach/message.h>
#include <mach/vm_types.h>
/*
* Support for determining the state of a thread
*/
/*
* Flavors
*/
#define ARM_THREAD_STATE 1
#define ARM_UNIFIED_THREAD_STATE ARM_THREAD_STATE
#define ARM_VFP_STATE 2
#define ARM_EXCEPTION_STATE 3
#define ARM_DEBUG_STATE 4 /* pre-armv8 */
#define THREAD_STATE_NONE 5
#define ARM_THREAD_STATE64 6
#define ARM_EXCEPTION_STATE64 7
// ARM_THREAD_STATE_LAST 8 /* legacy */
#define ARM_THREAD_STATE32 9
/* API */
#define ARM_DEBUG_STATE32 14
#define ARM_DEBUG_STATE64 15
#define ARM_NEON_STATE 16
#define ARM_NEON_STATE64 17
#define ARM_CPMU_STATE64 18
#define ARM_PAGEIN_STATE 27
#ifndef ARM_STATE_FLAVOR_IS_OTHER_VALID
#define ARM_STATE_FLAVOR_IS_OTHER_VALID(_flavor_) 0
#endif
#define VALID_THREAD_STATE_FLAVOR(x) \
((x == ARM_THREAD_STATE) || \
(x == ARM_VFP_STATE) || \
(x == ARM_EXCEPTION_STATE) || \
(x == ARM_DEBUG_STATE) || \
(x == THREAD_STATE_NONE) || \
(x == ARM_THREAD_STATE32) || \
(x == ARM_THREAD_STATE64) || \
(x == ARM_EXCEPTION_STATE64) || \
(x == ARM_NEON_STATE) || \
(x == ARM_NEON_STATE64) || \
(x == ARM_DEBUG_STATE32) || \
(x == ARM_DEBUG_STATE64) || \
(x == ARM_PAGEIN_STATE) || \
(ARM_STATE_FLAVOR_IS_OTHER_VALID(x)))
struct arm_state_hdr {
uint32_t flavor;
uint32_t count;
};
typedef struct arm_state_hdr arm_state_hdr_t;
typedef _STRUCT_ARM_THREAD_STATE arm_thread_state_t;
typedef _STRUCT_ARM_THREAD_STATE arm_thread_state32_t;
typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t;
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__)
/* Accessor macros for arm_thread_state64_t pointer fields */
/* Return pc field of arm_thread_state64_t as a data pointer value */
#define arm_thread_state64_get_pc(ts) \
__darwin_arm_thread_state64_get_pc(ts)
/* Return pc field of arm_thread_state64_t as a function pointer. May return
* NULL if a valid function pointer cannot be constructed, the caller should
* fall back to the arm_thread_state64_get_pc() macro in that case. */
#define arm_thread_state64_get_pc_fptr(ts) \
__darwin_arm_thread_state64_get_pc_fptr(ts)
/* Set pc field of arm_thread_state64_t to a function pointer */
#define arm_thread_state64_set_pc_fptr(ts, fptr) \
__darwin_arm_thread_state64_set_pc_fptr(ts, fptr)
/* Return lr field of arm_thread_state64_t as a data pointer value */
#define arm_thread_state64_get_lr(ts) \
__darwin_arm_thread_state64_get_lr(ts)
/* Return lr field of arm_thread_state64_t as a function pointer. May return
* NULL if a valid function pointer cannot be constructed, the caller should
* fall back to the arm_thread_state64_get_lr() macro in that case. */
#define arm_thread_state64_get_lr_fptr(ts) \
__darwin_arm_thread_state64_get_lr_fptr(ts)
/* Set lr field of arm_thread_state64_t to a function pointer */
#define arm_thread_state64_set_lr_fptr(ts, fptr) \
__darwin_arm_thread_state64_set_lr_fptr(ts, fptr)
/* Return sp field of arm_thread_state64_t as a data pointer value */
#define arm_thread_state64_get_sp(ts) \
__darwin_arm_thread_state64_get_sp(ts)
/* Set sp field of arm_thread_state64_t to a data pointer value */
#define arm_thread_state64_set_sp(ts, ptr) \
__darwin_arm_thread_state64_set_sp(ts, ptr)
/* Return fp field of arm_thread_state64_t as a data pointer value */
#define arm_thread_state64_get_fp(ts) \
__darwin_arm_thread_state64_get_fp(ts)
/* Set fp field of arm_thread_state64_t to a data pointer value */
#define arm_thread_state64_set_fp(ts, ptr) \
__darwin_arm_thread_state64_set_fp(ts, ptr)
/* Strip ptr auth bits from pc, lr, sp and fp field of arm_thread_state64_t */
#define arm_thread_state64_ptrauth_strip(ts) \
__darwin_arm_thread_state64_ptrauth_strip(ts)
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__) */
struct arm_unified_thread_state {
arm_state_hdr_t ash;
union {
arm_thread_state32_t ts_32;
arm_thread_state64_t ts_64;
} uts;
};
#define ts_32 uts.ts_32
#define ts_64 uts.ts_64
typedef struct arm_unified_thread_state arm_unified_thread_state_t;
#define ARM_THREAD_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_thread_state_t)/sizeof(uint32_t)))
#define ARM_THREAD_STATE32_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_thread_state32_t)/sizeof(uint32_t)))
#define ARM_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_thread_state64_t)/sizeof(uint32_t)))
#define ARM_UNIFIED_THREAD_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_unified_thread_state_t)/sizeof(uint32_t)))
typedef _STRUCT_ARM_VFP_STATE arm_vfp_state_t;
typedef _STRUCT_ARM_NEON_STATE arm_neon_state_t;
typedef _STRUCT_ARM_NEON_STATE arm_neon_state32_t;
typedef _STRUCT_ARM_NEON_STATE64 arm_neon_state64_t;
typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state_t;
typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state32_t;
typedef _STRUCT_ARM_EXCEPTION_STATE64 arm_exception_state64_t;
typedef _STRUCT_ARM_DEBUG_STATE32 arm_debug_state32_t;
typedef _STRUCT_ARM_DEBUG_STATE64 arm_debug_state64_t;
typedef _STRUCT_ARM_PAGEIN_STATE arm_pagein_state_t;
/*
* Otherwise not ARM64 kernel and we must preserve legacy ARM definitions of
* arm_debug_state for binary compatability of userland consumers of this file.
*/
#if defined(__arm__)
typedef _STRUCT_ARM_DEBUG_STATE arm_debug_state_t;
#elif defined(__arm64__)
typedef _STRUCT_ARM_LEGACY_DEBUG_STATE arm_debug_state_t;
#else /* defined(__arm__) */
#error Undefined architecture
#endif /* defined(__arm__) */
#define ARM_VFP_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_vfp_state_t)/sizeof(uint32_t)))
#define ARM_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_exception_state_t)/sizeof(uint32_t)))
#define ARM_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_exception_state64_t)/sizeof(uint32_t)))
#define ARM_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_debug_state_t)/sizeof(uint32_t)))
#define ARM_DEBUG_STATE32_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_debug_state32_t)/sizeof(uint32_t)))
#define ARM_PAGEIN_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_pagein_state_t)/sizeof(uint32_t)))
#define ARM_DEBUG_STATE64_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_debug_state64_t)/sizeof(uint32_t)))
#define ARM_NEON_STATE_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_neon_state_t)/sizeof(uint32_t)))
#define ARM_NEON_STATE64_COUNT ((mach_msg_type_number_t) \
(sizeof (arm_neon_state64_t)/sizeof(uint32_t)))
#define MACHINE_THREAD_STATE ARM_THREAD_STATE
#define MACHINE_THREAD_STATE_COUNT ARM_UNIFIED_THREAD_STATE_COUNT
/*
* Largest state on this machine:
*/
#define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM_THREAD_STATUS_H_ */

View File

@ -1,112 +0,0 @@
/*
* Copyright (c) 2007 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
* 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@
*/
/*
* FILE_ID: vm_param.h
*/
/*
* ARM machine dependent virtual memory parameters.
*/
#ifndef _MACH_ARM_VM_PARAM_H_
#define _MACH_ARM_VM_PARAM_H_
#if defined (__arm__) || defined (__arm64__)
#if !defined (KERNEL) && !defined (__ASSEMBLER__)
#include <mach/vm_page_size.h>
#endif
#define BYTE_SIZE 8 /* byte size in bits */
#define PAGE_SHIFT vm_page_shift
#define PAGE_SIZE vm_page_size
#define PAGE_MASK vm_page_mask
#define VM_PAGE_SIZE vm_page_size
#define machine_ptob(x) ((x) << PAGE_SHIFT)
#define PAGE_MAX_SHIFT 14
#define PAGE_MAX_SIZE (1 << PAGE_MAX_SHIFT)
#define PAGE_MAX_MASK (PAGE_MAX_SIZE-1)
#define PAGE_MIN_SHIFT 12
#define PAGE_MIN_SIZE (1 << PAGE_MIN_SHIFT)
#define PAGE_MIN_MASK (PAGE_MIN_SIZE-1)
#define VM_MAX_PAGE_ADDRESS MACH_VM_MAX_ADDRESS
#ifndef __ASSEMBLER__
#if defined (__arm__)
#define VM_MIN_ADDRESS ((vm_address_t) 0x00000000)
#define VM_MAX_ADDRESS ((vm_address_t) 0x80000000)
/* system-wide values */
#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0)
#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_ADDRESS)
#elif defined (__arm64__)
#define VM_MIN_ADDRESS ((vm_address_t) 0x0000000000000000ULL)
#define VM_MAX_ADDRESS ((vm_address_t) 0x0000000080000000ULL)
/* system-wide values */
#define MACH_VM_MIN_ADDRESS_RAW 0x0ULL
#define MACH_VM_MAX_ADDRESS_RAW 0x00007FFFFE000000ULL
#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) MACH_VM_MIN_ADDRESS_RAW)
#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) MACH_VM_MAX_ADDRESS_RAW)
#define MACH_VM_MIN_GPU_CARVEOUT_ADDRESS_RAW 0x0000001000000000ULL
#define MACH_VM_MAX_GPU_CARVEOUT_ADDRESS_RAW 0x0000007000000000ULL
#define MACH_VM_MIN_GPU_CARVEOUT_ADDRESS ((mach_vm_offset_t) MACH_VM_MIN_GPU_CARVEOUT_ADDRESS_RAW)
#define MACH_VM_MAX_GPU_CARVEOUT_ADDRESS ((mach_vm_offset_t) MACH_VM_MAX_GPU_CARVEOUT_ADDRESS_RAW)
#else /* defined(__arm64__) */
#error architecture not supported
#endif
#define VM_MAP_MIN_ADDRESS VM_MIN_ADDRESS
#define VM_MAP_MAX_ADDRESS VM_MAX_ADDRESS
#endif /* !__ASSEMBLER__ */
#define SWI_SYSCALL 0x80
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _MACH_ARM_VM_PARAM_H_ */

View File

@ -1,95 +0,0 @@
/*
* 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
* 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 __ARM_MCONTEXT_H_
#define __ARM_MCONTEXT_H_
#if defined (__arm__) || defined (__arm64__)
#include <sys/cdefs.h> /* __DARWIN_UNIX03 */
#include <sys/appleapiopts.h>
#include <mach/machine/_structs.h>
#ifndef _STRUCT_MCONTEXT32
#if __DARWIN_UNIX03
#define _STRUCT_MCONTEXT32 struct __darwin_mcontext32
_STRUCT_MCONTEXT32
{
_STRUCT_ARM_EXCEPTION_STATE __es;
_STRUCT_ARM_THREAD_STATE __ss;
_STRUCT_ARM_VFP_STATE __fs;
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_MCONTEXT32 struct mcontext32
_STRUCT_MCONTEXT32
{
_STRUCT_ARM_EXCEPTION_STATE es;
_STRUCT_ARM_THREAD_STATE ss;
_STRUCT_ARM_VFP_STATE fs;
};
#endif /* __DARWIN_UNIX03 */
#endif /* _STRUCT_MCONTEXT32 */
#ifndef _STRUCT_MCONTEXT64
#if __DARWIN_UNIX03
#define _STRUCT_MCONTEXT64 struct __darwin_mcontext64
_STRUCT_MCONTEXT64
{
_STRUCT_ARM_EXCEPTION_STATE64 __es;
_STRUCT_ARM_THREAD_STATE64 __ss;
_STRUCT_ARM_NEON_STATE64 __ns;
};
#else /* !__DARWIN_UNIX03 */
#define _STRUCT_MCONTEXT64 struct mcontext64
_STRUCT_MCONTEXT64
{
_STRUCT_ARM_EXCEPTION_STATE64 es;
_STRUCT_ARM_THREAD_STATE64 ss;
_STRUCT_ARM_NEON_STATE64 ns;
};
#endif /* __DARWIN_UNIX03 */
#endif /* _STRUCT_MCONTEXT32 */
#ifndef _MCONTEXT_T
#define _MCONTEXT_T
#if defined(__arm64__)
typedef _STRUCT_MCONTEXT64 *mcontext_t;
#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT64
#else
typedef _STRUCT_MCONTEXT32 *mcontext_t;
#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT32
#endif
#endif /* _MCONTEXT_T */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* __ARM_MCONTEXT_H_ */

View File

@ -1,102 +0,0 @@
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
#ifndef _BSD_ARM__TYPES_H_
#define _BSD_ARM__TYPES_H_
#if defined (__arm__) || defined (__arm64__)
/*
* This header file contains integer types. It's intended to also contain
* flotaing point and other arithmetic types, as needed, later.
*/
#ifdef __GNUC__
typedef __signed char __int8_t;
#else /* !__GNUC__ */
typedef char __int8_t;
#endif /* !__GNUC__ */
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
typedef long __darwin_intptr_t;
typedef unsigned int __darwin_natural_t;
/*
* The rune type below is declared to be an ``int'' instead of the more natural
* ``unsigned long'' or ``long''. Two things are happening here. It is not
* unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
* it looks like 10646 will be a 31 bit standard. This means that if your
* ints cannot hold 32 bits, you will be in trouble. The reason an int was
* chosen over a long is that the is*() and to*() routines take ints (says
* ANSI C), but they use __darwin_ct_rune_t instead of int. By changing it
* here, you lose a bit of ANSI conformance, but your programs will still
* work.
*
* NOTE: rune_t is not covered by ANSI nor other standards, and should not
* be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and
* rune_t must be the same type. Also wint_t must be no narrower than
* wchar_t, and should also be able to hold all members of the largest
* character set plus one extra value (WEOF). wint_t must be at least 16 bits.
*/
typedef int __darwin_ct_rune_t; /* ct_rune_t */
/*
* mbstate_t is an opaque object to keep conversion state, during multibyte
* stream conversions. The content must not be referenced by user programs.
*/
typedef union {
char __mbstate8[128];
long long _mbstateL; /* for alignment */
} __mbstate_t;
typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */
#if defined(__PTRDIFF_TYPE__)
typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */
#elif defined(__LP64__)
typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
#else
typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */
#endif /* __GNUC__ */
#if defined(__SIZE_TYPE__)
typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */
#else
typedef unsigned long __darwin_size_t; /* sizeof() */
#endif
#if (__GNUC__ > 2)
typedef __builtin_va_list __darwin_va_list; /* va_list */
#else
typedef void * __darwin_va_list; /* va_list */
#endif
#if defined(__WCHAR_TYPE__)
typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */
#else
typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */
#endif
typedef __darwin_wchar_t __darwin_rune_t; /* rune_t */
#if defined(__WINT_TYPE__)
typedef __WINT_TYPE__ __darwin_wint_t; /* wint_t */
#else
typedef __darwin_ct_rune_t __darwin_wint_t; /* wint_t */
#endif
typedef unsigned long __darwin_clock_t; /* clock() */
typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
typedef long __darwin_ssize_t; /* byte count or error */
typedef long __darwin_time_t; /* time() */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _BSD_ARM__TYPES_H_ */

View File

@ -1,81 +0,0 @@
/*
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
*/
/*
* Copyright 1995 NeXT Computer, Inc. All rights reserved.
*/
/*
* Copyright (c) 1987, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)endian.h 8.1 (Berkeley) 6/11/93
*/
#ifndef _ARM__ENDIAN_H_
#define _ARM__ENDIAN_H_
#if defined (__arm__) || defined (__arm64__)
#include <sys/cdefs.h>
/*
* Define _NOQUAD if the compiler does NOT support 64-bit integers.
*/
/* #define _NOQUAD */
/*
* Define the order of 32-bit words in 64-bit words.
*/
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0
/*
* Definitions for byte order, according to byte significance from low
* address to high.
*/
#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
#define BIG_ENDIAN __DARWIN_BIG_ENDIAN
#define PDP_ENDIAN __DARWIN_PDP_ENDIAN
#define BYTE_ORDER __DARWIN_BYTE_ORDER
#include <sys/_endian.h>
#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* !_ARM__ENDIAN_H_ */

View File

@ -1,151 +0,0 @@
/*
* Copyright (c) 2000-2010 Apple Inc. All rights reserved.
*/
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)param.h 8.1 (Berkeley) 4/4/95
*/
/*
* Machine dependent constants for ARM
*/
#ifndef _ARM_PARAM_H_
#define _ARM_PARAM_H_
#if defined (__arm__) || defined (__arm64__)
#include <arm/_param.h>
/*
* Round p (pointer or byte index) up to a correctly-aligned value for all
* data types (int, long, ...). The result is unsigned int and must be
* cast to any desired pointer type.
*/
#define ALIGNBYTES __DARWIN_ALIGNBYTES
#define ALIGN(p) __DARWIN_ALIGN(p)
#define NBPG 4096 /* bytes/page */
#define PGOFSET (NBPG-1) /* byte offset into page */
#define PGSHIFT 12 /* LOG2(NBPG) */
#define DEV_BSIZE 512
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
#define CLSIZE 1
#define CLSIZELOG2 0
/*
* Constants related to network buffer management.
* MCLBYTES must be no larger than CLBYTES (the software page size), and,
* on machines that exchange pages of input or output buffers with mbuf
* clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
* of the hardware page size.
*/
#define MSIZESHIFT 8 /* 256 */
#define MSIZE (1 << MSIZESHIFT) /* size of an mbuf */
#define MCLSHIFT 11 /* 2048 */
#define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */
#define MBIGCLSHIFT 12 /* 4096 */
#define MBIGCLBYTES (1 << MBIGCLSHIFT) /* size of a big cluster */
#define M16KCLSHIFT 14 /* 16384 */
#define M16KCLBYTES (1 << M16KCLSHIFT) /* size of a jumbo cluster */
#define MCLOFSET (MCLBYTES - 1)
#ifndef NMBCLUSTERS
#define NMBCLUSTERS CONFIG_NMBCLUSTERS /* cl map size */
#endif
/*
* Some macros for units conversion
*/
/* Core clicks (NeXT_page_size bytes) to segments and vice versa */
#define ctos(x) (x)
#define stoc(x) (x)
/* Core clicks (4096 bytes) to disk blocks */
#define ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT))
#define dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT))
#define dtob(x) ((x)<<DEV_BSHIFT)
/* clicks to bytes */
#define ctob(x) ((x)<<PGSHIFT)
/* bytes to clicks */
#define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT)
#ifdef __APPLE__
#define btodb(bytes, devBlockSize) \
((unsigned)(bytes) / devBlockSize)
#define dbtob(db, devBlockSize) \
((unsigned)(db) * devBlockSize)
#else
#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \
((unsigned)(bytes) >> DEV_BSHIFT)
#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \
((unsigned)(db) << DEV_BSHIFT)
#endif
/*
* Map a ``block device block'' to a file system block.
* This should be device dependent, and will be if we
* add an entry to cdevsw/bdevsw for that purpose.
* For now though just use DEV_BSIZE.
*/
#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
/*
* Macros to decode (and encode) processor status word.
*/
#define STATUS_WORD(rpl, ipl) (((ipl) << 8) | (rpl))
#define USERMODE(x) (((x) & 3) == 3)
#define BASEPRI(x) (((x) & (255 << 8)) == 0)
#if defined(KERNEL) || defined(STANDALONE)
#define DELAY(n) delay(n)
#else /* defined(KERNEL) || defined(STANDALONE) */
#define DELAY(n) { int N = (n); while (--N > 0); }
#endif /* defined(KERNEL) || defined(STANDALONE) */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM_PARAM_H_ */

View File

@ -1,111 +0,0 @@
/*
* Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*/
/*
* Copyright 1995 NeXT Computer, Inc. All rights reserved.
*/
/*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)types.h 8.3 (Berkeley) 1/5/94
*/
#ifndef _ARM_MACHTYPES_H_
#define _ARM_MACHTYPES_H_
#define _MACHTYPES_H_
#if defined (__arm__) || defined (__arm64__)
#ifndef __ASSEMBLER__
#include <arm/_types.h>
#include <sys/cdefs.h>
/*
* Basic integral types. Omit the typedef if
* not possible for a machine/compiler combination.
*/
#include <sys/_types/_int8_t.h>
#include <sys/_types/_int16_t.h>
#include <sys/_types/_int32_t.h>
#include <sys/_types/_int64_t.h>
#include <sys/_types/_u_int8_t.h>
#include <sys/_types/_u_int16_t.h>
#include <sys/_types/_u_int32_t.h>
#include <sys/_types/_u_int64_t.h>
#if __LP64__
typedef int64_t register_t;
#else
typedef int32_t register_t;
#endif
#include <sys/_types/_intptr_t.h>
#include <sys/_types/_uintptr_t.h>
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
/* These types are used for reserving the largest possible size. */
#ifdef __arm64__
typedef u_int64_t user_addr_t;
typedef u_int64_t user_size_t;
typedef int64_t user_ssize_t;
typedef int64_t user_long_t;
typedef u_int64_t user_ulong_t;
typedef int64_t user_time_t;
typedef int64_t user_off_t;
#else
typedef u_int32_t user_addr_t;
typedef u_int32_t user_size_t;
typedef int32_t user_ssize_t;
typedef int32_t user_long_t;
typedef u_int32_t user_ulong_t;
typedef int32_t user_time_t;
typedef int64_t user_off_t;
#endif
#define USER_ADDR_NULL ((user_addr_t) 0)
#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
/* This defines the size of syscall arguments after copying into the kernel: */
#if defined(__arm__)
typedef u_int32_t syscall_arg_t;
#elif defined(__arm64__)
typedef u_int64_t syscall_arg_t;
#else
#error Unknown architecture.
#endif
#endif /* __ASSEMBLER__ */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM_MACHTYPES_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,115 +0,0 @@
/*
* Copyright (c) 2004-2016 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 _OSATOMICQUEUE_H_
#define _OSATOMICQUEUE_H_
#include <stddef.h>
#include <sys/cdefs.h>
#include <stdint.h>
#include <stdbool.h>
#include "OSAtomicDeprecated.h"
#include <Availability.h>
/*! @header Lockless atomic enqueue and dequeue
* These routines manipulate singly-linked LIFO lists.
*/
__BEGIN_DECLS
/*! @abstract The data structure for a queue head.
@discussion
You should always initialize a queue head structure with the
initialization vector {@link OS_ATOMIC_QUEUE_INIT} before use.
*/
#if defined(__LP64__)
typedef volatile struct {
void *opaque1;
long opaque2;
} __attribute__ ((aligned (16))) OSQueueHead;
#else
typedef volatile struct {
void *opaque1;
long opaque2;
} OSQueueHead;
#endif
/*! @abstract The initialization vector for a queue head. */
#define OS_ATOMIC_QUEUE_INIT { 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 (<code>__new</code>).
The link field should be a pointer type.
The <code>__offset</code> 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 <code>offsetset()</code>, defined in
<code>stddef.h</code> is the common way to specify the <code>__offset</code>
value.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_4_0)
void OSAtomicEnqueue( OSQueueHead *__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 (<code>__new</code>).
The link field should be a pointer type.
The <code>__offset</code> 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 <code>offsetset()</code>, defined in
<code>stddef.h</code> is the common way to specify the <code>__offset</code>
value.
IMPORTANT: the memory backing the link field of a queue element must not be
unmapped after OSAtomicDequeue() returns until all concurrent calls to
OSAtomicDequeue() for the same list on other threads have also returned,
as they may still be accessing that memory location.
@result
Returns the most recently enqueued element, or <code>NULL</code> if the
list is empty.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_4_0)
void* OSAtomicDequeue( OSQueueHead *__list, size_t __offset);
__END_DECLS
#endif /* _OSATOMICQUEUE_H_ */

View File

@ -1,212 +0,0 @@
/*
* Copyright (c) 2004-2016 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 _OSSPINLOCK_DEPRECATED_H_
#define _OSSPINLOCK_DEPRECATED_H_
/*! @header
* These are deprecated legacy interfaces for userspace spinlocks.
*
* These interfaces should no longer be used, particularily in situations where
* threads of differing priorities may contend on the same spinlock.
*
* The interfaces in <os/lock.h> should be used instead in cases where a very
* low-level lock primitive is required. In general however, using higher level
* synchronization primitives such as those provided by the pthread or dispatch
* subsystems should be preferred.
*
* Define OSSPINLOCK_USE_INLINED=1 to get inline implementations of these
* interfaces in terms of the <os/lock.h> primitives. This is intended as a
* transition convenience, direct use of those primitives is preferred.
*/
#ifndef OSSPINLOCK_DEPRECATED
#define OSSPINLOCK_DEPRECATED 1
#define OSSPINLOCK_DEPRECATED_MSG(_r) "Use " #_r "() from <os/lock.h> instead"
#define OSSPINLOCK_DEPRECATED_REPLACE_WITH(_r) \
__OS_AVAILABILITY_MSG(macosx, deprecated=10.12, OSSPINLOCK_DEPRECATED_MSG(_r)) \
__OS_AVAILABILITY_MSG(ios, deprecated=10.0, OSSPINLOCK_DEPRECATED_MSG(_r)) \
__OS_AVAILABILITY_MSG(tvos, deprecated=10.0, OSSPINLOCK_DEPRECATED_MSG(_r)) \
__OS_AVAILABILITY_MSG(watchos, deprecated=3.0, OSSPINLOCK_DEPRECATED_MSG(_r))
#else
#undef OSSPINLOCK_DEPRECATED
#define OSSPINLOCK_DEPRECATED 0
#define OSSPINLOCK_DEPRECATED_REPLACE_WITH(_r)
#endif
#if !(defined(OSSPINLOCK_USE_INLINED) && OSSPINLOCK_USE_INLINED)
#include <sys/cdefs.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <Availability.h>
__BEGIN_DECLS
/*! @abstract The default value for an <code>OSSpinLock</code>.
@discussion
The convention is that unlocked is zero, locked is nonzero.
*/
#define OS_SPINLOCK_INIT 0
/*! @abstract Data type for a spinlock.
@discussion
You should always initialize a spinlock to {@link OS_SPINLOCK_INIT} before
using it.
*/
typedef int32_t OSSpinLock OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock);
/*! @abstract Locks a spinlock if it would not block
@result
Returns <code>false</code> if the lock was already held by another thread,
<code>true</code> if it took the lock successfully.
*/
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_trylock)
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
bool OSSpinLockTry( volatile OSSpinLock *__lock );
/*! @abstract Locks a spinlock
@discussion
Although the lock operation spins, it employs various strategies to back
off if the lock is held.
*/
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_lock)
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
void OSSpinLockLock( volatile OSSpinLock *__lock );
/*! @abstract Unlocks a spinlock */
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_unlock)
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
void OSSpinLockUnlock( volatile OSSpinLock *__lock );
__END_DECLS
#else /* OSSPINLOCK_USE_INLINED */
/*
* Inline implementations of the legacy OSSpinLock interfaces in terms of the
* of the <os/lock.h> primitives. Direct use of those primitives is preferred.
*
* NOTE: the locked value of os_unfair_lock is implementation defined and
* subject to change, code that relies on the specific locked value used by the
* legacy OSSpinLock interface WILL break when using these inline
* implementations in terms of os_unfair_lock.
*/
#if !OSSPINLOCK_USE_INLINED_TRANSPARENT
#include <os/lock.h>
__BEGIN_DECLS
#if __has_attribute(always_inline)
#define OSSPINLOCK_INLINE static __inline
#else
#define OSSPINLOCK_INLINE static __inline __attribute__((__always_inline__))
#endif
#define OS_SPINLOCK_INIT 0
typedef int32_t OSSpinLock;
#if __has_extension(c_static_assert)
_Static_assert(sizeof(OSSpinLock) == sizeof(os_unfair_lock),
"Incompatible os_unfair_lock type");
#endif
OSSPINLOCK_INLINE
void
OSSpinLockLock(volatile OSSpinLock *__lock)
{
os_unfair_lock_t lock = (os_unfair_lock_t)__lock;
return os_unfair_lock_lock(lock);
}
OSSPINLOCK_INLINE
bool
OSSpinLockTry(volatile OSSpinLock *__lock)
{
os_unfair_lock_t lock = (os_unfair_lock_t)__lock;
return os_unfair_lock_trylock(lock);
}
OSSPINLOCK_INLINE
void
OSSpinLockUnlock(volatile OSSpinLock *__lock)
{
os_unfair_lock_t lock = (os_unfair_lock_t)__lock;
return os_unfair_lock_unlock(lock);
}
#undef OSSPINLOCK_INLINE
__END_DECLS
#else /* OSSPINLOCK_USE_INLINED_TRANSPARENT */
#include <sys/cdefs.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <Availability.h>
#define OS_NOSPIN_LOCK_AVAILABILITY \
__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) \
__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
__BEGIN_DECLS
#define OS_SPINLOCK_INIT 0
typedef int32_t OSSpinLock OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock);
typedef volatile OSSpinLock *_os_nospin_lock_t
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_t);
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_lock)
OS_NOSPIN_LOCK_AVAILABILITY
void _os_nospin_lock_lock(_os_nospin_lock_t lock);
#undef OSSpinLockLock
#define OSSpinLockLock(lock) _os_nospin_lock_lock(lock)
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_trylock)
OS_NOSPIN_LOCK_AVAILABILITY
bool _os_nospin_lock_trylock(_os_nospin_lock_t lock);
#undef OSSpinLockTry
#define OSSpinLockTry(lock) _os_nospin_lock_trylock(lock)
OSSPINLOCK_DEPRECATED_REPLACE_WITH(os_unfair_lock_unlock)
OS_NOSPIN_LOCK_AVAILABILITY
void _os_nospin_lock_unlock(_os_nospin_lock_t lock);
#undef OSSpinLockUnlock
#define OSSpinLockUnlock(lock) _os_nospin_lock_unlock(lock)
__END_DECLS
#endif /* OSSPINLOCK_USE_INLINED_TRANSPARENT */
#endif /* OSSPINLOCK_USE_INLINED */
#endif /* _OSSPINLOCK_DEPRECATED_H_ */

View File

@ -1,216 +0,0 @@
/*
* Copyright (c) 1999-2007 Apple Inc. All rights reserved.
*/
#ifndef _OS_OSBYTEORDERARM_H
#define _OS_OSBYTEORDERARM_H
#include <stdint.h>
#include <arm/arch.h> /* for _ARM_ARCH_6 */
/* Generic byte swapping functions. */
__DARWIN_OS_INLINE
uint16_t
_OSSwapInt16(
uint16_t _data
)
{
/* Reduces to 'rev16' with clang */
return (uint16_t)(_data << 8 | _data >> 8);
}
__DARWIN_OS_INLINE
uint32_t
_OSSwapInt32(
uint32_t _data
)
{
#if defined(__llvm__)
_data = __builtin_bswap32(_data);
#else
/* This actually generates the best code */
_data = (((_data ^ (_data >> 16 | (_data << 16))) & 0xFF00FFFF) >> 8) ^ (_data >> 8 | _data << 24);
#endif
return _data;
}
__DARWIN_OS_INLINE
uint64_t
_OSSwapInt64(
uint64_t _data
)
{
#if defined(__llvm__)
return __builtin_bswap64(_data);
#else
union {
uint64_t _ull;
uint32_t _ul[2];
} _u;
/* This actually generates the best code */
_u._ul[0] = (uint32_t)(_data >> 32);
_u._ul[1] = (uint32_t)(_data & 0xffffffff);
_u._ul[0] = _OSSwapInt32(_u._ul[0]);
_u._ul[1] = _OSSwapInt32(_u._ul[1]);
return _u._ull;
#endif
}
/* Functions for byte reversed loads. */
struct _OSUnalignedU16 {
volatile uint16_t __val;
} __attribute__((__packed__));
struct _OSUnalignedU32 {
volatile uint32_t __val;
} __attribute__((__packed__));
struct _OSUnalignedU64 {
volatile uint64_t __val;
} __attribute__((__packed__));
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
uint16_t
_OSReadSwapInt16(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt16(((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val);
}
#else
__DARWIN_OS_INLINE
uint16_t
OSReadSwapInt16(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt16(((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val);
}
#endif
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
uint32_t
_OSReadSwapInt32(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt32(((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val);
}
#else
__DARWIN_OS_INLINE
uint32_t
OSReadSwapInt32(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt32(((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val);
}
#endif
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
uint64_t
_OSReadSwapInt64(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt64(((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val);
}
#else
__DARWIN_OS_INLINE
uint64_t
OSReadSwapInt64(
const volatile void * _base,
uintptr_t _offset
)
{
return _OSSwapInt64(((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val);
}
#endif
/* Functions for byte reversed stores. */
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
void
_OSWriteSwapInt16(
volatile void * _base,
uintptr_t _offset,
uint16_t _data
)
{
((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt16(_data);
}
#else
__DARWIN_OS_INLINE
void
OSWriteSwapInt16(
volatile void * _base,
uintptr_t _offset,
uint16_t _data
)
{
((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt16(_data);
}
#endif
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
void
_OSWriteSwapInt32(
volatile void * _base,
uintptr_t _offset,
uint32_t _data
)
{
((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt32(_data);
}
#else
__DARWIN_OS_INLINE
void
OSWriteSwapInt32(
volatile void * _base,
uintptr_t _offset,
uint32_t _data
)
{
((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt32(_data);
}
#endif
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
__DARWIN_OS_INLINE
void
_OSWriteSwapInt64(
volatile void * _base,
uintptr_t _offset,
uint64_t _data
)
{
((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt64(_data);
}
#else
__DARWIN_OS_INLINE
void
OSWriteSwapInt64(
volatile void * _base,
uintptr_t _offset,
uint64_t _data
)
{
((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt64(_data);
}
#endif
#endif /* ! _OS_OSBYTEORDERARM_H */

View File

@ -1,82 +0,0 @@
/*
* Copyright (c) 2007 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
* 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_ARM_EXCEPTION_H_
#define _MACH_ARM_EXCEPTION_H_
#if defined (__arm__) || defined (__arm64__)
#define EXC_TYPES_COUNT 14 /* incl. illegal exception 0 */
#define EXC_MASK_MACHINE 0
#define EXCEPTION_CODE_MAX 2 /* code and subcode */
/*
* Trap numbers as defined by the hardware exception vectors.
*/
/*
* EXC_BAD_INSTRUCTION
*/
#define EXC_ARM_UNDEFINED 1 /* Undefined */
/*
* EXC_ARITHMETIC
*/
#define EXC_ARM_FP_UNDEFINED 0 /* Undefined Floating Point Exception */
#define EXC_ARM_FP_IO 1 /* Invalid Floating Point Operation */
#define EXC_ARM_FP_DZ 2 /* Floating Point Divide by Zero */
#define EXC_ARM_FP_OF 3 /* Floating Point Overflow */
#define EXC_ARM_FP_UF 4 /* Floating Point Underflow */
#define EXC_ARM_FP_IX 5 /* Inexact Floating Point Result */
#define EXC_ARM_FP_ID 6 /* Floating Point Denormal Input */
/*
* EXC_BAD_ACCESS
* Note: do not conflict with kern_return_t values returned by vm_fault
*/
#define EXC_ARM_DA_ALIGN 0x101 /* Alignment Fault */
#define EXC_ARM_DA_DEBUG 0x102 /* Debug (watch/break) Fault */
#define EXC_ARM_SP_ALIGN 0x103 /* SP Alignment Fault */
#define EXC_ARM_SWP 0x104 /* SWP instruction */
#define EXC_ARM_PAC_FAIL 0x105 /* PAC authentication failure */
/*
* EXC_BREAKPOINT
*/
#define EXC_ARM_BREAKPOINT 1 /* breakpoint trap */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _MACH_ARM_EXCEPTION_H_ */

View File

@ -1,76 +0,0 @@
/*
* Copyright (c) 2007-2018 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
* 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_ARM_PROCESSOR_INFO_H_
#define _MACH_ARM_PROCESSOR_INFO_H_
#if defined (__arm__) || defined (__arm64__)
#define PROCESSOR_CPU_STAT 0x10000003 /* Low-level CPU statistics */
#define PROCESSOR_CPU_STAT64 0x10000004 /* Low-level CPU statistics, in full 64-bit */
#include <stdint.h> /* uint32_t, uint64_t */
struct processor_cpu_stat {
uint32_t irq_ex_cnt;
uint32_t ipi_cnt;
uint32_t timer_cnt;
uint32_t undef_ex_cnt;
uint32_t unaligned_cnt;
uint32_t vfp_cnt;
uint32_t vfp_shortv_cnt;
uint32_t data_ex_cnt;
uint32_t instr_ex_cnt;
};
typedef struct processor_cpu_stat processor_cpu_stat_data_t;
typedef struct processor_cpu_stat *processor_cpu_stat_t;
#define PROCESSOR_CPU_STAT_COUNT ((mach_msg_type_number_t) \
(sizeof(processor_cpu_stat_data_t) / sizeof(natural_t)))
struct processor_cpu_stat64 {
uint64_t irq_ex_cnt;
uint64_t ipi_cnt;
uint64_t timer_cnt;
uint64_t undef_ex_cnt;
uint64_t unaligned_cnt;
uint64_t vfp_cnt;
uint64_t vfp_shortv_cnt;
uint64_t data_ex_cnt;
uint64_t instr_ex_cnt;
uint64_t pmi_cnt;
} __attribute__((packed, aligned(4)));
typedef struct processor_cpu_stat64 processor_cpu_stat64_data_t;
typedef struct processor_cpu_stat64 *processor_cpu_stat64_t;
#define PROCESSOR_CPU_STAT64_COUNT ((mach_msg_type_number_t) \
(sizeof(processor_cpu_stat64_data_t) / sizeof(integer_t)))
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _MACH_ARM_PROCESSOR_INFO_H_ */

View File

@ -1,162 +0,0 @@
/*
* Copyright (c) 2000-2007 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
* 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@
*/
/*
* @OSF_COPYRIGHT@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
*/
/*
* File: vm_types.h
* Author: Avadis Tevanian, Jr.
* Date: 1985
*
* Header file for VM data types. ARM version.
*/
#ifndef _MACH_ARM_VM_TYPES_H_
#define _MACH_ARM_VM_TYPES_H_
#if defined (__arm__) || defined (__arm64__)
#ifndef ASSEMBLER
#include <arm/_types.h>
#include <stdint.h>
#include <Availability.h>
#include <sys/cdefs.h>
/*
* natural_t and integer_t are Mach's legacy types for machine-
* independent integer types (unsigned, and signed, respectively).
* Their original purpose was to define other types in a machine/
* compiler independent way.
*
* They also had an implicit "same size as pointer" characteristic
* to them (i.e. Mach's traditional types are very ILP32 or ILP64
* centric). We will likely support x86 ABIs that do not follow
* either ofthese models (specifically LP64). Therefore, we had to
* make a choice between making these types scale with pointers or stay
* tied to integers. Because their use is predominantly tied to
* to the size of an integer, we are keeping that association and
* breaking free from pointer size guarantees.
*
* New use of these types is discouraged.
*/
typedef __darwin_natural_t natural_t;
typedef int integer_t;
/*
* A vm_offset_t is a type-neutral pointer,
* e.g. an offset into a virtual memory space.
*/
#ifdef __LP64__
typedef uintptr_t vm_offset_t __kernel_ptr_semantics;
typedef uintptr_t vm_size_t;
typedef uint64_t mach_vm_address_t __kernel_ptr_semantics;
typedef uint64_t mach_vm_offset_t __kernel_ptr_semantics;
typedef uint64_t mach_vm_size_t;
typedef uint64_t vm_map_offset_t __kernel_ptr_semantics;
typedef uint64_t vm_map_address_t __kernel_ptr_semantics;
typedef uint64_t vm_map_size_t;
#else
typedef natural_t vm_offset_t __kernel_ptr_semantics;
/*
* A vm_size_t is the proper type for e.g.
* expressing the difference between two
* vm_offset_t entities.
*/
typedef natural_t vm_size_t;
/*
* This new type is independent of a particular vm map's
* implementation size - and represents appropriate types
* for all possible maps. This is used for interfaces
* where the size of the map is not known - or we don't
* want to have to distinguish.
*/
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0)
typedef uint32_t mach_vm_address_t;
typedef uint32_t mach_vm_offset_t;
typedef uint32_t mach_vm_size_t;
#else
typedef uint64_t mach_vm_address_t __kernel_ptr_semantics;
typedef uint64_t mach_vm_offset_t __kernel_ptr_semantics;
typedef uint64_t mach_vm_size_t;
#endif
typedef uint32_t vm_map_offset_t __kernel_ptr_semantics;
typedef uint32_t vm_map_address_t __kernel_ptr_semantics;
typedef uint32_t vm_map_size_t;
#endif /* __LP64__ */
typedef uint32_t vm32_offset_t;
typedef uint32_t vm32_address_t;
typedef uint32_t vm32_size_t;
typedef vm_offset_t mach_port_context_t;
#endif /* ASSEMBLER */
/*
* If composing messages by hand (please do not)
*/
#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _MACH_ARM_VM_TYPES_H_ */

View File

@ -1443,4 +1443,4 @@
#endif /* ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES */
#endif /* __ASSERTMACROS__ */
#endif /* __ASSERTMACROS__ */

View File

@ -128,10 +128,42 @@
* clang -D__API_TO_BE_DEPRECATED=11.0 <other compiler flags>
*/
#ifndef __API_TO_BE_DEPRECATED
#define __API_TO_BE_DEPRECATED 100000
#ifndef __API_TO_BE_DEPRECATED
#define __API_TO_BE_DEPRECATED 100000
#endif
#ifndef __API_TO_BE_DEPRECATED_MACOS
#define __API_TO_BE_DEPRECATED_MACOS 100000
#endif
#ifndef __API_TO_BE_DEPRECATED_IOS
#define __API_TO_BE_DEPRECATED_IOS 100000
#endif
#ifndef __API_TO_BE_DEPRECATED_MACCATALYST
#define __API_TO_BE_DEPRECATED_MACCATALYST 100000
#endif
#ifndef __API_TO_BE_DEPRECATED_WATCHOS
#define __API_TO_BE_DEPRECATED_WATCHOS 100000
#endif
#ifndef __API_TO_BE_DEPRECATED_TVOS
#define __API_TO_BE_DEPRECATED_TVOS 100000
#endif
#ifndef __API_TO_BE_DEPRECATED_BRIDGEOS
#endif
#ifndef __API_TO_BE_DEPRECATED_DRIVERKIT
#define __API_TO_BE_DEPRECATED_DRIVERKIT 100000
#endif
#ifndef __API_TO_BE_DEPRECATED_XROS
#define __API_TO_BE_DEPRECATED_XROS 100000
#endif
#include <AvailabilityVersions.h>
#include <AvailabilityInternal.h>
@ -250,11 +282,17 @@
#endif
#if __has_include(<AvailabilityProhibitedInternal.h>)
#include <AvailabilityProhibitedInternal.h>
#endif
/* for use marking APIs available info for iOS */
#if defined(__has_attribute)
#if __has_attribute(availability)
#define __IOS_UNAVAILABLE __OS_AVAILABILITY(ios,unavailable)
#define __IOS_PROHIBITED __OS_AVAILABILITY(ios,unavailable)
#ifndef __IOS_PROHIBITED
#define __IOS_PROHIBITED __OS_AVAILABILITY(ios,unavailable)
#endif
#define __IOS_AVAILABLE(_vers) __OS_AVAILABILITY(ios,introduced=_vers)
#define __IOS_DEPRECATED(_start, _dep, _msg) __IOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(ios,deprecated=_dep,_msg)
#endif
@ -281,7 +319,9 @@
#if defined(__has_feature)
#if __has_feature(attribute_availability_tvos)
#define __TVOS_UNAVAILABLE __OS_AVAILABILITY(tvos,unavailable)
#define __TVOS_PROHIBITED __OS_AVAILABILITY(tvos,unavailable)
#ifndef __TVOS_PROHIBITED
#define __TVOS_PROHIBITED __OS_AVAILABILITY(tvos,unavailable)
#endif
#define __TVOS_AVAILABLE(_vers) __OS_AVAILABILITY(tvos,introduced=_vers)
#define __TVOS_DEPRECATED(_start, _dep, _msg) __TVOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(tvos,deprecated=_dep,_msg)
#endif
@ -308,7 +348,9 @@
#if defined(__has_feature)
#if __has_feature(attribute_availability_watchos)
#define __WATCHOS_UNAVAILABLE __OS_AVAILABILITY(watchos,unavailable)
#define __WATCHOS_PROHIBITED __OS_AVAILABILITY(watchos,unavailable)
#ifndef __WATCHOS_PROHIBITED
#define __WATCHOS_PROHIBITED __OS_AVAILABILITY(watchos,unavailable)
#endif
#define __WATCHOS_AVAILABLE(_vers) __OS_AVAILABILITY(watchos,introduced=_vers)
#define __WATCHOS_DEPRECATED(_start, _dep, _msg) __WATCHOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(watchos,deprecated=_dep,_msg)
#endif
@ -330,7 +372,6 @@
#define __WATCHOS_DEPRECATED(_start, _dep, _msg)
#endif
/* for use marking APIs unavailable for swift */
#if defined(__has_feature)
#if __has_feature(attribute_availability_swift)
@ -378,9 +419,9 @@
* __API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))
* __API_AVAILABLE(driverkit(19.0))
*/
#define __API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE7, __API_AVAILABLE6, __API_AVAILABLE5, __API_AVAILABLE4, __API_AVAILABLE3, __API_AVAILABLE2, __API_AVAILABLE1, 0)(__VA_ARGS__)
#define __API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN7, __API_AVAILABLE_BEGIN6, __API_AVAILABLE_BEGIN5, __API_AVAILABLE_BEGIN4, __API_AVAILABLE_BEGIN3, __API_AVAILABLE_BEGIN2, __API_AVAILABLE_BEGIN1, 0)(__VA_ARGS__)
#define __API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE7,__API_AVAILABLE6,__API_AVAILABLE5,__API_AVAILABLE4,__API_AVAILABLE3,__API_AVAILABLE2,__API_AVAILABLE1,__API_AVAILABLE0,0)(__VA_ARGS__)
#define __API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN7,__API_AVAILABLE_BEGIN6,__API_AVAILABLE_BEGIN5,__API_AVAILABLE_BEGIN4,__API_AVAILABLE_BEGIN3,__API_AVAILABLE_BEGIN2,__API_AVAILABLE_BEGIN1,__API_AVAILABLE_BEGIN0,0)(__VA_ARGS__)
#define __API_AVAILABLE_END _Pragma("clang attribute pop")
/*
@ -399,13 +440,13 @@
* __API_DEPRECATED_WITH_REPLACEMENT("-setName:", tvos(10.0, 10.4), ios(9.0, 10.0))
* __API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))
*/
#define __API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG8,__API_DEPRECATED_MSG7,__API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1, 0)(__VA_ARGS__)
#define __API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP8,__API_DEPRECATED_REP7,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1, 0)(__VA_ARGS__)
#define __API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG7,__API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1,__API_DEPRECATED_MSG0,0,0)(__VA_ARGS__)
#define __API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP7,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1,__API_DEPRECATED_REP0,0,0)(__VA_ARGS__)
#define __API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN_MSG8,__API_DEPRECATED_BEGIN_MSG7, __API_DEPRECATED_BEGIN_MSG6, __API_DEPRECATED_BEGIN_MSG5, __API_DEPRECATED_BEGIN_MSG4, __API_DEPRECATED_BEGIN_MSG3, __API_DEPRECATED_BEGIN_MSG2, __API_DEPRECATED_BEGIN_MSG1, 0)(__VA_ARGS__)
#define __API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN7,__API_DEPRECATED_BEGIN6,__API_DEPRECATED_BEGIN5,__API_DEPRECATED_BEGIN4,__API_DEPRECATED_BEGIN3,__API_DEPRECATED_BEGIN2,__API_DEPRECATED_BEGIN1,__API_DEPRECATED_BEGIN0,0,0)(__VA_ARGS__)
#define __API_DEPRECATED_END _Pragma("clang attribute pop")
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN_REP8,__API_DEPRECATED_BEGIN_REP7, __API_DEPRECATED_BEGIN_REP6, __API_DEPRECATED_BEGIN_REP5, __API_DEPRECATED_BEGIN_REP4, __API_DEPRECATED_BEGIN_REP3, __API_DEPRECATED_BEGIN_REP2, __API_DEPRECATED_BEGIN_REP1, 0)(__VA_ARGS__)
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN7,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN6,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN5,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN4,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN3,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN2,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN1,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN0,0,0)(__VA_ARGS__)
#define __API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")
/*
@ -416,51 +457,63 @@
* __API_UNAVAILABLE(macos)
* __API_UNAVAILABLE(watchos, tvos)
*/
#define __API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__)
#define __API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6, __API_UNAVAILABLE_BEGIN5, __API_UNAVAILABLE_BEGIN4, __API_UNAVAILABLE_BEGIN3, __API_UNAVAILABLE_BEGIN2, __API_UNAVAILABLE_BEGIN1, 0)(__VA_ARGS__)
#define __API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1,__API_UNAVAILABLE0,0)(__VA_ARGS__)
#define __API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6,__API_UNAVAILABLE_BEGIN5,__API_UNAVAILABLE_BEGIN4,__API_UNAVAILABLE_BEGIN3,__API_UNAVAILABLE_BEGIN2,__API_UNAVAILABLE_BEGIN1,__API_UNAVAILABLE_BEGIN0,0)(__VA_ARGS__)
#define __API_UNAVAILABLE_END _Pragma("clang attribute pop")
#else
/*
* Evaluate to nothing for compilers that don't support availability.
*/
#define __API_AVAILABLE(...)
#define __API_AVAILABLE_BEGIN(...)
#define __API_AVAILABLE_END
#define __API_DEPRECATED(...)
#define __API_DEPRECATED_WITH_REPLACEMENT(...)
#define __API_DEPRECATED_BEGIN(...)
#define __API_DEPRECATED_END
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...)
#define __API_DEPRECATED_WITH_REPLACEMENT_END
#define __API_UNAVAILABLE(...)
#define __API_UNAVAILABLE_BEGIN(...)
#define __API_UNAVAILABLE_END
#endif /* __has_attribute(availability) */
#else
/*
* Evaluate to nothing for compilers that don't support clang language extensions.
*/
#define __API_AVAILABLE(...)
#define __API_AVAILABLE_BEGIN(...)
#define __API_AVAILABLE_END
#define __API_DEPRECATED(...)
#define __API_DEPRECATED_WITH_REPLACEMENT(...)
#define __API_DEPRECATED_BEGIN(...)
#define __API_DEPRECATED_END
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...)
#define __API_DEPRECATED_WITH_REPLACEMENT_END
#define __API_UNAVAILABLE(...)
#define __API_UNAVAILABLE_BEGIN(...)
#define __API_UNAVAILABLE_END
#endif /* #if defined(__has_feature) && defined(__has_attribute) */
#if __has_include(<AvailabilityProhibitedInternal.h>)
#include <AvailabilityProhibitedInternal.h>
/*
* Evaluate to nothing for compilers that don't support availability.
*/
#ifndef __API_AVAILABLE
#define __API_AVAILABLE(...)
#endif
#ifndef __API_AVAILABLE_BEGIN
#define __API_AVAILABLE_BEGIN(...)
#endif
#ifndef __API_AVAILABLE_END
#define __API_AVAILABLE_END(...)
#endif
#ifndef __API_DEPRECATED
#define __API_DEPRECATED(...)
#endif
#ifndef __API_DEPRECATED_BEGIN
#define __API_DEPRECATED_BEGIN(...)
#endif
#ifndef __API_DEPRECATED_END
#define __API_DEPRECATED_END(...)
#endif
#ifndef __API_DEPRECATED_WITH_REPLACEMENT
#define __API_DEPRECATED_WITH_REPLACEMENT(...)
#endif
#ifndef __API_DEPRECATED_WITH_REPLACEMENT_BEGIN
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...)
#endif
#ifndef __API_DEPRECATED_WITH_REPLACEMENT_END
#define __API_DEPRECATED_WITH_REPLACEMENT_END(...)
#endif
#ifndef __API_UNAVAILABLE
#define __API_UNAVAILABLE(...)
#endif
#ifndef __API_UNAVAILABLE_BEGIN
#define __API_UNAVAILABLE_BEGIN(...)
#endif
#ifndef __API_UNAVAILABLE_END
#define __API_UNAVAILABLE_END(...)
#endif
/*
@ -479,4 +532,5 @@
#define __SPI_DEPRECATED_WITH_REPLACEMENT(...)
#endif
#endif /* __AVAILABILITY__ */
#endif /* __AVAILABILITY__ */

View File

@ -0,0 +1,357 @@
/*
* Copyright (c) 2007-2016 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@
*/
/*
File: AvailabilityInternal.h
Contains: implementation details of __OSX_AVAILABLE_* macros from <Availability.h>
*/
#ifndef __AVAILABILITY_INTERNAL__
#define __AVAILABILITY_INTERNAL__
#if __has_include(<AvailabilityInternalPrivate.h>)
#include <AvailabilityInternalPrivate.h>
#endif
#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(macos)
#define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_0
#endif
#elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_0
#endif /* __has_builtin(__is_target_os) && __is_target_os(macos) */
#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
#ifndef __IPHONE_OS_VERSION_MIN_REQUIRED
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(ios)
#define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_17_0
#endif
#elif __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_17_0
#endif /* __has_builtin(__is_target_os) && __is_target_os(ios) */
#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */
#ifndef __WATCH_OS_VERSION_MIN_REQUIRED
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(watchos)
#define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_10_0
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif
#elif __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_10_0
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif /* __has_builtin(__is_target_os) && __is_target_os(watchos) */
#endif /* __WATCH_OS_VERSION_MIN_REQUIRED */
#ifndef __TV_OS_VERSION_MIN_REQUIRED
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(tvos)
#define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_17_0
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif
#elif __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_17_0
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif /* __has_builtin(__is_target_os) && __is_target_os(tvos) */
#endif /* __TV_OS_VERSION_MIN_REQUIRED */
#ifndef __BRIDGE_OS_VERSION_MIN_REQUIRED
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(bridgeos)
#define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __BRIDGE_OS_VERSION_MAX_ALLOWED __BRIDGEOS_8_0
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_11_0
#endif
#endif
#endif /* __BRIDGE_OS_VERSION_MIN_REQUIRED */
#ifndef __DRIVERKIT_VERSION_MIN_REQUIRED
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(driverkit)
#define __DRIVERKIT_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_23_0
#endif
#endif /* __has_builtin(__is_target_os) && __is_target_os(driverkit) */
#endif /* __DRIVERKIT_VERSION_MIN_REQUIRED */
#ifndef __XR_OS_VERSION_MIN_REQUIRED
#if defined(__has_builtin) && __has_builtin(__is_target_os)
#if __is_target_os(xros)
#define __XR_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __XR_OS_VERSION_MAX_ALLOWED __XROS_1_0
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_0
#endif
#endif /* __has_builtin(__is_target_os) && __is_target_os(xros) */
#endif /* __XR_OS_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_17_0
#endif
/* make sure a valid min is set */
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0
#undef __IPHONE_OS_VERSION_MIN_REQUIRED
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_2_0
#endif
#endif
#define __AVAILABILITY_INTERNAL_DEPRECATED __attribute__((deprecated))
#ifdef __has_feature
#if __has_feature(attribute_deprecated_with_message)
#define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg)))
#else
#define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated))
#endif
#elif defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)))
#define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg)))
#else
#define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated))
#endif
#define __AVAILABILITY_INTERNAL_UNAVAILABLE __attribute__((unavailable))
#define __AVAILABILITY_INTERNAL_WEAK_IMPORT __attribute__((weak_import))
#define __AVAILABILITY_INTERNAL_REGULAR
#include <AvailabilityInternalLegacy.h>
#if defined(__has_feature) && defined(__has_attribute)
#if __has_attribute(availability)
#define __API_AVAILABLE_PLATFORM_macos(x) macos,introduced=x
#define __API_UNAVAILABLE_PLATFORM_macos macos,unavailable
#define __API_DEPRECATED_PLATFORM_macos(x,y) macos,introduced=x,deprecated=y
#define __API_AVAILABLE_PLATFORM_macosx(x) macos,introduced=x
#define __API_UNAVAILABLE_PLATFORM_macosx macos,unavailable
#define __API_DEPRECATED_PLATFORM_macosx(x,y) macos,introduced=x,deprecated=y
#define __API_AVAILABLE_PLATFORM_ios(x) ios,introduced=x
#define __API_UNAVAILABLE_PLATFORM_ios ios,unavailable
#define __API_DEPRECATED_PLATFORM_ios(x,y) ios,introduced=x,deprecated=y
#define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
#define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
#define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
#define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
#define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
#define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
#define __API_AVAILABLE_PLATFORM_watchos(x) watchos,introduced=x
#define __API_UNAVAILABLE_PLATFORM_watchos watchos,unavailable
#define __API_DEPRECATED_PLATFORM_watchos(x,y) watchos,introduced=x,deprecated=y
#define __API_AVAILABLE_PLATFORM_tvos(x) tvos,introduced=x
#define __API_UNAVAILABLE_PLATFORM_tvos tvos,unavailable
#define __API_DEPRECATED_PLATFORM_tvos(x,y) tvos,introduced=x,deprecated=y
#define __API_AVAILABLE_PLATFORM_driverkit(x) driverkit,introduced=x
#define __API_UNAVAILABLE_PLATFORM_driverkit driverkit,unavailable
#define __API_DEPRECATED_PLATFORM_driverkit(x,y) driverkit,introduced=x,deprecated=y
#define __API_AVAILABLE_PLATFORM_xros(x) xros,introduced=x
#define __API_UNAVAILABLE_PLATFORM_xros xros,unavailable
#define __API_DEPRECATED_PLATFORM_xros(x,y) xros,introduced=x,deprecated=y
#define __API_AVAILABLE_PLATFORM_visionos(x) xros,introduced=x
#define __API_UNAVAILABLE_PLATFORM_visionos xros,unavailable
#define __API_DEPRECATED_PLATFORM_visionos(x,y) xros,introduced=x,deprecated=y
#endif /* __has_attribute(availability) */
#endif /* defined(__has_feature) && defined(__has_attribute) */
#if defined(__has_feature) && defined(__has_attribute)
#if __has_attribute(availability)
#define __API_APPLY_TO any(record, enum, enum_constant, function, objc_method, objc_category, objc_protocol, objc_interface, objc_property, type_alias, variable, field)
#define __API_RANGE_STRINGIFY(x) __API_RANGE_STRINGIFY2(x)
#define __API_RANGE_STRINGIFY2(x) #x
#endif /* __has_attribute(availability) */
#endif /* defined(__has_feature) && defined(__has_attribute) */
/*
Macros for defining which versions/platform a given symbol can be used.
@see http://clang.llvm.org/docs/AttributeReference.html#availability
*/
#if defined(__has_feature) && defined(__has_attribute)
#if __has_attribute(availability)
#define __API_A(x) __attribute__((availability(__API_AVAILABLE_PLATFORM_##x)))
#define __API_AVAILABLE0(arg0) __API_A(arg0)
#define __API_AVAILABLE1(arg0,arg1) __API_A(arg0) __API_A(arg1)
#define __API_AVAILABLE2(arg0,arg1,arg2) __API_A(arg0) __API_A(arg1) __API_A(arg2)
#define __API_AVAILABLE3(arg0,arg1,arg2,arg3) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3)
#define __API_AVAILABLE4(arg0,arg1,arg2,arg3,arg4) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4)
#define __API_AVAILABLE5(arg0,arg1,arg2,arg3,arg4,arg5) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5)
#define __API_AVAILABLE6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5) __API_A(arg6)
#define __API_AVAILABLE7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5) __API_A(arg6) __API_A(arg7)
#define __API_AVAILABLE_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
#define __API_A_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_AVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
#define __API_AVAILABLE_BEGIN0(arg0) __API_A_BEGIN(arg0)
#define __API_AVAILABLE_BEGIN1(arg0,arg1) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1)
#define __API_AVAILABLE_BEGIN2(arg0,arg1,arg2) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2)
#define __API_AVAILABLE_BEGIN3(arg0,arg1,arg2,arg3) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3)
#define __API_AVAILABLE_BEGIN4(arg0,arg1,arg2,arg3,arg4) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4)
#define __API_AVAILABLE_BEGIN5(arg0,arg1,arg2,arg3,arg4,arg5) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5)
#define __API_AVAILABLE_BEGIN6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5) __API_A_BEGIN(arg6)
#define __API_AVAILABLE_BEGIN7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5) __API_A_BEGIN(arg6) __API_A_BEGIN(arg7)
#define __API_AVAILABLE_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
#define __API_D(msg,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg)))
#define __API_DEPRECATED_MSG0(msg,arg0) __API_D(msg,arg0)
#define __API_DEPRECATED_MSG1(msg,arg0,arg1) __API_D(msg,arg0) __API_D(msg,arg1)
#define __API_DEPRECATED_MSG2(msg,arg0,arg1,arg2) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2)
#define __API_DEPRECATED_MSG3(msg,arg0,arg1,arg2,arg3) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3)
#define __API_DEPRECATED_MSG4(msg,arg0,arg1,arg2,arg3,arg4) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4)
#define __API_DEPRECATED_MSG5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5)
#define __API_DEPRECATED_MSG6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5) __API_D(msg,arg6)
#define __API_DEPRECATED_MSG7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5) __API_D(msg,arg6) __API_D(msg,arg7)
#define __API_DEPRECATED_MSG_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define __API_D_BEGIN(msg, x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg))), apply_to = __API_APPLY_TO)))
#define __API_DEPRECATED_BEGIN0(msg,arg0) __API_D_BEGIN(msg,arg0)
#define __API_DEPRECATED_BEGIN1(msg,arg0,arg1) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1)
#define __API_DEPRECATED_BEGIN2(msg,arg0,arg1,arg2) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2)
#define __API_DEPRECATED_BEGIN3(msg,arg0,arg1,arg2,arg3) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3)
#define __API_DEPRECATED_BEGIN4(msg,arg0,arg1,arg2,arg3,arg4) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4)
#define __API_DEPRECATED_BEGIN5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5)
#define __API_DEPRECATED_BEGIN6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5) __API_D_BEGIN(msg,arg6)
#define __API_DEPRECATED_BEGIN7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5) __API_D_BEGIN(msg,arg6) __API_D_BEGIN(msg,arg7)
#define __API_DEPRECATED_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#if __has_feature(attribute_availability_with_replacement)
#define __API_R(rep,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep)))
#else
#define __API_R(rep,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x)))
#endif
#define __API_DEPRECATED_REP0(msg,arg0) __API_R(msg,arg0)
#define __API_DEPRECATED_REP1(msg,arg0,arg1) __API_R(msg,arg0) __API_R(msg,arg1)
#define __API_DEPRECATED_REP2(msg,arg0,arg1,arg2) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2)
#define __API_DEPRECATED_REP3(msg,arg0,arg1,arg2,arg3) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3)
#define __API_DEPRECATED_REP4(msg,arg0,arg1,arg2,arg3,arg4) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4)
#define __API_DEPRECATED_REP5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5)
#define __API_DEPRECATED_REP6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5) __API_R(msg,arg6)
#define __API_DEPRECATED_REP7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5) __API_R(msg,arg6) __API_R(msg,arg7)
#define __API_DEPRECATED_REP_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#if __has_feature(attribute_availability_with_replacement)
#define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep))), apply_to = __API_APPLY_TO)))
#else
#define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
#endif
#define __API_DEPRECATED_BEGIN_REP0(msg,arg0) __API_R_BEGIN(msg,arg0)
#define __API_DEPRECATED_BEGIN_REP1(msg,arg0,arg1) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1)
#define __API_DEPRECATED_BEGIN_REP2(msg,arg0,arg1,arg2) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2)
#define __API_DEPRECATED_BEGIN_REP3(msg,arg0,arg1,arg2,arg3) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3)
#define __API_DEPRECATED_BEGIN_REP4(msg,arg0,arg1,arg2,arg3,arg4) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4)
#define __API_DEPRECATED_BEGIN_REP5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5)
#define __API_DEPRECATED_BEGIN_REP6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6)
#define __API_DEPRECATED_BEGIN_REP7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6) __API_R_BEGIN(msg,arg7)
#define __API_DEPRECATED_BEGIN_REP_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
/*
* API Unavailability
* Use to specify that an API is unavailable for a particular platform.
*
* Example:
* __API_UNAVAILABLE(macos)
* __API_UNAVAILABLE(watchos, tvos)
*/
#define __API_U(x) __attribute__((availability(__API_UNAVAILABLE_PLATFORM_##x)))
#define __API_UNAVAILABLE0(arg0) __API_U(arg0)
#define __API_UNAVAILABLE1(arg0,arg1) __API_U(arg0) __API_U(arg1)
#define __API_UNAVAILABLE2(arg0,arg1,arg2) __API_U(arg0) __API_U(arg1) __API_U(arg2)
#define __API_UNAVAILABLE3(arg0,arg1,arg2,arg3) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3)
#define __API_UNAVAILABLE4(arg0,arg1,arg2,arg3,arg4) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4)
#define __API_UNAVAILABLE5(arg0,arg1,arg2,arg3,arg4,arg5) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5)
#define __API_UNAVAILABLE6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5) __API_U(arg6)
#define __API_UNAVAILABLE7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5) __API_U(arg6) __API_U(arg7)
#define __API_UNAVAILABLE_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
#define __API_U_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_UNAVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
#define __API_UNAVAILABLE_BEGIN0(arg0) __API_U_BEGIN(arg0)
#define __API_UNAVAILABLE_BEGIN1(arg0,arg1) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1)
#define __API_UNAVAILABLE_BEGIN2(arg0,arg1,arg2) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2)
#define __API_UNAVAILABLE_BEGIN3(arg0,arg1,arg2,arg3) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3)
#define __API_UNAVAILABLE_BEGIN4(arg0,arg1,arg2,arg3,arg4) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4)
#define __API_UNAVAILABLE_BEGIN5(arg0,arg1,arg2,arg3,arg4,arg5) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5)
#define __API_UNAVAILABLE_BEGIN6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5) __API_U_BEGIN(arg6)
#define __API_UNAVAILABLE_BEGIN7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5) __API_U_BEGIN(arg6) __API_U_BEGIN(arg7)
#define __API_UNAVAILABLE_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
#endif /* __has_attribute(availability) */
#endif /* #if defined(__has_feature) && defined(__has_attribute) */
/*
* Swift compiler version
* Allows for project-agnostic "epochs" for frameworks imported into Swift via the Clang importer, like #if _compiler_version for Swift
* Example:
*
* #if __swift_compiler_version_at_least(800, 2, 20)
* - (nonnull NSString *)description;
* #else
* - (NSString *)description;
* #endif
*/
#ifdef __SWIFT_COMPILER_VERSION
#define __swift_compiler_version_at_least_impl(X, Y, Z, a, b, ...) \
__SWIFT_COMPILER_VERSION >= ((X * UINT64_C(1000) * 1000 * 1000) + (Z * 1000 * 1000) + (a * 1000) + b)
#define __swift_compiler_version_at_least(...) __swift_compiler_version_at_least_impl(__VA_ARGS__, 0, 0, 0, 0)
#else
#define __swift_compiler_version_at_least(...) 1
#endif
/*
* If __SPI_AVAILABLE has not been defined elsewhere, disable it.
*/
#ifndef __SPI_AVAILABLE
#define __SPI_AVAILABLE(...)
#endif
#endif /* __AVAILABILITY_INTERNAL__ */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007-2016 by Apple Inc.. All rights reserved.
* Copyright (c) 2007-2022 by Apple Inc.. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
@ -22,105 +22,14 @@
*/
/*
File: AvailabilityInternal.h
File: AvailabilityInternalLegacy.h
Contains: implementation details of __OSX_AVAILABLE_* macros from <Availability.h>
*/
#ifndef __AVAILABILITY_INTERNAL__
#define __AVAILABILITY_INTERNAL__
#if __has_include(<AvailabilityInternalPrivate.h>)
#include <AvailabilityInternalPrivate.h>
#endif
#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
/* compiler for Mac OS X sets __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ */
#define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#endif
#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED*/
#ifndef __IPHONE_OS_VERSION_MIN_REQUIRED
#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 */
#ifndef __TV_OS_VERSION_MIN_REQUIRED
#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_15_4
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED 90000
#endif
#endif
#ifndef __WATCH_OS_VERSION_MIN_REQUIRED
#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_8_5
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED 90000
#endif
#endif
#ifndef __BRIDGE_OS_VERSION_MIN_REQUIRED
#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 60400
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED 110000
#endif
#endif
#ifndef __DRIVERKIT_VERSION_MIN_REQUIRED
#ifdef __ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__
#define __DRIVERKIT_VERSION_MIN_REQUIRED __ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__
#endif
#endif
#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_12_3
#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_15_4
#endif
/* make sure a valid min is set */
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0
#undef __IPHONE_OS_VERSION_MIN_REQUIRED
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_2_0
#endif
#endif
#define __AVAILABILITY_INTERNAL_DEPRECATED __attribute__((deprecated))
#ifdef __has_feature
#if __has_feature(attribute_deprecated_with_message)
#define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg)))
#else
#define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated))
#endif
#elif defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)))
#define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg)))
#else
#define __AVAILABILITY_INTERNAL_DEPRECATED_MSG(_msg) __attribute__((deprecated))
#endif
#define __AVAILABILITY_INTERNAL_UNAVAILABLE __attribute__((unavailable))
#define __AVAILABILITY_INTERNAL_WEAK_IMPORT __attribute__((weak_import))
#define __AVAILABILITY_INTERNAL_REGULAR
#ifndef __AVAILABILITY_INTERNAL_LEGACY__
#define __AVAILABILITY_INTERNAL_LEGACY__
#if defined(__has_builtin)
#if __has_builtin(__is_target_arch)
@ -4432,244 +4341,4 @@
#endif
#endif /* __ENABLE_LEGACY_MAC_AVAILABILITY */
/*
Macros for defining which versions/platform a given symbol can be used.
@see http://clang.llvm.org/docs/AttributeReference.html#availability
*/
#if defined(__has_feature) && defined(__has_attribute)
#if __has_attribute(availability)
#define __API_AVAILABLE_PLATFORM_macos(x) macos,introduced=x
#define __API_AVAILABLE_PLATFORM_macosx(x) macosx,introduced=x
#define __API_AVAILABLE_PLATFORM_ios(x) ios,introduced=x
#define __API_AVAILABLE_PLATFORM_watchos(x) watchos,introduced=x
#define __API_AVAILABLE_PLATFORM_tvos(x) tvos,introduced=x
#define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
#define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
#ifndef __API_AVAILABLE_PLATFORM_uikitformac
#define __API_AVAILABLE_PLATFORM_uikitformac(x) uikitformac,introduced=x
#endif
#define __API_AVAILABLE_PLATFORM_driverkit(x) driverkit,introduced=x
#if defined(__has_attribute)
#if __has_attribute(availability)
#define __API_A(x) __attribute__((availability(__API_AVAILABLE_PLATFORM_##x)))
#else
#define __API_A(x)
#endif
#else
#define __API_A(x)
#endif
#define __API_AVAILABLE1(x) __API_A(x)
#define __API_AVAILABLE2(x,y) __API_A(x) __API_A(y)
#define __API_AVAILABLE3(x,y,z) __API_A(x) __API_A(y) __API_A(z)
#define __API_AVAILABLE4(x,y,z,t) __API_A(x) __API_A(y) __API_A(z) __API_A(t)
#define __API_AVAILABLE5(x,y,z,t,b) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b)
#define __API_AVAILABLE6(x,y,z,t,b,m) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b) __API_A(m)
#define __API_AVAILABLE7(x,y,z,t,b,m,d) __API_A(x) __API_A(y) __API_A(z) __API_A(t) __API_A(b) __API_A(m) __API_A(d)
#define __API_AVAILABLE_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
#define __API_APPLY_TO any(record, enum, enum_constant, function, objc_method, objc_category, objc_protocol, objc_interface, objc_property, type_alias, variable, field)
#define __API_RANGE_STRINGIFY(x) __API_RANGE_STRINGIFY2(x)
#define __API_RANGE_STRINGIFY2(x) #x
#define __API_A_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_AVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
#define __API_AVAILABLE_BEGIN1(a) __API_A_BEGIN(a)
#define __API_AVAILABLE_BEGIN2(a,b) __API_A_BEGIN(a) __API_A_BEGIN(b)
#define __API_AVAILABLE_BEGIN3(a,b,c) __API_A_BEGIN(a) __API_A_BEGIN(b) __API_A_BEGIN(c)
#define __API_AVAILABLE_BEGIN4(a,b,c,d) __API_A_BEGIN(a) __API_A_BEGIN(b) __API_A_BEGIN(c) __API_A_BEGIN(d)
#define __API_AVAILABLE_BEGIN5(a,b,c,d,e) __API_A_BEGIN(a) __API_A_BEGIN(b) __API_A_BEGIN(c) __API_A_BEGIN(d) __API_A_BEGIN(e)
#define __API_AVAILABLE_BEGIN6(a,b,c,d,e,f) __API_A_BEGIN(a) __API_A_BEGIN(b) __API_A_BEGIN(c) __API_A_BEGIN(d) __API_A_BEGIN(e) __API_A_BEGIN(f)
#define __API_AVAILABLE_BEGIN7(a,b,c,d,e,f,g) __API_A_BEGIN(a) __API_A_BEGIN(b) __API_A_BEGIN(c) __API_A_BEGIN(d) __API_A_BEGIN(e) __API_A_BEGIN(f) __API_A_BEGIN(g)
#define __API_AVAILABLE_BEGIN_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
#define __API_DEPRECATED_PLATFORM_macos(x,y) macos,introduced=x,deprecated=y
#define __API_DEPRECATED_PLATFORM_macosx(x,y) macosx,introduced=x,deprecated=y
#define __API_DEPRECATED_PLATFORM_ios(x,y) ios,introduced=x,deprecated=y
#define __API_DEPRECATED_PLATFORM_watchos(x,y) watchos,introduced=x,deprecated=y
#define __API_DEPRECATED_PLATFORM_tvos(x,y) tvos,introduced=x,deprecated=y
#define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
#define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
#ifndef __API_DEPRECATED_PLATFORM_uikitformac
#define __API_DEPRECATED_PLATFORM_uikitformac(x) uikitformac,introduced=x,deprecated=y
#endif
#define __API_DEPRECATED_PLATFORM_driverkit(x,y) driverkit,introduced=x,deprecated=y
#if defined(__has_attribute)
#if __has_attribute(availability)
#define __API_D(msg,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg)))
#else
#define __API_D(msg,x)
#endif
#else
#define __API_D(msg,x)
#endif
#define __API_DEPRECATED_MSG2(msg,x) __API_D(msg,x)
#define __API_DEPRECATED_MSG3(msg,x,y) __API_D(msg,x) __API_D(msg,y)
#define __API_DEPRECATED_MSG4(msg,x,y,z) __API_DEPRECATED_MSG3(msg,x,y) __API_D(msg,z)
#define __API_DEPRECATED_MSG5(msg,x,y,z,t) __API_DEPRECATED_MSG4(msg,x,y,z) __API_D(msg,t)
#define __API_DEPRECATED_MSG6(msg,x,y,z,t,b) __API_DEPRECATED_MSG5(msg,x,y,z,t) __API_D(msg,b)
#define __API_DEPRECATED_MSG7(msg,x,y,z,t,b,m) __API_DEPRECATED_MSG6(msg,x,y,z,t,b) __API_D(msg,m)
#define __API_DEPRECATED_MSG8(msg,x,y,z,t,b,m,d) __API_DEPRECATED_MSG7(msg,x,y,z,t,b,m) __API_D(msg,d)
#define __API_DEPRECATED_MSG_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define __API_D_BEGIN(msg, x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg))), apply_to = __API_APPLY_TO)))
#define __API_DEPRECATED_BEGIN_MSG2(msg,a) __API_D_BEGIN(msg,a)
#define __API_DEPRECATED_BEGIN_MSG3(msg,a,b) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b)
#define __API_DEPRECATED_BEGIN_MSG4(msg,a,b,c) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b) __API_D_BEGIN(msg,c)
#define __API_DEPRECATED_BEGIN_MSG5(msg,a,b,c,d) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b) __API_D_BEGIN(msg,c) __API_D_BEGIN(msg,d)
#define __API_DEPRECATED_BEGIN_MSG6(msg,a,b,c,d,e) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b) __API_D_BEGIN(msg,c) __API_D_BEGIN(msg,d) __API_D_BEGIN(msg,e)
#define __API_DEPRECATED_BEGIN_MSG7(msg,a,b,c,d,e,f) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b) __API_D_BEGIN(msg,c) __API_D_BEGIN(msg,d) __API_D_BEGIN(msg,e) __API_D_BEGIN(msg,f)
#define __API_DEPRECATED_BEGIN_MSG8(msg,a,b,c,d,e,f,g) __API_D_BEGIN(msg,a) __API_D_BEGIN(msg,b) __API_D_BEGIN(msg,c) __API_D_BEGIN(msg,d) __API_D_BEGIN(msg,e) __API_D_BEGIN(msg,f) __API_D_BEGIN(msg,g)
#define __API_DEPRECATED_BEGIN_MSG_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#if __has_feature(attribute_availability_with_replacement)
#define __API_R(rep,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep)))
#else
#define __API_R(rep,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x)))
#endif
#define __API_DEPRECATED_REP2(rep,x) __API_R(rep,x)
#define __API_DEPRECATED_REP3(rep,x,y) __API_R(rep,x) __API_R(rep,y)
#define __API_DEPRECATED_REP4(rep,x,y,z) __API_DEPRECATED_REP3(rep,x,y) __API_R(rep,z)
#define __API_DEPRECATED_REP5(rep,x,y,z,t) __API_DEPRECATED_REP4(rep,x,y,z) __API_R(rep,t)
#define __API_DEPRECATED_REP6(rep,x,y,z,t,b) __API_DEPRECATED_REP5(rep,x,y,z,t) __API_R(rep,b)
#define __API_DEPRECATED_REP7(rep,x,y,z,t,b,m) __API_DEPRECATED_REP6(rep,x,y,z,t,b) __API_R(rep,m)
#define __API_DEPRECATED_REP8(rep,x,y,z,t,b,m,d) __API_DEPRECATED_REP7(rep,x,y,z,t,b,m) __API_R(rep,d)
#define __API_DEPRECATED_REP_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#if __has_feature(attribute_availability_with_replacement)
#define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep))), apply_to = __API_APPLY_TO)))
#else
#define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
#endif
#define __API_DEPRECATED_BEGIN_REP2(rep,a) __API_R_BEGIN(rep,a)
#define __API_DEPRECATED_BEGIN_REP3(rep,a,b) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b)
#define __API_DEPRECATED_BEGIN_REP4(rep,a,b,c) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b) __API_R_BEGIN(rep,c)
#define __API_DEPRECATED_BEGIN_REP5(rep,a,b,c,d) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b) __API_R_BEGIN(rep,c) __API_R_BEGIN(rep,d)
#define __API_DEPRECATED_BEGIN_REP6(rep,a,b,c,d,e) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b) __API_R_BEGIN(rep,c) __API_R_BEGIN(rep,d) __API_R_BEGIN(rep,e)
#define __API_DEPRECATED_BEGIN_REP7(rep,a,b,c,d,e,f) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b) __API_R_BEGIN(rep,c) __API_R_BEGIN(rep,d) __API_R_BEGIN(rep,e) __API_R_BEGIN(rep,f)
#define __API_DEPRECATED_BEGIN_REP8(rep,a,b,c,d,e,f,g) __API_R_BEGIN(rep,a) __API_R_BEGIN(rep,b) __API_R_BEGIN(rep,c) __API_R_BEGIN(rep,d) __API_R_BEGIN(rep,e) __API_R_BEGIN(rep,f) __API_R_BEGIN(rep,g)
#define __API_DEPRECATED_BEGIN_REP_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
/*
* API Unavailability
* Use to specify that an API is unavailable for a particular platform.
*
* Example:
* __API_UNAVAILABLE(macos)
* __API_UNAVAILABLE(watchos, tvos)
*/
#define __API_UNAVAILABLE_PLATFORM_macos macos,unavailable
#define __API_UNAVAILABLE_PLATFORM_macosx macosx,unavailable
#define __API_UNAVAILABLE_PLATFORM_ios ios,unavailable
#define __API_UNAVAILABLE_PLATFORM_watchos watchos,unavailable
#define __API_UNAVAILABLE_PLATFORM_tvos tvos,unavailable
#define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
#define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
#ifndef __API_UNAVAILABLE_PLATFORM_uikitformac
#define __API_UNAVAILABLE_PLATFORM_uikitformac(x) uikitformac,unavailable
#endif
#define __API_UNAVAILABLE_PLATFORM_driverkit driverkit,unavailable
#if defined(__has_attribute)
#if __has_attribute(availability)
#define __API_U(x) __attribute__((availability(__API_UNAVAILABLE_PLATFORM_##x)))
#else
#define __API_U(x)
#endif
#else
#define __API_U(x)
#endif
#define __API_UNAVAILABLE1(x) __API_U(x)
#define __API_UNAVAILABLE2(x,y) __API_U(x) __API_U(y)
#define __API_UNAVAILABLE3(x,y,z) __API_UNAVAILABLE2(x,y) __API_U(z)
#define __API_UNAVAILABLE4(x,y,z,t) __API_UNAVAILABLE3(x,y,z) __API_U(t)
#define __API_UNAVAILABLE5(x,y,z,t,b) __API_UNAVAILABLE4(x,y,z,t) __API_U(b)
#define __API_UNAVAILABLE6(x,y,z,t,b,m) __API_UNAVAILABLE5(x,y,z,t,b) __API_U(m)
#define __API_UNAVAILABLE7(x,y,z,t,b,m,d) __API_UNAVAILABLE6(x,y,z,t,b,m) __API_U(d)
#define __API_UNAVAILABLE_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
#define __API_U_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_UNAVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
#define __API_UNAVAILABLE_BEGIN1(a) __API_U_BEGIN(a)
#define __API_UNAVAILABLE_BEGIN2(a,b) __API_U_BEGIN(a) __API_U_BEGIN(b)
#define __API_UNAVAILABLE_BEGIN3(a,b,c) __API_U_BEGIN(a) __API_U_BEGIN(b) __API_U_BEGIN(c)
#define __API_UNAVAILABLE_BEGIN4(a,b,c,d) __API_U_BEGIN(a) __API_U_BEGIN(b) __API_U_BEGIN(c) __API_U_BEGIN(d)
#define __API_UNAVAILABLE_BEGIN5(a,b,c,d,e) __API_U_BEGIN(a) __API_U_BEGIN(b) __API_U_BEGIN(c) __API_U_BEGIN(d) __API_U_BEGIN(e)
#define __API_UNAVAILABLE_BEGIN6(a,b,c,d,e,f) __API_U_BEGIN(a) __API_U_BEGIN(b) __API_U_BEGIN(c) __API_U_BEGIN(d) __API_U_BEGIN(e) __API_U_BEGIN(f)
#define __API_UNAVAILABLE_BEGIN7(a,b,c,d,e,f) __API_U_BEGIN(a) __API_U_BEGIN(b) __API_U_BEGIN(c) __API_U_BEGIN(d) __API_U_BEGIN(e) __API_U_BEGIN(f) __API_U_BEGIN(g)
#define __API_UNAVAILABLE_BEGIN_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
#else
/*
* Evaluate to nothing for compilers that don't support availability.
*/
#define __API_AVAILABLE_GET_MACRO(...)
#define __API_AVAILABLE_BEGIN_GET_MACRO(...)
#define __API_DEPRECATED_MSG_GET_MACRO(...)
#define __API_DEPRECATED_REP_GET_MACRO(...)
#define __API_DEPRECATED_BEGIN_MSG_GET_MACRO(...)
#define __API_DEPRECATED_BEGIN_REP_GET_MACRO
#define __API_UNAVAILABLE_GET_MACRO(...)
#define __API_UNAVAILABLE_BEGIN_GET_MACRO(...)
#endif /* __has_attribute(availability) */
#else
/*
* Evaluate to nothing for compilers that don't support clang language extensions.
*/
#define __API_AVAILABLE_GET_MACRO(...)
#define __API_AVAILABLE_BEGIN_GET_MACRO(...)
#define __API_DEPRECATED_MSG_GET_MACRO(...)
#define __API_DEPRECATED_REP_GET_MACRO(...)
#define __API_DEPRECATED_BEGIN_MSG_GET_MACRO(...)
#define __API_DEPRECATED_BEGIN_REP_GET_MACRO
#define __API_UNAVAILABLE_GET_MACRO(...)
#define __API_UNAVAILABLE_BEGIN_GET_MACRO(...)
#endif /* #if defined(__has_feature) && defined(__has_attribute) */
/*
* Swift compiler version
* Allows for project-agnostic "epochs" for frameworks imported into Swift via the Clang importer, like #if _compiler_version for Swift
* Example:
*
* #if __swift_compiler_version_at_least(800, 2, 20)
* - (nonnull NSString *)description;
* #else
* - (NSString *)description;
* #endif
*/
#ifdef __SWIFT_COMPILER_VERSION
#define __swift_compiler_version_at_least_impl(X, Y, Z, a, b, ...) \
__SWIFT_COMPILER_VERSION >= ((X * UINT64_C(1000) * 1000 * 1000) + (Z * 1000 * 1000) + (a * 1000) + b)
#define __swift_compiler_version_at_least(...) __swift_compiler_version_at_least_impl(__VA_ARGS__, 0, 0, 0, 0)
#else
#define __swift_compiler_version_at_least(...) 1
#endif
/*
* If __SPI_AVAILABLE has not been defined elsewhere, disable it.
*/
#ifndef __SPI_AVAILABLE
#define __SPI_AVAILABLE(...)
#endif
#endif /* __AVAILABILITY_INTERNAL__ */
#endif /* __AVAILABILITY_INTERNAL_LEAGCY__ */

View File

@ -82,45 +82,12 @@
*/
#include <AvailabilityVersions.h>
#ifndef __AVAILABILITYMACROS__
#define __AVAILABILITYMACROS__
/*
* Set up standard Mac OS X versions
*/
#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_15 101500
#define MAC_OS_VERSION_11_0 110000
#define MAC_OS_VERSION_11_1 110100
#define MAC_OS_VERSION_11_3 110300
/*
* 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
@ -146,10 +113,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_3
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_VERSION_14_0
#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_3
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_VERSION_14_0
#endif
#endif
@ -4012,4 +3979,6 @@
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_14_4_AND_LATER
#endif
#endif /* __AVAILABILITYMACROS__ */
#endif /* __AVAILABILITYMACROS__ */

View File

@ -0,0 +1,340 @@
/*
* 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_5 101405
#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
#define __MAC_11_1 110100
#define __MAC_11_3 110300
#define __MAC_11_4 110400
#define __MAC_11_5 110500
#define __MAC_11_6 110600
#define __MAC_12_0 120000
#define __MAC_12_1 120100
#define __MAC_12_2 120200
#define __MAC_12_3 120300
#define __MAC_12_4 120400
#define __MAC_12_5 120500
#define __MAC_13_0 130000
#define __MAC_13_1 130100
#define __MAC_13_1 130100
#define __MAC_13_2 130200
#define __MAC_13_3 130300
#define __MAC_13_4 130400
#define __MAC_14_0 140000
/* __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
#define __IPHONE_14_3 140300
#define __IPHONE_14_5 140500
#define __IPHONE_14_4 140400
#define __IPHONE_14_5 140500
#define __IPHONE_14_6 140600
#define __IPHONE_14_7 140700
#define __IPHONE_14_8 140800
#define __IPHONE_15_0 150000
#define __IPHONE_15_1 150100
#define __IPHONE_15_2 150200
#define __IPHONE_15_3 150300
#define __IPHONE_15_4 150400
#define __IPHONE_15_5 150500
#define __IPHONE_15_6 150600
#define __IPHONE_16_0 160000
#define __IPHONE_16_1 160100
#define __IPHONE_16_2 160200
#define __IPHONE_16_3 160300
#define __IPHONE_16_4 160400
#define __IPHONE_16_5 160500
#define __IPHONE_17_0 170000
/* __IPHONE__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
#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
#define __WATCHOS_7_2 70200
#define __WATCHOS_7_3 70300
#define __WATCHOS_7_4 70400
#define __WATCHOS_7_5 70500
#define __WATCHOS_7_6 70600
#define __WATCHOS_8_0 80000
#define __WATCHOS_8_1 80100
#define __WATCHOS_8_3 80300
#define __WATCHOS_8_4 80400
#define __WATCHOS_8_5 80500
#define __WATCHOS_8_6 80600
#define __WATCHOS_8_7 80700
#define __WATCHOS_9_0 90000
#define __WATCHOS_9_1 90100
#define __WATCHOS_9_2 90200
#define __WATCHOS_9_3 90300
#define __WATCHOS_9_4 90400
#define __WATCHOS_9_5 90500
#define __WATCHOS_10_0 100000
/* __WATCHOS__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 __TVOS_14_3 140300
#define __TVOS_14_5 140500
#define __TVOS_14_6 140600
#define __TVOS_14_7 140700
#define __TVOS_15_0 150000
#define __TVOS_15_1 150100
#define __TVOS_15_2 150200
#define __TVOS_15_3 150300
#define __TVOS_15_4 150400
#define __TVOS_15_5 150500
#define __TVOS_15_6 150600
#define __TVOS_16_0 160000
#define __TVOS_16_1 160100
#define __TVOS_16_2 160200
#define __TVOS_16_3 160300
#define __TVOS_16_4 160400
#define __TVOS_16_5 160500
#define __TVOS_17_0 170000
/* __TVOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
#define __BRIDGEOS_2_0 20000
#define __BRIDGEOS_3_0 30000
#define __BRIDGEOS_3_1 30100
#define __BRIDGEOS_3_4 30400
#define __BRIDGEOS_4_0 40000
#define __BRIDGEOS_4_1 40100
#define __BRIDGEOS_5_0 50000
#define __BRIDGEOS_5_1 50100
#define __BRIDGEOS_5_3 50300
#define __BRIDGEOS_6_0 60000
#define __BRIDGEOS_6_2 60200
#define __BRIDGEOS_6_4 60400
#define __BRIDGEOS_6_5 60500
#define __BRIDGEOS_6_6 60600
#define __BRIDGEOS_7_0 70000
#define __BRIDGEOS_7_1 70100
#define __BRIDGEOS_7_1 70100
#define __BRIDGEOS_7_2 70200
#define __BRIDGEOS_7_3 70300
#define __BRIDGEOS_7_4 70400
#define __BRIDGEOS_8_0 80000
#define __DRIVERKIT_19_0 190000
#define __DRIVERKIT_20_0 200000
#define __DRIVERKIT_21_0 210000
#define __DRIVERKIT_22_0 220000
#define __DRIVERKIT_22_4 220400
#define __DRIVERKIT_22_5 220500
#define __DRIVERKIT_23_0 230000
/* __DRIVERKIT__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
#define __XROS_1_0 10000
/* __XROS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
/*
* 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 __MAC_10_0
#define MAC_OS_X_VERSION_10_1 __MAC_10_1
#define MAC_OS_X_VERSION_10_2 __MAC_10_2
#define MAC_OS_X_VERSION_10_3 __MAC_10_3
#define MAC_OS_X_VERSION_10_4 __MAC_10_4
#define MAC_OS_X_VERSION_10_5 __MAC_10_5
#define MAC_OS_X_VERSION_10_6 __MAC_10_6
#define MAC_OS_X_VERSION_10_7 __MAC_10_7
#define MAC_OS_X_VERSION_10_8 __MAC_10_8
#define MAC_OS_X_VERSION_10_9 __MAC_10_9
#define MAC_OS_X_VERSION_10_10 __MAC_10_10
#define MAC_OS_X_VERSION_10_10_2 __MAC_10_10_2
#define MAC_OS_X_VERSION_10_10_3 __MAC_10_10_3
#define MAC_OS_X_VERSION_10_11 __MAC_10_11
#define MAC_OS_X_VERSION_10_11_2 __MAC_10_11_2
#define MAC_OS_X_VERSION_10_11_3 __MAC_10_11_3
#define MAC_OS_X_VERSION_10_11_4 __MAC_10_11_4
#define MAC_OS_X_VERSION_10_12 __MAC_10_12
#define MAC_OS_X_VERSION_10_12_1 __MAC_10_12_1
#define MAC_OS_X_VERSION_10_12_2 __MAC_10_12_2
#define MAC_OS_X_VERSION_10_12_4 __MAC_10_12_4
#define MAC_OS_X_VERSION_10_13 __MAC_10_13
#define MAC_OS_X_VERSION_10_13_1 __MAC_10_13_1
#define MAC_OS_X_VERSION_10_13_2 __MAC_10_13_2
#define MAC_OS_X_VERSION_10_13_4 __MAC_10_13_4
#define MAC_OS_X_VERSION_10_14 __MAC_10_14
#define MAC_OS_X_VERSION_10_14_1 __MAC_10_14_1
#define MAC_OS_X_VERSION_10_14_4 __MAC_10_14_4
#define MAC_OS_X_VERSION_10_14_5 __MAC_10_14_5
#define MAC_OS_X_VERSION_10_14_6 __MAC_10_14_6
#define MAC_OS_X_VERSION_10_15 __MAC_10_15
#define MAC_OS_X_VERSION_10_15_1 __MAC_10_15_1
#define MAC_OS_X_VERSION_10_15_4 __MAC_10_15_4
#define MAC_OS_X_VERSION_10_16 __MAC_10_16
#define MAC_OS_VERSION_11_0 __MAC_11_0
#define MAC_OS_VERSION_11_1 __MAC_11_1
#define MAC_OS_VERSION_11_3 __MAC_11_3
#define MAC_OS_VERSION_11_4 __MAC_11_4
#define MAC_OS_VERSION_11_5 __MAC_11_5
#define MAC_OS_VERSION_11_6 __MAC_11_6
#define MAC_OS_VERSION_12_0 __MAC_12_0
#define MAC_OS_VERSION_12_1 __MAC_12_1
#define MAC_OS_VERSION_12_2 __MAC_12_2
#define MAC_OS_VERSION_12_3 __MAC_12_3
#define MAC_OS_VERSION_12_4 __MAC_12_4
#define MAC_OS_VERSION_12_5 __MAC_12_5
#define MAC_OS_VERSION_13_0 __MAC_13_0
#define MAC_OS_VERSION_13_1 __MAC_13_1
#define MAC_OS_VERSION_13_1 __MAC_13_1
#define MAC_OS_VERSION_13_2 __MAC_13_2
#define MAC_OS_VERSION_13_3 __MAC_13_3
#define MAC_OS_VERSION_13_4 __MAC_13_4
#define MAC_OS_VERSION_14_0 __MAC_14_0
#endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */
#endif /* __AVAILABILITY_VERSIONS__ */

View File

@ -18,8 +18,14 @@
# endif
#endif
#if __has_include(<Availability.h>)
#include <Availability.h>
#else
#define __OSX_AVAILABLE_STARTING(m,i)
#endif
#include <TargetConditionals.h>
#include <sys/cdefs.h>
#if __cplusplus
extern "C" {
@ -28,11 +34,11 @@ extern "C" {
// Create a heap based copy of a Block or simply add a reference to an existing one.
// This must be paired with Block_release to recover memory, even when running
// under Objective-C Garbage Collection.
BLOCK_EXPORT void *_Block_copy(const void *aBlock)
BLOCK_EXPORT void *__single _Block_copy(const void *__single aBlock)
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
// Lose the reference, and if heap based and last reference, recover the memory
BLOCK_EXPORT void _Block_release(const void *aBlock)
BLOCK_EXPORT void _Block_release(const void *__single aBlock)
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
@ -57,8 +63,8 @@ BLOCK_EXPORT void * _NSConcreteStackBlock[32]
// Type correct macros
#define Block_copy(...) ((__typeof(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__)))
#define Block_release(...) _Block_release((const void *)(__VA_ARGS__))
#define Block_copy(...) ((__typeof(__VA_ARGS__))_Block_copy(__unsafe_forge_single(const void *, (const void *)(__VA_ARGS__))))
#define Block_release(...) _Block_release(__unsafe_forge_single(const void *, (const void *)(__VA_ARGS__)))
#endif
#endif

View File

@ -334,4 +334,4 @@ API_DEPRECATED(CC_DIGEST_DEPRECATION_WARNING, macos(10.4, 10.15), ios(2.0, 13.0)
}
#endif
#endif /* _CC_COMMON_DIGEST_H_ */
#endif /* _CC_COMMON_DIGEST_H_ */

View File

@ -615,4 +615,5 @@
#endif /* __CONDITIONALMACROS__ */
#endif /* __CONDITIONALMACROS__ */

View File

@ -804,4 +804,5 @@ SysBreakFunc(ConstStr255Param debuggerMsg) __OSX_AVAILABLE_BU
}
#endif
#endif /* __MACTYPES__ */
#endif /* __MACTYPES__ */

View File

@ -140,6 +140,7 @@
/* "-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)
#define TARGET_OS_MAC 1
#define TARGET_OS_OSX 0
#define TARGET_OS_IPHONE 1
#define TARGET_OS_IOS 1
@ -152,6 +153,9 @@
#define TARGET_OS_MACCATALYST 1
#define TARGET_OS_MACCATALYST 1
#define TARGET_OS_VISION 0
#ifndef TARGET_OS_UIKITFORMAC
#define TARGET_OS_UIKITFORMAC 1
#endif
@ -163,6 +167,7 @@
/* "-target=arm64-apple-ios12-simulator" */
/* "-target=arm64e-apple-ios12-simulator" */
#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(simulator)
#define TARGET_OS_MAC 1
#define TARGET_OS_OSX 0
#define TARGET_OS_IPHONE 1
#define TARGET_OS_IOS 1
@ -175,6 +180,9 @@
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_VISION 0
#ifndef TARGET_OS_UIKITFORMAC
#define TARGET_OS_UIKITFORMAC 0
#endif
@ -184,10 +192,61 @@
/* "-target=x86_64-apple-driverkit19.0" */
/* "-target=arm64-apple-driverkit19.0" */
/* "-target=arm64e-apple-driverkit19.0" */
#if __is_target_vendor(apple) && __is_target_os(driverkit)
/* "-target=arm64e-apple-xros1.0" */
#if (__is_target_arch(arm64e) || __is_target_arch(arm64)) && __is_target_vendor(apple) && __is_target_os(xros)
#define TARGET_OS_MAC 1
#define TARGET_OS_OSX 0
#define TARGET_OS_IPHONE 1
#define TARGET_OS_IOS 1
#define TARGET_OS_WATCH 0
#define TARGET_OS_TV 0
#define TARGET_OS_SIMULATOR 0
#define TARGET_OS_EMBEDDED 1
#define TARGET_OS_RTKIT 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_VISION 1
#ifndef TARGET_OS_UIKITFORMAC
#define TARGET_OS_UIKITFORMAC 0
#endif
#define TARGET_OS_DRIVERKIT 0
#define DYNAMIC_TARGETS_ENABLED 1
#endif
/* "-target=arm64e-apple-xros1.0-simulator" */
#if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(xros) && __is_target_environment(simulator)
#define TARGET_OS_MAC 1
#define TARGET_OS_OSX 0
#define TARGET_OS_IPHONE 1
#define TARGET_OS_IOS 1
#define TARGET_OS_WATCH 0
#define TARGET_OS_TV 0
#define TARGET_OS_SIMULATOR 1
#define TARGET_OS_EMBEDDED 0
#define TARGET_OS_RTKIT 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_VISION 1
#ifndef TARGET_OS_UIKITFORMAC
#define TARGET_OS_UIKITFORMAC 0
#endif
#define TARGET_OS_DRIVERKIT 0
#define DYNAMIC_TARGETS_ENABLED 1
#endif
//FIXME: Workaround for rdar://100536146
#if (__is_target_vendor(apple) && defined(__APPLE_EXCLAVECORE__) && __APPLE_EXCLAVECORE__)
#define TARGET_OS_MAC 0
#define TARGET_OS_OSX 0
#define TARGET_OS_IPHONE 0
#define TARGET_OS_IOS 0
@ -200,6 +259,63 @@
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_VISION 0
#ifndef TARGET_OS_UIKITFORMAC
#define TARGET_OS_UIKITFORMAC 0
#endif
#define TARGET_OS_DRIVERKIT 0
#define DYNAMIC_TARGETS_ENABLED 1
#endif
//FIXME: Workaround for rdar://100536146
#if (__is_target_vendor(apple) && defined(__APPLE_EXCLAVEKIT__) && __APPLE_EXCLAVEKIT__)
#define TARGET_OS_MAC 1
#define TARGET_OS_OSX 0
#define TARGET_OS_IPHONE 0
#define TARGET_OS_IOS 0
#define TARGET_OS_WATCH 0
#define TARGET_OS_TV 0
#define TARGET_OS_SIMULATOR 0
#define TARGET_OS_EMBEDDED 0
#define TARGET_OS_RTKIT 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_VISION 0
#ifndef TARGET_OS_UIKITFORMAC
#define TARGET_OS_UIKITFORMAC 0
#endif
#define TARGET_OS_DRIVERKIT 0
#define DYNAMIC_TARGETS_ENABLED 1
#endif
/* "-target=x86_64-apple-driverkit19.0" */
/* "-target=arm64-apple-driverkit19.0" */
/* "-target=arm64e-apple-driverkit19.0" */
#if __is_target_vendor(apple) && __is_target_os(driverkit)
#define TARGET_OS_MAC 1
#define TARGET_OS_OSX 0
#define TARGET_OS_IPHONE 0
#define TARGET_OS_IOS 0
#define TARGET_OS_WATCH 0
#define TARGET_OS_TV 0
#define TARGET_OS_SIMULATOR 0
#define TARGET_OS_EMBEDDED 0
#define TARGET_OS_RTKIT 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_VISION 0
#ifndef TARGET_OS_UIKITFORMAC
#define TARGET_OS_UIKITFORMAC 0
#endif
@ -222,13 +338,13 @@
* gcc based compiler used on Mac OS X
*/
#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
#define TARGET_OS_MAC 1
#define TARGET_OS_WIN32 0
#define TARGET_OS_WINDOWS 0
#define TARGET_OS_UNIX 0
#define TARGET_OS_LINUX 0
#if !DYNAMIC_TARGETS_ENABLED
#define TARGET_OS_MAC 1
#define TARGET_OS_OSX 1
#define TARGET_OS_IPHONE 0
#define TARGET_OS_IOS 0
@ -237,7 +353,10 @@
#define TARGET_OS_TV 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_MACCATALYST 0
#define TARGET_OS_VISION 0
#ifndef TARGET_OS_UIKITFORMAC
#define TARGET_OS_UIKITFORMAC 0
#endif
@ -522,4 +641,4 @@
#endif
#endif /* __TARGETCONDITIONALS__ */
#endif /* __TARGETCONDITIONALS__ */

View File

@ -71,4 +71,4 @@
#include <ctype.h>
#endif /* ___WCTYPE_H_ */
#endif /* ___WCTYPE_H_ */

View File

@ -32,4 +32,4 @@ char *ctermid(char *);
__END_DECLS
#endif
#endif

View File

@ -384,4 +384,4 @@ __END_DECLS
#include <xlocale/_ctype.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#endif /* !_CTYPE_H_ */
#endif /* !_CTYPE_H_ */

View File

@ -73,4 +73,4 @@ __BEGIN_DECLS
struct lconv *localeconv(void);
__END_DECLS
#endif /* __LOCALE_H_ */
#endif /* __LOCALE_H_ */

View File

@ -118,4 +118,4 @@ typedef struct {
regoff_t rm_eo; /* end of match */
} regmatch_t;
#endif /* !__REGEX_H_ */
#endif /* !__REGEX_H_ */

View File

@ -156,4 +156,4 @@ typedef struct __sFILE {
fpos_t _offset; /* current lseek offset (see WARNING) */
} FILE;
#endif /* __STDIO_H_ */
#endif /* __STDIO_H_ */

View File

@ -66,4 +66,4 @@ typedef unsigned long __darwin_wctype_t;
# endif
#endif
#endif /* __TYPES_H_ */
#endif /* __TYPES_H_ */

View File

@ -37,4 +37,4 @@ typedef long int intmax_t;
typedef long long int intmax_t;
#endif /* __LP64__ */
#endif /* __INTMAX_TYPE__ */
#endif /* _INTMAX_T */
#endif /* _INTMAX_T */

View File

@ -29,4 +29,4 @@
#ifndef _UINT16_T
#define _UINT16_T
typedef unsigned short uint16_t;
#endif /* _UINT16_T */
#endif /* _UINT16_T */

View File

@ -29,4 +29,4 @@
#ifndef _UINT32_T
#define _UINT32_T
typedef unsigned int uint32_t;
#endif /* _UINT32_T */
#endif /* _UINT32_T */

View File

@ -29,4 +29,4 @@
#ifndef _UINT64_T
#define _UINT64_T
typedef unsigned long long uint64_t;
#endif /* _UINT64_T */
#endif /* _UINT64_T */

View File

@ -29,4 +29,4 @@
#ifndef _UINT8_T
#define _UINT8_T
typedef unsigned char uint8_t;
#endif /* _UINT8_T */
#endif /* _UINT8_T */

View File

@ -37,4 +37,4 @@ typedef long unsigned int uintmax_t;
typedef long long unsigned int uintmax_t;
#endif /* __LP64__ */
#endif /* __UINTMAX_TYPE__ */
#endif /* _UINTMAX_T */
#endif /* _UINTMAX_T */

View File

@ -161,4 +161,4 @@ __END_DECLS
#include <xlocale/__wctype.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#endif /* __WCTYPE_H_ */
#endif /* __WCTYPE_H_ */

View File

@ -34,4 +34,4 @@ int ___mb_cur_max(void);
int ___mb_cur_max_l(locale_t);
__END_DECLS
#endif /* __XLOCALE_H_ */
#endif /* __XLOCALE_H_ */

View File

@ -34,4 +34,4 @@
#include <sys/aio.h>
#endif /* _AIO_H_ */
#endif /* _AIO_H_ */

View File

@ -40,4 +40,4 @@ __END_DECLS
#define __alloca(size) __builtin_alloca(size)
#endif
#endif /* _ALLOCA_H_ */
#endif /* _ALLOCA_H_ */

View File

@ -64,4 +64,4 @@ struct ar_hdr {
char ar_fmag[2]; /* consistency check */
};
#endif /* !_AR_H_ */
#endif /* !_AR_H_ */

View File

@ -378,4 +378,4 @@ NXSwapHostFloatToLittle(
return (NXSwappedFloat)OSSwapHostToLittleInt32((uint32_t)NXConvertHostFloatToSwapped(x));
}
#endif /* _ARCHITECTURE_BYTE_ORDER_H_ */
#endif /* _ARCHITECTURE_BYTE_ORDER_H_ */

View File

@ -10,4 +10,4 @@
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM__LIMITS_H_ */
#endif /* _ARM__LIMITS_H_ */

View File

@ -92,4 +92,4 @@ typedef _STRUCT_MCONTEXT32 *mcontext_t;
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* __ARM_MCONTEXT_H_ */
#endif /* __ARM_MCONTEXT_H_ */

View File

@ -22,4 +22,4 @@
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM__PARAM_H_ */
#endif /* _ARM__PARAM_H_ */

View File

@ -99,4 +99,4 @@ typedef long __darwin_time_t; /* time() */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _BSD_ARM__TYPES_H_ */
#endif /* _BSD_ARM__TYPES_H_ */

View File

@ -68,4 +68,4 @@
#endif /* defined (__arm__) || defined (__arm64__) */
#endif
#endif

View File

@ -78,4 +78,4 @@
#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* !_ARM__ENDIAN_H_ */
#endif /* !_ARM__ENDIAN_H_ */

View File

@ -44,13 +44,25 @@
#include <sys/cdefs.h>
#include <arm/_limits.h>
#define CHAR_BIT 8 /* number of bits in a char */
#undef MB_LEN_MAX
#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#define CLK_TCK __DARWIN_CLK_TCK /* ticks per second */
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
#if (defined(__has_include) && __has_include(<__xnu_libcxx_sentinel.h>))
#if !__has_include_next(<limits.h>)
#error Do not build with -nostdinc (use GCC_USE_STANDARD_INCLUDE_SEARCHING=NO)
#else
#include_next <limits.h>
#endif /* __has_include_next */
#else
#define CHAR_BIT 8 /* number of bits in a char */
/*
* According to ANSI (section 2.2.4.2), the values below must be usable by
* #if preprocessing directives. Additionally, the expression must have the
@ -90,6 +102,8 @@
#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */
#endif /* defined(__has_include) && __has_include(<__xnu_libcxx_sentinel.h>) */
#if !defined(_ANSI_SOURCE)
#ifdef __LP64__
#define LONG_BIT 64
@ -111,4 +125,4 @@
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM_LIMITS_H_ */
#endif /* _ARM_LIMITS_H_ */

View File

@ -148,4 +148,4 @@
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM_PARAM_H_ */
#endif /* _ARM_PARAM_H_ */

View File

@ -19,4 +19,4 @@ typedef int sig_atomic_t;
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM_SIGNAL_ */
#endif /* _ARM_SIGNAL_ */

View File

@ -108,4 +108,4 @@ typedef u_int64_t syscall_arg_t;
#endif /* __ASSEMBLER__ */
#endif /* defined (__arm__) || defined (__arm64__) */
#endif /* _ARM_MACHTYPES_H_ */
#endif /* _ARM_MACHTYPES_H_ */

View File

@ -94,4 +94,4 @@ char *inet_nsap_ntoa(int, const unsigned char *, char *);
__END_DECLS
#endif /* !_ARPA_INET_H_ */
#endif /* !_ARPA_INET_H_ */

View File

@ -114,4 +114,4 @@ __END_DECLS
#endif /* __STDC_VERSION__ */
#endif /* !__cplusplus */
#endif /* _ASSERT_H_ */
#endif /* _ASSERT_H_ */

View File

@ -332,6 +332,30 @@ struct au_evclass_map {
};
typedef struct au_evclass_map au_evclass_map_t;
/*
* Audit session flags for the ai_flags member of auditinfo_addr.
*/
enum audit_session_flags {
/* The initial session created by PID 1. */
AU_SESSION_FLAG_IS_INITIAL = 0x0001,
/* The graphics subsystem (CoreGraphics, etc.) is available. */
AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS = 0x0010,
/* /dev/tty is available. */
AU_SESSION_FLAG_HAS_TTY = 0x0020,
/* The session was created for a remote connection. */
AU_SESSION_FLAG_IS_REMOTE = 0x1000,
/* The console and associated devices are available. */
AU_SESSION_FLAG_HAS_CONSOLE_ACCESS = 0x2000,
/* An active, authenticated user is associated with the session. */
AU_SESSION_FLAG_HAS_AUTHENTICATED = 0x4000,
};
__END_DECLS
#if !defined(_KERNEL) && !defined(KERNEL)
#include <Availability.h>
@ -344,6 +368,9 @@ typedef struct au_evclass_map au_evclass_map_t;
* Audit system calls.
*/
#if !defined(_KERNEL) && !defined(KERNEL)
__BEGIN_DECLS
int audit(const void *, int)
__AUDIT_API_DEPRECATED;
int auditon(int, void *, int)
@ -355,9 +382,13 @@ int setauid(const au_id_t *);
int getaudit_addr(struct auditinfo_addr *, int);
int setaudit_addr(const struct auditinfo_addr *, int);
__END_DECLS
#if defined(__APPLE__)
#include <Availability.h>
__BEGIN_DECLS
/*
* getaudit()/setaudit() are deprecated and have been replaced with
* wrappers to the getaudit_addr()/setaudit_addr() syscalls above.
@ -369,23 +400,35 @@ __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8,
int setaudit(const struct auditinfo *)
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8,
__IPHONE_2_0, __IPHONE_6_0);
__END_DECLS
#else
__BEGIN_DECLS
int getaudit(struct auditinfo *)
__AUDIT_API_DEPRECATED;
int setaudit(const struct auditinfo *)
__AUDIT_API_DEPRECATED;
__END_DECLS
#endif /* !__APPLE__ */
#ifdef __APPLE_API_PRIVATE
#include <mach/port.h>
__BEGIN_DECLS
mach_port_name_t audit_session_self(void);
au_asid_t audit_session_join(mach_port_name_t port);
int audit_session_port(au_asid_t asid, mach_port_name_t *portname);
__END_DECLS
#endif /* __APPLE_API_PRIVATE */
#endif /* defined(_KERNEL) || defined(KERNEL) */
__END_DECLS
#endif /* !_BSM_AUDIT_H */
#endif /* !_BSM_AUDIT_H */

View File

@ -164,4 +164,4 @@ extern double creal(double complex);
extern long double creall(long double complex);
__END_DECLS
#endif /* __COMPLEX_H__ */
#endif /* __COMPLEX_H__ */

View File

@ -78,6 +78,7 @@ typedef int (*copyfile_callback_t)(int, int, copyfile_state_t, const char *__uns
#define COPYFILE_STATE_SRC_BSIZE 11
#define COPYFILE_STATE_DST_BSIZE 12
#define COPYFILE_STATE_BSIZE 13
#define COPYFILE_STATE_FORBID_CROSS_MOUNT 14
#define COPYFILE_DISABLE_VAR "COPYFILE_DISABLE"
@ -134,4 +135,4 @@ typedef int (*copyfile_callback_t)(int, int, copyfile_state_t, const char *__uns
__END_DECLS
#endif /* _COPYFILE_H_ */
#endif /* _COPYFILE_H_ */

View File

@ -52,4 +52,4 @@
#define MAGIC "070707"
#endif /* _CPIO_H_ */
#endif /* _CPIO_H_ */

View File

@ -44,4 +44,4 @@ extern struct mach_header_64 *
extern struct mach_header *
#endif /* __LP64__ */
_NSGetMachExecuteHeader(void);
__END_DECLS
__END_DECLS

View File

@ -72,4 +72,4 @@
#include <xlocale/_ctype.h>
#endif /* _USE_EXTENDED_LOCALES_ */
#endif /* !_CTYPE_H_ */
#endif /* !_CTYPE_H_ */

Some files were not shown because too many files have changed in this diff Show More