From c2c20b7848e5db7d21a73cc8c23aa446192ad72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 14 Dec 2004 01:46:46 +0000 Subject: [PATCH] Incorporated some code from NewOS to set up a double fault handler. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10444 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/x86/arch_cpu.h | 4 ++++ headers/private/kernel/arch/x86/descriptors.h | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/headers/private/kernel/arch/x86/arch_cpu.h b/headers/private/kernel/arch/x86/arch_cpu.h index cbe80a9220..bc986947f8 100644 --- a/headers/private/kernel/arch/x86/arch_cpu.h +++ b/headers/private/kernel/arch/x86/arch_cpu.h @@ -99,10 +99,14 @@ void i386_frstor(void *fpu_state); void i386_fxrstor(void *fpu_state); void i386_fsave_swap(void *old_fpu_state, void *new_fpu_state); void i386_fxsave_swap(void *old_fpu_state, void *new_fpu_state); +void x86_set_task_gate(int32 n, int32 segment); #define read_ebp(value) \ __asm__("movl %%ebp,%0" : "=r" (value)) +#define read_cr3(value) \ + __asm__("movl %%cr3,%0" : "=r" (value)) + #define read_dr3(value) \ __asm__("movl %%dr3,%0" : "=r" (value)) diff --git a/headers/private/kernel/arch/x86/descriptors.h b/headers/private/kernel/arch/x86/descriptors.h index 3dde40d598..20db3e053a 100644 --- a/headers/private/kernel/arch/x86/descriptors.h +++ b/headers/private/kernel/arch/x86/descriptors.h @@ -17,7 +17,8 @@ // this file can also be included from assembler as well // (and is in arch_interrupts.S) -#define TSS_BASE_SEGMENT 5 +#define DOUBLE_FAULT_TSS_SEGMENT 5 +#define TSS_BASE_SEGMENT 6 #define TLS_BASE_SEGMENT (TSS_BASE_SEGMENT + smp_get_num_cpus()) @@ -56,6 +57,7 @@ enum descriptor_types { DT_DATA_EXPANSION_DOWN = 0x4, DT_TSS = 9, + /* non busy, 32 bit */ // descriptor types DT_SYSTEM_SEGMENT = 0,