diff --git a/include/jinue/shared/asm/i686.h b/include/jinue/shared/asm/i686.h index 77fda5db..ab48dcfc 100644 --- a/include/jinue/shared/asm/i686.h +++ b/include/jinue/shared/asm/i686.h @@ -69,18 +69,18 @@ #define JINUE_STACK_START (JINUE_STACK_BASE - JINUE_STACK_SIZE) /** interrupt vector for system call software interrupt */ -#define JINUE_X86_SYSCALL_IRQ 0x80 +#define JINUE_I686_SYSCALL_IRQ 0x80 /** slow/safe interrupt-based system call implementation */ -#define JINUE_X86_HOWSYSCALL_INTERRUPT 0 +#define JINUE_I686_HOWSYSCALL_INTERRUPT 0 /** AMD's fast system call implementation (SYSCALL/SYSLEAVE) */ -#define JINUE_X86_HOWSYSCALL_FAST_AMD 1 +#define JINUE_I686_HOWSYSCALL_FAST_AMD 1 /** Intel's fast system call implementation (SYSENTER/SYSEXIT) */ -#define JINUE_X86_HOWSYSCALL_FAST_INTEL 2 +#define JINUE_I686_HOWSYSCALL_FAST_INTEL 2 /** last system call implementation index */ -#define JINUE_X86_HOWSYSCALL_LAST 2 +#define JINUE_I686_HOWSYSCALL_LAST 2 #endif diff --git a/kernel/infrastructure/i686/init.c b/kernel/infrastructure/i686/init.c index c1e84004..463bd863 100644 --- a/kernel/infrastructure/i686/init.c +++ b/kernel/infrastructure/i686/init.c @@ -129,7 +129,7 @@ static void init_idt(void) { /* set interrupt gate flags */ unsigned int flags = SEG_TYPE_INTERRUPT_GATE | SEG_FLAG_NORMAL_GATE; - if(idx == JINUE_X86_SYSCALL_IRQ) { + if(idx == JINUE_I686_SYSCALL_IRQ) { flags |= SEG_FLAG_USER; } else { @@ -222,7 +222,7 @@ static void select_syscall_implementation(void) { if(cpu_has_feature(CPU_FEATURE_SYSCALL)) { uint64_t msrval; - syscall_implementation = JINUE_X86_HOWSYSCALL_FAST_AMD; + syscall_implementation = JINUE_I686_HOWSYSCALL_FAST_AMD; msrval = rdmsr(MSR_EFER); msrval |= MSR_FLAG_EFER_SCE; @@ -235,7 +235,7 @@ static void select_syscall_implementation(void) { wrmsr(MSR_STAR, msrval); } else if(cpu_has_feature(CPU_FEATURE_SYSENTER)) { - syscall_implementation = JINUE_X86_HOWSYSCALL_FAST_INTEL; + syscall_implementation = JINUE_I686_HOWSYSCALL_FAST_INTEL; wrmsr(MSR_IA32_SYSENTER_CS, SEG_SELECTOR(GDT_KERNEL_CODE, RPL_KERNEL)); wrmsr(MSR_IA32_SYSENTER_EIP, (uint64_t)(uintptr_t)fast_intel_entry); @@ -244,7 +244,7 @@ static void select_syscall_implementation(void) { wrmsr(MSR_IA32_SYSENTER_ESP, (uint64_t)(uintptr_t)NULL); } else { - syscall_implementation = JINUE_X86_HOWSYSCALL_INTERRUPT; + syscall_implementation = JINUE_I686_HOWSYSCALL_INTERRUPT; } } diff --git a/kernel/interface/i686/interrupt.c b/kernel/interface/i686/interrupt.c index f0387815..ac3a8eb4 100644 --- a/kernel/interface/i686/interrupt.c +++ b/kernel/interface/i686/interrupt.c @@ -58,7 +58,7 @@ void dispatch_interrupt(trapframe_t *trapframe) { panic("caught exception"); } - if(ivt == JINUE_X86_SYSCALL_IRQ) { + if(ivt == JINUE_I686_SYSCALL_IRQ) { /* interrupt-based system call implementation */ dispatch_syscall((jinue_syscall_args_t *)&trapframe->msg_arg0); } diff --git a/userspace/lib/jinue/i686/stubs.asm b/userspace/lib/jinue/i686/stubs.asm index 4b632ef9..a24af2a4 100644 --- a/userspace/lib/jinue/i686/stubs.asm +++ b/userspace/lib/jinue/i686/stubs.asm @@ -180,7 +180,7 @@ jinue_syscall_intr: mov esi, [edi+ 8] ; arg2 (message pointer) mov edi, [edi+12] ; arg3 (message size) - int JINUE_X86_SYSCALL_IRQ + int JINUE_I686_SYSCALL_IRQ ; restore arguments structure pointer mov ebp, [esp+20] diff --git a/userspace/lib/jinue/i686/syscalls.c b/userspace/lib/jinue/i686/syscalls.c index 476f1878..2bbf4d8d 100644 --- a/userspace/lib/jinue/i686/syscalls.c +++ b/userspace/lib/jinue/i686/syscalls.c @@ -34,15 +34,15 @@ #include "stubs.h" static jinue_syscall_stub_t syscall_stubs[] = { - [JINUE_X86_HOWSYSCALL_INTERRUPT] = jinue_syscall_intr, - [JINUE_X86_HOWSYSCALL_FAST_AMD] = jinue_syscall_fast_amd, - [JINUE_X86_HOWSYSCALL_FAST_INTEL] = jinue_syscall_fast_intel + [JINUE_I686_HOWSYSCALL_INTERRUPT] = jinue_syscall_intr, + [JINUE_I686_HOWSYSCALL_FAST_AMD] = jinue_syscall_fast_amd, + [JINUE_I686_HOWSYSCALL_FAST_INTEL] = jinue_syscall_fast_intel }; -static int syscall_stub_index = JINUE_X86_HOWSYSCALL_INTERRUPT; +static int syscall_stub_index = JINUE_I686_HOWSYSCALL_INTERRUPT; int jinue_init(int implementation, int *perrno) { - if(implementation < 0 || implementation > JINUE_X86_HOWSYSCALL_LAST) { + if(implementation < 0 || implementation > JINUE_I686_HOWSYSCALL_LAST) { *perrno = JINUE_EINVAL; return -1; } diff --git a/userspace/testapp/debug.c b/userspace/testapp/debug.c index 0fadc6dd..337f708c 100644 --- a/userspace/testapp/debug.c +++ b/userspace/testapp/debug.c @@ -154,12 +154,12 @@ static const char *auxv_type_name(int type) { static const char *syscall_implementation_name(int implementation) { const char *names[] = { - [JINUE_X86_HOWSYSCALL_INTERRUPT] = "interrupt", - [JINUE_X86_HOWSYSCALL_FAST_AMD] = "SYSCALL/SYSRET (fast AMD)", - [JINUE_X86_HOWSYSCALL_FAST_INTEL] = "SYSENTER/SYSEXIT (fast Intel)" + [JINUE_I686_HOWSYSCALL_INTERRUPT] = "interrupt", + [JINUE_I686_HOWSYSCALL_FAST_AMD] = "SYSCALL/SYSRET (fast AMD)", + [JINUE_I686_HOWSYSCALL_FAST_INTEL] = "SYSENTER/SYSEXIT (fast Intel)" }; - if(implementation < 0 || implementation > JINUE_X86_HOWSYSCALL_LAST) { + if(implementation < 0 || implementation > JINUE_I686_HOWSYSCALL_LAST) { return "?"; }