Fixed GCC using sse instructions, fixing TSS support (and removed using
[tpg/acess2.git] / Kernel / arch / x86_64 / proc.c
index 623de55..a1d5c86 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * AcessOS Microkernel Version
+ * Acess2 x86_64 port
  * proc.c
  */
 #include <acess.h>
@@ -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<giNumCPUs;pos++) {
        #endif
-               __asm__ __volatile__ ("ltr %%ax"::"a"(0x30+pos*8));
+               __asm__ __volatile__ ("ltr %%ax"::"a"(0x38+pos*16));
        #if USE_MP
        }
        #endif
@@ -627,7 +627,7 @@ void Proc_StartProcess(Uint16 SS, Uint Stack, Uint Flags, Uint16 CS, Uint IP)
  */
 int Proc_Demote(Uint *Err, int Dest, tRegs *Regs)
 {
-        int    cpl = Regs->cs & 3;
+        int    cpl = Regs->CS & 3;
        // Sanity Check
        if(Dest > 3 || Dest < 0) {
                *Err = -EINVAL;
@@ -641,8 +641,8 @@ int Proc_Demote(Uint *Err, int Dest, tRegs *Regs)
        }
        
        // Change the Segment Registers
-       Regs->cs = (((Dest+1)<<4) | Dest) - 8;
-       Regs->ss = ((Dest+1)<<4) | Dest;
+       Regs->CS = (((Dest+1)<<4) | Dest) - 8;
+       Regs->SS = ((Dest+1)<<4) | Dest;
        
        return 0;
 }

UCC git Repository :: git.ucc.asn.au