From c8d7534e5d67a8a390d53e9172aebc85f5f053ec Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 1 Mar 2005 23:52:09 +0000 Subject: [PATCH] * Made C++ save. * Made the parameter for restoring the FPU state const. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11522 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/x86/arch_cpu.h | 20 +++++++++++++++----- src/kernel/core/arch/x86/arch_x86.S | 8 ++++---- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/headers/private/kernel/arch/x86/arch_cpu.h b/headers/private/kernel/arch/x86/arch_cpu.h index 94201d47dd..445e757dc9 100644 --- a/headers/private/kernel/arch/x86/arch_cpu.h +++ b/headers/private/kernel/arch/x86/arch_cpu.h @@ -10,6 +10,11 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + + struct tss { uint16 prev_task; uint16 unused0; @@ -59,7 +64,6 @@ typedef struct pdentry { // page directory entry unsigned int addr:20; } pdentry; -// NOTE: Keep in sync with ! struct iframe { unsigned int gs; unsigned int fs; @@ -96,10 +100,10 @@ void i386_switch_stack_and_call(addr_t stack, void (*func)(void *), void *arg); void i386_swap_pgdir(addr_t new_pgdir); void i386_fsave(void *fpu_state); void i386_fxsave(void *fpu_state); -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 i386_frstor(const void *fpu_state); +void i386_fxrstor(const void *fpu_state); +void i386_fsave_swap(void *old_fpu_state, const void *new_fpu_state); +void i386_fxsave_swap(void *old_fpu_state, const void *new_fpu_state); void x86_set_task_gate(int32 n, int32 segment); #define read_ebp(value) \ @@ -161,4 +165,10 @@ _v; \ extern segment_descriptor *gGDT; + +#ifdef __cplusplus +} // extern "C" { +#endif + + #endif /* _KERNEL_ARCH_x86_CPU_H */ diff --git a/src/kernel/core/arch/x86/arch_x86.S b/src/kernel/core/arch/x86/arch_x86.S index 0a0338e42b..fbd7a5de44 100755 --- a/src/kernel/core/arch/x86/arch_x86.S +++ b/src/kernel/core/arch/x86/arch_x86.S @@ -30,19 +30,19 @@ FUNCTION(i386_fxsave): fxsave (%eax) ret -/* void i386_frstor(void *fpu_state); */ +/* void i386_frstor(const void *fpu_state); */ FUNCTION(i386_frstor): movl 4(%esp), %eax frstor (%eax) ret -/* void i386_fxrstor(void *fpu_state); */ +/* void i386_fxrstor(const void *fpu_state); */ FUNCTION(i386_fxrstor): movl 4(%esp), %eax fxrstor (%eax) ret -/* void i386_fsave_swap(void *old_fpu_state, void *new_fpu_state); */ +/* void i386_fsave_swap(void *old_fpu_state, const void *new_fpu_state); */ FUNCTION(i386_fsave_swap): movl 4(%esp),%eax fsave (%eax) @@ -50,7 +50,7 @@ FUNCTION(i386_fsave_swap): frstor (%eax) ret -/* void i386_fxsave_swap(void *old_fpu_state, void *new_fpu_state); */ +/* void i386_fxsave_swap(void *old_fpu_state, const void *new_fpu_state); */ FUNCTION(i386_fxsave_swap): movl 4(%esp),%eax fxsave (%eax)