···11-/*
22- * Copyright (c) 1999-2010 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
2929- *
3030- * File: libc/ppc/sys/fork.s
3131- *
3232- * HISTORY
3333- * 18-Nov-92 Ben Fathi (benf@next.com)
3434- * Created from M88K sources
3535- *
3636- * 11-Jan-92 Peter King (king@next.com)
3737- * Created from M68K sources
3838- */
3939-4040-/*
4141- * All of the asm stubs in this file have been adjusted so the pre/post
4242- * fork handlers and dyld fixup are done in C inside Libc. As such, Libc
4343- * expects the __fork asm to fix up the return code to be -1, 0 or pid
4444- * and errno if needed.
4545- */
4646-4747-#include "SYS.h"
4848-4949-#if defined(__i386__)
5050-5151-LEAF(___fork, 0)
5252- subl $28, %esp // Align the stack, with 16 bytes of extra padding that we'll need
5353-5454- movl $ SYS_fork,%eax; // code for fork -> eax
5555- #ifdef DARLING
5656- call __darling_bsd_syscall
5757- cmpl $0, %eax
5858- jnb L1
5959- #else
6060- UNIX_SYSCALL_TRAP // do the system call
6161- jnc L1 // jump if CF==0
6262- #endif
6363-6464- CALL_EXTERN(tramp_cerror)
6565- movl $-1,%eax
6666- addl $28, %esp // restore the stack
6767- ret
6868-6969-L1:
7070- orl %edx,%edx // CF=OF=0, ZF set if zero result
7171- jz L2 // parent, since r1 == 0 in parent, 1 in child
7272-7373- //child here...
7474- xorl %eax,%eax // zero eax
7575- REG_TO_EXTERN(%eax, __current_pid);
7676-L2:
7777- addl $28, %esp // restore the stack
7878- // parent ends up here skipping child portion
7979- ret
8080-8181-#elif defined(__x86_64__)
8282-8383-LEAF(___fork, 0)
8484- subq $24, %rsp // Align the stack, plus room for local storage
8585-8686- #ifdef DARLING
8787- movl $ SYS_fork, %eax
8888- call __darling_bsd_syscall
8989- cmpq $0, %rax
9090- jnb L1
9191- #else
9292- movl $ SYSCALL_CONSTRUCT_UNIX(SYS_fork),%eax; // code for fork -> rax
9393- UNIX_SYSCALL_TRAP // do the system call
9494- jnc L1 // jump if CF==0
9595- #endif
9696-9797- movq %rax, %rdi
9898- CALL_EXTERN(_cerror)
9999- movq $-1, %rax
100100- addq $24, %rsp // restore the stack
101101- ret
102102-103103-L1:
104104- #ifdef DARLING
105105- testl %eax, %eax
106106- jnz L2
107107- #else
108108- orl %edx,%edx // CF=OF=0, ZF set if zero result
109109- jz L2 // parent, since r1 == 0 in parent, 1 in child
110110- #endif
111111-112112- //child here...
113113- xorq %rax, %rax
114114- PICIFY(__current_pid)
115115- movl %eax,(%r11)
116116-L2:
117117- // parent ends up here skipping child portion
118118- addq $24, %rsp // restore the stack
119119- ret
120120-121121-#elif defined(__arm__)
122122-123123-MI_ENTRY_POINT(___fork)
124124- stmfd sp!, {r4, r7, lr}
125125- add r7, sp, #4
126126-127127- mov r1, #1 // prime results
128128- mov r12, #SYS_fork
129129- swi #SWI_SYSCALL // make the syscall
130130- bcs Lbotch // error?
131131-132132- cmp r1, #0 // parent (r1=0) or child(r1=1)
133133- beq Lparent
134134-135135- //child here...
136136- MI_GET_ADDRESS(r3, __current_pid)
137137- mov r0, #0
138138- str r0, [r3] // clear cached pid in child
139139- ldmfd sp!, {r4, r7, pc}
140140-141141-Lbotch:
142142- MI_CALL_EXTERNAL(_cerror) // jump here on error
143143- mov r0,#-1 // set the error
144144- // fall thru
145145-Lparent:
146146- ldmfd sp!, {r4, r7, pc} // pop and return
147147-148148-#elif defined(__arm64__)
149149-150150-#include <mach/arm64/asm.h>
151151-152152-MI_ENTRY_POINT(___fork)
153153- ARM64_STACK_PROLOG
154154- PUSH_FRAME
155155- // ARM moves a 1 in to r1 here, but I can't see why.
156156- mov x16, #SYS_fork // Syscall code
157157- svc #SWI_SYSCALL // Trap to kernel
158158- b.cs Lbotch // Carry bit indicates failure
159159- cbz x1, Lparent // x1 == 0 indicates that we are the parent
160160-161161- // Child
162162- MI_GET_ADDRESS(x9, __current_pid) // Get address of cached "current pid"
163163- mov w0, #0
164164- str w0, [x9] // Clear cached current pid
165165- POP_FRAME // And done
166166- ARM64_STACK_EPILOG
167167-168168-Lbotch:
169169- MI_CALL_EXTERNAL(_cerror) // Handle error
170170- mov w0, #-1 // Return value is -1
171171-Lparent:
172172- POP_FRAME // Return
173173- ARM64_STACK_EPILOG
174174-175175-#else
176176-#error Unsupported architecture
177177-#endif
···11-/*
22- * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-2929-#include "SYS.h"
3030-3131-#if defined(__i386__)
3232-3333- .data
3434- .private_extern __current_pid
3535-L__current_pid_addr:
3636- __current_pid:
3737- .long 0
3838-3939-#if defined(__DYNAMIC__)
4040-#define GET_CURRENT_PID \
4141- call 0f ; \
4242-0: ; \
4343- popl %ecx ; \
4444- leal L__current_pid_addr-0b(%ecx), %ecx
4545-4646-#define __current_pid (%ecx)
4747-4848-#else
4949-#define GET_CURRENT_PID
5050-#endif
5151-5252-/*
5353- * If __current_pid is > 0, return it, else make syscall.
5454- * If __current_pid is 0, cache result of syscall.
5555- */
5656-TEXT
5757-LEAF(___getpid, 0)
5858- GET_CURRENT_PID
5959- movl __current_pid, %eax
6060- testl %eax, %eax
6161- jle 1f
6262- ret
6363-1:
6464- UNIX_SYSCALL_NONAME(getpid, 0, cerror_nocancel)
6565- movl %eax, %edx
6666- xorl %eax, %eax
6767- GET_CURRENT_PID
6868- lock
6969- cmpxchgl %edx, __current_pid
7070- movl %edx, %eax
7171- ret
7272-7373-#elif defined(__x86_64__)
7474-7575- .data
7676- .private_extern __current_pid
7777-__current_pid:
7878- .long 0
7979-8080-/*
8181- * If __current_pid is > 0, return it, else make syscall.
8282- * If __current_pid is 0, cache result of syscall.
8383- */
8484-TEXT
8585-LEAF(___getpid, 0)
8686- movl __current_pid(%rip), %eax
8787- testl %eax, %eax
8888- jle 1f
8989- ret
9090-1:
9191- UNIX_SYSCALL_NONAME(getpid, 0, cerror_nocancel)
9292- movl %eax, %edx
9393- xorl %eax, %eax
9494- leaq __current_pid(%rip), %rcx
9595- lock
9696- cmpxchgl %edx, (%rcx)
9797- movl %edx, %eax
9898- ret
9999-100100-#elif defined(__arm__)
101101-102102-#include <arm/arch.h>
103103-104104- .data
105105- .globl __current_pid
106106- .align 2
107107-__current_pid:
108108- /* Cached pid. Possible values:
109109- * 0: no value cached
110110- * > 0: cached PID of current process
111111- * < 0: negative number of vforks in progress
112112- * INT_MIN: for pre-ARMv6, "looking" value (0x80000000)
113113- */
114114- .long 0
115115-116116-MI_ENTRY_POINT(___getpid)
117117- ldr r3, L__current_pid
118118-L1: add r3, pc, r3 // r3 = &__current_pid
119119- ldr r0, [r3] // get the cached pid
120120- cmp r0, #0
121121- bxgt lr // if positive, return it
122122-123123- SYSCALL_NONAME(getpid, 0, cerror_nocancel)
124124-125125-#ifdef _ARM_ARCH_6
126126- ldrex r2, [r3] // see if we can cache it
127127- cmp r2, #0 // we can't if there are any...
128128- bxlt lr // ...vforks in progress
129129- strex r2, r0, [r3] // ignore conflicts
130130-#else
131131- mov r1, #0x80000000 // load "looking" value
132132- swp r2, r1, [r3] // look at the value, lock others out
133133- cmp r2, r1 // anyone else trying to look?
134134- bxeq lr // yes, so return immediately/
135135- cmp r2, #0 // see if we can cache it
136136- streq r0, [r3] // if zero, we can
137137- strne r2, [r3] // otherwise restore previous value
138138-#endif
139139-140140- bx lr
141141-142142-L__current_pid:
143143- .long __current_pid - (L1+8)
144144-145145-#elif defined(__arm64__)
146146- .data
147147- .globl __current_pid
148148- .align 2
149149-__current_pid:
150150- /* cached pid. possible values:
151151- * 0: no value cached
152152- * > 0: cached pid of current process
153153- * < 0: negative number of vforks in progress
154154- * int_min: for pre-armv6, "looking" value (0x80000000)
155155- */
156156- .long 0
157157-158158-MI_ENTRY_POINT(___getpid)
159159- MI_GET_ADDRESS(x9, __current_pid) // Get address of cached value
160160- ldr w0, [x9] // Load it
161161- cmp w0, #0 // See if there's a cached value
162162- b.le L_notcached // If not, make syscall
163163- ret // Else, we're done
164164-L_notcached:
165165- SYSCALL_NONAME(getpid, 0, cerror_nocancel)
166166- ldxr w10, [x9] // Exclusive load
167167- cbnz w10, L_done // Unless unset, don't even try
168168- stxr wzr, w0, [x9] // Try to store, but don't care if we fail (someone will win, or not)
169169-L_done:
170170- ret // Done
171171-#else
172172-#error Unsupported architecture
173173-#endif
174174-#if defined(__i386__)
175175- .globl _getpid
176176- .set _getpid, ___getpid
177177-#endif
178178-179179-#if defined(__x86_64__)
180180- .globl _getpid
181181- .set _getpid, ___getpid
182182-#endif
183183-184184-#if defined(__ppc__)
185185- .globl _getpid
186186- .set _getpid, ___getpid
187187-#endif
188188-189189-#if defined(__arm__)
190190- .globl _getpid
191191- .set _getpid, ___getpid
192192-#endif
193193-194194-#if defined(__arm64__)
195195- .globl _getpid
196196- .set _getpid, ___getpid
197197-#endif
198198-
-28
src/kernel/libsyscall/bsdsyscalls/___getrlimit.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_getrlimit
55-#error "SYS_getrlimit not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___getrlimit)
1010-SYSCALL_NONAME(getrlimit, 2, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___getrlimit, getrlimit, 2, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-1919-#if defined(__i386__)
2020- .globl _getrlimit
2121- .set _getrlimit, ___getrlimit
2222-#endif
2323-2424-#if defined(__ppc__)
2525- .globl _getrlimit
2626- .set _getrlimit, ___getrlimit
2727-#endif
2828-
···11-/*
22- * Copyright (c) 1999-2016 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-2929-#include "SYS.h"
3030-3131-/*
3232- * A third argument, of type uint64_t*, was added to the gettimeofday syscall
3333- * for use cases that also want to know the mach_absolute_time that matches the
3434- * time value returned.
3535- *
3636- * __gettimeofday takes the traditional two arguments. It will zero out the
3737- * third argument argument before entering the kernel, behaving like the old
3838- * call.
3939- *
4040- * __gettimeofday_with_mach will pass it through and supporting kernels will
4141- * copy-out the mach_absolute_time. Old kernels will leave the pointed to
4242- * value alone.
4343- */
4444-4545-.private_extern ___gettimeofday_with_mach
4646-4747-#if defined(__i386__)
4848-4949-LABEL(___gettimeofday)
5050- pushl $0
5151- pushl 12(%esp)
5252- pushl 12(%esp)
5353- calll ___gettimeofday_with_mach
5454- addl $12, %esp
5555- ret
5656-5757-LABEL(___gettimeofday_with_mach)
5858- UNIX_SYSCALL_INT_NONAME(gettimeofday,0)
5959- /*
6060- * <rdar://problem/26410029>
6161- * If eax is 0, we're on a new kernel and timeval was written by the kernel.
6262- * Otherwise, eax:edx contains the timeval and we marshal into timeval.
6363- */
6464- cmp $0, %eax
6565- je 2f
6666- mov 4(%esp),%ecx
6767- mov %eax,(%ecx)
6868- mov %edx,4(%ecx)
6969- xor %eax,%eax
7070-2:
7171- ret
7272-7373-#elif defined(__x86_64__)
7474-7575-__SYSCALL(___gettimeofday_with_mach, gettimeofday, 3)
7676-7777-LABEL(___gettimeofday)
7878- movq $0x0, %rdx // zero out third argument
7979-8080- UNIX_SYSCALL_NONAME(gettimeofday,0,cerror_nocancel)
8181- /*
8282- * <rdar://problem/26410029>
8383- * If rax is 0, we're on a new kernel and timeval was written by the kernel.
8484- * Otherwise, rax:rdx contains the timeval and we marshal into timeval.
8585- */
8686- cmp $0, %rax
8787- je 2f
8888- movq %rax, (%rdi)
8989- movl %edx, 8(%rdi)
9090- xorl %eax, %eax
9191-2:
9292- ret
9393-9494-#elif defined(__arm__)
9595-9696-__SYSCALL2(___gettimeofday_with_mach, gettimeofday, 3, cerror_nocancel)
9797-9898-.text
9999-.align 2
100100-.globl ___gettimeofday
101101-___gettimeofday:
102102- mov r2, #0x0
103103- SYSCALL_NONAME(gettimeofday, 3, cerror_nocancel)
104104- bx lr
105105-106106-#elif defined(__arm64__)
107107-108108-__SYSCALL2(___gettimeofday_with_mach, gettimeofday, 3, cerror_nocancel)
109109-110110-.text
111111-.align 2
112112-.globl ___gettimeofday
113113-___gettimeofday:
114114- movz x2, #0x0
115115- SYSCALL_NONAME(gettimeofday, 3, cerror_nocancel)
116116- ret
117117-118118-#else
119119-#error Unsupported architecture
120120-#endif
···11-/*
22- * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-2929-#include "SYS.h"
3030-3131-#if defined(__x86_64__)
3232-3333-__SYSCALL(___kdebug_trace_string, kdebug_trace_string, 3)
3434-3535-#elif defined(__i386__)
3636-3737-__SYSCALL_INT(___kdebug_trace_string, kdebug_trace_string, 3)
3838-3939-#elif defined(__arm__)
4040-4141-__SYSCALL(___kdebug_trace_string, kdebug_trace_string, 4)
4242-4343-#elif defined(__arm64__)
4444-4545-__SYSCALL(___kdebug_trace_string, kdebug_trace_string, 3)
4646-4747-#else
4848-#error Unsupported architecture
4949-#endif
···11-#define __SYSCALL_32BIT_ARG_BYTES 16
22-#include "SYS.h"
33-44-#ifndef SYS_log_data
55-#error "SYS_log_data not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___log_data)
1010-SYSCALL_NONAME(log_data, 4, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___log_data, log_data, 4, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-74
src/kernel/libsyscall/bsdsyscalls/___lseek.S
···11-/*
22- * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-2929-#include "SYS.h"
3030-3131-#if defined(__x86_64__)
3232-3333-__SYSCALL(___lseek, lseek, 3)
3434-3535-#elif defined(__i386__)
3636-3737-__SYSCALL_INT(___lseek, lseek, 3)
3838-3939-#elif defined(__arm__)
4040-4141-__SYSCALL(___lseek, lseek, 4)
4242-4343-#elif defined(__arm64__)
4444-4545-__SYSCALL(___lseek, lseek, 3)
4646-4747-#else
4848-#error Unsupported architecture
4949-#endif
5050-#if defined(__i386__)
5151- .globl _lseek
5252- .set _lseek, ___lseek
5353-#endif
5454-5555-#if defined(__x86_64__)
5656- .globl _lseek
5757- .set _lseek, ___lseek
5858-#endif
5959-6060-#if defined(__ppc__)
6161- .globl _lseek
6262- .set _lseek, ___lseek
6363-#endif
6464-6565-#if defined(__arm__)
6666- .globl _lseek
6767- .set _lseek, ___lseek
6868-#endif
6969-7070-#if defined(__arm64__)
7171- .globl _lseek
7272- .set _lseek, ___lseek
7373-#endif
7474-
···11-#define __SYSCALL_32BIT_ARG_BYTES 24
22-#include "SYS.h"
33-44-#ifndef SYS_persona
55-#error "SYS_persona not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___persona)
1010-SYSCALL_NONAME(persona, 6, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___persona, persona, 6, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-95
src/kernel/libsyscall/bsdsyscalls/___pipe.S
···11-/*
22- * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. */
2929-3030-#include "SYS.h"
3131-3232-#if defined(__i386__)
3333-3434-PSEUDO_INT(___pipe, pipe, 0)
3535- movl 4(%esp),%ecx
3636- movl %eax,(%ecx)
3737- movl %edx,4(%ecx)
3838- xorl %eax,%eax
3939- ret
4040-4141-#elif defined(__x86_64__)
4242-4343-PSEUDO(___pipe, pipe, 0, cerror_nocancel)
4444- movl %eax, (%rdi)
4545- movl %edx, 4(%rdi)
4646- xorl %eax, %eax
4747- ret
4848-4949-#elif defined(__arm__)
5050-5151-MI_ENTRY_POINT(___pipe)
5252- mov r3,r0 // save fildes across syscall
5353- SYSCALL_NONAME(pipe, 0, cerror_nocancel)
5454- str r0, [r3, #0]
5555- str r1, [r3, #4]
5656- mov r0,#0
5757- bx lr
5858-5959-#elif defined(__arm64__)
6060-6161-MI_ENTRY_POINT(___pipe)
6262- mov x9, x0 // Stash FD array
6363- SYSCALL_NONAME(pipe, 0, cerror_nocancel)
6464- stp w0, w1, [x9] // Save results
6565- mov x0, #0 // Success
6666- ret // Done
6767-6868-#else
6969-#error Unsupported architecture
7070-#endif
7171-#if defined(__i386__)
7272- .globl _pipe
7373- .set _pipe, ___pipe
7474-#endif
7575-7676-#if defined(__x86_64__)
7777- .globl _pipe
7878- .set _pipe, ___pipe
7979-#endif
8080-8181-#if defined(__ppc__)
8282- .globl _pipe
8383- .set _pipe, ___pipe
8484-#endif
8585-8686-#if defined(__arm__)
8787- .globl _pipe
8888- .set _pipe, ___pipe
8989-#endif
9090-9191-#if defined(__arm64__)
9292- .globl _pipe
9393- .set _pipe, ___pipe
9494-#endif
9595-
···11-#define __SYSCALL_32BIT_ARG_BYTES 12
22-#include "SYS.h"
33-44-#ifndef SYS___pthread_sigmask
55-#error "SYS___pthread_sigmask not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___pthread_sigmask)
1010-SYSCALL_NONAME(__pthread_sigmask, 3, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___pthread_sigmask, __pthread_sigmask, 3, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-99
src/kernel/libsyscall/bsdsyscalls/___ptrace.S
···11-/*
22- * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. */
2929-3030-#include "SYS.h"
3131-3232-#if defined(__i386__)
3333-3434- .globl _errno
3535-3636-LEAF(___ptrace, 0)
3737- xorl %eax,%eax
3838- REG_TO_EXTERN(%eax,_errno)
3939- UNIX_SYSCALL_NONAME(ptrace, 4, cerror)
4040- ret
4141-4242-#elif defined(__x86_64__)
4343-4444- .globl _errno
4545-4646-LEAF(___ptrace, 0)
4747- xorq %rax,%rax
4848- PICIFY(_errno)
4949- movl %eax,(%r11)
5050- UNIX_SYSCALL_NONAME(ptrace, 4, cerror)
5151- ret
5252-5353-#elif defined(__arm__)
5454-5555-MI_ENTRY_POINT(___ptrace)
5656- MI_GET_ADDRESS(ip,_errno)
5757- str r8, [sp, #-4]!
5858- mov r8, #0
5959- str r8, [ip]
6060- ldr r8, [sp], #4
6161- SYSCALL_NONAME(ptrace, 4, cerror)
6262- bx lr
6363-6464-#elif defined(__arm64__)
6565-6666-MI_ENTRY_POINT(___ptrace)
6767- MI_GET_ADDRESS(x9,_errno)
6868- str wzr, [x9]
6969- SYSCALL_NONAME(ptrace, 4, cerror)
7070- ret
7171-7272-#else
7373-#error Unsupported architecture
7474-#endif
7575-#if defined(__i386__)
7676- .globl _ptrace
7777- .set _ptrace, ___ptrace
7878-#endif
7979-8080-#if defined(__x86_64__)
8181- .globl _ptrace
8282- .set _ptrace, ___ptrace
8383-#endif
8484-8585-#if defined(__ppc__)
8686- .globl _ptrace
8787- .set _ptrace, ___ptrace
8888-#endif
8989-9090-#if defined(__arm__)
9191- .globl _ptrace
9292- .set _ptrace, ___ptrace
9393-#endif
9494-9595-#if defined(__arm64__)
9696- .globl _ptrace
9797- .set _ptrace, ___ptrace
9898-#endif
9999-
···11-/*
22- * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-2929-#include "SYS.h"
3030-3131-#if defined(__x86_64__)
3232-3333-__SYSCALL(___sigaltstack, sigaltstack, 3)
3434-3535-#elif defined(__i386__)
3636-3737-__SYSCALL_INT(___sigaltstack, sigaltstack, 3)
3838-3939-#elif defined(__arm__)
4040-4141-__SYSCALL(___sigaltstack, sigaltstack, 3)
4242-4343-#elif defined(__arm64__)
4444-4545-__SYSCALL(___sigaltstack, sigaltstack, 3)
4646-4747-#else
4848-#error Unsupported architecture
4949-#endif
5050-#if defined(__i386__)
5151- .globl _sigaltstack
5252- .set _sigaltstack, ___sigaltstack
5353-#endif
5454-5555-#if defined(__ppc__)
5656- .globl _sigaltstack
5757- .set _sigaltstack, ___sigaltstack
5858-#endif
5959-
···11/*
22- * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
22+ * Copyright (c) 2020 Apple Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
55+ *
66 * This file contains Original Code and/or Modifications of Original Code
77 * as defined in and that are subject to the Apple Public Source License
88 * Version 2.0 (the 'License'). You may not use this file except in
···1111 * unlawful or unlicensed copies of an Apple operating system, or to
1212 * circumvent, violate, or enable the circumvention or violation of, any
1313 * terms of an Apple operating system software license agreement.
1414- *
1414+ *
1515 * Please obtain a copy of the License at
1616 * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1717+ *
1818 * The Original Code and all software distributed under the License are
1919 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
···2222 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323 * Please see the License for the specific language governing rights and
2424 * limitations under the License.
2525- *
2525+ *
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
28282929-#include "SYS.h"
3030-3131-#if defined(__x86_64__)
3232-3333-__SYSCALL(___sigreturn, sigreturn, 3)
3434-3535-#elif defined(__i386__)
3636-3737-__SYSCALL_INT(___sigreturn, sigreturn, 3)
2929+#undef _task_user_
3030+#include <mach/task_internal.h>
38313939-#elif defined(__arm__)
3232+extern mach_port_t mach_task_self_;
40334141-__SYSCALL(___sigreturn, sigreturn, 3)
3434+boolean_t
3535+mach_task_is_self(task_name_t task)
3636+{
3737+ boolean_t is_self;
3838+ kern_return_t kr;
42394343-#elif defined(__arm64__)
4040+ if (task == mach_task_self_) {
4141+ return TRUE;
4242+ }
44434545-__SYSCALL(___sigreturn, sigreturn, 3)
4444+ kr = _kernelrpc_mach_task_is_self(task, &is_self);
46454747-#else
4848-#error Unsupported architecture
4949-#endif
4646+ return kr == KERN_SUCCESS && is_self;
4747+}
-18
src/kernel/libsyscall/bsdsyscalls/___sigsuspend.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 4
22-#include "SYS.h"
33-44-#ifndef SYS_sigsuspend
55-#error "SYS_sigsuspend not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___sigsuspend)
1010-SYSCALL_NONAME(sigsuspend, 1, cerror)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___sigsuspend, sigsuspend, 1, cerror)
1515-#endif
1616-1717-#endif
1818-
···11-#define __SYSCALL_32BIT_ARG_BYTES 16
22-#include "SYS.h"
33-44-#ifndef SYS_stat_extended
55-#error "SYS_stat_extended not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___stat_extended)
1010-SYSCALL_NONAME(stat_extended, 4, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___stat_extended, stat_extended, 4, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-98
src/kernel/libsyscall/bsdsyscalls/___syscall.S
···11-/*
22- * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. */
2929-3030-#include "SYS.h"
3131-3232-#if defined(__i386__)
3333-3434-LEAF(___syscall, 0)
3535- popl %ecx // ret addr
3636- popl %eax // syscall number
3737- pushl %ecx
3838- UNIX_SYSCALL_TRAP
3939- movl (%esp),%edx // add one element to stack so
4040- pushl %edx // caller "pop" will work
4141- jnb 2f
4242- BRANCH_EXTERN(tramp_cerror)
4343-2:
4444-END(___syscall)
4545-4646-#elif defined(__x86_64__)
4747-4848-// For x86-64, the kernel slides the argument list for us.
4949-// The number of arguments here is variable, but our macros ignore
5050-// that value anyway.
5151-__SYSCALL(___syscall, syscall, 0);
5252-5353-#elif defined(__arm__)
5454-5555-__SYSCALL(___syscall, syscall, 7)
5656-5757-#elif defined(__arm64__)
5858-5959-/*
6060- * Ignore nominal number of arguments: just pop from stack and let the kernel
6161- * interpret.
6262- */
6363-#include <mach/arm64/asm.h>
6464-MI_ENTRY_POINT(___syscall)
6565- ldp x1, x2, [sp]
6666- ldp x3, x4, [sp, #16]
6767- ldp x5, x6, [sp, #32]
6868- ldr x7, [sp, #48]
6969- DO_SYSCALL(SYS_syscall, cerror)
7070- ret
7171-#else
7272-#error Unsupported architecture
7373-#endif
7474-#if defined(__i386__)
7575- .globl _syscall
7676- .set _syscall, ___syscall
7777-#endif
7878-7979-#if defined(__x86_64__)
8080- .globl _syscall
8181- .set _syscall, ___syscall
8282-#endif
8383-8484-#if defined(__ppc__)
8585- .globl _syscall
8686- .set _syscall, ___syscall
8787-#endif
8888-8989-#if defined(__arm__)
9090- .globl _syscall
9191- .set _syscall, ___syscall
9292-#endif
9393-9494-#if defined(__arm64__)
9595- .globl _syscall
9696- .set _syscall, ___syscall
9797-#endif
9898-
-19
src/kernel/libsyscall/bsdsyscalls/___sysctl.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 24
22-#include "SYS.h"
33-44-#ifndef SYS_sysctl
55-#error "SYS_sysctl not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___sysctl)
1010-ZERO_EXTEND(5)
1111-SYSCALL_NONAME(sysctl, 6, cerror_nocancel)
1212-ret
1313-#else
1414-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1515-__SYSCALL2(___sysctl, sysctl, 6, cerror_nocancel)
1616-#endif
1717-1818-#endif
1919-
···11/*
22- * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
22+ * Copyright (c) 2020 Apple Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
55+ *
66 * This file contains Original Code and/or Modifications of Original Code
77 * as defined in and that are subject to the Apple Public Source License
88 * Version 2.0 (the 'License'). You may not use this file except in
···1111 * unlawful or unlicensed copies of an Apple operating system, or to
1212 * circumvent, violate, or enable the circumvention or violation of, any
1313 * terms of an Apple operating system software license agreement.
1414- *
1414+ *
1515 * Please obtain a copy of the License at
1616 * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1717+ *
1818 * The Original Code and all software distributed under the License are
1919 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
···2222 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323 * Please see the License for the specific language governing rights and
2424 * limitations under the License.
2525- *
2525+ *
2626 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727 */
2828-2929-#include "SYS.h"
3030-3131-#if defined(__x86_64__)
3232-3333-__SYSCALL(___thread_selfid, thread_selfid, 0)
3434-3535-#elif defined(__i386__)
3636-3737-__SYSCALL_INT(___thread_selfid, thread_selfid, 0)
3838-3939-#elif defined(__arm__)
4040-4141-__SYSCALL(___thread_selfid, thread_selfid, 0)
4242-4343-#elif defined(__arm64__)
2828+#ifndef __SYSTEM_VERSION_COMPAT_SUPPORT_H
2929+#define __SYSTEM_VERSION_COMPAT_SUPPORT_H
44304545-__SYSCALL(___thread_selfid, thread_selfid, 0)
3131+typedef enum system_version_compat_mode {
3232+ SYSTEM_VERSION_COMPAT_MODE_DISABLED = 0,
3333+ SYSTEM_VERSION_COMPAT_MODE_MACOSX = 1,
3434+ SYSTEM_VERSION_COMPAT_MODE_IOS = 2,
3535+} system_version_compat_mode_t;
46364747-#endif
3737+#endif /* __SYSTEM_VERSION_COMPAT_SUPPORT_H */
···11-/*
22- * Copyright (c) 2014 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-2929-#include "SYS.h"
3030-3131-#if defined(__x86_64__)
3232-3333-__SYSCALL(___thread_selfusage, thread_selfusage, 0)
3434-3535-#elif defined(__i386__)
3636-3737-__SYSCALL_INT(___thread_selfusage, thread_selfusage, 0)
3838-3939-#elif defined(__arm__)
4040-4141-__SYSCALL(___thread_selfusage, thread_selfusage, 0)
4242-4343-#elif defined(__arm64__)
4444-4545-__SYSCALL(___thread_selfusage, thread_selfusage, 0)
4646-4747-#endif
-18
src/kernel/libsyscall/bsdsyscalls/___ulock_wait.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 20
22-#include "SYS.h"
33-44-#ifndef SYS_ulock_wait
55-#error "SYS_ulock_wait not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___ulock_wait)
1010-SYSCALL_NONAME(ulock_wait, 4, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___ulock_wait, ulock_wait, 4, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/___ulock_wake.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 16
22-#include "SYS.h"
33-44-#ifndef SYS_ulock_wake
55-#error "SYS_ulock_wake not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___ulock_wake)
1010-SYSCALL_NONAME(ulock_wake, 3, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___ulock_wake, ulock_wake, 3, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_umask_extended
55-#error "SYS_umask_extended not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___umask_extended)
1010-SYSCALL_NONAME(umask_extended, 2, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___umask_extended, umask_extended, 2, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/___unlink.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 4
22-#include "SYS.h"
33-44-#ifndef SYS_unlink
55-#error "SYS_unlink not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___unlink)
1010-SYSCALL_NONAME(unlink, 1, cerror)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___unlink, unlink, 1, cerror)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/___unlinkat.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 12
22-#include "SYS.h"
33-44-#ifndef SYS_unlinkat
55-#error "SYS_unlinkat not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___unlinkat)
1010-SYSCALL_NONAME(unlinkat, 3, cerror)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___unlinkat, unlinkat, 3, cerror)
1515-#endif
1616-1717-#endif
1818-
-279
src/kernel/libsyscall/bsdsyscalls/___vfork.S
···11-/*
22- * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-/* Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
2929- *
3030- * File: libc/ppc/sys/vfork.s
3131- *
3232- * HISTORY
3333- * 23-Jun-1998 Umesh Vaishampayan (umeshv@apple.com)
3434- * Created from fork.s
3535- *
3636- */
3737-3838-#include "SYS.h"
3939-4040-#if defined(__i386__)
4141-4242-#if defined(__DYNAMIC__)
4343-#define GET_CURRENT_PID PICIFY(__current_pid)
4444-4545- NON_LAZY_STUB(__current_pid)
4646-#define __current_pid (%edx)
4747-#else
4848-#define GET_CURRENT_PID
4949-#endif
5050-5151-/*
5252- * If __current_pid >= 0, we want to put a -1 in there
5353- * otherwise we just decrement it
5454- */
5555-5656-LEAF(___vfork, 0)
5757- GET_CURRENT_PID
5858- movl __current_pid, %eax
5959-0:
6060- xorl %ecx, %ecx
6161- testl %eax, %eax
6262- cmovs %eax, %ecx
6363- decl %ecx
6464- lock
6565- cmpxchgl %ecx, __current_pid
6666- jne 0b
6767- popl %ecx
6868- movl $(SYS_vfork), %eax // code for vfork -> eax
6969- UNIX_SYSCALL_TRAP // do the system call
7070- jnb L1 // jump if CF==0
7171- GET_CURRENT_PID
7272- lock
7373- incl __current_pid
7474- pushl %ecx
7575- BRANCH_EXTERN(tramp_cerror)
7676-7777-L1:
7878- testl %edx, %edx // CF=OF=0, ZF set if zero result
7979- jz L2 // parent, since r1 == 0 in parent, 1 in child
8080- xorl %eax, %eax // zero eax
8181- jmp *%ecx
8282-8383-L2:
8484- GET_CURRENT_PID
8585- lock
8686- incl __current_pid
8787- jmp *%ecx
8888-8989-#elif defined(__x86_64__)
9090-9191-/*
9292- * If __current_pid >= 0, we want to put a -1 in there
9393- * otherwise we just decrement it
9494- */
9595-9696-LEAF(___vfork, 0)
9797- movq __current_pid@GOTPCREL(%rip), %rax
9898- movl (%rax), %eax
9999-0:
100100- xorl %ecx, %ecx
101101- testl %eax, %eax
102102- cmovs %eax, %ecx
103103- subl $1, %ecx
104104- movq __current_pid@GOTPCREL(%rip), %rdx
105105- lock
106106- cmpxchgl %ecx, (%rdx)
107107- jne 0b
108108-#ifdef DARLING
109109- movl $ SYS_vfork, %eax
110110- call __darling_bsd_syscall
111111- cmpq $0, %rax
112112- jnb L1
113113-#else
114114- popq %rdi // return address in %rdi
115115- movq $ SYSCALL_CONSTRUCT_UNIX(SYS_vfork), %rax // code for vfork -> rax
116116- UNIX_SYSCALL_TRAP // do the system call
117117- jnb L1 // jump if CF==0
118118- pushq %rdi // put return address back on stack for cerror
119119-#endif
120120- movq __current_pid@GOTPCREL(%rip), %rcx
121121- lock
122122- addl $1, (%rcx)
123123- movq %rax, %rdi
124124- BRANCH_EXTERN(_cerror)
125125-126126-L1:
127127-#ifdef DARLING
128128- testl %eax, %eax
129129- jnz L2
130130-#else
131131- testl %edx, %edx // CF=OF=0, ZF set if zero result
132132- jz L2 // parent, since r1 == 0 in parent, 1 in child
133133-#endif
134134- xorq %rax, %rax // zero rax
135135-#ifdef DARLING
136136- ret
137137-#else
138138- jmp *%rdi
139139-#endif
140140-141141-L2:
142142- movq __current_pid@GOTPCREL(%rip), %rdx
143143- lock
144144- addl $1, (%rdx)
145145-#ifdef DARLING
146146- ret
147147-#else
148148- jmp *%rdi
149149-#endif
150150-151151-#elif defined(__arm__)
152152-153153-#include <arm/arch.h>
154154-155155- .globl cerror
156156- MI_ENTRY_POINT(___vfork)
157157-158158- MI_GET_ADDRESS(r3, __current_pid) // get address of __current_pid
159159-#ifdef _ARM_ARCH_6
160160-L0:
161161- ldrex r1, [r3]
162162- subs r1, r1, #1 // if __current_pid <= 0, decrement it
163163- movpl r1, #-1 // otherwise put -1 in there
164164- strex r2, r1, [r3]
165165- cmp r2, #0
166166- bne L0
167167-#else
168168- mov r2, #0x80000000 // load "looking" value
169169-L0:
170170- swp r1, r2, [r3] // look at the value, lock others out
171171- cmp r1, r2 // anyone else trying to look?
172172- beq L0 // yes, so wait our turn
173173- subs r1, r1, #1 // if __current_pid <= 0, decrement it
174174- movpl r1, #-1 // otherwise put -1 in there
175175- str r1, [r3]
176176-#endif
177177-178178- mov r1, #1 // prime results
179179- mov r12, #SYS_vfork
180180- swi #SWI_SYSCALL // make the syscall
181181- bcs Lbotch // error?
182182- cmp r1, #0 // parent (r1=0) or child(r1=1)
183183- beq Lparent
184184-185185- //child here...
186186- mov r0, #0
187187- bx lr // return
188188-189189-Lbotch:
190190- MI_CALL_EXTERNAL(_cerror) // jump here on error
191191- mov r0,#-1 // set the error
192192- // reload values clobbered by cerror (so we can treat them as live in Lparent)
193193- MI_GET_ADDRESS(r3, __current_pid) // get address of __current_pid
194194-#ifndef _ARM_ARCH_6
195195- mov r2, #0x80000000 // load "looking" value
196196-#endif
197197- // fall thru
198198-199199-Lparent:
200200-#ifdef _ARM_ARCH_6
201201- ldrex r1, [r3]
202202- add r1, r1, #1 // we're back, decrement vfork count
203203- strex r2, r1, [r3]
204204- cmp r2, #0
205205- bne Lparent
206206-#else
207207- swp r1, r2, [r3] // look at the value, lock others out
208208- cmp r1, r2 // anyone else trying to look?
209209- beq Lparent // yes, so wait our turn
210210- add r1, r1, #1 // we're back, decrement vfork count
211211- str r1, [r3]
212212-#endif
213213-214214- bx lr // return
215215-216216-#elif defined(__arm64__)
217217-218218- MI_ENTRY_POINT(___vfork)
219219-220220- MI_GET_ADDRESS(x9, __current_pid)
221221-Ltry_set_vfork:
222222- ldxr w10, [x9] // Get old current pid value (exclusive)
223223- mov w11, #-1 // Will be -1 if current value is positive
224224- subs w10, w10, #1 // Subtract one
225225- csel w12, w11, w10, pl // If >= 0, set to -1, else set to (current - 1)
226226- stxr w13, w12, [x9] // Attempt exclusive store to current pid
227227- cbnz w13, Ltry_set_vfork // If store failed, retry
228228-229229- // ARM sets r1 to 1 here. I don't see why.
230230- mov w16, #SYS_vfork // Set syscall code
231231- svc #SWI_SYSCALL
232232- b.cs Lbotch
233233- cbz w1, Lparent
234234-235235- // Child
236236- mov w0, #0
237237- ret
238238-239239- // Error case
240240-Lbotch:
241241- bl _cerror // Update errno
242242- mov w0, #-1 // Set return value
243243- MI_GET_ADDRESS(x9, __current_pid) // Reload current pid address
244244- // Fall through
245245-Lparent:
246246- ldxr w10, [x9] // Exclusive load current pid value
247247- add w10, w10, #1 // Increment (i.e. decrement vfork count)
248248- stxr w11, w10, [x9] // Attempt exclusive store of updated vfork count
249249- cbnz w11, Lparent // If exclusive store failed, retry
250250- ret // Done, return
251251-252252-#else
253253-#error Unsupported architecture
254254-#endif
255255-#if defined(__i386__)
256256- .globl _vfork
257257- .set _vfork, ___vfork
258258-#endif
259259-260260-#if defined(__x86_64__)
261261- .globl _vfork
262262- .set _vfork, ___vfork
263263-#endif
264264-265265-#if defined(__ppc__)
266266- .globl _vfork
267267- .set _vfork, ___vfork
268268-#endif
269269-270270-#if defined(__arm__)
271271- .globl _vfork
272272- .set _vfork, ___vfork
273273-#endif
274274-275275-#if defined(__arm64__)
276276- .globl _vfork
277277- .set _vfork, ___vfork
278278-#endif
279279-
-18
src/kernel/libsyscall/bsdsyscalls/___wait4.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 16
22-#include "SYS.h"
33-44-#ifndef SYS_wait4
55-#error "SYS_wait4 not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(___wait4)
1010-SYSCALL_NONAME(wait4, 4, cerror)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(___wait4, wait4, 4, cerror)
1515-#endif
1616-1717-#endif
1818-
···11-#define __SYSCALL_32BIT_ARG_BYTES 24
22-#include "SYS.h"
33-44-#ifndef SYS_fsgetpath_ext
55-#error "SYS_fsgetpath_ext not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_fsgetpath_ext)
1010-ZERO_EXTEND(1)
1111-SYSCALL_NONAME(fsgetpath_ext, 5, cerror_nocancel)
1212-ret
1313-#else
1414-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1515-__SYSCALL2(_fsgetpath_ext, fsgetpath_ext, 5, cerror_nocancel)
1616-#endif
1717-1818-#endif
1919-
-13
src/kernel/libsyscall/bsdsyscalls/_fstat.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_fstat
55-#error "SYS_fstat not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__)
99-__SYSCALL2(_fstat, fstat, 2, cerror)
1010-#else
1111-__SYSCALL2(___fstat, fstat, 2, cerror)
1212-#endif
1313-
···11-#define __SYSCALL_32BIT_ARG_BYTES 16
22-#include "SYS.h"
33-44-#ifndef SYS_fstatat
55-#error "SYS_fstatat not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__)
99-__SYSCALL2(_fstatat, fstatat, 4, cerror)
1010-#else
1111-__SYSCALL2(___fstatat, fstatat, 4, cerror)
1212-#endif
1313-
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_fstatfs
55-#error "SYS_fstatfs not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__)
99-__SYSCALL2(_fstatfs, fstatfs, 2, cerror_nocancel)
1010-#else
1111-__SYSCALL2(___fstatfs, fstatfs, 2, cerror_nocancel)
1212-#endif
1313-
···11-#define __SYSCALL_32BIT_ARG_BYTES 0
22-#include "SYS.h"
33-44-#ifndef SYS_getdtablesize
55-#error "SYS_getdtablesize not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_getdtablesize)
1010-SYSCALL_NONAME(getdtablesize, 0, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_getdtablesize, getdtablesize, 0, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_getegid.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 0
22-#include "SYS.h"
33-44-#ifndef SYS_getegid
55-#error "SYS_getegid not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_getegid)
1010-SYSCALL_NONAME(getegid, 0, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_getegid, getegid, 0, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-19
src/kernel/libsyscall/bsdsyscalls/_getentropy.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_getentropy
55-#error "SYS_getentropy not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_getentropy)
1010-ZERO_EXTEND(1)
1111-SYSCALL_NONAME(getentropy, 2, cerror_nocancel)
1212-ret
1313-#else
1414-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1515-__SYSCALL2(_getentropy, getentropy, 2, cerror_nocancel)
1616-#endif
1717-1818-#endif
1919-
-18
src/kernel/libsyscall/bsdsyscalls/_geteuid.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 0
22-#include "SYS.h"
33-44-#ifndef SYS_geteuid
55-#error "SYS_geteuid not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_geteuid)
1010-SYSCALL_NONAME(geteuid, 0, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_geteuid, geteuid, 0, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_getfh.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_getfh
55-#error "SYS_getfh not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_getfh)
1010-SYSCALL_NONAME(getfh, 2, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_getfh, getfh, 2, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-13
src/kernel/libsyscall/bsdsyscalls/_getfsstat.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 12
22-#include "SYS.h"
33-44-#ifndef SYS_getfsstat
55-#error "SYS_getfsstat not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__)
99-__SYSCALL2(_getfsstat, getfsstat, 3, cerror_nocancel)
1010-#else
1111-__SYSCALL2(___getfsstat, getfsstat, 3, cerror_nocancel)
1212-#endif
1313-
···11-#define __SYSCALL_32BIT_ARG_BYTES 16
22-#include "SYS.h"
33-44-#ifndef SYS_guarded_writev_np
55-#error "SYS_guarded_writev_np not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_guarded_writev_np)
1010-SYSCALL_NONAME(guarded_writev_np, 4, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_guarded_writev_np, guarded_writev_np, 4, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_issetugid.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 0
22-#include "SYS.h"
33-44-#ifndef SYS_issetugid
55-#error "SYS_issetugid not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_issetugid)
1010-SYSCALL_NONAME(issetugid, 0, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_issetugid, issetugid, 0, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_kas_info.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 12
22-#include "SYS.h"
33-44-#ifndef SYS_kas_info
55-#error "SYS_kas_info not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_kas_info)
1010-SYSCALL_NONAME(kas_info, 3, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_kas_info, kas_info, 3, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_kevent.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 24
22-#include "SYS.h"
33-44-#ifndef SYS_kevent
55-#error "SYS_kevent not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_kevent)
1010-SYSCALL_NONAME(kevent, 6, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_kevent, kevent, 6, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_kevent64.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 28
22-#include "SYS.h"
33-44-#ifndef SYS_kevent64
55-#error "SYS_kevent64 not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_kevent64)
1010-SYSCALL_NONAME(kevent64, 7, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_kevent64, kevent64, 7, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_kevent_id.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 36
22-#include "SYS.h"
33-44-#ifndef SYS_kevent_id
55-#error "SYS_kevent_id not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_kevent_id)
1010-SYSCALL_NONAME(kevent_id, 8, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_kevent_id, kevent_id, 8, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_kevent_qos.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 32
22-#include "SYS.h"
33-44-#ifndef SYS_kevent_qos
55-#error "SYS_kevent_qos not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_kevent_qos)
1010-SYSCALL_NONAME(kevent_qos, 8, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_kevent_qos, kevent_qos, 8, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_kqueue.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 0
22-#include "SYS.h"
33-44-#ifndef SYS_kqueue
55-#error "SYS_kqueue not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_kqueue)
1010-SYSCALL_NONAME(kqueue, 0, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_kqueue, kqueue, 0, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_ledger.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 16
22-#include "SYS.h"
33-44-#ifndef SYS_ledger
55-#error "SYS_ledger not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_ledger)
1010-SYSCALL_NONAME(ledger, 4, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_ledger, ledger, 4, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_link.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_link
55-#error "SYS_link not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_link)
1010-SYSCALL_NONAME(link, 2, cerror)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_link, link, 2, cerror)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_linkat.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 20
22-#include "SYS.h"
33-44-#ifndef SYS_linkat
55-#error "SYS_linkat not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_linkat)
1010-SYSCALL_NONAME(linkat, 5, cerror)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_linkat, linkat, 5, cerror)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_lio_listio.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 16
22-#include "SYS.h"
33-44-#ifndef SYS_lio_listio
55-#error "SYS_lio_listio not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_lio_listio)
1010-SYSCALL_NONAME(lio_listio, 4, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_lio_listio, lio_listio, 4, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-19
src/kernel/libsyscall/bsdsyscalls/_listxattr.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 16
22-#include "SYS.h"
33-44-#ifndef SYS_listxattr
55-#error "SYS_listxattr not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_listxattr)
1010-ZERO_EXTEND(2)
1111-SYSCALL_NONAME(listxattr, 4, cerror_nocancel)
1212-ret
1313-#else
1414-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1515-__SYSCALL2(_listxattr, listxattr, 4, cerror_nocancel)
1616-#endif
1717-1818-#endif
1919-
-13
src/kernel/libsyscall/bsdsyscalls/_lstat.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_lstat
55-#error "SYS_lstat not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__)
99-__SYSCALL2(_lstat, lstat, 2, cerror)
1010-#else
1111-__SYSCALL2(___lstat, lstat, 2, cerror)
1212-#endif
1313-
···11-#define __SYSCALL_32BIT_ARG_BYTES 16
22-#include "SYS.h"
33-44-#ifndef SYS_socket_delegate
55-#error "SYS_socket_delegate not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_socket_delegate)
1010-SYSCALL_NONAME(socket_delegate, 4, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_socket_delegate, socket_delegate, 4, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-13
src/kernel/libsyscall/bsdsyscalls/_stat.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_stat
55-#error "SYS_stat not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__)
99-__SYSCALL2(_stat, stat, 2, cerror)
1010-#else
1111-__SYSCALL2(___stat, stat, 2, cerror)
1212-#endif
1313-
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_statfs
55-#error "SYS_statfs not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__)
99-__SYSCALL2(_statfs, statfs, 2, cerror_nocancel)
1010-#else
1111-__SYSCALL2(___statfs, statfs, 2, cerror_nocancel)
1212-#endif
1313-
···11-#define __SYSCALL_32BIT_ARG_BYTES 12
22-#include "SYS.h"
33-44-#ifndef SYS_vm_pressure_monitor
55-#error "SYS_vm_pressure_monitor not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_vm_pressure_monitor)
1010-SYSCALL_NONAME(vm_pressure_monitor, 3, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_vm_pressure_monitor, vm_pressure_monitor, 3, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-18
src/kernel/libsyscall/bsdsyscalls/_waitevent.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_waitevent
55-#error "SYS_waitevent not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_waitevent)
1010-SYSCALL_NONAME(waitevent, 2, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_waitevent, waitevent, 2, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-30
src/kernel/libsyscall/bsdsyscalls/_waitid.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 16
22-#include "SYS.h"
33-44-#ifndef SYS_waitid
55-#error "SYS_waitid not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_waitid)
1010-SYSCALL_NONAME(waitid, 4, cerror)
1111-ret
1212-#else
1313-#if defined(__x86_64__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_waitid, waitid, 4, cerror)
1515-#else
1616-__SYSCALL2(___waitid, waitid, 4, cerror)
1717-#endif
1818-1919-#endif
2020-2121-#if defined(__i386__)
2222- .globl _waitid$UNIX2003
2323- .set _waitid$UNIX2003, ___waitid
2424-#endif
2525-2626-#if defined(__ppc__)
2727- .globl _waitid$UNIX2003
2828- .set _waitid$UNIX2003, ___waitid
2929-#endif
3030-
-18
src/kernel/libsyscall/bsdsyscalls/_watchevent.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 8
22-#include "SYS.h"
33-44-#ifndef SYS_watchevent
55-#error "SYS_watchevent not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_watchevent)
1010-SYSCALL_NONAME(watchevent, 2, cerror_nocancel)
1111-ret
1212-#else
1313-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_watchevent, watchevent, 2, cerror_nocancel)
1515-#endif
1616-1717-#endif
1818-
-31
src/kernel/libsyscall/bsdsyscalls/_write.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 12
22-#include "SYS.h"
33-44-#ifndef SYS_write
55-#error "SYS_write not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_write)
1010-ZERO_EXTEND(2)
1111-SYSCALL_NONAME(write, 3, cerror)
1212-ret
1313-#else
1414-#if defined(__x86_64__) || defined(__arm__) || defined(__arm64__)
1515-__SYSCALL2(_write, write, 3, cerror)
1616-#else
1717-__SYSCALL2(___write, write, 3, cerror)
1818-#endif
1919-2020-#endif
2121-2222-#if defined(__i386__)
2323- .globl _write$UNIX2003
2424- .set _write$UNIX2003, ___write
2525-#endif
2626-2727-#if defined(__ppc__)
2828- .globl _write$UNIX2003
2929- .set _write$UNIX2003, ___write
3030-#endif
3131-
-30
src/kernel/libsyscall/bsdsyscalls/_writev.S
···11-#define __SYSCALL_32BIT_ARG_BYTES 12
22-#include "SYS.h"
33-44-#ifndef SYS_writev
55-#error "SYS_writev not defined. The header files libsyscall is building against do not match syscalls.master."
66-#endif
77-88-#if defined(__arm64__)
99-MI_ENTRY_POINT(_writev)
1010-SYSCALL_NONAME(writev, 3, cerror)
1111-ret
1212-#else
1313-#if defined(__x86_64__) || defined(__arm__) || defined(__arm64__)
1414-__SYSCALL2(_writev, writev, 3, cerror)
1515-#else
1616-__SYSCALL2(___writev, writev, 3, cerror)
1717-#endif
1818-1919-#endif
2020-2121-#if defined(__i386__)
2222- .globl _writev$UNIX2003
2323- .set _writev$UNIX2003, ___writev
2424-#endif
2525-2626-#if defined(__ppc__)
2727- .globl _writev$UNIX2003
2828- .set _writev$UNIX2003, ___writev
2929-#endif
3030-
-149
src/kernel/libsyscall/bsdsyscalls/custom.S
···11-/*
22- * Copyright (c) 1999-2015 Apple Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
2929- */
3030-3131-#include "SYS.h"
3232-3333-#if defined(__i386__)
3434-3535-/*
3636- * i386 needs custom assembly to transform the return from syscalls
3737- * into a proper stack for a function call out to cerror{,_nocancel}.
3838- */
3939-4040-LABEL(tramp_cerror)
4141- mov %esp, %edx
4242- andl $0xfffffff0, %esp
4343- subl $16, %esp
4444- movl %edx, 4(%esp)
4545- movl %eax, (%esp)
4646- CALL_EXTERN(_cerror)
4747- movl 4(%esp), %esp
4848- ret
4949-5050-LABEL(tramp_cerror_nocancel)
5151- mov %esp, %edx
5252- andl $0xfffffff0, %esp
5353- subl $16, %esp
5454- movl %edx, 4(%esp)
5555- movl %eax, (%esp)
5656- CALL_EXTERN(_cerror_nocancel)
5757- movl 4(%esp), %esp
5858- ret
5959-6060-LABEL(__sysenter_trap)
6161- popl %edx
6262- movl %esp, %ecx
6363- sysenter
6464-6565- .globl _i386_get_ldt
6666- ALIGN
6767-_i386_get_ldt:
6868- movl $6,%eax
6969- MACHDEP_SYSCALL_TRAP
7070- jnb 2f
7171- jmp tramp_cerror
7272-2: ret
7373-7474-7575- .globl _i386_set_ldt
7676- ALIGN
7777-_i386_set_ldt:
7878- movl $5,%eax
7979- MACHDEP_SYSCALL_TRAP
8080- jnb 2f
8181- jmp tramp_cerror
8282-2: ret
8383-8484- ALIGN
8585- .globl __thread_set_tsd_base
8686-__thread_set_tsd_base:
8787- pushl 4(%esp)
8888- pushl $0
8989- movl $3,%eax
9090- MACHDEP_SYSCALL_TRAP
9191- addl $8,%esp
9292- ret
9393-9494-#elif defined(__x86_64__)
9595-9696- .globl _i386_get_ldt
9797- ALIGN
9898-_i386_get_ldt:
9999- movl $SYSCALL_CONSTRUCT_MDEP(6), %eax
100100- MACHDEP_SYSCALL_TRAP
101101- jnb 2f
102102- movq %rax, %rdi
103103- jmp _cerror
104104-2: ret
105105-106106-107107- .globl _i386_set_ldt
108108- ALIGN
109109-_i386_set_ldt:
110110- movl $SYSCALL_CONSTRUCT_MDEP(5), %eax
111111- MACHDEP_SYSCALL_TRAP
112112- jnb 2f
113113- movq %rax, %rdi
114114- jmp _cerror
115115-2: ret
116116-117117- ALIGN
118118- .globl __thread_set_tsd_base
119119-__thread_set_tsd_base:
120120- movl $0, %esi // 0 as the second argument
121121- movl $ SYSCALL_CONSTRUCT_MDEP(3), %eax // Machine-dependent syscall number 3
122122- MACHDEP_SYSCALL_TRAP
123123- ret
124124-125125-#elif defined(__arm__)
126126-127127- .align 2
128128- .globl __thread_set_tsd_base
129129-__thread_set_tsd_base:
130130- mov r3, #2
131131- mov r12, #0x80000000
132132- swi #SWI_SYSCALL
133133- bx lr
134134-135135-#elif defined(__arm64__)
136136-137137- .align 2
138138- .globl __thread_set_tsd_base
139139-__thread_set_tsd_base:
140140- mov x3, #2
141141- mov x16, #0x80000000
142142- svc #SWI_SYSCALL
143143- ret
144144-145145-#else
146146-#error unknown architecture
147147-#endif
148148-149149-.subsections_via_symbols
···5252 subl $28, %esp // Align the stack, with 16 bytes of extra padding that we'll need
53535454 movl $ SYS_fork,%eax; // code for fork -> eax
5555- #ifdef DARLING
5656- call __darling_bsd_syscall
5757- cmpl $0, %eax
5858- jnb L1
5959- #else
6060- UNIX_SYSCALL_TRAP // do the system call
6161- jnc L1 // jump if CF==0
6262- #endif
5555+ UNIX_SYSCALL_TRAP // do the system call
5656+ jnc L1 // jump if CF==0
63576458 CALL_EXTERN(tramp_cerror)
6559 movl $-1,%eax
···8377LEAF(___fork, 0)
8478 subq $24, %rsp // Align the stack, plus room for local storage
85798686- #ifdef DARLING
8787- movl $ SYS_fork, %eax
8888- call __darling_bsd_syscall
8989- cmpq $0, %rax
9090- jnb L1
9191- #else
9292- movl $ SYSCALL_CONSTRUCT_UNIX(SYS_fork),%eax; // code for fork -> rax
9393- UNIX_SYSCALL_TRAP // do the system call
9494- jnc L1 // jump if CF==0
9595- #endif
8080+ movl $ SYSCALL_CONSTRUCT_UNIX(SYS_fork),%eax; // code for fork -> rax
8181+ UNIX_SYSCALL_TRAP // do the system call
8282+ jnc L1 // jump if CF==0
96839784 movq %rax, %rdi
9885 CALL_EXTERN(_cerror)
···10188 ret
1028910390L1:
104104- #ifdef DARLING
105105- testl %eax, %eax
106106- jnz L2
107107- #else
108108- orl %edx,%edx // CF=OF=0, ZF set if zero result
109109- jz L2 // parent, since r1 == 0 in parent, 1 in child
110110- #endif
9191+ orl %edx,%edx // CF=OF=0, ZF set if zero result
9292+ jz L2 // parent, since r1 == 0 in parent, 1 in child
1119311294 //child here...
11395 xorq %rax, %rax
+7-22
src/kernel/libsyscall/custom/__vfork.S
···105105 lock
106106 cmpxchgl %ecx, (%rdx)
107107 jne 0b
108108-#ifdef DARLING
109109- movl $ SYS_vfork, %eax
110110- call __darling_bsd_syscall
111111- cmpq $0, %rax
112112- jnb L1
113113-#else
114108 popq %rdi // return address in %rdi
115109 movq $ SYSCALL_CONSTRUCT_UNIX(SYS_vfork), %rax // code for vfork -> rax
116110 UNIX_SYSCALL_TRAP // do the system call
117111 jnb L1 // jump if CF==0
118112 pushq %rdi // put return address back on stack for cerror
119119-#endif
120113 movq __current_pid@GOTPCREL(%rip), %rcx
121114 lock
122115 addl $1, (%rcx)
···124117 BRANCH_EXTERN(_cerror)
125118126119L1:
127127-#ifdef DARLING
128128- testl %eax, %eax
129129- jnz L2
130130-#else
131120 testl %edx, %edx // CF=OF=0, ZF set if zero result
132121 jz L2 // parent, since r1 == 0 in parent, 1 in child
133133-#endif
134122 xorq %rax, %rax // zero rax
135135-#ifdef DARLING
136136- ret
137137-#else
138123 jmp *%rdi
139139-#endif
140124141125L2:
142126 movq __current_pid@GOTPCREL(%rip), %rdx
143127 lock
144128 addl $1, (%rdx)
145145-#ifdef DARLING
146146- ret
147147-#else
148129 jmp *%rdi
149149-#endif
150130151131#elif defined(__arm__)
152132···187167 bx lr // return
188168189169Lbotch:
170170+ stmfd sp!, {lr}
190171 MI_CALL_EXTERNAL(_cerror) // jump here on error
191172 mov r0,#-1 // set the error
192173 // reload values clobbered by cerror (so we can treat them as live in Lparent)
193174 MI_GET_ADDRESS(r3, __current_pid) // get address of __current_pid
175175+ ldmfd sp!, {lr}
194176#ifndef _ARM_ARCH_6
195177 mov r2, #0x80000000 // load "looking" value
196178#endif
···216198#elif defined(__arm64__)
217199218200 MI_ENTRY_POINT(___vfork)
201201+ ARM64_STACK_PROLOG
219202220203 MI_GET_ADDRESS(x9, __current_pid)
221204Ltry_set_vfork:
···234217235218 // Child
236219 mov w0, #0
237237- ret
220220+ ARM64_STACK_EPILOG
238221239222 // Error case
240223Lbotch:
224224+ PUSH_FRAME
241225 bl _cerror // Update errno
242226 mov w0, #-1 // Set return value
243227 MI_GET_ADDRESS(x9, __current_pid) // Reload current pid address
228228+ POP_FRAME
244229 // Fall through
245230Lparent:
246231 ldxr w10, [x9] // Exclusive load current pid value
247232 add w10, w10, #1 // Increment (i.e. decrement vfork count)
248233 stxr w11, w10, [x9] // Attempt exclusive store of updated vfork count
249234 cbnz w11, Lparent // If exclusive store failed, retry
250250- ret // Done, return
235235+ ARM64_STACK_EPILOG // Done, return
251236252237#else
253238#error Unsupported architecture
-836
src/kernel/libsyscall/device/device.defs
···11-/*
22- * Copyright (c) 1998-2014 Apple Computer, Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-/*
2929- * @OSF_COPYRIGHT@
3030- */
3131-/*
3232- * Mach Operating System
3333- * Copyright (c) 1991,1990,1989 Carnegie Mellon University
3434- * All Rights Reserved.
3535- *
3636- * Permission to use, copy, modify and distribute this software and its
3737- * documentation is hereby granted, provided that both the copyright
3838- * notice and this permission notice appear in all copies of the
3939- * software, derivative works or modified versions, and any portions
4040- * thereof, and that both notices appear in supporting documentation.
4141- *
4242- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
4343- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
4444- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
4545- *
4646- * Carnegie Mellon requests users of this software to return to
4747- *
4848- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
4949- * School of Computer Science
5050- * Carnegie Mellon University
5151- * Pittsburgh PA 15213-3890
5252- *
5353- * any improvements or extensions that they make and grant Carnegie Mellon
5454- * the rights to redistribute these changes.
5555- */
5656-/*
5757- * File: device/device.defs
5858- * Author: Douglas Orr
5959- * Feb 10, 1988
6060- * Abstract:
6161- * Mach device support. Mach devices are accessed through
6262- * block and character device interfaces to the kernel.
6363- */
6464-6565-subsystem
6666-#if KERNEL_SERVER
6767- KernelServer
6868-#endif /* KERNEL_SERVER */
6969- iokit 2800;
7070-7171-#if IOKITSIMD || KERNEL_SERVER
7272-#define IOKIT_ALL_IPC 1
7373-#endif
7474-7575-#include <mach/std_types.defs>
7676-#include <mach/mach_types.defs>
7777-#include <mach/clock_types.defs>
7878-#include <mach/clock_types.defs>
7979-8080-#if !__LP64__
8181-# define __ILP32__ 1
8282-#endif
8383-8484-import <device/device_types.h>;
8585-8686-serverprefix is_;
8787-8888-type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
8989- ctype: mach_port_t;
9090-9191-#if IOKIT
9292-9393-type io_name_t = c_string[*:128];
9494-type io_string_t = c_string[*:512];
9595-type io_string_inband_t = c_string[*:4096];
9696-type io_struct_inband_t = array[*:4096] of char;
9797-type io_buf_ptr_t = ^array[] of MACH_MSG_TYPE_INTEGER_8;
9898-type NDR_record_t = struct[8] of char;
9999-100100-#if KERNEL
101101-type io_user_scalar_t = uint64_t;
102102-type io_user_reference_t = uint64_t;
103103-type io_scalar_inband_t = array[*:16] of int;
104104-// must be the same type as OSAsyncReference
105105-type io_async_ref_t = array[*:8] of natural_t;
106106-type io_scalar_inband64_t = array[*:16] of io_user_scalar_t;
107107-type io_async_ref64_t = array[*:8] of io_user_reference_t;
108108-#elif __LP64__
109109-type io_user_scalar_t = uint64_t;
110110-type io_user_reference_t = uint64_t;
111111-type io_scalar_inband_t = array[*:16] of io_user_scalar_t;
112112-type io_async_ref_t = array[*:8] of io_user_reference_t;
113113-type io_scalar_inband64_t = array[*:16] of io_user_scalar_t;
114114-type io_async_ref64_t = array[*:8] of io_user_reference_t;
115115-#else
116116-type io_user_scalar_t = int;
117117-type io_user_reference_t = natural_t;
118118-type io_scalar_inband_t = array[*:16] of io_user_scalar_t;
119119-type io_async_ref_t = array[*:8] of io_user_reference_t;
120120-type io_scalar_inband64_t = array[*:16] of uint64_t;
121121-type io_async_ref64_t = array[*:8] of uint64_t;
122122-#endif // __LP64__
123123-124124-type io_object_t = mach_port_t
125125- ctype: mach_port_t
126126-#if KERNEL_SERVER
127127- intran: io_object_t iokit_lookup_object_port(mach_port_t)
128128- outtran: mach_port_t iokit_make_object_port(io_object_t)
129129- destructor: iokit_remove_reference(io_object_t)
130130-#endif /* KERNEL_SERVER */
131131- ;
132132-133133-type io_connect_t = mach_port_t
134134- ctype: mach_port_t
135135-#if KERNEL_SERVER
136136- intran: io_connect_t iokit_lookup_connect_port(mach_port_t)
137137- outtran: mach_port_t iokit_make_connect_port(io_connect_t)
138138- destructor: iokit_remove_connect_reference(io_connect_t)
139139-#endif /* KERNEL_SERVER */
140140- ;
141141-142142-routine io_object_get_class(
143143- object : io_object_t;
144144- out className : io_name_t
145145- );
146146-147147-routine io_object_conforms_to(
148148- object : io_object_t;
149149- in className : io_name_t;
150150- out conforms : boolean_t
151151- );
152152-153153-routine io_iterator_next(
154154- iterator : io_object_t;
155155- out object : io_object_t
156156- );
157157-158158-routine io_iterator_reset(
159159- iterator : io_object_t
160160- );
161161-162162-routine io_service_get_matching_services(
163163- master_port : mach_port_t;
164164- in matching : io_string_t;
165165- out existing : io_object_t
166166- );
167167-168168-routine io_registry_entry_get_property(
169169- registry_entry : io_object_t;
170170- in property_name : io_name_t;
171171- out properties : io_buf_ptr_t, physicalcopy
172172- );
173173-174174-routine io_registry_create_iterator(
175175- master_port : mach_port_t;
176176- in plane : io_name_t;
177177- in options : uint32_t;
178178- out iterator : io_object_t
179179- );
180180-181181-routine io_registry_iterator_enter_entry(
182182- iterator : io_object_t
183183- );
184184-185185-routine io_registry_iterator_exit_entry(
186186- iterator : io_object_t
187187- );
188188-189189-routine io_registry_entry_from_path(
190190- master_port : mach_port_t;
191191- in path : io_string_t;
192192- out registry_entry : io_object_t
193193- );
194194-195195-routine io_registry_entry_get_name(
196196- registry_entry : io_object_t;
197197- out name : io_name_t
198198- );
199199-200200-routine io_registry_entry_get_properties(
201201- registry_entry : io_object_t;
202202- out properties : io_buf_ptr_t, physicalcopy
203203- );
204204-205205-routine io_registry_entry_get_property_bytes(
206206- registry_entry : io_object_t;
207207- in property_name : io_name_t;
208208- out data : io_struct_inband_t, CountInOut
209209- );
210210-211211-routine io_registry_entry_get_child_iterator(
212212- registry_entry : io_object_t;
213213- in plane : io_name_t;
214214- out iterator : io_object_t
215215- );
216216-217217-routine io_registry_entry_get_parent_iterator(
218218- registry_entry : io_object_t;
219219- in plane : io_name_t;
220220- out iterator : io_object_t
221221- );
222222-223223-skip;
224224-/* was routine io_service_open
225225- service : io_object_t;
226226- in owningTask : task_t;
227227- in connect_type : uint32_t;
228228- out connection : io_connect_t
229229- );
230230-*/
231231-232232-routine io_service_close(
233233- connection : io_connect_t
234234- );
235235-236236-routine io_connect_get_service(
237237- connection : io_connect_t;
238238- out service : io_object_t
239239- );
240240-241241-#if IOKIT_ALL_IPC || __ILP32__
242242-routine io_connect_set_notification_port(
243243- connection : io_connect_t;
244244- in notification_type : uint32_t;
245245- in port : mach_port_make_send_t;
246246- in reference : uint32_t
247247- );
248248-249249-routine io_connect_map_memory(
250250- connection : io_connect_t;
251251- in memory_type : uint32_t;
252252- in into_task : task_t;
253253-#if IOKIT_ALL_IPC
254254- inout address : uint32_t;
255255- inout size : uint32_t;
256256-#else
257257- inout address : vm_address_t;
258258- inout size : vm_size_t;
259259-#endif
260260- in flags : uint32_t
261261- );
262262-#else
263263-skip;
264264-skip;
265265-#endif
266266-267267-routine io_connect_add_client(
268268- connection : io_connect_t;
269269- in connect_to : io_connect_t
270270- );
271271-272272-routine io_connect_set_properties(
273273- connection : io_connect_t;
274274- in properties : io_buf_ptr_t, physicalcopy;
275275- out result : kern_return_t
276276- );
277277-278278-#if IOKIT_ALL_IPC || __ILP32__
279279-routine io_connect_method_scalarI_scalarO(
280280- connection : io_connect_t;
281281- in selector : uint32_t;
282282- in input : io_scalar_inband_t;
283283- out output : io_scalar_inband_t, CountInOut
284284- );
285285-286286-routine io_connect_method_scalarI_structureO(
287287- connection : io_connect_t;
288288- in selector : uint32_t;
289289- in input : io_scalar_inband_t;
290290- out output : io_struct_inband_t, CountInOut
291291- );
292292-293293-routine io_connect_method_scalarI_structureI(
294294- connection : io_connect_t;
295295- in selector : uint32_t;
296296- in input : io_scalar_inband_t;
297297- in inputStruct : io_struct_inband_t
298298- );
299299-300300-routine io_connect_method_structureI_structureO(
301301- connection : io_connect_t;
302302- in selector : uint32_t;
303303- in input : io_struct_inband_t;
304304- out output : io_struct_inband_t, CountInOut
305305- );
306306-#else
307307-skip;
308308-skip;
309309-skip;
310310-skip;
311311-#endif
312312-313313-routine io_registry_entry_get_path(
314314- registry_entry : io_object_t;
315315- in plane : io_name_t;
316316- out path : io_string_t
317317- );
318318-319319-routine io_registry_get_root_entry(
320320- master_port : mach_port_t;
321321- out root : io_object_t
322322- );
323323-324324-routine io_registry_entry_set_properties(
325325- registry_entry : io_object_t;
326326- in properties : io_buf_ptr_t, physicalcopy;
327327- out result : kern_return_t
328328- );
329329-330330-routine io_registry_entry_in_plane(
331331- registry_entry : io_object_t;
332332- in plane : io_name_t;
333333- out inPlane : boolean_t
334334- );
335335-336336-routine io_object_get_retain_count(
337337- object : io_object_t;
338338- out retainCount : uint32_t
339339- );
340340-341341-routine io_service_get_busy_state(
342342- service : io_object_t;
343343- out busyState : uint32_t
344344- );
345345-346346-routine io_service_wait_quiet(
347347- service : io_object_t;
348348- wait_time : mach_timespec_t
349349- );
350350-351351-routine io_registry_entry_create_iterator(
352352- registry_entry : io_object_t;
353353- in plane : io_name_t;
354354- in options : uint32_t;
355355- out iterator : io_object_t
356356- );
357357-358358-routine io_iterator_is_valid(
359359- iterator : io_object_t;
360360- out is_valid : boolean_t
361361- );
362362-363363-skip;
364364-/* was routine io_make_matching(
365365- master_port : mach_port_t;
366366- in of_type : uint32_t;
367367- in options : uint32_t;
368368- in input : io_struct_inband_t;
369369- out matching : io_string_t
370370- );
371371-*/
372372-373373-routine io_catalog_send_data(
374374- master_port : mach_port_t;
375375- in flag : uint32_t;
376376- in inData : io_buf_ptr_t;
377377- out result : kern_return_t
378378- );
379379-380380-routine io_catalog_terminate(
381381- master_port : mach_port_t;
382382- in flag : uint32_t;
383383- in name : io_name_t
384384- );
385385-386386-routine io_catalog_get_data(
387387- master_port : mach_port_t;
388388- in flag : uint32_t;
389389- out outData : io_buf_ptr_t
390390- );
391391-392392-routine io_catalog_get_gen_count(
393393- master_port : mach_port_t;
394394- out genCount : uint32_t
395395- );
396396-397397-routine io_catalog_module_loaded(
398398- master_port : mach_port_t;
399399- in name : io_name_t
400400- );
401401-402402-routine io_catalog_reset(
403403- master_port : mach_port_t;
404404- in flag : uint32_t
405405- );
406406-407407-routine io_service_request_probe(
408408- service : io_object_t;
409409- in options : uint32_t
410410- );
411411-412412-routine io_registry_entry_get_name_in_plane(
413413- registry_entry : io_object_t;
414414- in plane : io_name_t;
415415- out name : io_name_t
416416- );
417417-418418-routine io_service_match_property_table(
419419- service : io_object_t;
420420- in matching : io_string_t;
421421- out matches : boolean_t
422422- );
423423-424424-#if IOKIT_ALL_IPC || __ILP32__
425425-routine io_async_method_scalarI_scalarO(
426426- connection : io_connect_t;
427427- in wake_port : mach_port_make_send_t;
428428- in reference : io_async_ref_t;
429429- in selector : uint32_t;
430430- in input : io_scalar_inband_t;
431431- out output : io_scalar_inband_t, CountInOut
432432- );
433433-routine io_async_method_scalarI_structureO(
434434- connection : io_connect_t;
435435- in wake_port : mach_port_make_send_t;
436436- in reference : io_async_ref_t;
437437- in selector : uint32_t;
438438- in input : io_scalar_inband_t;
439439- out output : io_struct_inband_t, CountInOut
440440- );
441441-routine io_async_method_scalarI_structureI(
442442- connection : io_connect_t;
443443- in wake_port : mach_port_make_send_t;
444444- in reference : io_async_ref_t;
445445- in selector : uint32_t;
446446- in input : io_scalar_inband_t;
447447- in inputStruct : io_struct_inband_t
448448- );
449449-routine io_async_method_structureI_structureO(
450450- connection : io_connect_t;
451451- in wake_port : mach_port_make_send_t;
452452- in reference : io_async_ref_t;
453453- in selector : uint32_t;
454454- in input : io_struct_inband_t;
455455- out output : io_struct_inband_t, CountInOut
456456- );
457457-#else
458458-skip;
459459-skip;
460460-skip;
461461-skip;
462462-#endif
463463-464464-#if IOKIT_ALL_IPC || __ILP32__
465465-routine io_service_add_notification(
466466- master_port : mach_port_t;
467467- in notification_type : io_name_t;
468468- in matching : io_string_t;
469469- in wake_port : mach_port_make_send_t;
470470- in reference : io_async_ref_t;
471471- out notification : io_object_t
472472- );
473473-routine io_service_add_interest_notification(
474474- service : io_object_t;
475475- in type_of_interest : io_name_t;
476476- in wake_port : mach_port_make_send_t;
477477- in reference : io_async_ref_t;
478478- out notification : io_object_t
479479- );
480480-routine io_service_acknowledge_notification(
481481- service : io_object_t;
482482- in notify_ref : natural_t;
483483- in response : natural_t
484484- );
485485-#else
486486-skip;
487487-skip;
488488-skip;
489489-#endif
490490-491491-routine io_connect_get_notification_semaphore(
492492- connection : io_connect_t;
493493- in notification_type : natural_t;
494494- out semaphore : semaphore_t
495495- );
496496-497497-#if IOKIT_ALL_IPC || __ILP32__
498498-routine io_connect_unmap_memory(
499499- connection : io_connect_t;
500500- in memory_type : uint32_t;
501501- in into_task : task_t;
502502-#if IOKIT_ALL_IPC
503503- in address : uint32_t
504504-#else
505505- in address : vm_address_t
506506-#endif
507507- );
508508-#else
509509-skip;
510510-#endif
511511-512512-routine io_registry_entry_get_location_in_plane(
513513- registry_entry : io_object_t;
514514- in plane : io_name_t;
515515- out location : io_name_t
516516- );
517517-518518-routine io_registry_entry_get_property_recursively(
519519- registry_entry : io_object_t;
520520- in plane : io_name_t;
521521- in property_name : io_name_t;
522522- in options : uint32_t;
523523- out properties : io_buf_ptr_t, physicalcopy
524524- );
525525-526526-routine io_service_get_state(
527527- service : io_object_t;
528528- out state : uint64_t;
529529- out busy_state : uint32_t;
530530- out accumulated_busy_time : uint64_t
531531- );
532532-533533-routine io_service_get_matching_services_ool(
534534- master_port : mach_port_t;
535535- in matching : io_buf_ptr_t, physicalcopy;
536536- out result : kern_return_t;
537537- out existing : io_object_t
538538- );
539539-540540-routine io_service_match_property_table_ool(
541541- service : io_object_t;
542542- in matching : io_buf_ptr_t, physicalcopy;
543543- out result : kern_return_t;
544544- out matches : boolean_t
545545- );
546546-547547-#if IOKIT_ALL_IPC || __ILP32__
548548-routine io_service_add_notification_ool(
549549- master_port : mach_port_t;
550550- in notification_type : io_name_t;
551551- in matching : io_buf_ptr_t, physicalcopy;
552552- in wake_port : mach_port_make_send_t;
553553- in reference : io_async_ref_t;
554554- out result : kern_return_t;
555555- out notification : io_object_t
556556- );
557557-#else
558558-skip;
559559-#endif
560560-561561-routine io_object_get_superclass(
562562- master_port : mach_port_t;
563563- in obj_name : io_name_t;
564564- out class_name : io_name_t
565565- );
566566-567567-routine io_object_get_bundle_identifier(
568568- master_port : mach_port_t;
569569- in obj_name : io_name_t;
570570- out class_name : io_name_t
571571- );
572572-573573-routine io_service_open_extended(
574574- service : io_object_t;
575575- in owningTask : task_t;
576576- in connect_type : uint32_t;
577577- in ndr : NDR_record_t;
578578- in properties : io_buf_ptr_t, physicalcopy;
579579- out result : kern_return_t;
580580- out connection : io_connect_t
581581- );
582582-583583-584584-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
585585-586586-routine io_connect_map_memory_into_task(
587587- connection : io_connect_t;
588588- in memory_type : uint32_t;
589589- in into_task : task_t;
590590- inout address : mach_vm_address_t;
591591- inout size : mach_vm_size_t;
592592- in flags : uint32_t
593593- );
594594-595595-routine io_connect_unmap_memory_from_task(
596596- connection : io_connect_t;
597597- in memory_type : uint32_t;
598598- in from_task : task_t;
599599- in address : mach_vm_address_t
600600- );
601601-602602-routine io_connect_method(
603603- connection : io_connect_t;
604604- in selector : uint32_t;
605605-606606- in scalar_input : io_scalar_inband64_t;
607607- in inband_input : io_struct_inband_t;
608608- in ool_input : mach_vm_address_t;
609609- in ool_input_size : mach_vm_size_t;
610610-611611- out inband_output : io_struct_inband_t, CountInOut;
612612- out scalar_output : io_scalar_inband64_t, CountInOut;
613613- in ool_output : mach_vm_address_t;
614614- inout ool_output_size : mach_vm_size_t
615615- );
616616-617617-routine io_connect_async_method(
618618- connection : io_connect_t;
619619- in wake_port : mach_port_make_send_t;
620620- in reference : io_async_ref64_t;
621621- in selector : uint32_t;
622622-623623- in scalar_input : io_scalar_inband64_t;
624624- in inband_input : io_struct_inband_t;
625625- in ool_input : mach_vm_address_t;
626626- in ool_input_size : mach_vm_size_t;
627627-628628- out inband_output : io_struct_inband_t, CountInOut;
629629- out scalar_output : io_scalar_inband64_t, CountInOut;
630630- in ool_output : mach_vm_address_t;
631631- inout ool_output_size : mach_vm_size_t
632632- );
633633-634634-635635-#if IOKIT_ALL_IPC || __LP64__
636636-637637-#if IOKIT_ALL_IPC
638638-#define FUNC_NAME(name) name ## _64
639639-#else
640640-#define FUNC_NAME(name) name
641641-#endif
642642-643643-routine FUNC_NAME(io_connect_set_notification_port)(
644644- connection : io_connect_t;
645645- in notification_type : uint32_t;
646646- in port : mach_port_make_send_t;
647647- in reference : io_user_reference_t
648648- );
649649-650650-routine FUNC_NAME(io_service_add_notification)(
651651- master_port : mach_port_t;
652652- in notification_type : io_name_t;
653653- in matching : io_string_t;
654654- in wake_port : mach_port_make_send_t;
655655- in reference : io_async_ref64_t;
656656- out notification : io_object_t
657657- );
658658-659659-routine FUNC_NAME(io_service_add_interest_notification)(
660660- service : io_object_t;
661661- in type_of_interest : io_name_t;
662662- in wake_port : mach_port_make_send_t;
663663- in reference : io_async_ref64_t;
664664- out notification : io_object_t
665665- );
666666-667667-routine FUNC_NAME(io_service_add_notification_ool)(
668668- master_port : mach_port_t;
669669- in notification_type : io_name_t;
670670- in matching : io_buf_ptr_t, physicalcopy;
671671- in wake_port : mach_port_make_send_t;
672672- in reference : io_async_ref64_t;
673673- out result : kern_return_t;
674674- out notification : io_object_t
675675- );
676676-677677-#else
678678-679679- skip;
680680- skip;
681681- skip;
682682- skip;
683683-684684-#endif /* IOKIT_ALL_IPC || __LP64__ */
685685-686686-routine io_registry_entry_get_registry_entry_id(
687687- registry_entry : io_object_t;
688688- out entry_id : uint64_t
689689- );
690690-691691-routine io_connect_method_var_output(
692692- connection : io_connect_t;
693693- in selector : uint32_t;
694694-695695- in scalar_input : io_scalar_inband64_t;
696696- in inband_input : io_struct_inband_t;
697697- in ool_input : mach_vm_address_t;
698698- in ool_input_size : mach_vm_size_t;
699699-700700- out inband_output : io_struct_inband_t, CountInOut;
701701- out scalar_output : io_scalar_inband64_t, CountInOut;
702702- out var_output : io_buf_ptr_t, physicalcopy
703703- );
704704-705705-routine io_service_get_matching_service(
706706- master_port : mach_port_t;
707707- in matching : io_string_t;
708708- out service : io_object_t
709709- );
710710-711711-routine io_service_get_matching_service_ool(
712712- master_port : mach_port_t;
713713- in matching : io_buf_ptr_t, physicalcopy;
714714- out result : kern_return_t;
715715- out service : io_object_t
716716- );
717717-718718-routine io_service_get_authorization_id(
719719- service : io_object_t;
720720- out authorization_id : uint64_t
721721- );
722722-723723-routine io_service_set_authorization_id(
724724- service : io_object_t;
725725- in authorization_id : uint64_t
726726- );
727727-728728-/* */
729729-730730-routine io_server_version(
731731- master_port : mach_port_t;
732732- out version : uint64_t
733733- );
734734-735735-routine io_registry_entry_get_properties_bin(
736736- registry_entry : io_object_t;
737737- out properties : io_buf_ptr_t, physicalcopy
738738- );
739739-740740-routine io_registry_entry_get_property_bin(
741741- registry_entry : io_object_t;
742742- in plane : io_name_t;
743743- in property_name : io_name_t;
744744- in options : uint32_t;
745745- out properties : io_buf_ptr_t, physicalcopy
746746- );
747747-748748-routine io_service_get_matching_service_bin(
749749- master_port : mach_port_t;
750750- in matching : io_struct_inband_t;
751751- out service : io_object_t
752752- );
753753-754754-routine io_service_get_matching_services_bin(
755755- master_port : mach_port_t;
756756- in matching : io_struct_inband_t;
757757- out existing : io_object_t
758758- );
759759-760760-routine io_service_match_property_table_bin(
761761- service : io_object_t;
762762- in matching : io_struct_inband_t;
763763- out matches : boolean_t
764764- );
765765-766766-#if IOKIT_ALL_IPC || __ILP32__
767767-routine io_service_add_notification_bin(
768768- master_port : mach_port_t;
769769- in notification_type : io_name_t;
770770- in matching : io_struct_inband_t;
771771- in wake_port : mach_port_make_send_t;
772772- in reference : io_async_ref_t;
773773- out notification : io_object_t
774774- );
775775-#else
776776-skip;
777777-#endif
778778-779779-#if IOKIT_ALL_IPC || __LP64__
780780-routine FUNC_NAME(io_service_add_notification_bin)(
781781- master_port : mach_port_t;
782782- in notification_type : io_name_t;
783783- in matching : io_struct_inband_t;
784784- in wake_port : mach_port_make_send_t;
785785- in reference : io_async_ref64_t;
786786- out notification : io_object_t
787787- );
788788-#else
789789-skip;
790790-#endif
791791-792792-#if !IOKITSIMD
793793-794794-routine io_registry_entry_get_path_ool(
795795- registry_entry : io_object_t;
796796- in plane : io_name_t;
797797- out path : io_string_inband_t;
798798- out path_ool : io_buf_ptr_t, physicalcopy
799799- );
800800-801801-routine io_registry_entry_from_path_ool(
802802- master_port : mach_port_t;
803803- in path : io_string_inband_t;
804804- in path_ool : io_buf_ptr_t, physicalcopy;
805805- out result : kern_return_t;
806806- out registry_entry : io_object_t
807807- );
808808-809809-#endif
810810-811811-routine io_device_tree_entry_exists_with_name(
812812- master_port : mach_port_t;
813813- in name : io_name_t;
814814- out exists : boolean_t
815815- );
816816-817817-routine io_registry_entry_get_properties_bin_buf(
818818- registry_entry : io_object_t;
819819- in buf : mach_vm_address_t;
820820- inout bufsize : mach_vm_size_t;
821821- out properties : io_buf_ptr_t, physicalcopy
822822- );
823823-824824-routine io_registry_entry_get_property_bin_buf(
825825- registry_entry : io_object_t;
826826- in plane : io_name_t;
827827- in property_name : io_name_t;
828828- in options : uint32_t;
829829- in buf : mach_vm_address_t;
830830- inout bufsize : mach_vm_size_t;
831831- out properties : io_buf_ptr_t, physicalcopy
832832- );
833833-834834-#endif /* IOKIT */
835835-836836-/* vim: set ft=c : */
-107
src/kernel/libsyscall/device/device_types.defs
···11-/*
22- * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved.
33- *
44- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. The rights granted to you under the License
1010- * may not be used to create, or enable the creation or redistribution of,
1111- * unlawful or unlicensed copies of an Apple operating system, or to
1212- * circumvent, violate, or enable the circumvention or violation of, any
1313- * terms of an Apple operating system software license agreement.
1414- *
1515- * Please obtain a copy of the License at
1616- * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717- *
1818- * The Original Code and all software distributed under the License are
1919- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323- * Please see the License for the specific language governing rights and
2424- * limitations under the License.
2525- *
2626- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727- */
2828-/*
2929- * @OSF_COPYRIGHT@
3030- */
3131-/*
3232- * Mach Operating System
3333- * Copyright (c) 1991,1990,1989 Carnegie Mellon University
3434- * All Rights Reserved.
3535- *
3636- * Permission to use, copy, modify and distribute this software and its
3737- * documentation is hereby granted, provided that both the copyright
3838- * notice and this permission notice appear in all copies of the
3939- * software, derivative works or modified versions, and any portions
4040- * thereof, and that both notices appear in supporting documentation.
4141- *
4242- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
4343- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
4444- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
4545- *
4646- * Carnegie Mellon requests users of this software to return to
4747- *
4848- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
4949- * School of Computer Science
5050- * Carnegie Mellon University
5151- * Pittsburgh PA 15213-3890
5252- *
5353- * any improvements or extensions that they make and grant Carnegie Mellon
5454- * the rights to redistribute these changes.
5555- */
5656-/*
5757- */
5858-/*
5959- * Author: David B. Golub, Carnegie Mellon University
6060- * Date: 3/89
6161- *
6262- * Common definitions for device interface types.
6363- */
6464-6565-#ifndef _DEVICE_DEVICE_TYPES_DEFS_
6666-#define _DEVICE_DEVICE_TYPES_DEFS_
6767-6868-/*
6969- * Basic types
7070- */
7171-7272-#include <mach/std_types.defs>
7373-#include <mach/mach_types.defs>
7474-7575-type recnum_t = uint32_t;
7676-type dev_mode_t = uint32_t;
7777-type dev_flavor_t = uint32_t;
7878-type dev_name_t = c_string[*:128];
7979-type dev_status_t = array[*:1024] of int;
8080-type io_buf_len_t = integer_t;
8181-type io_buf_ptr_t = ^array[] of MACH_MSG_TYPE_INTEGER_8;
8282-type io_buf_ptr_inband_t= array[*:128] of char;
8383-type filter_t = short;
8484-type filter_array_t = array[*:64] of filter_t;
8585-8686-type device_t = mach_port_t
8787- ctype: mach_port_t
8888-#if KERNEL_SERVER
8989- intran: device_t dev_port_lookup(mach_port_t)
9090- outtran: mach_port_t convert_device_to_port(device_t)
9191- destructor: device_deallocate(device_t)
9292-#endif /* KERNEL_SERVER */
9393- ;
9494-9595-type io_done_queue_t = mach_port_t
9696- ctype: mach_port_t
9797-#if KERNEL_SERVER
9898- intran: io_done_queue_t io_done_queue_port_lookup(mach_port_t)
9999- outtran: mach_port_t convert_io_done_queue_to_port(io_done_queue_t)
100100-#endif /* KERNEL_SERVER */
101101- ;
102102-103103-import <device/device_types.h>;
104104-105105-#endif /* _DEVICE_DEVICE_TYPES_DEFS_ */
106106-107107-/* vim: set ft=c : */
···4545const char *mach_task_special_port_description(int offset);
46464747/*
4848+ * Returns a string describing the thread special port offset provided, or NULL if
4949+ * the provided offset is not a thread special port offset.
5050+ */
5151+const char *mach_thread_special_port_description(int offset);
5252+5353+/*
4854 * Returns the port for the given identifier of a host special port. For
4955 * instance, passing "HOST_PRIV_PORT" would return 1.
5056 *
···5864 * Returns -1 on error.
5965 */
6066int mach_task_special_port_for_id(const char *id);
6767+6868+/*
6969+ * Returns the port for the given identifier of a thread special port.
7070+ *
7171+ * Returns -1 on error.
7272+ */
7373+int mach_thread_special_port_for_id(const char *id);
61746275__END_DECLS
6376
+105
src/kernel/libsyscall/mach/mach_eventlink.c
···11+/*
22+ * Copyright (c) 2019 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+2929+#include <mach/boolean.h>
3030+#include <mach/message.h>
3131+#include <mach/kern_return.h>
3232+#include <mach/mach_traps.h>
3333+#include <mach/mach_types.h>
3434+#include <mach/clock_types.h>
3535+#include <mach/mach_eventlink_types.h>
3636+3737+/*
3838+ * __mach_eventlink* calls are bsd syscalls instead of mach traps because
3939+ * they need to return a 64 bit value in register and mach traps currently
4040+ * does not allow 64 bit return values.
4141+ */
4242+uint64_t
4343+__mach_eventlink_signal(
4444+ mach_port_t eventlink_port,
4545+ uint64_t signal_count);
4646+4747+uint64_t
4848+__mach_eventlink_wait_until(
4949+ mach_port_t eventlink_port,
5050+ uint64_t wait_signal_count,
5151+ uint64_t deadline,
5252+ kern_clock_id_t clock_id,
5353+ mach_eventlink_signal_wait_option_t option);
5454+5555+uint64_t
5656+__mach_eventlink_signal_wait_until(
5757+ mach_port_t eventlink_port,
5858+ uint64_t wait_count,
5959+ uint64_t signal_count,
6060+ uint64_t deadline,
6161+ kern_clock_id_t clock_id,
6262+ mach_eventlink_signal_wait_option_t option);
6363+6464+kern_return_t
6565+mach_eventlink_signal(
6666+ mach_port_t eventlink_port,
6767+ uint64_t signal_count)
6868+{
6969+ uint64_t retval = __mach_eventlink_signal(eventlink_port, signal_count);
7070+7171+ return decode_eventlink_error_from_retval(retval);
7272+}
7373+7474+kern_return_t
7575+mach_eventlink_wait_until(
7676+ mach_port_t eventlink_port,
7777+ uint64_t *wait_count_ptr,
7878+ mach_eventlink_signal_wait_option_t option,
7979+ kern_clock_id_t clock_id,
8080+ uint64_t deadline)
8181+{
8282+ uint64_t retval;
8383+8484+ retval = __mach_eventlink_wait_until(eventlink_port, *wait_count_ptr,
8585+ deadline, clock_id, option);
8686+8787+ *wait_count_ptr = decode_eventlink_count_from_retval(retval);
8888+ return decode_eventlink_error_from_retval(retval);
8989+}
9090+9191+kern_return_t
9292+mach_eventlink_signal_wait_until(
9393+ mach_port_t eventlink_port,
9494+ uint64_t *wait_count_ptr,
9595+ uint64_t signal_count,
9696+ mach_eventlink_signal_wait_option_t option,
9797+ kern_clock_id_t clock_id,
9898+ uint64_t deadline)
9999+{
100100+ uint64_t retval;
101101+ retval = __mach_eventlink_signal_wait_until(eventlink_port, *wait_count_ptr,
102102+ signal_count, deadline, clock_id, option);
103103+ *wait_count_ptr = decode_eventlink_count_from_retval(retval);
104104+ return decode_eventlink_error_from_retval(retval);
105105+}
+96
src/kernel/libsyscall/mach/mach_eventlink.defs
···11+/*
22+ * Copyright (c) 2019 Apple Computer, Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+2929+import <mach/mach_eventlink_types.h>;
3030+3131+/*
3232+ * Libsyscall mach_eventlink.defs should include mach/mach_eventlink.defs exported by
3333+ * kernel, putting a copy of the file instead to avoid the build failure due to
3434+ * ordering issues. Once the mach/mach_eventlink.defs is in build, replace the content
3535+ * on defs file with #inlude <mach/mach_eventlink.defs>.
3636+ */
3737+subsystem
3838+#if KERNEL_SERVER
3939+ KernelServer
4040+#endif /* KERNEL_SERVER */
4141+ mach_eventlink 716200;
4242+4343+#include <mach/std_types.defs>
4444+#include <mach/mach_types.defs>
4545+#include <mach/clock_types.defs>
4646+4747+#ifndef _MACH_MACH_EVENTLINK_TYPE_DEFS
4848+#define _MACH_MACH_EVENTLINK_TYPE_DEFS
4949+5050+type eventlink_t = mach_port_t
5151+ ctype: mach_port_t
5252+#if KERNEL_SERVER
5353+ intran: ipc_eventlink_t convert_port_to_eventlink(mach_port_t)
5454+ destructor: ipc_eventlink_deallocate(ipc_eventlink_t)
5555+#endif /* KERNEL_SERVER */
5656+ ;
5757+5858+type eventlink_consume_ref_t = mach_port_move_send_t
5959+ ctype: mach_port_t
6060+#if KERNEL_SERVER
6161+ intran: ipc_eventlink_t convert_port_to_eventlink(mach_port_t)
6262+ destructor: ipc_eventlink_deallocate(ipc_eventlink_t)
6363+#endif /* KERNEL_SERVER */
6464+ ;
6565+6666+type eventlink_port_pair_t = array[2] of mach_port_t;
6767+type mach_eventlink_create_option_t = uint32_t;
6868+type mach_eventlink_associate_option_t = uint32_t;
6969+type mach_eventlink_disassociate_option_t = uint32_t;
7070+type mach_eventlink_signal_wait_option_t = uint32_t;
7171+7272+#endif /* _MACH_MACH_EVENTLINK_TYPE_DEFS */
7373+7474+routine mach_eventlink_create(
7575+ task : task_t;
7676+ option : mach_eventlink_create_option_t;
7777+ out eventlink_pair : eventlink_port_pair_t);
7878+7979+routine mach_eventlink_destroy(
8080+ eventlink : eventlink_consume_ref_t);
8181+8282+8383+routine mach_eventlink_associate(
8484+ eventlink : eventlink_t;
8585+ thread : thread_t;
8686+ copyin_addr_wait : mach_vm_address_t;
8787+ copyin_mask_wait : uint64_t;
8888+ copyin_addr_signal : mach_vm_address_t;
8989+ copyin_mask_signal : uint64_t;
9090+ option : mach_eventlink_associate_option_t);
9191+9292+routine mach_eventlink_disassociate(
9393+ eventlink : eventlink_t;
9494+ option : mach_eventlink_disassociate_option_t);
9595+9696+ /* vim: set ft=c : */
···4242int _mach_snprintf(char *buffer, int length, const char *fmt, ...) __printflike(3, 4);
4343int _mach_vsnprintf(char *buffer, int length, const char *fmt, va_list ap) __printflike(3, 0);
44444545-// Actually in memcpy.c but MIG likes to include string.h
4545+// These declarations are just for MIG, other users should include string/strings.h
4646+// These symbols are defined in _libc_funcptr.c
46474748void *memcpy(void *dst0, const void *src0, size_t length);
4949+void *memset(void *dst0, int c0, size_t length);
5050+void bzero(void *dst0, size_t length);
48514952#endif /* _STRING_H_ */
···6464 case F_ADDFILESIGS:
6565 case F_ADDFILESIGS_FOR_DYLD_SIM:
6666 case F_ADDFILESIGS_RETURN:
6767+ case F_ADDFILESIGS_INFO:
6868+ case F_ADDFILESUPPL:
6769 case F_FINDSIGS:
6870 case F_TRANSCODEKEY:
6971 case F_TRIM_ACTIVE_FILE:
7072 case F_SPECULATIVE_READ:
7173 case F_CHECK_LV:
7474+ case F_GETSIGSINFO:
7275 arg = va_arg(ap, void *);
7376 break;
7477 default:
+26
src/kernel/libsyscall/wrappers/cancelable/open.c
···11+/*
22+ * Copyright (c) 2020 Apple Inc. All rights reserved.
33+ *
44+ * @APPLE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. Please obtain a copy of the License at
1010+ * http://www.opensource.apple.com/apsl/ and read it before using this
1111+ * file.
1212+ *
1313+ * The Original Code and all software distributed under the License are
1414+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1515+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
1616+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
1717+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
1818+ * Please see the License for the specific language governing rights and
1919+ * limitations under the License.
2020+ *
2121+ * @APPLE_LICENSE_HEADER_END@
2222+ */
2323+2424+#define VARIANT_CANCELABLE
2525+2626+#include "../open-base.c"
+1-6
src/kernel/libsyscall/wrappers/getiopolicy_np.c
···3333 int policy, error;
3434 struct _iopol_param_t iop_param;
35353636- if ((iotype != IOPOL_TYPE_DISK && iotype != IOPOL_TYPE_VFS_ATIME_UPDATES && iotype != IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES) ||
3737- (scope != IOPOL_SCOPE_PROCESS && scope != IOPOL_SCOPE_THREAD)) {
3838- errno = EINVAL;
3939- policy = -1;
4040- goto exit;
4141- }
3636+ /* Do not sanity check iotype and scope, leave it to kernel. */
42374338 iop_param.iop_scope = scope;
4439 iop_param.iop_iotype = iotype;
···8484bool
8585kdebug_is_enabled(uint32_t debugid)
8686{
8787- uint32_t state = *((volatile uint32_t *)(uintptr_t)(_COMM_PAGE_KDEBUG_ENABLE));
8787+ uint32_t state = COMM_PAGE_READ(uint32_t, KDEBUG_ENABLE);
88888989 if (state == 0) {
9090 return FALSE;
···119119bool
120120kdebug_using_continuous_time(void)
121121{
122122- uint32_t state = *((volatile uint32_t *)(uintptr_t)(_COMM_PAGE_KDEBUG_ENABLE));
122122+ uint32_t state = COMM_PAGE_READ(uint32_t, KDEBUG_ENABLE);
123123 return state & KDEBUG_ENABLE_CONT_TIME;
124124}
125125
-54
src/kernel/libsyscall/wrappers/legacy/open.c
···11-/*
22- * Copyright (c) 2005, 2009 Apple Inc. All rights reserved.
33- *
44- * @APPLE_LICENSE_HEADER_START@
55- *
66- * This file contains Original Code and/or Modifications of Original Code
77- * as defined in and that are subject to the Apple Public Source License
88- * Version 2.0 (the 'License'). You may not use this file except in
99- * compliance with the License. Please obtain a copy of the License at
1010- * http://www.opensource.apple.com/apsl/ and read it before using this
1111- * file.
1212- *
1313- * The Original Code and all software distributed under the License are
1414- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1515- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
1616- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
1717- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
1818- * Please see the License for the specific language governing rights and
1919- * limitations under the License.
2020- *
2121- * @APPLE_LICENSE_HEADER_END@
2222- */
2323-2424-#ifndef NO_SYSCALL_LEGACY
2525-2626-#define _NONSTD_SOURCE
2727-#include <sys/cdefs.h>
2828-2929-#include <sys/types.h>
3030-#include <sys/fcntl.h>
3131-#include <stdarg.h>
3232-3333-int __open_nocancel(const char *path, int flags, mode_t mode);
3434-3535-/*
3636- * open stub: The legacy interface never automatically associated a controlling
3737- * tty, so we always pass O_NOCTTY.
3838- */
3939-int
4040-open(const char *path, int flags, ...)
4141-{
4242- mode_t mode = 0;
4343-4444- if (flags & O_CREAT) {
4545- va_list ap;
4646- va_start(ap, flags);
4747- // compiler warns to pass int (not mode_t) to va_arg
4848- mode = va_arg(ap, int);
4949- va_end(ap);
5050- }
5151- return __open_nocancel(path, flags | O_NOCTTY, mode);
5252-}
5353-5454-#endif /* NO_SYSCALL_LEGACY */
···3131#include <sys/resource.h>
3232#include <stdint.h>
3333#include <stdbool.h>
3434+#include <mach/message.h> /* for audit_token_t */
34353536#include <sys/proc_info.h>
36373738#include <Availability.h>
3939+#include <os/availability.h>
38403941/*
4042 * This header file contains private interfaces to obtain process information.
···98100int proc_regionfilename(int pid, uint64_t address, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
99101int proc_kmsgbuf(void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
100102int proc_pidpath(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
103103+int proc_pidpath_audittoken(audit_token_t *audittoken, void * buffer, uint32_t buffersize) API_AVAILABLE(macos(10.16), ios(14.0), watchos(7.0), tvos(14.0));
101104int proc_libversion(int *major, int * minor) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
102105103106/*
···125128int proc_clear_dirty(pid_t pid, uint32_t flags);
126129127130int proc_terminate(pid_t pid, int *sig);
131131+132132+/*
133133+ * NO_SMT means that on an SMT CPU, this thread must be scheduled alone,
134134+ * with the paired CPU idle.
135135+ *
136136+ * Set NO_SMT on the current proc (all existing and future threads)
137137+ * This attribute is inherited on fork and exec
138138+ */
139139+int proc_set_no_smt(void) __API_AVAILABLE(macos(10.16));
140140+141141+/* Set NO_SMT on the current thread */
142142+int proc_setthread_no_smt(void) __API_AVAILABLE(macos(10.16));
143143+144144+/*
145145+ * CPU Security Mitigation APIs
146146+ *
147147+ * Set CPU security mitigation on the current proc (all existing and future threads)
148148+ * This attribute is inherited on fork and exec
149149+ */
150150+int proc_set_csm(uint32_t flags) __API_AVAILABLE(macos(10.16));
151151+152152+/* Set CPU security mitigation on the current thread */
153153+int proc_setthread_csm(uint32_t flags) __API_AVAILABLE(macos(10.16));
154154+155155+/*
156156+ * flags for CPU Security Mitigation APIs
157157+ * PROC_CSM_ALL should be used in most cases,
158158+ * the individual flags are provided only for performance evaluation etc
159159+ */
160160+#define PROC_CSM_ALL 0x0001 /* Set all available mitigations */
161161+#define PROC_CSM_NOSMT 0x0002 /* Set NO_SMT - see above */
162162+#define PROC_CSM_TECS 0x0004 /* Execute VERW on every return to user mode */
128163129164#ifdef PRIVATE
130165#include <sys/event.h>
···6464 if (__gettimeofday_with_mach(&tv, NULL, &tbr) < 0) {
6565 return KERN_FAILURE;
6666 } else if (tbr == 0) {
6767-#if !(TARGET_OS_IPHONE && !TARGET_OS_SIMULATOR)
6868- // On an old kernel, likely chroot'ed. (remove next year)
6969- tbr = mach_absolute_time();
7070-#else
7167 __builtin_trap();
7272-#endif
7368 }
7469 }
7570
+164
src/kernel/libsyscall/wrappers/open-base.c
···11+/*
22+ * Copyright (c) 2020 Apple Inc. All rights reserved.
33+ *
44+ * @APPLE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. Please obtain a copy of the License at
1010+ * http://www.opensource.apple.com/apsl/ and read it before using this
1111+ * file.
1212+ *
1313+ * The Original Code and all software distributed under the License are
1414+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1515+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
1616+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
1717+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
1818+ * Please see the License for the specific language governing rights and
1919+ * limitations under the License.
2020+ *
2121+ * @APPLE_LICENSE_HEADER_END@
2222+ */
2323+2424+#include <fcntl.h>
2525+#include <stdarg.h>
2626+#include <sys/param.h>
2727+#include <sys/types.h>
2828+#include <TargetConditionals.h>
2929+3030+#if !defined(__i386__)
3131+3232+#if TARGET_OS_OSX
3333+#include <stdbool.h>
3434+3535+/*
3636+ * On macOS we have support for shimming calls to open the SystemVersion plist.
3737+ * This support is enabled for specific (generally older) binaries from
3838+ * libSystem_initializer()/__libkernel_init_late() by populating these function pointers
3939+ * with the corresponding functions built into libsyscall_dynamic (see open-compat-shim.c).
4040+ */
4141+extern bool (*system_version_compat_check_path_suffix)(const char *orig_path);
4242+extern int (*system_version_compat_open_shim)(int opened_fd, int openat_fd, const char *orig_path, int oflag, mode_t mode,
4343+ int (*close_syscall)(int), int (*open_syscall)(const char *, int, mode_t),
4444+ int (*openat_syscall)(int, const char *, int, mode_t),
4545+ int (*fcntl_syscall)(int, int, long));
4646+#endif /* TARGET_OS_OSX */
4747+4848+#ifdef VARIANT_CANCELABLE
4949+int __open(const char *path, int oflag, mode_t mode);
5050+int __openat(int fd, const char *path, int oflag, mode_t mode);
5151+5252+#define OPEN_SYSCALL __open
5353+#define OPENAT_SYSCALL __openat
5454+5555+#if TARGET_OS_OSX
5656+int __fcntl(int fd, int cmd, long arg);
5757+int close(int fd);
5858+5959+#define FCNTL_SYSCALL __fcntl
6060+#define CLOSE_SYSCALL close
6161+#endif /* TARGET_OS_OSX */
6262+6363+#else /* VARIANT_CANCELABLE */
6464+int __open_nocancel(const char *path, int oflag, mode_t mode);
6565+int __openat_nocancel(int fd, const char *path, int oflag, mode_t mode);
6666+6767+#define OPEN_SYSCALL __open_nocancel
6868+#define OPENAT_SYSCALL __openat_nocancel
6969+7070+#if TARGET_OS_OSX
7171+int __fcntl_nocancel(int fd, int cmd, long arg);
7272+int __close_nocancel(int fd);
7373+7474+#define FCNTL_SYSCALL __fcntl_nocancel
7575+#define CLOSE_SYSCALL __close_nocancel
7676+#endif /* TARGET_OS_OSX */
7777+#endif /* VARIANT_CANCELABLE */
7878+7979+#ifdef VARIANT_CANCELABLE
8080+int
8181+open(const char *path, int oflag, ...)
8282+#else /* VARIANT_CANCELABLE */
8383+int
8484+open$NOCANCEL(const char *path, int oflag, ...)
8585+#endif
8686+{
8787+ int opened_fd = 0;
8888+ mode_t mode = 0;
8989+9090+ if (oflag & O_CREAT) {
9191+ va_list ap;
9292+ va_start(ap, oflag);
9393+ /* compiler warns to pass int (not mode_t) to va_arg */
9494+ mode = va_arg(ap, int);
9595+ va_end(ap);
9696+ }
9797+9898+ opened_fd = OPEN_SYSCALL(path, oflag, mode);
9999+#if !TARGET_OS_OSX
100100+ return opened_fd;
101101+#else /* TARGET_OS_OSX */
102102+ if (opened_fd < 0) {
103103+ return opened_fd;
104104+ }
105105+106106+ /* check to see if system_version_compat is enabled for this process */
107107+ if (system_version_compat_check_path_suffix == NULL) {
108108+ return opened_fd;
109109+ }
110110+111111+ /* check to see if the suffix of the path we opened matches one we are shimming */
112112+ if (!system_version_compat_check_path_suffix(path)) {
113113+ return opened_fd;
114114+ }
115115+116116+ /* at this point we call into the version compat open shim and return values from there */
117117+ return system_version_compat_open_shim(opened_fd, -1, path, oflag, mode, CLOSE_SYSCALL, OPEN_SYSCALL,
118118+ NULL, FCNTL_SYSCALL);
119119+#endif /* TARGET_OS_OSX */
120120+}
121121+122122+#ifdef VARIANT_CANCELABLE
123123+int
124124+openat(int fd, const char *path, int oflag, ...)
125125+#else /* VARIANT_CANCELABLE */
126126+int
127127+openat$NOCANCEL(int fd, const char *path, int oflag, ...)
128128+#endif
129129+{
130130+ int opened_fd = 0;
131131+ mode_t mode = 0;
132132+133133+ if (oflag & O_CREAT) {
134134+ va_list ap;
135135+ va_start(ap, oflag);
136136+ // compiler warns to pass int (not mode_t) to va_arg
137137+ mode = va_arg(ap, int);
138138+ va_end(ap);
139139+ }
140140+141141+ opened_fd = OPENAT_SYSCALL(fd, path, oflag, mode);
142142+#if !TARGET_OS_OSX
143143+ return opened_fd;
144144+#else
145145+ if (opened_fd < 0) {
146146+ return opened_fd;
147147+ }
148148+149149+ /* check to see if system_version_compat is enabled for this process */
150150+ if (system_version_compat_check_path_suffix == NULL) {
151151+ return opened_fd;
152152+ }
153153+154154+ /* check to see if the suffix of the path we opened matches one we are shimming */
155155+ if (!system_version_compat_check_path_suffix(path)) {
156156+ return opened_fd;
157157+ }
158158+159159+ /* at this point we call into the version compat open shim and return values from there */
160160+ return system_version_compat_open_shim(opened_fd, fd, path, oflag, mode, CLOSE_SYSCALL, NULL,
161161+ OPENAT_SYSCALL, FCNTL_SYSCALL);
162162+#endif /* !TARGET_OS_OSX */
163163+}
164164+#endif /* !defined(__i386__) */
···11/*
22- * Copyright (c) 2015-2019 Apple Inc. All rights reserved.
22+ * Copyright (c) 2015-2020 Apple Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
···11/*
22- * Copyright (c) 2015-2017 Apple Inc. All rights reserved.
22+ * Copyright (c) 2015-2020 Apple Inc. All rights reserved.
33 *
44 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55 *
···5353 s_config->sc_delta_timestamp = 0;
5454 s_config->sc_buffer = 0;
5555 s_config->sc_size = 0;
5656+ s_config->sc_pagetable_mask = 0;
56575758 return s_config;
5859}
···9192 * 0 on success
9293 */
9394int
9494-stackshot_config_set_flags(stackshot_config_t *stackshot_config, uint32_t flags)
9595+stackshot_config_set_flags(stackshot_config_t *stackshot_config, uint64_t flags)
9596{
9697 stackshot_config_t *s_config;
9798···232233 }
233234234235 stackshot_config->sc_delta_timestamp = delta_timestamp;
236236+237237+ return 0;
238238+}
239239+240240+/*
241241+ * stackshot_config_set_pagetable_mask: set the level mask for pagetable dumping
242242+ *
243243+ * Each bit of the mask corresponds to a level in the paging structure. Bit 0
244244+ * corresponds to Level 0, bit 1 to level 1, and so on. It is undefined what
245245+ * happens when a bit is set that's higher than the current maximum level of
246246+ * pagetable structures.
247247+ *
248248+ * When using this setter, you must also pass STACKSHOT_PAGE_TABLES as a flag
249249+ * before invoking stackshot, otherwise this setter is a no-operation.
250250+ *
251251+ * Inputs: stackshot_config - a pointer to a stackshot_config_t
252252+ * level_mask - the pagetable level mask, as described above
253253+ *
254254+ * Outputs: -1 if the passed stackshot config is NULL or there is existing stackshot buffer set.
255255+ * 0 on success
256256+ */
257257+int
258258+stackshot_config_set_pagetable_mask(stackshot_config_t *stackshot_config, uint32_t pagetable_mask)
259259+{
260260+ if (stackshot_config == NULL || (void *)stackshot_config->sc_buffer != NULL) {
261261+ return -1;
262262+ }
263263+264264+ stackshot_config->sc_pagetable_mask = pagetable_mask;
235265236266 return 0;
237267}
···11+/*
22+ * Copyright (c) 2020 Apple Inc. All rights reserved.
33+ *
44+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. The rights granted to you under the License
1010+ * may not be used to create, or enable the creation or redistribution of,
1111+ * unlawful or unlicensed copies of an Apple operating system, or to
1212+ * circumvent, violate, or enable the circumvention or violation of, any
1313+ * terms of an Apple operating system software license agreement.
1414+ *
1515+ * Please obtain a copy of the License at
1616+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
1717+ *
1818+ * The Original Code and all software distributed under the License are
1919+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
2020+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
2121+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2222+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
2323+ * Please see the License for the specific language governing rights and
2424+ * limitations under the License.
2525+ *
2626+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
2727+ */
2828+#include <TargetConditionals.h>
2929+3030+#if TARGET_OS_OSX && !defined(__i386__)
3131+3232+/*
3333+ * Support for the open compatibilty shim for macOS. These NULL
3434+ * function pointers need to be built into libsyscall_static. They
3535+ * are hooked up to the actual functions from libsyscall_dynamic
3636+ * if/when they are used (generally only for older binaries where we
3737+ * need to shim the version information).
3838+ */
3939+4040+#include "system-version-compat-support.h"
4141+#include <stdbool.h>
4242+#include <sys/param.h>
4343+#include <sys/types.h>
4444+4545+__attribute__((visibility("hidden")))
4646+bool (*system_version_compat_check_path_suffix)(const char *orig_path) = NULL;
4747+system_version_compat_mode_t system_version_compat_mode = SYSTEM_VERSION_COMPAT_MODE_DISABLED;
4848+4949+__attribute__((visibility("hidden")))
5050+int (*system_version_compat_open_shim)(int opened_fd, int openat_fd, const char *orig_path, int oflag, mode_t mode,
5151+ int (*close_syscall)(int), int (*open_syscall)(const char *, int, mode_t),
5252+ int (*openat_syscall)(int, const char *, int, mode_t),
5353+ int (*fcntl_syscall)(int, int, long)) = NULL;
5454+#endif /* TARGET_OS_OSX && && !defined(__i386__) */
···11+/*
22+ * Copyright (c) 2020 Apple Inc. All rights reserved.
33+ *
44+ * @APPLE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. Please obtain a copy of the License at
1010+ * http://www.opensource.apple.com/apsl/ and read it before using this
1111+ * file.
1212+ *
1313+ * The Original Code and all software distributed under the License are
1414+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1515+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
1616+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
1717+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
1818+ * Please see the License for the specific language governing rights and
1919+ * limitations under the License.
2020+ *
2121+ * @APPLE_LICENSE_HEADER_END@
2222+ */
2323+2424+#include <TargetConditionals.h>
2525+2626+#if TARGET_OS_OSX && !defined(__i386__)
2727+/*
2828+ * Support for shimming calls to open() to the SystemVersion plist on macOS for older
2929+ * binaries. This code is only built into libsyscall_dynamic.
3030+ */
3131+3232+#include <fcntl.h>
3333+#include <stdbool.h>
3434+#include <strings.h>
3535+#include <sys/errno.h>
3636+#include <sys/param.h>
3737+#include <unistd.h>
3838+3939+#include "system-version-compat-support.h"
4040+4141+#define PLAT_PREFIX_IOS "iOS"
4242+#define PLAT_PREFIX_MACOS ""
4343+4444+#define COMPAT_SUFFIX_MACOS "Compat"
4545+#define COMPAT_SUFFIX_IOS ""
4646+4747+#define SYSTEM_VERSION_PLIST_FILENAME "SystemVersion.plist"
4848+#define SYSTEM_VERSION_PLIST_PATH ("/System/Library/CoreServices/" SYSTEM_VERSION_PLIST_FILENAME)
4949+5050+#define SYSTEM_VERSION_COMPAT_PLIST_FILENAME(platform_prefix, compat_suffix) (platform_prefix "SystemVersion" compat_suffix ".plist")
5151+5252+#define SYSTEM_VERSION_PLIST_FILENAMELEN strlen(SYSTEM_VERSION_PLIST_FILENAME)
5353+5454+#define SYSTEM_VERSION_COMPAT_PLIST_FILENAMELEN(platform_prefix, compat_suffix) strlen(SYSTEM_VERSION_COMPAT_PLIST_FILENAME(platform_prefix, compat_suffix))
5555+5656+#define SYSTEM_VERSION_PLIST_PATHLEN strlen(SYSTEM_VERSION_PLIST_PATH)
5757+5858+extern system_version_compat_mode_t system_version_compat_mode;
5959+6060+/*
6161+ * This routine determines whether the path specified matches the path of the SystemVersion plist file
6262+ * we are shimming accesses to. If the file name suffix matches, it's expected we'll call into the
6363+ * version_compat_open_shim() routine below which will do a full comparison on the expanded path.
6464+ *
6565+ * Parameters: orig_path The path suffix that was provided to the open{at} call.
6666+ *
6767+ * Returns: true if the path suffix matches the SystemVersion plist path we're shimming
6868+ * false otherwise
6969+ */
7070+__attribute__((visibility("hidden")))
7171+bool
7272+_system_version_compat_check_path_suffix(const char *orig_path)
7373+{
7474+ size_t path_str_len = strnlen(orig_path, MAXPATHLEN);
7575+ /*
7676+ * If the length of the filename we're opening is shorter than
7777+ * SYSTEM_VERSION_PLIST_FILENAME, bail.
7878+ */
7979+ if (path_str_len < SYSTEM_VERSION_PLIST_FILENAMELEN) {
8080+ return false;
8181+ }
8282+8383+ /* If the path we're accessing doesn't end in SYSTEM_VERSION_PLIST_FILENAME, bail. */
8484+ if (strncmp(&orig_path[path_str_len - SYSTEM_VERSION_PLIST_FILENAMELEN], SYSTEM_VERSION_PLIST_FILENAME,
8585+ SYSTEM_VERSION_PLIST_FILENAMELEN) != 0) {
8686+ return false;
8787+ }
8888+8989+ /* If modifying the path specified would exceed MAXPATHLEN, bail */
9090+ if (path_str_len == MAXPATHLEN) {
9191+ return false;
9292+ }
9393+9494+ size_t compat_len = (system_version_compat_mode == SYSTEM_VERSION_COMPAT_MODE_IOS) ? SYSTEM_VERSION_COMPAT_PLIST_FILENAMELEN(PLAT_PREFIX_IOS, COMPAT_SUFFIX_IOS) : SYSTEM_VERSION_COMPAT_PLIST_FILENAMELEN(PLAT_PREFIX_MACOS, COMPAT_SUFFIX_MACOS);
9595+ if ((compat_len - SYSTEM_VERSION_PLIST_FILENAMELEN) > (MAXPATHLEN - path_str_len - 1)) {
9696+ return false;
9797+ }
9898+9999+ /* Indicate that we should */
100100+ return true;
101101+}
102102+103103+/*
104104+ * This routine determines whether we are trying to open the SystemVersion plist at SYSTEM_VERSION_PLIST_PATH.
105105+ * It's only used on targets that have the compatibility shim enabled (mainly older binaries).
106106+ *
107107+ * Note that this routine should * ABSOLUTELY NOT * be used as a general shim for accesses at all paths. We replace
108108+ * what the developer generally expected to be one system call with multiple additional system calls. We're ok
109109+ * with doing this here because we only do it for calls to open against files that match this very specific pattern
110110+ * (named SystemVersion.plist), but doing so for all calls to open could result in various issues. Specifically it's
111111+ * difficult to ensure the same cancellation semantics (around EINTR etc) that developers generally expect when replacing
112112+ * a single system call with multiple.
113113+ *
114114+ * This routine should return with the same semantics as the general open system calls that it is shimming - specifically
115115+ * it should leave errno and the return value matching what developers expect.
116116+ *
117117+ * It's expected that _version_compat_check_path_suffix() above was called prior to this call and returned true.
118118+ *
119119+ * We take the close, open and fcntl syscalls as parameters to make sure the variant we call matches the original call
120120+ * to open{at}.
121121+ *
122122+ * Parameters: opened_fd The file descriptor that was opened in the original open{at} call
123123+ * openat_fd The file descriptor passed to the original openat call (only used when use_openat is true)
124124+ * orig_path The original path suffix passed to open{at}
125125+ * oflag The original oflag passed to open{at}
126126+ * mode The original mode passed to open{at}
127127+ * close_syscall The appropriate syscall to use for closing file descriptors
128128+ * open_syscall The syscall that should be used for a new call to open.
129129+ * fctnl_syscall The appopriate syscall to use for fcntl.
130130+ *
131131+ * Returns: The original file descriptor if the open{at} access wasn't to SYSTEM_VERSION_PLIST_PATH
132132+ * A new file descriptor (with the original closed) if the expanded path matches SYSTEM_VERSION_PLIST_PATH
133133+ * The original file descriptor if the full path suffix does not match SYSTEM_VERSION_PLIST_PATH
134134+ * -1 (with errno set to EINTR) if the new open or fcntl calls received EINTR (with all new fds closed)
135135+ */
136136+__attribute__((visibility("hidden")))
137137+int
138138+_system_version_compat_open_shim(int opened_fd, int openat_fd, const char *orig_path, int oflag, mode_t mode,
139139+ int (*close_syscall)(int), int (*open_syscall)(const char *, int, mode_t),
140140+ int (*openat_syscall)(int, const char *, int, mode_t),
141141+ int (*fcntl_syscall)(int, int, long))
142142+{
143143+ /* stash the errno from the original open{at} call */
144144+ int stashed_errno = errno;
145145+ char new_path[MAXPATHLEN];
146146+ size_t path_str_len = strnlen(orig_path, sizeof(new_path));
147147+148148+ /* Resolve the full path of the file we've opened */
149149+ if (fcntl_syscall(opened_fd, F_GETPATH, new_path)) {
150150+ if (errno == EINTR) {
151151+ /* If we got EINTR, we close the file that was opened and return -1 & EINTR */
152152+ close_syscall(opened_fd);
153153+ errno = EINTR;
154154+ return -1;
155155+ } else {
156156+ /* otherwise we return the original file descriptor that was requested */
157157+ errno = stashed_errno;
158158+ return opened_fd;
159159+ }
160160+ }
161161+162162+ /* Check to see whether the path matches SYSTEM_VERSION_PLIST_PATH */
163163+ size_t newpathlen = strnlen(new_path, MAXPATHLEN);
164164+ if (newpathlen != SYSTEM_VERSION_PLIST_PATHLEN) {
165165+ errno = stashed_errno;
166166+ return opened_fd;
167167+ }
168168+169169+ if (strncmp(new_path, SYSTEM_VERSION_PLIST_PATH, SYSTEM_VERSION_PLIST_PATHLEN) != 0) {
170170+ errno = stashed_errno;
171171+ return opened_fd;
172172+ }
173173+174174+ new_path[0] = '\0';
175175+176176+ /*
177177+ * It looks like we're trying to access the SystemVersion plist. Let's try to open
178178+ * the compatibility plist and return that instead if it exists.
179179+ */
180180+ size_t prefix_str_len = path_str_len - SYSTEM_VERSION_PLIST_FILENAMELEN;
181181+ strlcpy(new_path, orig_path, (prefix_str_len + 1));
182182+ if (system_version_compat_mode == SYSTEM_VERSION_COMPAT_MODE_IOS) {
183183+ strlcat(new_path, SYSTEM_VERSION_COMPAT_PLIST_FILENAME(PLAT_PREFIX_IOS, COMPAT_SUFFIX_IOS), MAXPATHLEN);
184184+ } else {
185185+ strlcat(new_path, SYSTEM_VERSION_COMPAT_PLIST_FILENAME(PLAT_PREFIX_MACOS, COMPAT_SUFFIX_MACOS), MAXPATHLEN);
186186+ }
187187+188188+ int new_fd = -1;
189189+ if (openat_syscall != NULL) {
190190+ new_fd = openat_syscall(openat_fd, new_path, oflag, mode);
191191+ } else {
192192+ new_fd = open_syscall(new_path, oflag, mode);
193193+ }
194194+ if ((new_fd == -1) && (errno == ENOENT)) {
195195+ /* The file doesn't exist, so return the original fd and errno. */
196196+ errno = stashed_errno;
197197+ return opened_fd;
198198+ }
199199+200200+ /*
201201+ * Otherwise we close the first file we opened and populate errno
202202+ * with errno from the call to open{at}. (Note this covers the EINTR
203203+ * case and other failures).
204204+ */
205205+ stashed_errno = errno;
206206+ close_syscall(opened_fd);
207207+ errno = stashed_errno;
208208+ return new_fd;
209209+}
210210+211211+#endif /* TARGET_OS_OSX && !defined(__i386__) */
+5-3
src/kernel/libsyscall/wrappers/unix03/mmap.c
···4646 * Preemptory failures:
4747 *
4848 * o off is not a multiple of the page size
4949+ * [ This is enforced by the kernel with MAP_UNIX03 ]
4950 * o flags does not contain either MAP_PRIVATE or MAP_SHARED
5051 * o len is zero
5252+ *
5353+ * Now enforced by the kernel when the MAP_UNIX03 flag is provided.
5154 */
5255 extern void cerror_nocancel(int);
5353- if ((off & PAGE_MASK) ||
5454- (((flags & MAP_PRIVATE) != MAP_PRIVATE) &&
5656+ if ((((flags & MAP_PRIVATE) != MAP_PRIVATE) &&
5557 ((flags & MAP_SHARED) != MAP_SHARED)) ||
5658 (len == 0)) {
5759 cerror_nocancel(EINVAL);
5860 return MAP_FAILED;
5961 }
60626161- void *ptr = __mmap(addr, len, prot, flags, fildes, off);
6363+ void *ptr = __mmap(addr, len, prot, flags | MAP_UNIX03, fildes, off);
62646365 if (__syscall_logger) {
6466 int stackLoggingFlags = stack_logging_type_vm_allocate;
-64
src/kernel/libsyscall/wrappers/varargs_wrappers.S
···5454 POP_FRAME
5555 ARM64_STACK_EPILOG
56565757-/*
5858- * int open(const char *name, int oflag, ...);
5959- * int __open(const char *name, int oflag, int mode, int value);
6060- */
6161-MI_ENTRY_POINT(_open)
6262- ARM64_STACK_PROLOG
6363- PUSH_FRAME
6464-#if __LP64__
6565- ldr x2, [fp, #16]
6666-#else
6767- ldr w2, [fp, #16]
6868-#endif
6969- MI_CALL_EXTERNAL(___open)
7070- POP_FRAME
7171- ARM64_STACK_EPILOG
7272-7373-/*
7474- * int open_nocancel(const char *name, int oflag, ...);
7575- * int __open_nocancel(const char *name, int oflag, int mode);
7676- */
7777-MI_ENTRY_POINT(_open$NOCANCEL)
7878- ARM64_STACK_PROLOG
7979- PUSH_FRAME
8080-#if __LP64__
8181- ldr x2, [fp, #16]
8282-#else
8383- ldr w2, [fp, #16]
8484-#endif
8585- MI_CALL_EXTERNAL(___open_nocancel)
8686- POP_FRAME
8787- ARM64_STACK_EPILOG
8888-8989-/*
9090- * int openat(int fd,const char *name, int oflag, ...);
9191- * int __openat(int fd, const char *name, int oflag, int mode, int value);
9292- */
9393-MI_ENTRY_POINT(_openat)
9494- ARM64_STACK_PROLOG
9595- PUSH_FRAME
9696-#if __LP64__
9797- ldr x3, [fp, #16]
9898-#else
9999- ldr w3, [fp, #16]
100100-#endif
101101- MI_CALL_EXTERNAL(___openat)
102102- POP_FRAME
103103- ARM64_STACK_EPILOG
104104-105105-/*
106106- * int openat_nocancel(int fd, const char *name, int oflag, ...);
107107- * int __openat_nocancel(int fd, const char *name, int oflag, int mode);
108108- */
109109-MI_ENTRY_POINT(_openat$NOCANCEL)
110110- ARM64_STACK_PROLOG
111111- PUSH_FRAME
112112-#if __LP64__
113113- ldr x3, [fp, #16]
114114-#else
115115- ldr w3, [fp, #16]
116116-#endif
117117- MI_CALL_EXTERNAL(___openat_nocancel)
118118- POP_FRAME
119119- ARM64_STACK_EPILOG
120120-12157/*
12258 * int shm_open(const char *, int, ...);
12359 * int __shm_open(const char*, int oflag, int mode);
···11-; derived from: FreeBSD @(#)syscalls.master 8.2 (Berkeley) 1/13/94
22-;
33-; System call name/number master file.
44-; This is file processed by .../xnu/bsd/kern/makesyscalls.sh and creates:
55-; .../xnu/bsd/kern/init_sysent.c
66-; .../xnu/bsd/kern/syscalls.c
77-; .../xnu/bsd/sys/syscall.h
88-; .../xnu/bsd/sys/sysproto.h
99-; .../xnu/bsd/security/audit_syscalls.c
1010-1111-; Columns -> | Number Audit Files | { Name and Args } | { Comments }
1212-; Number: system call number, must be in order
1313-; Audit: the audit event associated with the system call
1414-; A value of AUE_NULL means no auditing, but it also means that
1515-; there is no audit event for the call at this time. For the
1616-; case where the event exists, but we don't want auditing, the
1717-; event should be #defined to AUE_NULL in audit_kevents.h.
1818-; Files: with files to generate - "ALL" or any combo of:
1919-; "T" for syscall table (in init_sysent.c)
2020-; "N" for syscall names (in syscalls.c)
2121-; "H" for syscall headers (in syscall.h)
2222-; "P" for syscall prototypes (in sysproto.h)
2323-; Name and Args: function prototype, optionally followed by
2424-; NO_SYSCALL_STUB (which mean no system call stub will
2525-; be generated in libSystem) and ending with a semicolon.
2626-; (Note: functions prefixed by double-underbar are
2727-; automatically given the NO_SYSCALL_STUB attribute.)
2828-; Comments: additional comments about the sys call copied to output files
2929-3030-; #ifdef's, #include's, #if's etc. are copied to all output files.
3131-; N.B.: makesyscalls.sh and createsyscalls.pl must be updated to account
3232-; for any new argument types.
3333-3434-#include <sys/appleapiopts.h>
3535-#include <sys/param.h>
3636-#include <sys/systm.h>
3737-#include <sys/types.h>
3838-#include <sys/sysent.h>
3939-#include <sys/sysproto.h>
4040-4141-0 AUE_NULL ALL { int nosys(void); } { indirect syscall }
4242-1 AUE_EXIT ALL { void exit(int rval) NO_SYSCALL_STUB; }
4343-2 AUE_FORK ALL { int fork(void) NO_SYSCALL_STUB; }
4444-3 AUE_NULL ALL { user_ssize_t read(int fd, user_addr_t cbuf, user_size_t nbyte); }
4545-4 AUE_NULL ALL { user_ssize_t write(int fd, user_addr_t cbuf, user_size_t nbyte); }
4646-5 AUE_OPEN_RWTC ALL { int open(user_addr_t path, int flags, int mode) NO_SYSCALL_STUB; }
4747-6 AUE_CLOSE ALL { int close(int fd); }
4848-7 AUE_WAIT4 ALL { int wait4(int pid, user_addr_t status, int options, user_addr_t rusage) NO_SYSCALL_STUB; }
4949-8 AUE_NULL ALL { int enosys(void); } { old creat }
5050-9 AUE_LINK ALL { int link(user_addr_t path, user_addr_t link); }
5151-10 AUE_UNLINK ALL { int unlink(user_addr_t path) NO_SYSCALL_STUB; }
5252-11 AUE_NULL ALL { int enosys(void); } { old execv }
5353-12 AUE_CHDIR ALL { int chdir(user_addr_t path); }
5454-13 AUE_FCHDIR ALL { int fchdir(int fd); }
5555-14 AUE_MKNOD ALL { int mknod(user_addr_t path, int mode, int dev); }
5656-15 AUE_CHMOD ALL { int chmod(user_addr_t path, int mode) NO_SYSCALL_STUB; }
5757-16 AUE_CHOWN ALL { int chown(user_addr_t path, int uid, int gid); }
5858-17 AUE_NULL ALL { int enosys(void); } { old break }
5959-18 AUE_GETFSSTAT ALL { int getfsstat(user_addr_t buf, int bufsize, int flags); }
6060-19 AUE_NULL ALL { int enosys(void); } { old lseek }
6161-20 AUE_GETPID ALL { int getpid(void); }
6262-21 AUE_NULL ALL { int enosys(void); } { old mount }
6363-22 AUE_NULL ALL { int enosys(void); } { old umount }
6464-23 AUE_SETUID ALL { int setuid(uid_t uid); }
6565-24 AUE_GETUID ALL { int getuid(void); }
6666-25 AUE_GETEUID ALL { int geteuid(void); }
6767-26 AUE_PTRACE ALL { int ptrace(int req, pid_t pid, caddr_t addr, int data); }
6868-#if SOCKETS
6969-27 AUE_RECVMSG ALL { int recvmsg(int s, struct msghdr *msg, int flags) NO_SYSCALL_STUB; }
7070-28 AUE_SENDMSG ALL { int sendmsg(int s, caddr_t msg, int flags) NO_SYSCALL_STUB; }
7171-29 AUE_RECVFROM ALL { int recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, int *fromlenaddr) NO_SYSCALL_STUB; }
7272-30 AUE_ACCEPT ALL { int accept(int s, caddr_t name, socklen_t *anamelen) NO_SYSCALL_STUB; }
7373-31 AUE_GETPEERNAME ALL { int getpeername(int fdes, caddr_t asa, socklen_t *alen) NO_SYSCALL_STUB; }
7474-32 AUE_GETSOCKNAME ALL { int getsockname(int fdes, caddr_t asa, socklen_t *alen) NO_SYSCALL_STUB; }
7575-#else
7676-27 AUE_NULL ALL { int nosys(void); }
7777-28 AUE_NULL ALL { int nosys(void); }
7878-29 AUE_NULL ALL { int nosys(void); }
7979-30 AUE_NULL ALL { int nosys(void); }
8080-31 AUE_NULL ALL { int nosys(void); }
8181-32 AUE_NULL ALL { int nosys(void); }
8282-#endif /* SOCKETS */
8383-33 AUE_ACCESS ALL { int access(user_addr_t path, int flags); }
8484-34 AUE_CHFLAGS ALL { int chflags(char *path, int flags); }
8585-35 AUE_FCHFLAGS ALL { int fchflags(int fd, int flags); }
8686-36 AUE_SYNC ALL { int sync(void); }
8787-37 AUE_KILL ALL { int kill(int pid, int signum, int posix) NO_SYSCALL_STUB; }
8888-38 AUE_NULL ALL { int nosys(void); } { old stat }
8989-39 AUE_GETPPID ALL { int getppid(void); }
9090-40 AUE_NULL ALL { int nosys(void); } { old lstat }
9191-41 AUE_DUP ALL { int dup(u_int fd); }
9292-42 AUE_PIPE ALL { int pipe(void); }
9393-43 AUE_GETEGID ALL { int getegid(void); }
9494-44 AUE_NULL ALL { int nosys(void); } { old profil }
9595-45 AUE_NULL ALL { int nosys(void); } { old ktrace }
9696-46 AUE_SIGACTION ALL { int sigaction(int signum, struct __sigaction *nsa, struct sigaction *osa) NO_SYSCALL_STUB; }
9797-47 AUE_GETGID ALL { int getgid(void); }
9898-48 AUE_SIGPROCMASK ALL { int sigprocmask(int how, user_addr_t mask, user_addr_t omask); }
9999-49 AUE_GETLOGIN ALL { int getlogin(char *namebuf, u_int namelen) NO_SYSCALL_STUB; }
100100-50 AUE_SETLOGIN ALL { int setlogin(char *namebuf) NO_SYSCALL_STUB; }
101101-51 AUE_ACCT ALL { int acct(char *path); }
102102-52 AUE_SIGPENDING ALL { int sigpending(struct sigvec *osv); }
103103-53 AUE_SIGALTSTACK ALL { int sigaltstack(struct sigaltstack *nss, struct sigaltstack *oss) NO_SYSCALL_STUB ; }
104104-54 AUE_IOCTL ALL { int ioctl(int fd, u_long com, caddr_t data) NO_SYSCALL_STUB; }
105105-55 AUE_REBOOT ALL { int reboot(int opt, char *msg) NO_SYSCALL_STUB; }
106106-56 AUE_REVOKE ALL { int revoke(char *path); }
107107-57 AUE_SYMLINK ALL { int symlink(char *path, char *link); }
108108-58 AUE_READLINK ALL { int readlink(char *path, char *buf, int count); }
109109-59 AUE_EXECVE ALL { int execve(char *fname, char **argp, char **envp); }
110110-60 AUE_UMASK ALL { int umask(int newmask); }
111111-61 AUE_CHROOT ALL { int chroot(user_addr_t path); }
112112-62 AUE_NULL ALL { int nosys(void); } { old fstat }
113113-63 AUE_NULL ALL { int nosys(void); } { used internally and reserved }
114114-64 AUE_NULL ALL { int nosys(void); } { old getpagesize }
115115-65 AUE_MSYNC ALL { int msync(caddr_t addr, size_t len, int flags) NO_SYSCALL_STUB; }
116116-66 AUE_VFORK ALL { int vfork(void); }
117117-67 AUE_NULL ALL { int nosys(void); } { old vread }
118118-68 AUE_NULL ALL { int nosys(void); } { old vwrite }
119119-69 AUE_NULL ALL { int nosys(void); } { old sbrk }
120120-70 AUE_NULL ALL { int nosys(void); } { old sstk }
121121-71 AUE_NULL ALL { int nosys(void); } { old mmap }
122122-72 AUE_NULL ALL { int nosys(void); } { old vadvise }
123123-73 AUE_MUNMAP ALL { int munmap(caddr_t addr, size_t len) NO_SYSCALL_STUB; }
124124-74 AUE_MPROTECT ALL { int mprotect(caddr_t addr, size_t len, int prot) NO_SYSCALL_STUB; }
125125-75 AUE_MADVISE ALL { int madvise(caddr_t addr, size_t len, int behav); }
126126-76 AUE_NULL ALL { int nosys(void); } { old vhangup }
127127-77 AUE_NULL ALL { int nosys(void); } { old vlimit }
128128-78 AUE_MINCORE ALL { int mincore(user_addr_t addr, user_size_t len, user_addr_t vec); }
129129-79 AUE_GETGROUPS ALL { int getgroups(u_int gidsetsize, gid_t *gidset); }
130130-80 AUE_SETGROUPS ALL { int setgroups(u_int gidsetsize, gid_t *gidset); }
131131-81 AUE_GETPGRP ALL { int getpgrp(void); }
132132-82 AUE_SETPGRP ALL { int setpgid(int pid, int pgid); }
133133-83 AUE_SETITIMER ALL { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); }
134134-84 AUE_NULL ALL { int nosys(void); } { old wait }
135135-85 AUE_SWAPON ALL { int swapon(void); }
136136-86 AUE_GETITIMER ALL { int getitimer(u_int which, struct itimerval *itv); }
137137-87 AUE_NULL ALL { int nosys(void); } { old gethostname }
138138-88 AUE_NULL ALL { int nosys(void); } { old sethostname }
139139-89 AUE_GETDTABLESIZE ALL { int getdtablesize(void); }
140140-90 AUE_DUP2 ALL { int dup2(u_int from, u_int to); }
141141-91 AUE_NULL ALL { int nosys(void); } { old getdopt }
142142-92 AUE_FCNTL ALL { int fcntl(int fd, int cmd, long arg) NO_SYSCALL_STUB; }
143143-93 AUE_SELECT ALL { int select(int nd, u_int32_t *in, u_int32_t *ou, u_int32_t *ex, struct timeval *tv) NO_SYSCALL_STUB; }
144144-94 AUE_NULL ALL { int nosys(void); } { old setdopt }
145145-95 AUE_FSYNC ALL { int fsync(int fd); }
146146-96 AUE_SETPRIORITY ALL { int setpriority(int which, id_t who, int prio) NO_SYSCALL_STUB; }
147147-#if SOCKETS
148148-97 AUE_SOCKET ALL { int socket(int domain, int type, int protocol); }
149149-98 AUE_CONNECT ALL { int connect(int s, caddr_t name, socklen_t namelen) NO_SYSCALL_STUB; }
150150-#else
151151-97 AUE_NULL ALL { int nosys(void); }
152152-98 AUE_NULL ALL { int nosys(void); }
153153-#endif /* SOCKETS */
154154-99 AUE_NULL ALL { int nosys(void); } { old accept }
155155-100 AUE_GETPRIORITY ALL { int getpriority(int which, id_t who); }
156156-101 AUE_NULL ALL { int nosys(void); } { old send }
157157-102 AUE_NULL ALL { int nosys(void); } { old recv }
158158-103 AUE_NULL ALL { int nosys(void); } { old sigreturn }
159159-#if SOCKETS
160160-104 AUE_BIND ALL { int bind(int s, caddr_t name, socklen_t namelen) NO_SYSCALL_STUB; }
161161-105 AUE_SETSOCKOPT ALL { int setsockopt(int s, int level, int name, caddr_t val, socklen_t valsize); }
162162-106 AUE_LISTEN ALL { int listen(int s, int backlog) NO_SYSCALL_STUB; }
163163-#else
164164-104 AUE_NULL ALL { int nosys(void); }
165165-105 AUE_NULL ALL { int nosys(void); }
166166-106 AUE_NULL ALL { int nosys(void); }
167167-#endif /* SOCKETS */
168168-107 AUE_NULL ALL { int nosys(void); } { old vtimes }
169169-108 AUE_NULL ALL { int nosys(void); } { old sigvec }
170170-109 AUE_NULL ALL { int nosys(void); } { old sigblock }
171171-110 AUE_NULL ALL { int nosys(void); } { old sigsetmask }
172172-111 AUE_NULL ALL { int sigsuspend(sigset_t mask) NO_SYSCALL_STUB; }
173173-112 AUE_NULL ALL { int nosys(void); } { old sigstack }
174174-#if SOCKETS
175175-113 AUE_NULL ALL { int nosys(void); } { old recvmsg }
176176-114 AUE_NULL ALL { int nosys(void); } { old sendmsg }
177177-#else
178178-113 AUE_NULL ALL { int nosys(void); }
179179-114 AUE_NULL ALL { int nosys(void); }
180180-#endif /* SOCKETS */
181181-115 AUE_NULL ALL { int nosys(void); } { old vtrace }
182182-116 AUE_GETTIMEOFDAY ALL { int gettimeofday(struct timeval *tp, struct timezone *tzp, uint64_t *mach_absolute_time) NO_SYSCALL_STUB; }
183183-117 AUE_GETRUSAGE ALL { int getrusage(int who, struct rusage *rusage); }
184184-#if SOCKETS
185185-118 AUE_GETSOCKOPT ALL { int getsockopt(int s, int level, int name, caddr_t val, socklen_t *avalsize); }
186186-#else
187187-118 AUE_NULL ALL { int nosys(void); }
188188-#endif /* SOCKETS */
189189-119 AUE_NULL ALL { int nosys(void); } { old resuba }
190190-120 AUE_READV ALL { user_ssize_t readv(int fd, struct iovec *iovp, u_int iovcnt); }
191191-121 AUE_WRITEV ALL { user_ssize_t writev(int fd, struct iovec *iovp, u_int iovcnt); }
192192-122 AUE_SETTIMEOFDAY ALL { int settimeofday(struct timeval *tv, struct timezone *tzp) NO_SYSCALL_STUB; }
193193-123 AUE_FCHOWN ALL { int fchown(int fd, int uid, int gid); }
194194-124 AUE_FCHMOD ALL { int fchmod(int fd, int mode) NO_SYSCALL_STUB; }
195195-125 AUE_NULL ALL { int nosys(void); } { old recvfrom }
196196-126 AUE_SETREUID ALL { int setreuid(uid_t ruid, uid_t euid) NO_SYSCALL_STUB; }
197197-127 AUE_SETREGID ALL { int setregid(gid_t rgid, gid_t egid) NO_SYSCALL_STUB; }
198198-128 AUE_RENAME ALL { int rename(char *from, char *to) NO_SYSCALL_STUB; }
199199-129 AUE_NULL ALL { int nosys(void); } { old truncate }
200200-130 AUE_NULL ALL { int nosys(void); } { old ftruncate }
201201-131 AUE_FLOCK ALL { int flock(int fd, int how); }
202202-132 AUE_MKFIFO ALL { int mkfifo(user_addr_t path, int mode); }
203203-#if SOCKETS
204204-133 AUE_SENDTO ALL { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, socklen_t tolen) NO_SYSCALL_STUB; }
205205-134 AUE_SHUTDOWN ALL { int shutdown(int s, int how); }
206206-135 AUE_SOCKETPAIR ALL { int socketpair(int domain, int type, int protocol, int *rsv) NO_SYSCALL_STUB; }
207207-#else
208208-133 AUE_NULL ALL { int nosys(void); }
209209-134 AUE_NULL ALL { int nosys(void); }
210210-135 AUE_NULL ALL { int nosys(void); }
211211-#endif /* SOCKETS */
212212-136 AUE_MKDIR ALL { int mkdir(user_addr_t path, int mode); }
213213-137 AUE_RMDIR ALL { int rmdir(char *path) NO_SYSCALL_STUB; }
214214-138 AUE_UTIMES ALL { int utimes(char *path, struct timeval *tptr); }
215215-139 AUE_FUTIMES ALL { int futimes(int fd, struct timeval *tptr); }
216216-140 AUE_ADJTIME ALL { int adjtime(struct timeval *delta, struct timeval *olddelta); }
217217-141 AUE_NULL ALL { int nosys(void); } { old getpeername }
218218-142 AUE_SYSCTL ALL { int gethostuuid(unsigned char *uuid_buf, const struct timespec *timeoutp) NO_SYSCALL_STUB; }
219219-143 AUE_NULL ALL { int nosys(void); } { old sethostid }
220220-144 AUE_NULL ALL { int nosys(void); } { old getrlimit }
221221-145 AUE_NULL ALL { int nosys(void); } { old setrlimit }
222222-146 AUE_NULL ALL { int nosys(void); } { old killpg }
223223-147 AUE_SETSID ALL { int setsid(void); }
224224-148 AUE_NULL ALL { int nosys(void); } { old setquota }
225225-149 AUE_NULL ALL { int nosys(void); } { old qquota }
226226-150 AUE_NULL ALL { int nosys(void); } { old getsockname }
227227-151 AUE_GETPGID ALL { int getpgid(pid_t pid); }
228228-152 AUE_SETPRIVEXEC ALL { int setprivexec(int flag); }
229229-153 AUE_PREAD ALL { user_ssize_t pread(int fd, user_addr_t buf, user_size_t nbyte, off_t offset); }
230230-154 AUE_PWRITE ALL { user_ssize_t pwrite(int fd, user_addr_t buf, user_size_t nbyte, off_t offset); }
231231-232232-#if NFSSERVER
233233-155 AUE_NFS_SVC ALL { int nfssvc(int flag, caddr_t argp); }
234234-#else
235235-155 AUE_NULL ALL { int nosys(void); }
236236-#endif
237237-238238-156 AUE_NULL ALL { int nosys(void); } { old getdirentries }
239239-157 AUE_STATFS ALL { int statfs(char *path, struct statfs *buf); }
240240-158 AUE_FSTATFS ALL { int fstatfs(int fd, struct statfs *buf); }
241241-159 AUE_UNMOUNT ALL { int unmount(user_addr_t path, int flags); }
242242-160 AUE_NULL ALL { int nosys(void); } { old async_daemon }
243243-244244-#if NFSSERVER
245245-161 AUE_NFS_GETFH ALL { int getfh(char *fname, fhandle_t *fhp); }
246246-#else
247247-161 AUE_NULL ALL { int nosys(void); }
248248-#endif
249249-250250-162 AUE_NULL ALL { int nosys(void); } { old getdomainname }
251251-163 AUE_NULL ALL { int nosys(void); } { old setdomainname }
252252-164 AUE_NULL ALL { int nosys(void); }
253253-165 AUE_QUOTACTL ALL { int quotactl(const char *path, int cmd, int uid, caddr_t arg); }
254254-166 AUE_NULL ALL { int nosys(void); } { old exportfs }
255255-167 AUE_MOUNT ALL { int mount(char *type, char *path, int flags, caddr_t data); }
256256-168 AUE_NULL ALL { int nosys(void); } { old ustat }
257257-169 AUE_CSOPS ALL { int csops(pid_t pid, uint32_t ops, user_addr_t useraddr, user_size_t usersize); }
258258-170 AUE_CSOPS ALL { int csops_audittoken(pid_t pid, uint32_t ops, user_addr_t useraddr, user_size_t usersize, user_addr_t uaudittoken); }
259259-171 AUE_NULL ALL { int nosys(void); } { old wait3 }
260260-172 AUE_NULL ALL { int nosys(void); } { old rpause }
261261-173 AUE_WAITID ALL { int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options); }
262262-174 AUE_NULL ALL { int nosys(void); } { old getdents }
263263-175 AUE_NULL ALL { int nosys(void); } { old gc_control }
264264-176 AUE_NULL ALL { int nosys(void); } { old add_profil }
265265-177 AUE_NULL ALL { int kdebug_typefilter(void** addr, size_t* size) NO_SYSCALL_STUB; }
266266-178 AUE_NULL ALL { uint64_t kdebug_trace_string(uint32_t debugid, uint64_t str_id, const char *str) NO_SYSCALL_STUB; }
267267-179 AUE_NULL ALL { int kdebug_trace64(uint32_t code, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4) NO_SYSCALL_STUB; }
268268-180 AUE_NULL ALL { int kdebug_trace(uint32_t code, u_long arg1, u_long arg2, u_long arg3, u_long arg4) NO_SYSCALL_STUB; }
269269-181 AUE_SETGID ALL { int setgid(gid_t gid); }
270270-182 AUE_SETEGID ALL { int setegid(gid_t egid); }
271271-183 AUE_SETEUID ALL { int seteuid(uid_t euid); }
272272-184 AUE_SIGRETURN ALL { int sigreturn(struct ucontext *uctx, int infostyle, user_addr_t token) NO_SYSCALL_STUB; }
273273-185 AUE_NULL ALL { int enosys(void); } { old chud }
274274-186 AUE_NULL ALL { int thread_selfcounts(int type, user_addr_t buf, user_size_t nbytes); }
275275-187 AUE_FDATASYNC ALL { int fdatasync(int fd); }
276276-188 AUE_STAT ALL { int stat(user_addr_t path, user_addr_t ub); }
277277-189 AUE_FSTAT ALL { int fstat(int fd, user_addr_t ub); }
278278-190 AUE_LSTAT ALL { int lstat(user_addr_t path, user_addr_t ub); }
279279-191 AUE_PATHCONF ALL { int pathconf(char *path, int name); }
280280-192 AUE_FPATHCONF ALL { int fpathconf(int fd, int name); }
281281-193 AUE_NULL ALL { int nosys(void); } { old getfsstat }
282282-194 AUE_GETRLIMIT ALL { int getrlimit(u_int which, struct rlimit *rlp) NO_SYSCALL_STUB; }
283283-195 AUE_SETRLIMIT ALL { int setrlimit(u_int which, struct rlimit *rlp) NO_SYSCALL_STUB; }
284284-196 AUE_GETDIRENTRIES ALL { int getdirentries(int fd, char *buf, u_int count, long *basep); }
285285-197 AUE_MMAP ALL { user_addr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos) NO_SYSCALL_STUB; }
286286-198 AUE_NULL ALL { int nosys(void); } { old __syscall }
287287-199 AUE_LSEEK ALL { off_t lseek(int fd, off_t offset, int whence); }
288288-200 AUE_TRUNCATE ALL { int truncate(char *path, off_t length); }
289289-201 AUE_FTRUNCATE ALL { int ftruncate(int fd, off_t length); }
290290-202 AUE_SYSCTL ALL { int sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen) NO_SYSCALL_STUB; }
291291-203 AUE_MLOCK ALL { int mlock(caddr_t addr, size_t len); }
292292-204 AUE_MUNLOCK ALL { int munlock(caddr_t addr, size_t len); }
293293-205 AUE_UNDELETE ALL { int undelete(user_addr_t path); }
294294-295295-206 AUE_NULL ALL { int nosys(void); } { old ATsocket }
296296-207 AUE_NULL ALL { int nosys(void); } { old ATgetmsg }
297297-208 AUE_NULL ALL { int nosys(void); } { old ATputmsg }
298298-209 AUE_NULL ALL { int nosys(void); } { old ATsndreq }
299299-210 AUE_NULL ALL { int nosys(void); } { old ATsndrsp }
300300-211 AUE_NULL ALL { int nosys(void); } { old ATgetreq }
301301-212 AUE_NULL ALL { int nosys(void); } { old ATgetrsp }
302302-213 AUE_NULL ALL { int nosys(void); } { Reserved for AppleTalk }
303303-304304-214 AUE_NULL ALL { int nosys(void); }
305305-215 AUE_NULL ALL { int nosys(void); }
306306-307307-; System Calls 216 - 230 are reserved for calls to support HFS/HFS Plus
308308-; file system semantics. Currently, we only use 215-227. The rest is
309309-; for future expansion in anticipation of new MacOS APIs for HFS Plus.
310310-; These calls are not conditionalized because while they are specific
311311-; to HFS semantics, they are not specific to the HFS filesystem.
312312-; We expect all filesystems to recognize the call and report that it is
313313-; not supported or to actually implement it.
314314-315315-; 216-> 219 used to be mkcomplex and {f,l}statv variants. They are gone now.
316316-216 AUE_NULL ALL { int open_dprotected_np(user_addr_t path, int flags, int class, int dpflags, int mode) NO_SYSCALL_STUB; }
317317-217 AUE_FSGETPATH_EXTENDED ALL { user_ssize_t fsgetpath_ext(user_addr_t buf, size_t bufsize, user_addr_t fsid, uint64_t objid, uint32_t options); }
318318-218 AUE_NULL ALL { int nosys(void); } { old lstatv }
319319-219 AUE_NULL ALL { int nosys(void); } { old fstatv }
320320-220 AUE_GETATTRLIST ALL { int getattrlist(const char *path, struct attrlist *alist, void *attributeBuffer, size_t bufferSize, u_long options) NO_SYSCALL_STUB; }
321321-221 AUE_SETATTRLIST ALL { int setattrlist(const char *path, struct attrlist *alist, void *attributeBuffer, size_t bufferSize, u_long options) NO_SYSCALL_STUB; }
322322-222 AUE_GETDIRENTRIESATTR ALL { int getdirentriesattr(int fd, struct attrlist *alist, void *buffer, size_t buffersize, u_long *count, u_long *basep, u_long *newstate, u_long options); }
323323-223 AUE_EXCHANGEDATA ALL { int exchangedata(const char *path1, const char *path2, u_long options); }
324324-224 AUE_NULL ALL { int nosys(void); } { old checkuseraccess or fsgetpath }
325325-225 AUE_SEARCHFS ALL { int searchfs(const char *path, struct fssearchblock *searchblock, uint32_t *nummatches, uint32_t scriptcode, uint32_t options, struct searchstate *state); }
326326-226 AUE_DELETE ALL { int delete(user_addr_t path) NO_SYSCALL_STUB; } { private delete (Carbon semantics) }
327327-227 AUE_COPYFILE ALL { int copyfile(char *from, char *to, int mode, int flags) NO_SYSCALL_STUB; }
328328-228 AUE_FGETATTRLIST ALL { int fgetattrlist(int fd, struct attrlist *alist, void *attributeBuffer, size_t bufferSize, u_long options); }
329329-229 AUE_FSETATTRLIST ALL { int fsetattrlist(int fd, struct attrlist *alist, void *attributeBuffer, size_t bufferSize, u_long options); }
330330-230 AUE_POLL ALL { int poll(struct pollfd *fds, u_int nfds, int timeout); }
331331-231 AUE_WATCHEVENT ALL { int watchevent(struct eventreq *u_req, int u_eventmask); }
332332-232 AUE_WAITEVENT ALL { int waitevent(struct eventreq *u_req, struct timeval *tv); }
333333-233 AUE_MODWATCH ALL { int modwatch(struct eventreq *u_req, int u_eventmask); }
334334-234 AUE_GETXATTR ALL { user_ssize_t getxattr(user_addr_t path, user_addr_t attrname, user_addr_t value, size_t size, uint32_t position, int options); }
335335-235 AUE_FGETXATTR ALL { user_ssize_t fgetxattr(int fd, user_addr_t attrname, user_addr_t value, size_t size, uint32_t position, int options); }
336336-236 AUE_SETXATTR ALL { int setxattr(user_addr_t path, user_addr_t attrname, user_addr_t value, size_t size, uint32_t position, int options); }
337337-237 AUE_FSETXATTR ALL { int fsetxattr(int fd, user_addr_t attrname, user_addr_t value, size_t size, uint32_t position, int options); }
338338-238 AUE_REMOVEXATTR ALL { int removexattr(user_addr_t path, user_addr_t attrname, int options); }
339339-239 AUE_FREMOVEXATTR ALL { int fremovexattr(int fd, user_addr_t attrname, int options); }
340340-240 AUE_LISTXATTR ALL { user_ssize_t listxattr(user_addr_t path, user_addr_t namebuf, size_t bufsize, int options); }
341341-241 AUE_FLISTXATTR ALL { user_ssize_t flistxattr(int fd, user_addr_t namebuf, size_t bufsize, int options); }
342342-242 AUE_FSCTL ALL { int fsctl(const char *path, u_long cmd, caddr_t data, u_int options); }
343343-243 AUE_INITGROUPS ALL { int initgroups(u_int gidsetsize, gid_t *gidset, int gmuid) NO_SYSCALL_STUB; }
344344-244 AUE_POSIX_SPAWN ALL { int posix_spawn(pid_t *pid, const char *path, const struct _posix_spawn_args_desc *adesc, char **argv, char **envp) NO_SYSCALL_STUB; }
345345-245 AUE_FFSCTL ALL { int ffsctl(int fd, u_long cmd, caddr_t data, u_int options); }
346346-246 AUE_NULL ALL { int nosys(void); }
347347-348348-#if NFSCLIENT
349349-247 AUE_NULL ALL { int nfsclnt(int flag, caddr_t argp); }
350350-#else
351351-247 AUE_NULL ALL { int nosys(void); }
352352-#endif
353353-#if NFSSERVER
354354-248 AUE_FHOPEN ALL { int fhopen(const struct fhandle *u_fhp, int flags); }
355355-#else
356356-248 AUE_NULL ALL { int nosys(void); }
357357-#endif
358358-359359-249 AUE_NULL ALL { int nosys(void); }
360360-250 AUE_MINHERIT ALL { int minherit(void *addr, size_t len, int inherit); }
361361-#if SYSV_SEM
362362-251 AUE_SEMSYS ALL { int semsys(u_int which, int a2, int a3, int a4, int a5) NO_SYSCALL_STUB; }
363363-#else
364364-251 AUE_NULL ALL { int nosys(void); }
365365-#endif
366366-#if SYSV_MSG
367367-252 AUE_MSGSYS ALL { int msgsys(u_int which, int a2, int a3, int a4, int a5) NO_SYSCALL_STUB; }
368368-#else
369369-252 AUE_NULL ALL { int nosys(void); }
370370-#endif
371371-#if SYSV_SHM
372372-253 AUE_SHMSYS ALL { int shmsys(u_int which, int a2, int a3, int a4) NO_SYSCALL_STUB; }
373373-#else
374374-253 AUE_NULL ALL { int nosys(void); }
375375-#endif
376376-#if SYSV_SEM
377377-254 AUE_SEMCTL ALL { int semctl(int semid, int semnum, int cmd, semun_t arg) NO_SYSCALL_STUB; }
378378-255 AUE_SEMGET ALL { int semget(key_t key, int nsems, int semflg); }
379379-256 AUE_SEMOP ALL { int semop(int semid, struct sembuf *sops, int nsops); }
380380-257 AUE_NULL ALL { int nosys(void); } { old semconfig }
381381-#else
382382-254 AUE_NULL ALL { int nosys(void); }
383383-255 AUE_NULL ALL { int nosys(void); }
384384-256 AUE_NULL ALL { int nosys(void); }
385385-257 AUE_NULL ALL { int nosys(void); }
386386-#endif
387387-#if SYSV_MSG
388388-258 AUE_MSGCTL ALL { int msgctl(int msqid, int cmd, struct msqid_ds *buf) NO_SYSCALL_STUB; }
389389-259 AUE_MSGGET ALL { int msgget(key_t key, int msgflg); }
390390-260 AUE_MSGSND ALL { int msgsnd(int msqid, void *msgp, size_t msgsz, int msgflg); }
391391-261 AUE_MSGRCV ALL { user_ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); }
392392-#else
393393-258 AUE_NULL ALL { int nosys(void); }
394394-259 AUE_NULL ALL { int nosys(void); }
395395-260 AUE_NULL ALL { int nosys(void); }
396396-261 AUE_NULL ALL { int nosys(void); }
397397-#endif
398398-#if SYSV_SHM
399399-262 AUE_SHMAT ALL { user_addr_t shmat(int shmid, void *shmaddr, int shmflg); }
400400-263 AUE_SHMCTL ALL { int shmctl(int shmid, int cmd, struct shmid_ds *buf) NO_SYSCALL_STUB; }
401401-264 AUE_SHMDT ALL { int shmdt(void *shmaddr); }
402402-265 AUE_SHMGET ALL { int shmget(key_t key, size_t size, int shmflg); }
403403-#else
404404-262 AUE_NULL ALL { int nosys(void); }
405405-263 AUE_NULL ALL { int nosys(void); }
406406-264 AUE_NULL ALL { int nosys(void); }
407407-265 AUE_NULL ALL { int nosys(void); }
408408-#endif
409409-266 AUE_SHMOPEN ALL { int shm_open(const char *name, int oflag, int mode) NO_SYSCALL_STUB; }
410410-267 AUE_SHMUNLINK ALL { int shm_unlink(const char *name); }
411411-268 AUE_SEMOPEN ALL { user_addr_t sem_open(const char *name, int oflag, int mode, int value) NO_SYSCALL_STUB; }
412412-269 AUE_SEMCLOSE ALL { int sem_close(sem_t *sem); }
413413-270 AUE_SEMUNLINK ALL { int sem_unlink(const char *name); }
414414-271 AUE_SEMWAIT ALL { int sem_wait(sem_t *sem); }
415415-272 AUE_SEMTRYWAIT ALL { int sem_trywait(sem_t *sem); }
416416-273 AUE_SEMPOST ALL { int sem_post(sem_t *sem); }
417417-274 AUE_SYSCTL ALL { int sys_sysctlbyname(const char *name, size_t namelen, void *old, size_t *oldlenp, void *new, size_t newlen) NO_SYSCALL_STUB; }
418418-275 AUE_NULL ALL { int enosys(void); } { old sem_init }
419419-276 AUE_NULL ALL { int enosys(void); } { old sem_destroy }
420420-277 AUE_OPEN_EXTENDED_RWTC ALL { int open_extended(user_addr_t path, int flags, uid_t uid, gid_t gid, int mode, user_addr_t xsecurity) NO_SYSCALL_STUB; }
421421-278 AUE_UMASK_EXTENDED ALL { int umask_extended(int newmask, user_addr_t xsecurity) NO_SYSCALL_STUB; }
422422-279 AUE_STAT_EXTENDED ALL { int stat_extended(user_addr_t path, user_addr_t ub, user_addr_t xsecurity, user_addr_t xsecurity_size) NO_SYSCALL_STUB; }
423423-280 AUE_LSTAT_EXTENDED ALL { int lstat_extended(user_addr_t path, user_addr_t ub, user_addr_t xsecurity, user_addr_t xsecurity_size) NO_SYSCALL_STUB; }
424424-281 AUE_FSTAT_EXTENDED ALL { int fstat_extended(int fd, user_addr_t ub, user_addr_t xsecurity, user_addr_t xsecurity_size) NO_SYSCALL_STUB; }
425425-282 AUE_CHMOD_EXTENDED ALL { int chmod_extended(user_addr_t path, uid_t uid, gid_t gid, int mode, user_addr_t xsecurity) NO_SYSCALL_STUB; }
426426-283 AUE_FCHMOD_EXTENDED ALL { int fchmod_extended(int fd, uid_t uid, gid_t gid, int mode, user_addr_t xsecurity) NO_SYSCALL_STUB; }
427427-284 AUE_ACCESS_EXTENDED ALL { int access_extended(user_addr_t entries, size_t size, user_addr_t results, uid_t uid) NO_SYSCALL_STUB; }
428428-285 AUE_SETTID ALL { int settid(uid_t uid, gid_t gid) NO_SYSCALL_STUB; }
429429-286 AUE_GETTID ALL { int gettid(uid_t *uidp, gid_t *gidp) NO_SYSCALL_STUB; }
430430-287 AUE_SETSGROUPS ALL { int setsgroups(int setlen, user_addr_t guidset) NO_SYSCALL_STUB; }
431431-288 AUE_GETSGROUPS ALL { int getsgroups(user_addr_t setlen, user_addr_t guidset) NO_SYSCALL_STUB; }
432432-289 AUE_SETWGROUPS ALL { int setwgroups(int setlen, user_addr_t guidset) NO_SYSCALL_STUB; }
433433-290 AUE_GETWGROUPS ALL { int getwgroups(user_addr_t setlen, user_addr_t guidset) NO_SYSCALL_STUB; }
434434-291 AUE_MKFIFO_EXTENDED ALL { int mkfifo_extended(user_addr_t path, uid_t uid, gid_t gid, int mode, user_addr_t xsecurity) NO_SYSCALL_STUB; }
435435-292 AUE_MKDIR_EXTENDED ALL { int mkdir_extended(user_addr_t path, uid_t uid, gid_t gid, int mode, user_addr_t xsecurity) NO_SYSCALL_STUB; }
436436-#if CONFIG_EXT_RESOLVER
437437-293 AUE_IDENTITYSVC ALL { int identitysvc(int opcode, user_addr_t message) NO_SYSCALL_STUB; }
438438-#else
439439-293 AUE_NULL ALL { int nosys(void); }
440440-#endif
441441-294 AUE_NULL ALL { int shared_region_check_np(uint64_t *start_address) NO_SYSCALL_STUB; }
442442-295 AUE_NULL ALL { int nosys(void); } { old shared_region_map_np }
443443-296 AUE_NULL ALL { int vm_pressure_monitor(int wait_for_pressure, int nsecs_monitored, uint32_t *pages_reclaimed); }
444444-#if PSYNCH
445445-297 AUE_NULL ALL { uint32_t psynch_rw_longrdlock(user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags) NO_SYSCALL_STUB; }
446446-298 AUE_NULL ALL { uint32_t psynch_rw_yieldwrlock(user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags) NO_SYSCALL_STUB; }
447447-299 AUE_NULL ALL { int psynch_rw_downgrade(user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags) NO_SYSCALL_STUB; }
448448-300 AUE_NULL ALL { uint32_t psynch_rw_upgrade(user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags) NO_SYSCALL_STUB; }
449449-301 AUE_NULL ALL { uint32_t psynch_mutexwait(user_addr_t mutex, uint32_t mgen, uint32_t ugen, uint64_t tid, uint32_t flags) NO_SYSCALL_STUB; }
450450-302 AUE_NULL ALL { uint32_t psynch_mutexdrop(user_addr_t mutex, uint32_t mgen, uint32_t ugen, uint64_t tid, uint32_t flags) NO_SYSCALL_STUB; }
451451-303 AUE_NULL ALL { uint32_t psynch_cvbroad(user_addr_t cv, uint64_t cvlsgen, uint64_t cvudgen, uint32_t flags, user_addr_t mutex, uint64_t mugen, uint64_t tid) NO_SYSCALL_STUB; }
452452-304 AUE_NULL ALL { uint32_t psynch_cvsignal(user_addr_t cv, uint64_t cvlsgen, uint32_t cvugen, int thread_port, user_addr_t mutex, uint64_t mugen, uint64_t tid, uint32_t flags) NO_SYSCALL_STUB; }
453453-305 AUE_NULL ALL { uint32_t psynch_cvwait(user_addr_t cv, uint64_t cvlsgen, uint32_t cvugen, user_addr_t mutex, uint64_t mugen, uint32_t flags, int64_t sec, uint32_t nsec) NO_SYSCALL_STUB; }
454454-306 AUE_NULL ALL { uint32_t psynch_rw_rdlock(user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags) NO_SYSCALL_STUB; }
455455-307 AUE_NULL ALL { uint32_t psynch_rw_wrlock(user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags) NO_SYSCALL_STUB; }
456456-308 AUE_NULL ALL { uint32_t psynch_rw_unlock(user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags) NO_SYSCALL_STUB; }
457457-309 AUE_NULL ALL { uint32_t psynch_rw_unlock2(user_addr_t rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags) NO_SYSCALL_STUB; }
458458-#else
459459-297 AUE_NULL ALL { int nosys(void); } { old reset_shared_file }
460460-298 AUE_NULL ALL { int nosys(void); } { old new_system_shared_regions }
461461-299 AUE_NULL ALL { int enosys(void); } { old shared_region_map_file_np }
462462-300 AUE_NULL ALL { int enosys(void); } { old shared_region_make_private_np }
463463-301 AUE_NULL ALL { int nosys(void); }
464464-302 AUE_NULL ALL { int nosys(void); }
465465-303 AUE_NULL ALL { int nosys(void); }
466466-304 AUE_NULL ALL { int nosys(void); }
467467-305 AUE_NULL ALL { int nosys(void); }
468468-306 AUE_NULL ALL { int nosys(void); }
469469-307 AUE_NULL ALL { int nosys(void); }
470470-308 AUE_NULL ALL { int nosys(void); }
471471-309 AUE_NULL ALL { int nosys(void); }
472472-#endif
473473-310 AUE_GETSID ALL { int getsid(pid_t pid); }
474474-311 AUE_SETTIDWITHPID ALL { int settid_with_pid(pid_t pid, int assume) NO_SYSCALL_STUB; }
475475-#if PSYNCH
476476-312 AUE_NULL ALL { int psynch_cvclrprepost(user_addr_t cv, uint32_t cvgen, uint32_t cvugen, uint32_t cvsgen, uint32_t prepocnt, uint32_t preposeq, uint32_t flags) NO_SYSCALL_STUB; }
477477-#else
478478-312 AUE_NULL ALL { int nosys(void); } { old __pthread_cond_timedwait }
479479-#endif
480480-313 AUE_NULL ALL { int aio_fsync(int op, user_addr_t aiocbp); }
481481-314 AUE_NULL ALL { user_ssize_t aio_return(user_addr_t aiocbp); }
482482-315 AUE_NULL ALL { int aio_suspend(user_addr_t aiocblist, int nent, user_addr_t timeoutp); }
483483-316 AUE_NULL ALL { int aio_cancel(int fd, user_addr_t aiocbp); }
484484-317 AUE_NULL ALL { int aio_error(user_addr_t aiocbp); }
485485-318 AUE_NULL ALL { int aio_read(user_addr_t aiocbp); }
486486-319 AUE_NULL ALL { int aio_write(user_addr_t aiocbp); }
487487-320 AUE_LIOLISTIO ALL { int lio_listio(int mode, user_addr_t aiocblist, int nent, user_addr_t sigp); }
488488-321 AUE_NULL ALL { int nosys(void); } { old __pthread_cond_wait }
489489-322 AUE_IOPOLICYSYS ALL { int iopolicysys(int cmd, void *arg) NO_SYSCALL_STUB; }
490490-323 AUE_NULL ALL { int process_policy(int scope, int action, int policy, int policy_subtype, user_addr_t attrp, pid_t target_pid, uint64_t target_threadid) NO_SYSCALL_STUB; }
491491-324 AUE_MLOCKALL ALL { int mlockall(int how); }
492492-325 AUE_MUNLOCKALL ALL { int munlockall(int how); }
493493-326 AUE_NULL ALL { int nosys(void); }
494494-327 AUE_ISSETUGID ALL { int issetugid(void); }
495495-328 AUE_PTHREADKILL ALL { int __pthread_kill(int thread_port, int sig); }
496496-329 AUE_PTHREADSIGMASK ALL { int __pthread_sigmask(int how, user_addr_t set, user_addr_t oset); }
497497-330 AUE_SIGWAIT ALL { int __sigwait(user_addr_t set, user_addr_t sig); }
498498-331 AUE_NULL ALL { int __disable_threadsignal(int value); }
499499-332 AUE_NULL ALL { int __pthread_markcancel(int thread_port); }
500500-333 AUE_NULL ALL { int __pthread_canceled(int action); }
501501-502502-;#if OLD_SEMWAIT_SIGNAL
503503-;334 AUE_NULL ALL { int nosys(void); } { old __semwait_signal }
504504-;#else
505505-334 AUE_SEMWAITSIGNAL ALL { int __semwait_signal(int cond_sem, int mutex_sem, int timeout, int relative, int64_t tv_sec, int32_t tv_nsec); }
506506-;#endif
507507-508508-335 AUE_NULL ALL { int nosys(void); } { old utrace }
509509-336 AUE_PROCINFO ALL { int proc_info(int32_t callnum,int32_t pid,uint32_t flavor, uint64_t arg,user_addr_t buffer,int32_t buffersize) NO_SYSCALL_STUB; }
510510-#if SENDFILE
511511-337 AUE_SENDFILE ALL { int sendfile(int fd, int s, off_t offset, off_t *nbytes, struct sf_hdtr *hdtr, int flags); }
512512-#else /* !SENDFILE */
513513-337 AUE_NULL ALL { int nosys(void); }
514514-#endif /* SENDFILE */
515515-338 AUE_STAT64 ALL { int stat64(user_addr_t path, user_addr_t ub); }
516516-339 AUE_FSTAT64 ALL { int fstat64(int fd, user_addr_t ub); }
517517-340 AUE_LSTAT64 ALL { int lstat64(user_addr_t path, user_addr_t ub); }
518518-341 AUE_STAT64_EXTENDED ALL { int stat64_extended(user_addr_t path, user_addr_t ub, user_addr_t xsecurity, user_addr_t xsecurity_size) NO_SYSCALL_STUB; }
519519-342 AUE_LSTAT64_EXTENDED ALL { int lstat64_extended(user_addr_t path, user_addr_t ub, user_addr_t xsecurity, user_addr_t xsecurity_size) NO_SYSCALL_STUB; }
520520-343 AUE_FSTAT64_EXTENDED ALL { int fstat64_extended(int fd, user_addr_t ub, user_addr_t xsecurity, user_addr_t xsecurity_size) NO_SYSCALL_STUB; }
521521-344 AUE_GETDIRENTRIES64 ALL { user_ssize_t getdirentries64(int fd, void *buf, user_size_t bufsize, off_t *position) NO_SYSCALL_STUB; }
522522-345 AUE_STATFS64 ALL { int statfs64(char *path, struct statfs64 *buf); }
523523-346 AUE_FSTATFS64 ALL { int fstatfs64(int fd, struct statfs64 *buf); }
524524-347 AUE_GETFSSTAT64 ALL { int getfsstat64(user_addr_t buf, int bufsize, int flags); }
525525-348 AUE_NULL ALL { int __pthread_chdir(user_addr_t path); }
526526-349 AUE_NULL ALL { int __pthread_fchdir(int fd); }
527527-350 AUE_AUDIT ALL { int audit(void *record, int length); }
528528-351 AUE_AUDITON ALL { int auditon(int cmd, void *data, int length); }
529529-352 AUE_NULL ALL { int nosys(void); }
530530-353 AUE_GETAUID ALL { int getauid(au_id_t *auid); }
531531-354 AUE_SETAUID ALL { int setauid(au_id_t *auid); }
532532-355 AUE_NULL ALL { int nosys(void); } { old getaudit }
533533-356 AUE_NULL ALL { int nosys(void); } { old setaudit }
534534-357 AUE_GETAUDIT_ADDR ALL { int getaudit_addr(struct auditinfo_addr *auditinfo_addr, int length); }
535535-358 AUE_SETAUDIT_ADDR ALL { int setaudit_addr(struct auditinfo_addr *auditinfo_addr, int length); }
536536-359 AUE_AUDITCTL ALL { int auditctl(char *path); }
537537-#if CONFIG_WORKQUEUE
538538-360 AUE_NULL ALL { user_addr_t bsdthread_create(user_addr_t func, user_addr_t func_arg, user_addr_t stack, user_addr_t pthread, uint32_t flags) NO_SYSCALL_STUB; }
539539-361 AUE_NULL ALL { int bsdthread_terminate(user_addr_t stackaddr, size_t freesize, uint32_t port, uint32_t sem) NO_SYSCALL_STUB; }
540540-#else
541541-360 AUE_NULL ALL { int nosys(void); }
542542-361 AUE_NULL ALL { int nosys(void); }
543543-#endif /* CONFIG_WORKQUEUE */
544544-362 AUE_KQUEUE ALL { int kqueue(void); }
545545-363 AUE_NULL ALL { int kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); }
546546-364 AUE_LCHOWN ALL { int lchown(user_addr_t path, uid_t owner, gid_t group) NO_SYSCALL_STUB; }
547547-365 AUE_NULL ALL { int nosys(void); } { old stack_snapshot }
548548-#if CONFIG_WORKQUEUE
549549-366 AUE_NULL ALL { int bsdthread_register(user_addr_t threadstart, user_addr_t wqthread, uint32_t flags, user_addr_t stack_addr_hint, user_addr_t targetconc_ptr, uint32_t dispatchqueue_offset, uint32_t tsd_offset) NO_SYSCALL_STUB; }
550550-367 AUE_WORKQOPEN ALL { int workq_open(void) NO_SYSCALL_STUB; }
551551-368 AUE_WORKQOPS ALL { int workq_kernreturn(int options, user_addr_t item, int affinity, int prio) NO_SYSCALL_STUB; }
552552-#else
553553-366 AUE_NULL ALL { int nosys(void); }
554554-367 AUE_NULL ALL { int nosys(void); }
555555-368 AUE_NULL ALL { int nosys(void); }
556556-#endif /* CONFIG_WORKQUEUE */
557557-369 AUE_NULL ALL { int kevent64(int fd, const struct kevent64_s *changelist, int nchanges, struct kevent64_s *eventlist, int nevents, unsigned int flags, const struct timespec *timeout); }
558558-#if OLD_SEMWAIT_SIGNAL
559559-370 AUE_SEMWAITSIGNAL ALL { int __old_semwait_signal(int cond_sem, int mutex_sem, int timeout, int relative, const struct timespec *ts); }
560560-371 AUE_SEMWAITSIGNAL ALL { int __old_semwait_signal_nocancel(int cond_sem, int mutex_sem, int timeout, int relative, const struct timespec *ts) NO_SYSCALL_STUB; }
561561-#else
562562-370 AUE_NULL ALL { int nosys(void); } { old __semwait_signal }
563563-371 AUE_NULL ALL { int nosys(void); } { old __semwait_signal }
564564-#endif
565565-372 AUE_NULL ALL { uint64_t thread_selfid (void) NO_SYSCALL_STUB; }
566566-373 AUE_LEDGER ALL { int ledger(int cmd, caddr_t arg1, caddr_t arg2, caddr_t arg3); }
567567-374 AUE_NULL ALL { int kevent_qos(int fd, const struct kevent_qos_s *changelist, int nchanges, struct kevent_qos_s *eventlist, int nevents, void *data_out, size_t *data_available, unsigned int flags); }
568568-375 AUE_NULL ALL { int kevent_id(uint64_t id, const struct kevent_qos_s *changelist, int nchanges, struct kevent_qos_s *eventlist, int nevents, void *data_out, size_t *data_available, unsigned int flags); }
569569-376 AUE_NULL ALL { int nosys(void); }
570570-377 AUE_NULL ALL { int nosys(void); }
571571-378 AUE_NULL ALL { int nosys(void); }
572572-379 AUE_NULL ALL { int nosys(void); }
573573-380 AUE_MAC_EXECVE ALL { int __mac_execve(char *fname, char **argp, char **envp, struct mac *mac_p); }
574574-#if CONFIG_MACF
575575-381 AUE_MAC_SYSCALL ALL { int __mac_syscall(char *policy, int call, user_addr_t arg); }
576576-382 AUE_MAC_GET_FILE ALL { int __mac_get_file(char *path_p, struct mac *mac_p); }
577577-383 AUE_MAC_SET_FILE ALL { int __mac_set_file(char *path_p, struct mac *mac_p); }
578578-384 AUE_MAC_GET_LINK ALL { int __mac_get_link(char *path_p, struct mac *mac_p); }
579579-385 AUE_MAC_SET_LINK ALL { int __mac_set_link(char *path_p, struct mac *mac_p); }
580580-386 AUE_MAC_GET_PROC ALL { int __mac_get_proc(struct mac *mac_p); }
581581-387 AUE_MAC_SET_PROC ALL { int __mac_set_proc(struct mac *mac_p); }
582582-388 AUE_MAC_GET_FD ALL { int __mac_get_fd(int fd, struct mac *mac_p); }
583583-389 AUE_MAC_SET_FD ALL { int __mac_set_fd(int fd, struct mac *mac_p); }
584584-390 AUE_MAC_GET_PID ALL { int __mac_get_pid(pid_t pid, struct mac *mac_p); }
585585-#else
586586-381 AUE_MAC_SYSCALL ALL { int enosys(void); }
587587-382 AUE_MAC_GET_FILE ALL { int nosys(void); }
588588-383 AUE_MAC_SET_FILE ALL { int nosys(void); }
589589-384 AUE_MAC_GET_LINK ALL { int nosys(void); }
590590-385 AUE_MAC_SET_LINK ALL { int nosys(void); }
591591-386 AUE_MAC_GET_PROC ALL { int nosys(void); }
592592-387 AUE_MAC_SET_PROC ALL { int nosys(void); }
593593-388 AUE_MAC_GET_FD ALL { int nosys(void); }
594594-389 AUE_MAC_SET_FD ALL { int nosys(void); }
595595-390 AUE_MAC_GET_PID ALL { int nosys(void); }
596596-#endif
597597-391 AUE_NULL ALL { int enosys(void); }
598598-392 AUE_NULL ALL { int enosys(void); }
599599-393 AUE_NULL ALL { int enosys(void); }
600600-394 AUE_SELECT ALL { int pselect(int nd, u_int32_t *in, u_int32_t *ou, u_int32_t *ex, const struct timespec *ts, const struct sigset_t *mask) NO_SYSCALL_STUB; }
601601-395 AUE_SELECT ALL { int pselect_nocancel(int nd, u_int32_t *in, u_int32_t *ou, u_int32_t *ex, const struct timespec *ts, const struct sigset_t *mask) NO_SYSCALL_STUB; }
602602-396 AUE_NULL ALL { user_ssize_t read_nocancel(int fd, user_addr_t cbuf, user_size_t nbyte) NO_SYSCALL_STUB; }
603603-397 AUE_NULL ALL { user_ssize_t write_nocancel(int fd, user_addr_t cbuf, user_size_t nbyte) NO_SYSCALL_STUB; }
604604-398 AUE_OPEN_RWTC ALL { int open_nocancel(user_addr_t path, int flags, int mode) NO_SYSCALL_STUB; }
605605-399 AUE_CLOSE ALL { int close_nocancel(int fd) NO_SYSCALL_STUB; }
606606-400 AUE_WAIT4 ALL { int wait4_nocancel(int pid, user_addr_t status, int options, user_addr_t rusage) NO_SYSCALL_STUB; }
607607-#if SOCKETS
608608-401 AUE_RECVMSG ALL { int recvmsg_nocancel(int s, struct msghdr *msg, int flags) NO_SYSCALL_STUB; }
609609-402 AUE_SENDMSG ALL { int sendmsg_nocancel(int s, caddr_t msg, int flags) NO_SYSCALL_STUB; }
610610-403 AUE_RECVFROM ALL { int recvfrom_nocancel(int s, void *buf, size_t len, int flags, struct sockaddr *from, int *fromlenaddr) NO_SYSCALL_STUB; }
611611-404 AUE_ACCEPT ALL { int accept_nocancel(int s, caddr_t name, socklen_t *anamelen) NO_SYSCALL_STUB; }
612612-#else
613613-401 AUE_NULL ALL { int nosys(void); }
614614-402 AUE_NULL ALL { int nosys(void); }
615615-403 AUE_NULL ALL { int nosys(void); }
616616-404 AUE_NULL ALL { int nosys(void); }
617617-#endif /* SOCKETS */
618618-405 AUE_MSYNC ALL { int msync_nocancel(caddr_t addr, size_t len, int flags) NO_SYSCALL_STUB; }
619619-406 AUE_FCNTL ALL { int fcntl_nocancel(int fd, int cmd, long arg) NO_SYSCALL_STUB; }
620620-407 AUE_SELECT ALL { int select_nocancel(int nd, u_int32_t *in, u_int32_t *ou, u_int32_t *ex, struct timeval *tv) NO_SYSCALL_STUB; }
621621-408 AUE_FSYNC ALL { int fsync_nocancel(int fd) NO_SYSCALL_STUB; }
622622-#if SOCKETS
623623-409 AUE_CONNECT ALL { int connect_nocancel(int s, caddr_t name, socklen_t namelen) NO_SYSCALL_STUB; }
624624-#else
625625-409 AUE_NULL ALL { int nosys(void); }
626626-#endif /* SOCKETS */
627627-410 AUE_NULL ALL { int sigsuspend_nocancel(sigset_t mask) NO_SYSCALL_STUB; }
628628-411 AUE_READV ALL { user_ssize_t readv_nocancel(int fd, struct iovec *iovp, u_int iovcnt) NO_SYSCALL_STUB; }
629629-412 AUE_WRITEV ALL { user_ssize_t writev_nocancel(int fd, struct iovec *iovp, u_int iovcnt) NO_SYSCALL_STUB; }
630630-#if SOCKETS
631631-413 AUE_SENDTO ALL { int sendto_nocancel(int s, caddr_t buf, size_t len, int flags, caddr_t to, socklen_t tolen) NO_SYSCALL_STUB; }
632632-#else
633633-413 AUE_NULL ALL { int nosys(void); }
634634-#endif /* SOCKETS */
635635-414 AUE_PREAD ALL { user_ssize_t pread_nocancel(int fd, user_addr_t buf, user_size_t nbyte, off_t offset) NO_SYSCALL_STUB; }
636636-415 AUE_PWRITE ALL { user_ssize_t pwrite_nocancel(int fd, user_addr_t buf, user_size_t nbyte, off_t offset) NO_SYSCALL_STUB; }
637637-416 AUE_WAITID ALL { int waitid_nocancel(idtype_t idtype, id_t id, siginfo_t *infop, int options) NO_SYSCALL_STUB; }
638638-417 AUE_POLL ALL { int poll_nocancel(struct pollfd *fds, u_int nfds, int timeout) NO_SYSCALL_STUB; }
639639-#if SYSV_MSG
640640-418 AUE_MSGSND ALL { int msgsnd_nocancel(int msqid, void *msgp, size_t msgsz, int msgflg) NO_SYSCALL_STUB; }
641641-419 AUE_MSGRCV ALL { user_ssize_t msgrcv_nocancel(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg) NO_SYSCALL_STUB; }
642642-#else
643643-418 AUE_NULL ALL { int nosys(void); }
644644-419 AUE_NULL ALL { int nosys(void); }
645645-#endif
646646-420 AUE_SEMWAIT ALL { int sem_wait_nocancel(sem_t *sem) NO_SYSCALL_STUB; }
647647-421 AUE_NULL ALL { int aio_suspend_nocancel(user_addr_t aiocblist, int nent, user_addr_t timeoutp) NO_SYSCALL_STUB; }
648648-422 AUE_SIGWAIT ALL { int __sigwait_nocancel(user_addr_t set, user_addr_t sig) NO_SYSCALL_STUB; }
649649-;#if OLD_SEMWAIT_SIGNAL
650650-;423 AUE_NULL ALL { int nosys(void); } { old __semwait_signal_nocancel }
651651-;#else
652652-423 AUE_SEMWAITSIGNAL ALL { int __semwait_signal_nocancel(int cond_sem, int mutex_sem, int timeout, int relative, int64_t tv_sec, int32_t tv_nsec); }
653653-;#endif
654654-424 AUE_MAC_MOUNT ALL { int __mac_mount(char *type, char *path, int flags, caddr_t data, struct mac *mac_p); }
655655-#if CONFIG_MACF
656656-425 AUE_MAC_GET_MOUNT ALL { int __mac_get_mount(char *path, struct mac *mac_p); }
657657-#else
658658-425 AUE_MAC_GET_MOUNT ALL { int nosys(void); }
659659-#endif
660660-426 AUE_MAC_GETFSSTAT ALL { int __mac_getfsstat(user_addr_t buf, int bufsize, user_addr_t mac, int macsize, int flags); }
661661-427 AUE_FSGETPATH ALL { user_ssize_t fsgetpath(user_addr_t buf, size_t bufsize, user_addr_t fsid, uint64_t objid); } { private fsgetpath (File Manager SPI) }
662662-428 AUE_NULL ALL { mach_port_name_t audit_session_self(void); }
663663-429 AUE_NULL ALL { int audit_session_join(mach_port_name_t port); }
664664-430 AUE_NULL ALL { int fileport_makeport(int fd, user_addr_t portnamep); }
665665-431 AUE_NULL ALL { int fileport_makefd(mach_port_name_t port); }
666666-432 AUE_NULL ALL { int audit_session_port(au_asid_t asid, user_addr_t portnamep); }
667667-433 AUE_NULL ALL { int pid_suspend(int pid); }
668668-434 AUE_NULL ALL { int pid_resume(int pid); }
669669-#if CONFIG_EMBEDDED
670670-435 AUE_NULL ALL { int pid_hibernate(int pid); }
671671-#else
672672-435 AUE_NULL ALL { int nosys(void); }
673673-#endif
674674-#if SOCKETS
675675-436 AUE_NULL ALL { int pid_shutdown_sockets(int pid, int level); }
676676-#else
677677-436 AUE_NULL ALL { int nosys(void); }
678678-#endif
679679-437 AUE_NULL ALL { int nosys(void); } { old shared_region_slide_np }
680680-438 AUE_NULL ALL { int shared_region_map_and_slide_np(int fd, uint32_t count, const struct shared_file_mapping_np *mappings, uint32_t slide, uint64_t* slide_start, uint32_t slide_size) NO_SYSCALL_STUB; }
681681-439 AUE_NULL ALL { int kas_info(int selector, void *value, size_t *size); }
682682-#if CONFIG_MEMORYSTATUS
683683-440 AUE_NULL ALL { int memorystatus_control(uint32_t command, int32_t pid, uint32_t flags, user_addr_t buffer, size_t buffersize); }
684684-#else
685685-440 AUE_NULL ALL { int nosys(void); }
686686-#endif
687687-441 AUE_OPEN_RWTC ALL { int guarded_open_np(user_addr_t path, const guardid_t *guard, u_int guardflags, int flags, int mode) NO_SYSCALL_STUB; }
688688-442 AUE_CLOSE ALL { int guarded_close_np(int fd, const guardid_t *guard); }
689689-443 AUE_KQUEUE ALL { int guarded_kqueue_np(const guardid_t *guard, u_int guardflags); }
690690-444 AUE_NULL ALL { int change_fdguard_np(int fd, const guardid_t *guard, u_int guardflags, const guardid_t *nguard, u_int nguardflags, int *fdflagsp); }
691691-445 AUE_USRCTL ALL { int usrctl(uint32_t flags); }
692692-446 AUE_NULL ALL { int proc_rlimit_control(pid_t pid, int flavor, void *arg); }
693693-#if SOCKETS
694694-447 AUE_CONNECT ALL { int connectx(int socket, const sa_endpoints_t *endpoints, sae_associd_t associd, unsigned int flags, const struct iovec *iov, unsigned int iovcnt, size_t *len, sae_connid_t *connid); }
695695-448 AUE_NULL ALL { int disconnectx(int s, sae_associd_t aid, sae_connid_t cid); }
696696-449 AUE_NULL ALL { int peeloff(int s, sae_associd_t aid); }
697697-450 AUE_SOCKET ALL { int socket_delegate(int domain, int type, int protocol, pid_t epid); }
698698-#else
699699-447 AUE_NULL ALL { int nosys(void); }
700700-448 AUE_NULL ALL { int nosys(void); }
701701-449 AUE_NULL ALL { int nosys(void); }
702702-450 AUE_NULL ALL { int nosys(void); }
703703-#endif /* SOCKETS */
704704-451 AUE_NULL ALL { int telemetry(uint64_t cmd, uint64_t deadline, uint64_t interval, uint64_t leeway, uint64_t arg4, uint64_t arg5) NO_SYSCALL_STUB; }
705705-#if CONFIG_PROC_UUID_POLICY
706706-452 AUE_NULL ALL { int proc_uuid_policy(uint32_t operation, uuid_t uuid, size_t uuidlen, uint32_t flags); }
707707-#else
708708-452 AUE_NULL ALL { int nosys(void); }
709709-#endif
710710-#if CONFIG_MEMORYSTATUS
711711-453 AUE_NULL ALL { int memorystatus_get_level(user_addr_t level); }
712712-#else
713713-453 AUE_NULL ALL { int nosys(void); }
714714-#endif
715715-454 AUE_NULL ALL { int system_override(uint64_t timeout, uint64_t flags); }
716716-455 AUE_NULL ALL { int vfs_purge(void); }
717717-456 AUE_NULL ALL { int sfi_ctl(uint32_t operation, uint32_t sfi_class, uint64_t time, uint64_t *out_time) NO_SYSCALL_STUB; }
718718-457 AUE_NULL ALL { int sfi_pidctl(uint32_t operation, pid_t pid, uint32_t sfi_flags, uint32_t *out_sfi_flags) NO_SYSCALL_STUB; }
719719-#if CONFIG_COALITIONS
720720-458 AUE_NULL ALL { int coalition(uint32_t operation, uint64_t *cid, uint32_t flags) NO_SYSCALL_STUB; }
721721-459 AUE_NULL ALL { int coalition_info(uint32_t flavor, uint64_t *cid, void *buffer, size_t *bufsize) NO_SYSCALL_STUB; }
722722-#else
723723-458 AUE_NULL ALL { int enosys(void); }
724724-459 AUE_NULL ALL { int enosys(void); }
725725-#endif /* COALITIONS */
726726-#if NECP
727727-460 AUE_NECP ALL { int necp_match_policy(uint8_t *parameters, size_t parameters_size, struct necp_aggregate_result *returned_result); }
728728-#else
729729-460 AUE_NULL ALL { int nosys(void); }
730730-#endif /* NECP */
731731-461 AUE_GETATTRLISTBULK ALL { int getattrlistbulk(int dirfd, struct attrlist *alist, void *attributeBuffer, size_t bufferSize, uint64_t options); }
732732-462 AUE_CLONEFILEAT ALL { int clonefileat(int src_dirfd, user_addr_t src, int dst_dirfd, user_addr_t dst, uint32_t flags); }
733733-463 AUE_OPENAT_RWTC ALL { int openat(int fd, user_addr_t path, int flags, int mode) NO_SYSCALL_STUB; }
734734-464 AUE_OPENAT_RWTC ALL { int openat_nocancel(int fd, user_addr_t path, int flags, int mode) NO_SYSCALL_STUB; }
735735-465 AUE_RENAMEAT ALL { int renameat(int fromfd, char *from, int tofd, char *to) NO_SYSCALL_STUB; }
736736-466 AUE_FACCESSAT ALL { int faccessat(int fd, user_addr_t path, int amode, int flag); }
737737-467 AUE_FCHMODAT ALL { int fchmodat(int fd, user_addr_t path, int mode, int flag); }
738738-468 AUE_FCHOWNAT ALL { int fchownat(int fd, user_addr_t path, uid_t uid,gid_t gid, int flag); }
739739-469 AUE_FSTATAT ALL { int fstatat(int fd, user_addr_t path, user_addr_t ub, int flag); }
740740-470 AUE_FSTATAT ALL { int fstatat64(int fd, user_addr_t path, user_addr_t ub, int flag); }
741741-471 AUE_LINKAT ALL { int linkat(int fd1, user_addr_t path, int fd2, user_addr_t link, int flag); }
742742-472 AUE_UNLINKAT ALL { int unlinkat(int fd, user_addr_t path, int flag) NO_SYSCALL_STUB; }
743743-473 AUE_READLINKAT ALL { int readlinkat(int fd, user_addr_t path, user_addr_t buf, size_t bufsize); }
744744-474 AUE_SYMLINKAT ALL { int symlinkat(user_addr_t *path1, int fd, user_addr_t path2); }
745745-475 AUE_MKDIRAT ALL { int mkdirat(int fd, user_addr_t path, int mode); }
746746-476 AUE_GETATTRLISTAT ALL { int getattrlistat(int fd, const char *path, struct attrlist *alist, void *attributeBuffer, size_t bufferSize, u_long options); }
747747-477 AUE_NULL ALL { int proc_trace_log(pid_t pid, uint64_t uniqueid); }
748748-478 AUE_NULL ALL { int bsdthread_ctl(user_addr_t cmd, user_addr_t arg1, user_addr_t arg2, user_addr_t arg3) NO_SYSCALL_STUB; }
749749-479 AUE_OPENBYID_RWT ALL { int openbyid_np(user_addr_t fsid, user_addr_t objid, int oflags); }
750750-#if SOCKETS
751751-480 AUE_NULL ALL { user_ssize_t recvmsg_x(int s, struct msghdr_x *msgp, u_int cnt, int flags); }
752752-481 AUE_NULL ALL { user_ssize_t sendmsg_x(int s, struct msghdr_x *msgp, u_int cnt, int flags); }
753753-#else
754754-480 AUE_NULL ALL { int nosys(void); }
755755-481 AUE_NULL ALL { int nosys(void); }
756756-#endif /* SOCKETS */
757757-482 AUE_NULL ALL { uint64_t thread_selfusage(void) NO_SYSCALL_STUB; }
758758-#if CONFIG_CSR
759759-483 AUE_NULL ALL { int csrctl(uint32_t op, user_addr_t useraddr, user_addr_t usersize) NO_SYSCALL_STUB; }
760760-#else
761761-483 AUE_NULL ALL { int enosys(void); }
762762-#endif /* CSR */
763763-484 AUE_NULL ALL { int guarded_open_dprotected_np(user_addr_t path, const guardid_t *guard, u_int guardflags, int flags, int dpclass, int dpflags, int mode) NO_SYSCALL_STUB; }
764764-485 AUE_NULL ALL { user_ssize_t guarded_write_np(int fd, const guardid_t *guard, user_addr_t cbuf, user_size_t nbyte); }
765765-486 AUE_PWRITE ALL { user_ssize_t guarded_pwrite_np(int fd, const guardid_t *guard, user_addr_t buf, user_size_t nbyte, off_t offset); }
766766-487 AUE_WRITEV ALL { user_ssize_t guarded_writev_np(int fd, const guardid_t *guard, struct iovec *iovp, int iovcnt); }
767767-488 AUE_RENAMEAT ALL { int renameatx_np(int fromfd, char *from, int tofd, char *to, u_int flags) NO_SYSCALL_STUB; }
768768-#if CONFIG_CODE_DECRYPTION
769769-489 AUE_MPROTECT ALL { int mremap_encrypted(caddr_t addr, size_t len, uint32_t cryptid, uint32_t cputype, uint32_t cpusubtype); }
770770-#else
771771-489 AUE_NULL ALL { int enosys(void); }
772772-#endif
773773-#if NETWORKING
774774-490 AUE_NETAGENT ALL { int netagent_trigger(uuid_t agent_uuid, size_t agent_uuidlen); }
775775-#else
776776-490 AUE_NULL ALL { int nosys(void); }
777777-#endif /* NETWORKING */
778778-491 AUE_STACKSNAPSHOT ALL { int stack_snapshot_with_config(int stackshot_config_version, user_addr_t stackshot_config, size_t stackshot_config_size) NO_SYSCALL_STUB; }
779779-#if CONFIG_TELEMETRY
780780-492 AUE_STACKSNAPSHOT ALL { int microstackshot(user_addr_t tracebuf, uint32_t tracebuf_size, uint32_t flags) NO_SYSCALL_STUB; }
781781-#else
782782-492 AUE_NULL ALL { int enosys(void); }
783783-#endif /* CONFIG_TELEMETRY */
784784-#if PGO
785785-493 AUE_NULL ALL { user_ssize_t grab_pgo_data (user_addr_t uuid, int flags, user_addr_t buffer, user_ssize_t size); }
786786-#else
787787-493 AUE_NULL ALL { int enosys(void); }
788788-#endif
789789-#if CONFIG_PERSONAS
790790-494 AUE_PERSONA ALL { int persona(uint32_t operation, uint32_t flags, struct kpersona_info *info, uid_t *id, size_t *idlen, char *path) NO_SYSCALL_STUB; }
791791-#else
792792-494 AUE_NULL ALL { int enosys(void); }
793793-#endif
794794-495 AUE_NULL ALL { int enosys(void); }
795795-496 AUE_NULL ALL { int enosys(void); }
796796-497 AUE_NULL ALL { int enosys(void); }
797797-498 AUE_NULL ALL { int enosys(void); }
798798-499 AUE_NULL ALL { int work_interval_ctl(uint32_t operation, uint64_t work_interval_id, void *arg, size_t len) NO_SYSCALL_STUB; }
799799-500 AUE_NULL ALL { int getentropy(void *buffer, size_t size); }
800800-#if NECP
801801-501 AUE_NECP ALL { int necp_open(int flags); } }
802802-502 AUE_NECP ALL { int necp_client_action(int necp_fd, uint32_t action, uuid_t client_id, size_t client_id_len, uint8_t *buffer, size_t buffer_size); }
803803-#else
804804-501 AUE_NULL ALL { int enosys(void); }
805805-502 AUE_NULL ALL { int enosys(void); }
806806-#endif /* NECP */
807807-503 AUE_NULL ALL { int enosys(void); }
808808-504 AUE_NULL ALL { int enosys(void); }
809809-505 AUE_NULL ALL { int enosys(void); }
810810-506 AUE_NULL ALL { int enosys(void); }
811811-507 AUE_NULL ALL { int enosys(void); }
812812-508 AUE_NULL ALL { int enosys(void); }
813813-509 AUE_NULL ALL { int enosys(void); }
814814-510 AUE_NULL ALL { int enosys(void); }
815815-511 AUE_NULL ALL { int enosys(void); }
816816-512 AUE_NULL ALL { int enosys(void); }
817817-513 AUE_NULL ALL { int enosys(void); }
818818-514 AUE_NULL ALL { int enosys(void); }
819819-515 AUE_NULL ALL { int ulock_wait(uint32_t operation, void *addr, uint64_t value, uint32_t timeout) NO_SYSCALL_STUB; }
820820-516 AUE_NULL ALL { int ulock_wake(uint32_t operation, void *addr, uint64_t wake_value) NO_SYSCALL_STUB; }
821821-517 AUE_FCLONEFILEAT ALL { int fclonefileat(int src_fd, int dst_dirfd, user_addr_t dst, uint32_t flags); }
822822-518 AUE_NULL ALL { int fs_snapshot(uint32_t op, int dirfd, user_addr_t name1, user_addr_t name2, user_addr_t data, uint32_t flags) NO_SYSCALL_STUB; }
823823-519 AUE_NULL ALL { int enosys(void); }
824824-520 AUE_KILL ALL { int terminate_with_payload(int pid, uint32_t reason_namespace, uint64_t reason_code, void *payload, uint32_t payload_size, const char *reason_string, uint64_t reason_flags) NO_SYSCALL_STUB; }
825825-521 AUE_EXIT ALL { void abort_with_payload(uint32_t reason_namespace, uint64_t reason_code, void *payload, uint32_t payload_size, const char *reason_string, uint64_t reason_flags) NO_SYSCALL_STUB; }
826826-#if NECP
827827-522 AUE_NECP ALL { int necp_session_open(int flags); } }
828828-523 AUE_NECP ALL { int necp_session_action(int necp_fd, uint32_t action, uint8_t *in_buffer, size_t in_buffer_length, uint8_t *out_buffer, size_t out_buffer_length); }
829829-#else /* NECP */
830830-522 AUE_NULL ALL { int enosys(void); }
831831-523 AUE_NULL ALL { int enosys(void); }
832832-#endif /* NECP */
833833-524 AUE_SETATTRLISTAT ALL { int setattrlistat(int fd, const char *path, struct attrlist *alist, void *attributeBuffer, size_t bufferSize, uint32_t options); }
834834-525 AUE_NET ALL { int net_qos_guideline(struct net_qos_param *param, uint32_t param_len); }
835835-526 AUE_FMOUNT ALL { int fmount(const char *type, int fd, int flags, void *data); }
836836-527 AUE_NULL ALL { int ntp_adjtime(struct timex *tp); }
837837-528 AUE_NULL ALL { int ntp_gettime(struct ntptimeval *ntvp); }
838838-529 AUE_NULL ALL { int os_fault_with_payload(uint32_t reason_namespace, uint64_t reason_code, void *payload, uint32_t payload_size, const char *reason_string, uint64_t reason_flags); }
839839-#if CONFIG_WORKQUEUE
840840-530 AUE_WORKLOOPCTL ALL { int kqueue_workloop_ctl(user_addr_t cmd, uint64_t options, user_addr_t addr, size_t sz) NO_SYSCALL_STUB; }
841841-#else
842842-530 AUE_NULL ALL { int enosys(void); }
843843-#endif // CONFIG_WORKQUEUE
844844-531 AUE_NULL ALL { uint64_t __mach_bridge_remote_time(uint64_t local_timestamp); }
845845-#if CONFIG_COALITIONS
846846-532 AUE_NULL ALL { int coalition_ledger(uint32_t operation, uint64_t *cid, void *buffer, size_t *bufsize) NO_SYSCALL_STUB; }
847847-#else
848848-532 AUE_NULL ALL { int enosys(void); }
849849-#endif // CONFIG_COALITIONS
850850-533 AUE_NULL ALL { int log_data(unsigned int tag, unsigned int flags, void *buffer, unsigned int size) NO_SYSCALL_STUB; }
851851-534 AUE_NULL ALL { uint64_t memorystatus_available_memory(void) NO_SYSCALL_STUB; }