Loading...
--- Libc/Libc-262/ppc/sys/SYS.h
+++ Libc/Libc-498/ppc/sys/SYS.h
@@ -1,21 +1,22 @@
/*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License"). You may not use this file except in compliance with the
- * License. Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
*
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
@@ -40,13 +41,10 @@
* Created.
*/
-#define KERNEL_PRIVATE 1
/*
* Header files.
*/
-#import <architecture/ppc/asm_help.h>
-#import <architecture/ppc/pseudo_inst.h>
-#import <mach/ppc/exception.h>
+#include <architecture/ppc/mode_independent_asm.h>
#import <sys/syscall.h>
/* From rhapsody kernel mach/ppc/syscall_sw.h */
@@ -69,8 +67,7 @@
_##trap_name: @\
li r0,trap_number @\
sc @\
- blr @\
- END(trap_name)
+ blr
#define kernel_trap_0(trap_name,trap_number) \
simple_kernel_trap(trap_name,trap_number)
@@ -108,56 +105,62 @@
* Macros.
*/
+/*
+ * This is the same as SYSCALL, but it can call an alternate error
+ * return function. It's generic to support potential future callers.
+ */
+#define SYSCALL_ERR(name, nargs, error_ret) \
+ .globl error_ret @\
+ MI_ENTRY_POINT(_##name) @\
+ kernel_trap_args_##nargs @\
+ li r0,SYS_##name @\
+ sc @\
+ b 1f @\
+ blr @\
+1: MI_BRANCH_EXTERNAL(error_ret)
+
#define SYSCALL(name, nargs) \
.globl cerror @\
-LEAF(_##name) @\
- kernel_trap_args_##nargs @\
+ MI_ENTRY_POINT(_##name) @\
+ kernel_trap_args_##nargs @\
li r0,SYS_##name @\
- sc @\
- b 1f @\
- b 2f @\
-1: BRANCH_EXTERN(cerror) @\
-.text \
-2: nop
+ sc @\
+ b 1f @\
+ blr @\
+1: MI_BRANCH_EXTERNAL(cerror)
+
#define SYSCALL_NONAME(name, nargs) \
.globl cerror @\
- kernel_trap_args_##nargs @\
+ kernel_trap_args_##nargs @\
li r0,SYS_##name @\
- sc @\
- b 1f @\
- b 2f @\
-1: BRANCH_EXTERN(cerror) @\
-.text \
-2: nop
+ sc @\
+ b 1f @\
+ b 2f @\
+1: MI_BRANCH_EXTERNAL(cerror) @\
+2:
+
#define PSEUDO(pseudo, name, nargs) \
-LEAF(_##pseudo) @\
+ .globl _##pseudo @\
+ .text @\
+ .align 2 @\
+_##pseudo: @\
SYSCALL_NONAME(name, nargs)
+
+#define PSEUDO_ERR(pseudo, name, nargs, error_ret) \
+ .globl _##pseudo @\
+ .globl error_ret @\
+ .text @\
+ .align 2 @\
+_##pseudo: @\
+ kernel_trap_args_##nargs @\
+ li r0,SYS_##name @\
+ sc @\
+ b 1f @\
+ blr @\
+1: MI_BRANCH_EXTERNAL(error_ret)
#undef END
#import <mach/ppc/syscall_sw.h>
-
-#if !defined(SYS_getdirentriesattr)
-#define SYS_getdirentriesattr 222
-#endif
-
-#if !defined(SYS_semsys)
-#define SYS_semsys 251
-#define SYS_msgsys 252
-#define SYS_shmsys 253
-#define SYS_semctl 254
-#define SYS_semget 255
-#define SYS_semop 256
-#define SYS_semconfig 257
-#define SYS_msgctl 258
-#define SYS_msgget 259
-#define SYS_msgsnd 260
-#define SYS_msgrcv 261
-#define SYS_shmat 262
-#define SYS_shmctl 263
-#define SYS_shmdt 264
-#define SYS_shmget 265
-#endif
-