]>
git.saurik.com Git - apple/libc.git/blob - ppc/sys/SYS.h
2 * Copyright (c) 1999-2004 Apple Computer, 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@
23 /* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
27 * Definition of the user side of the UNIX system call interface
30 * Errors are flagged by the location of the trap return (ie., which
31 * instruction is executed upon rfi):
33 * SC PC + 4: Error (typically branch to cerror())
37 * 18-Nov-92 Ben Fathi (benf@next.com)
40 * 9-Jan-92 Peter King (king@next.com)
47 #include <architecture/ppc/mode_independent_asm.h>
48 #import <sys/syscall.h>
50 /* From rhapsody kernel mach/ppc/syscall_sw.h */
51 #define kernel_trap_args_0
52 #define kernel_trap_args_1
53 #define kernel_trap_args_2
54 #define kernel_trap_args_3
55 #define kernel_trap_args_4
56 #define kernel_trap_args_5
57 #define kernel_trap_args_6
58 #define kernel_trap_args_7
61 * simple_kernel_trap -- Mach system calls with 8 or less args
62 * Args are passed in a0 - a7, system call number in r0.
63 * Do a "sc" instruction to enter kernel.
65 #define simple_kernel_trap(trap_name, trap_number) \
66 .globl _##trap_name @\
72 #define kernel_trap_0(trap_name,trap_number) \
73 simple_kernel_trap(trap_name,trap_number)
75 #define kernel_trap_1(trap_name,trap_number) \
76 simple_kernel_trap(trap_name,trap_number)
78 #define kernel_trap_2(trap_name,trap_number) \
79 simple_kernel_trap(trap_name,trap_number)
81 #define kernel_trap_3(trap_name,trap_number) \
82 simple_kernel_trap(trap_name,trap_number)
84 #define kernel_trap_4(trap_name,trap_number) \
85 simple_kernel_trap(trap_name,trap_number)
87 #define kernel_trap_5(trap_name,trap_number) \
88 simple_kernel_trap(trap_name,trap_number)
90 #define kernel_trap_6(trap_name,trap_number) \
91 simple_kernel_trap(trap_name,trap_number)
93 #define kernel_trap_7(trap_name,trap_number) \
94 simple_kernel_trap(trap_name,trap_number)
96 #define kernel_trap_8(trap_name,trap_number) \
97 simple_kernel_trap(trap_name,trap_number)
99 #define kernel_trap_9(trap_name,trap_number) \
100 simple_kernel_trap(trap_name,trap_number)
102 /* End of rhapsody kernel mach/ppc/syscall_sw.h */
109 * This is the same as SYSCALL, but it can call an alternate error
110 * return function. It's generic to support potential future callers.
112 #define SYSCALL_ERR(name, nargs, error_ret) \
114 MI_ENTRY_POINT(_##name) @\
115 kernel_trap_args_##nargs @\
120 1: MI_BRANCH_EXTERNAL(error_ret)
122 #define SYSCALL(name, nargs) \
124 MI_ENTRY_POINT(_##name) @\
125 kernel_trap_args_##nargs @\
130 1: MI_BRANCH_EXTERNAL(cerror)
133 #define SYSCALL_NONAME(name, nargs) \
135 kernel_trap_args_##nargs @\
140 1: MI_BRANCH_EXTERNAL(cerror) @\
144 #define PSEUDO(pseudo, name, nargs) \
149 SYSCALL_NONAME(name, nargs)
151 #define PSEUDO_ERR(pseudo, name, nargs, error_ret) \
157 kernel_trap_args_##nargs @\
162 1: MI_BRANCH_EXTERNAL(error_ret)
166 #import <mach/ppc/syscall_sw.h>