]> git.saurik.com Git - apple/libc.git/blob - sys.subproj/i386.subproj/SYS.h
Libc-166.tar.gz
[apple/libc.git] / sys.subproj / i386.subproj / SYS.h
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved
24 *
25 * File: SYS.h
26 *
27 * Definition of the user side of the UNIX system call interface
28 * for i386.
29 *
30 * HISTORY
31 * 12-3-92 Bruce Martin (Bruce_Martin@next.com)
32 * Created.
33 */
34
35 #define KERNEL_PRIVATE 1
36 /*
37 * Headers
38 */
39 #include <sys/syscall.h>
40 #include <architecture/i386/asm_help.h>
41 #include <mach/i386/syscall_sw.h>
42
43
44 #define UNIX_SYSCALL_TRAP lcall $0x2b, $0
45 #define MACHDEP_SYSCALL_TRAP lcall $0x7, $0
46
47
48 #define UNIX_SYSCALL(name, nargs) \
49 .globl cerror ;\
50 LEAF(_##name, 0) ;\
51 movl $SYS_##name, %eax ;\
52 UNIX_SYSCALL_TRAP ;\
53 jnb 2f ;\
54 BRANCH_EXTERN(cerror) ;\
55 2:
56
57 #define UNIX_SYSCALL_NONAME(name, nargs) \
58 .globl cerror ;\
59 movl $SYS_##name, %eax ;\
60 UNIX_SYSCALL_TRAP ;\
61 jnb 2f ;\
62 BRANCH_EXTERN(cerror) ;\
63 2:
64
65 #define PSEUDO(pseudo, name, nargs) \
66 LEAF(_##pseudo, 0) ;\
67 UNIX_SYSCALL_NONAME(name, nargs)
68
69 #if !defined(SYS_getdirentriesattr)
70 #define SYS_getdirentriesattr 222
71 #endif
72
73 #if !defined(SYS_semsys)
74 #define SYS_semsys 251
75 #define SYS_msgsys 252
76 #define SYS_shmsys 253
77 #define SYS_semctl 254
78 #define SYS_semget 255
79 #define SYS_semop 256
80 #define SYS_semconfig 257
81 #define SYS_msgctl 258
82 #define SYS_msgget 259
83 #define SYS_msgsnd 260
84 #define SYS_msgrcv 261
85 #define SYS_shmat 262
86 #define SYS_shmctl 263
87 #define SYS_shmdt 264
88 #define SYS_shmget 265
89 #endif
90