From: John Hodge Date: Thu, 14 Oct 2010 06:13:06 +0000 (+0800) Subject: x86_64: Bugfixing X-Git-Tag: rel0.06~12 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=3681dbf27244ee07ae618a9d33a608ae6089d3c5;p=tpg%2Facess2.git x86_64: Bugfixing --- diff --git a/Kernel/Makefile.BuildNum.x86_64 b/Kernel/Makefile.BuildNum.x86_64 index bb5063bd..16710d2d 100644 --- a/Kernel/Makefile.BuildNum.x86_64 +++ b/Kernel/Makefile.BuildNum.x86_64 @@ -1 +1 @@ -BUILD_NUM = 210 +BUILD_NUM = 213 diff --git a/Kernel/arch/x86_64/Makefile b/Kernel/arch/x86_64/Makefile index c4260b51..d0d4f848 100644 --- a/Kernel/arch/x86_64/Makefile +++ b/Kernel/arch/x86_64/Makefile @@ -21,8 +21,10 @@ else endif -A_OBJ = start32.ao start64.ao desctab.ao -A_OBJ += main.o lib.o proc.o mm_virt.o mm_phys.o vm8086.o +A_OBJ := start32.ao start64.ao desctab.ao +A_OBJ += main.o lib.o proc.o mm_virt.o mm_phys.o A_OBJ += kernelpanic.o errors.o +A_OBJ += vm8086.o +# rme.o POSTBUILD = objcopy $(BIN) -F elf32-i386 $(BIN) diff --git a/Kernel/arch/x86_64/lib.c b/Kernel/arch/x86_64/lib.c index dcd6ec3a..f7f38c8b 100644 --- a/Kernel/arch/x86_64/lib.c +++ b/Kernel/arch/x86_64/lib.c @@ -58,7 +58,7 @@ void SHORTLOCK(struct sShortSpinlock *Lock) #if LOCK_DISABLE_INTS // Save interrupt state and clear interrupts - __ASM__ ("pushf;\n\tpop %%eax\n\tcli" : "=a"(IF)); + __ASM__ ("pushf;\n\tpop %0\n\tcli" : "=a"(IF)); IF &= 0x200; // AND out all but the interrupt flag #endif @@ -90,7 +90,7 @@ void SHORTLOCK(struct sShortSpinlock *Lock) : "a"(0), "r"(thread), "r"(&Lock->Lock) ); #else - __ASM__("xchgl %%eax, (%%edi)":"=a"(v):"a"(1),"D"(&Lock->Lock)); + __ASM__("xchgl %0, (%2)":"=a"(v):"a"(1),"D"(&Lock->Lock)); #endif } diff --git a/Kernel/arch/x86_64/vm8086.c b/Kernel/arch/x86_64/vm8086.c index 1459c73e..40860c8f 100644 --- a/Kernel/arch/x86_64/vm8086.c +++ b/Kernel/arch/x86_64/vm8086.c @@ -3,6 +3,7 @@ #include #include #include +//#include "rme.h" // === CONSTANTS === #define VM8086_STACK_SEG 0x9F00 @@ -17,6 +18,7 @@ void VM8086_Free(tVM8086 *State); // === GLOBALS === MODULE_DEFINE(0, 0x100, VM8086, VM8086_Install, NULL, NULL); tMutex glVM8086_Process; +//tRME_State *gpVM8086_State; tPID gVM8086_WorkerPID; tTID gVM8086_CallingThread; tVM8086 volatile * volatile gpVM8086_State = (void*)-1; // Set to -1 to avoid race conditions @@ -24,6 +26,7 @@ tVM8086 volatile * volatile gpVM8086_State = (void*)-1; // Set to -1 to avoid ra // === CODE === int VM8086_Install(char **Arguments) { + //gpVM8086_State = RME_CreateState(); return MODULE_ERR_OK; } diff --git a/Kernel/lib.c b/Kernel/lib.c index 2ce5c980..d388050a 100644 --- a/Kernel/lib.c +++ b/Kernel/lib.c @@ -215,7 +215,7 @@ int vsnprintf(char *__s, size_t __maxlen, const char *__format, va_list args) } // Get Argument - val = va_arg(args, Uint); + val = va_arg(args, unsigned int); // - Padding Side Flag if(c == '+') { @@ -234,7 +234,7 @@ int vsnprintf(char *__s, size_t __maxlen, const char *__format, va_list args) // - Minimum length if(c == '*') { // Dynamic length minSize = val; - val = va_arg(args, Uint); + val = va_arg(args, unsigned int); c = *__format++; } else if('1' <= c && c <= '9')