2 * Copyright (c) 2011-2013 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
26 #include "../custom/SYS.h"
27 #include <mach/arm64/asm.h>
30 * Stubs are to handle the ARM64 ABI for variadic functions'
31 * not matching the ABI used by the system call handler.
35 * sem_t* sem_open(const char *name, int oflag, ...);
36 * sem_t* __sem_open(const char *name, int oflag, int mode, int value);
38 MI_ENTRY_POINT(_sem_open)
46 MI_CALL_EXTERNAL(___sem_open)
48 /* xnu returns a 64-bit '-1' on failure, but pointers must have the high
49 * 32-bits set to zero. The following instruction is equivalent to
50 * masking off the top 32-bits.
58 * int shm_open(const char *, int, ...);
59 * int __shm_open(const char*, int oflag, int mode);
61 MI_ENTRY_POINT(_shm_open)
69 MI_CALL_EXTERNAL(___shm_open)
74 * int msgsys(int, ...);
75 * int __msgsys(int which, int a2, int a3, int a4, int a5);
77 MI_ENTRY_POINT(_msgsys)
87 MI_CALL_EXTERNAL(___msgsys)
91 * int semsys(int, ...);
92 * int __semsys(int which, int a2, int a3, int a4, int a5);
94 MI_ENTRY_POINT(_semsys)
101 ldp w1, w2, [fp, #16]
102 ldp w3, w4, [fp, #24]
104 MI_CALL_EXTERNAL(___semsys)
109 * int semctl(int, int, int, ...);
110 * int __semctl(int semid, int semnum, int cmd, semun_t arg);
112 MI_ENTRY_POINT(_semctl)
120 MI_CALL_EXTERNAL(___semctl)
125 * int shmsys(int, ...);
126 * int __shmsys(int which, int a2, int a3, int a4);
128 MI_ENTRY_POINT(_shmsys)
132 ldp x1, x2, [fp, #16]
135 ldp w1, w2, [fp, #16]
138 MI_CALL_EXTERNAL(___shmsys)
142 #endif /* defined(__arm64__) */