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)
41 MI_CALL_EXTERNAL(___sem_open)
46 * int open(const char *name, int oflag, ...);
47 * int __open(const char *name, int oflag, int mode, int value);
52 MI_CALL_EXTERNAL(___open)
57 * int open_nocancel(const char *name, int oflag, ...);
58 * int __open_nocancel(const char *name, int oflag, int mode);
60 MI_ENTRY_POINT(_open$NOCANCEL)
63 MI_CALL_EXTERNAL(___open_nocancel)
68 * int openat(int fd,const char *name, int oflag, ...);
69 * int __openat(int fd, const char *name, int oflag, int mode, int value);
71 MI_ENTRY_POINT(_openat)
74 MI_CALL_EXTERNAL(___openat)
79 * int openat_nocancel(int fd, const char *name, int oflag, ...);
80 * int __openat_nocancel(int fd, const char *name, int oflag, int mode);
82 MI_ENTRY_POINT(_openat$NOCANCEL)
85 MI_CALL_EXTERNAL(___openat_nocancel)
90 * int shm_open(const char *, int, ...);
91 * int __shm_open(const char*, int oflag, int mode);
93 MI_ENTRY_POINT(_shm_open)
96 MI_CALL_EXTERNAL(___shm_open)
101 * int msgsys(int, ...);
102 * int __msgsys(int which, int a2, int a3, int a4, int a5);
104 MI_ENTRY_POINT(_msgsys)
106 ldp x1, x2, [fp, #16]
107 ldp x3, x4, [fp, #32]
108 MI_CALL_EXTERNAL(___msgsys)
113 * int semsys(int, ...);
114 * int __semsys(int which, int a2, int a3, int a4, int a5);
116 MI_ENTRY_POINT(_semsys)
118 ldp x1, x2, [fp, #16]
119 ldp x3, x4, [fp, #32]
120 MI_CALL_EXTERNAL(___semsys)
125 * int semctl(int, int, int, ...);
126 * int __semctl(int semid, int semnum, int cmd, semun_t arg);
128 MI_ENTRY_POINT(_semctl)
131 MI_CALL_EXTERNAL(___semctl)
136 * int shmsys(int, ...);
137 * int __shmsys(int which, int a2, int a3, int a4);
139 MI_ENTRY_POINT(_shmsys)
141 ldp x1, x2, [fp, #16]
143 MI_CALL_EXTERNAL(___shmsys)
147 #endif /* defined(__arm64__) */