From 2fc80fd2e1db2c0a2c7661bee4ea03bb49ad7fbb Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 31 May 2010 22:14:20 +0800 Subject: [PATCH] Fixed GCC using sse instructions, fixing TSS support (and removed using the TSS as a data segment in GetCPUNum --- Kernel/arch/x86_64/Makefile | 2 +- Kernel/arch/x86_64/include/desctab.h | 3 --- Kernel/arch/x86_64/proc.c | 12 ++++++------ Kernel/arch/x86_64/start32.asm | 2 +- Kernel/arch/x86_64/start64.asm | 6 +++--- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Kernel/arch/x86_64/Makefile b/Kernel/arch/x86_64/Makefile index 6bc6419b..be7c12d6 100644 --- a/Kernel/arch/x86_64/Makefile +++ b/Kernel/arch/x86_64/Makefile @@ -12,7 +12,7 @@ MAX_CPUS := 4 CPPFLAGS := -DMAX_CPUS=$(MAX_CPUS) -CFLAGS := $(KERNEL_CFLAGS) +CFLAGS := $(KERNEL_CFLAGS) -mno-sse -mno-mmx ASFLAGS := -f elf64 -D MAX_CPUS=$(MAX_CPUS) LDFLAGS := -nostdlib -nodefaultlibs diff --git a/Kernel/arch/x86_64/include/desctab.h b/Kernel/arch/x86_64/include/desctab.h index ee9b20bf..de3996c6 100644 --- a/Kernel/arch/x86_64/include/desctab.h +++ b/Kernel/arch/x86_64/include/desctab.h @@ -52,9 +52,6 @@ typedef struct { Uint32 Rsvd3[2]; Uint16 Rsvd4; Uint16 IOMapBase; - - // Acess Specific Fields - Uint8 CPUNumber; // CPU Number } __attribute__ ((packed)) tTSS; #endif diff --git a/Kernel/arch/x86_64/proc.c b/Kernel/arch/x86_64/proc.c index ebb07d6a..a1d5c86a 100644 --- a/Kernel/arch/x86_64/proc.c +++ b/Kernel/arch/x86_64/proc.c @@ -269,17 +269,17 @@ void ArchThreads_Init() #else pos = 0; #endif - gTSSs[pos].CPUNumber = pos; gTSSs[pos].RSP0 = 0; // Set properly by scheduler - gGDT[6+pos*2].BaseLow = ((Uint)(&gTSSs[pos])) & 0xFFFF; - gGDT[6+pos*2].BaseMid = ((Uint)(&gTSSs[pos])) >> 16; - gGDT[6+pos*2].BaseHi = ((Uint)(&gTSSs[pos])) >> 24; - gGDT[6+pos*2+1].DWord[0] = ((Uint)(&gTSSs[pos])) >> 32; + gGDT[7+pos*2].LimitLow = sizeof(tTSS) & 0xFFFF; + gGDT[7+pos*2].BaseLow = ((Uint)(&gTSSs[pos])) & 0xFFFF; + gGDT[7+pos*2].BaseMid = ((Uint)(&gTSSs[pos])) >> 16; + gGDT[7+pos*2].BaseHi = ((Uint)(&gTSSs[pos])) >> 24; + gGDT[7+pos*2+1].DWord[0] = ((Uint)(&gTSSs[pos])) >> 32; #if USE_MP } for(pos=0;pos