X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Ftss.c;h=3a72fb04185bde1b182740f010b591af9a25f8d8;hb=2b1f4ef19d766727f873476861c64339c8836a40;hp=a94bc52899056ad1aba71aedef3a766c3524bdf2;hpb=626595465a2c6987606a6bc697df65130ad8c2d3;p=palacios.git diff --git a/palacios/src/geekos/tss.c b/palacios/src/geekos/tss.c index a94bc52..3a72fb0 100644 --- a/palacios/src/geekos/tss.c +++ b/palacios/src/geekos/tss.c @@ -1,7 +1,7 @@ /* * x86 TSS data structure and routines * Copyright (c) 2001,2004 David H. Hovemeyer - * $Revision: 1.1 $ + * $Revision: 1.4 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -20,17 +20,19 @@ #include #include +#include + /* * We use one TSS in GeekOS. */ -//static struct TSS s_theTSS; -static struct TSS *s_theTSS = (struct TSS *) TSS_LOCATION; +static struct TSS s_theTSS; static struct Segment_Descriptor *s_tssDesc; static ushort_t s_tssSelector; static void __inline__ Load_Task_Register(void) { + /* Critical: TSS must be marked as not busy */ s_tssDesc->type = 0x09; @@ -53,8 +55,8 @@ void Init_TSS(void) s_tssDesc = Allocate_Segment_Descriptor(); KASSERT(s_tssDesc != 0); - memset(s_theTSS, '\0', sizeof(struct TSS)); - Init_TSS_Descriptor(s_tssDesc, s_theTSS); + memset(&s_theTSS, '\0', sizeof(struct TSS)); + Init_TSS_Descriptor(s_tssDesc, &s_theTSS); s_tssSelector = Selector(0, true, Get_Descriptor_Index(s_tssDesc)); @@ -69,8 +71,8 @@ void Init_TSS(void) */ void Set_Kernel_Stack_Pointer(ulong_t esp0) { - s_theTSS->ss0 = KERNEL_DS; - s_theTSS->esp0 = esp0; + s_theTSS.ss0 = KERNEL_DS; + s_theTSS.esp0 = esp0; /* * NOTE: I read on alt.os.development that it is necessary to @@ -80,3 +82,21 @@ void Set_Kernel_Stack_Pointer(ulong_t esp0) */ Load_Task_Register(); } + + +/* JRL THIS FUCKING SUCKS */ + +uint_t GetTR_Base() { + return (uint_t)(&s_theTSS); +} +uint_t GetTR_Limit() { + return sizeof(struct TSS); +} + +ushort_t GetTR_Selector() { + return s_tssSelector; +} + + + +/* ** */