From 8872f037708d83d8b71de6747be499066d287455 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 6 Apr 2020 22:16:05 +0200 Subject: mach_trap_table: Fix 64bit version The addition of the mach_trap_name field made the 64bit unused field spurious. * kern/syscall_sw.h (mach_trap_t): Remove `unused' field. --- i386/i386/locore.S | 2 +- kern/syscall_sw.h | 5 ++--- x86_64/locore.S | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/i386/i386/locore.S b/i386/i386/locore.S index ddba2245..a0960a26 100644 --- a/i386/i386/locore.S +++ b/i386/i386/locore.S @@ -1075,7 +1075,7 @@ syscall_native: movb $0xf,%dh movw %dx,0xb800c #endif - shll $4,%eax /* manual indexing */ + shll $4,%eax /* manual indexing of mach_trap_t */ movl EXT(mach_trap_table)(%eax),%ecx /* get number of arguments */ jecxz mach_call_call /* skip argument copy if none */ diff --git a/kern/syscall_sw.h b/kern/syscall_sw.h index 9d28281a..80b1810b 100644 --- a/kern/syscall_sw.h +++ b/kern/syscall_sw.h @@ -31,6 +31,8 @@ * mach_trap_stack indicates the trap may discard * its kernel stack. Some architectures may need * to save more state in the pcb for these traps. + * + * Note: this is indexed manually by locore.S! */ typedef struct { @@ -38,9 +40,6 @@ typedef struct { int (*mach_trap_function)(); boolean_t mach_trap_stack; const char *mach_trap_name; -#ifdef __x86_64__ - long unused; -#endif } mach_trap_t; extern mach_trap_t mach_trap_table[]; diff --git a/x86_64/locore.S b/x86_64/locore.S index 3a2b3963..fd3617c5 100644 --- a/x86_64/locore.S +++ b/x86_64/locore.S @@ -1134,7 +1134,7 @@ syscall_native: movb $0xf,%dh movw %dx,0xb800c #endif - shll $5,%eax /* manual indexing */ + shll $5,%eax /* manual indexing of mach_trap_t */ xorq %r10,%r10 movl EXT(mach_trap_table)(%eax),%r10d /* get number of arguments */ -- cgit v1.2.3