X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/4452a7af2eac33dbad800bcc91f2399d62c18f53..813fb2f63a553c957e917ede5f119b021d6ce391:/osfmk/mach/i386/syscall_sw.h diff --git a/osfmk/mach/i386/syscall_sw.h b/osfmk/mach/i386/syscall_sw.h index ac8999730..abef968a7 100644 --- a/osfmk/mach/i386/syscall_sw.h +++ b/osfmk/mach/i386/syscall_sw.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -53,9 +53,6 @@ * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ -/* - */ - #ifdef PRIVATE #ifndef _MACH_I386_SYSCALL_SW_H_ @@ -63,7 +60,6 @@ #include -#if defined(__i386__) /* * Software interrupt codes for 32-bit system call entry: */ @@ -72,30 +68,29 @@ #define MACHDEP_INT 0x82 #define DIAG_INT 0x83 +#if defined(__i386__) + #ifndef KERNEL /* * Syscall entry macros for use in libc: - * [Note that the nop padding is temporary during 4/4 transition.] */ -#define SYSENTER_PAD nop;nop; -#define SYSCALL_PAD nop;nop;nop;nop;nop; #define UNIX_SYSCALL_TRAP \ - SYSCALL_PAD \ int $(UNIX_INT) #define MACHDEP_SYSCALL_TRAP \ - SYSCALL_PAD \ int $(MACHDEP_INT) /* * Macro to generate Mach call stubs in libc: */ + #define kernel_trap(trap_name,trap_number,number_args) \ LEAF(_##trap_name,0) ;\ - movl $##trap_number,%eax ;\ - int $(MACH_INT) ;\ + movl $##trap_number, %eax ;\ + call __sysenter_trap ;\ END(_##trap_name) -#endif +#endif /* !KERNEL */ + #endif /* defined(__i386__) */ #if defined(__x86_64__) @@ -121,7 +116,8 @@ LEAF(_##trap_name,0) ;\ syscall ;\ END(_##trap_name) -#endif +#endif /* !KERNEL */ + #endif /* defined(__x86_64__) */ /* @@ -140,11 +136,20 @@ END(_##trap_name) #define SYSCALL_CLASS_MASK (0xFF << SYSCALL_CLASS_SHIFT) #define SYSCALL_NUMBER_MASK (~SYSCALL_CLASS_MASK) +#define I386_SYSCALL_CLASS_MASK SYSCALL_CLASS_MASK +#define I386_SYSCALL_ARG_BYTES_SHIFT (16) +#define I386_SYSCALL_ARG_DWORDS_SHIFT (I386_SYSCALL_ARG_BYTES_SHIFT + 2) +#define I386_SYSCALL_ARG_BYTES_NUM (64) /* Must be <= sizeof(uu_arg) */ +#define I386_SYSCALL_ARG_DWORDS_MASK ((I386_SYSCALL_ARG_BYTES_NUM >> 2) -1) +#define I386_SYSCALL_ARG_BYTES_MASK (((I386_SYSCALL_ARG_BYTES_NUM -1)&~0x3) << I386_SYSCALL_ARG_BYTES_SHIFT) +#define I386_SYSCALL_NUMBER_MASK (0xFFFF) + #define SYSCALL_CLASS_NONE 0 /* Invalid */ #define SYSCALL_CLASS_MACH 1 /* Mach */ #define SYSCALL_CLASS_UNIX 2 /* Unix/BSD */ #define SYSCALL_CLASS_MDEP 3 /* Machine-dependent */ #define SYSCALL_CLASS_DIAG 4 /* Diagnostics */ +#define SYSCALL_CLASS_IPC 5 /* Mach IPC */ /* Macros to simpllfy constructing syscall numbers. */ #define SYSCALL_CONSTRUCT_MACH(syscall_number) \