X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fvm8086.c;h=469ab4361a8fac29a1af96d7be4c771e97258641;hb=3b0cee8ca739fc5c564c78467fdc65c4d83d45a1;hp=5253a62d430772200e82f3f89a371182b27d3edb;hpb=2a05bcd81312a2885f824dac79e82c01a6e60c6c;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/vm8086.c b/Kernel/arch/x86/vm8086.c index 5253a62d..469ab436 100644 --- a/Kernel/arch/x86/vm8086.c +++ b/Kernel/arch/x86/vm8086.c @@ -153,6 +153,7 @@ void VM8086_GPF(tRegs *Regs) //Log_Log("VM8086", "gpVM8086_State = %p, gVM8086_CallingThread = %i", // gpVM8086_State, gVM8086_CallingThread); if( gpVM8086_State ) { + int ret; gpVM8086_State->AX = Regs->eax; gpVM8086_State->CX = Regs->ecx; gpVM8086_State->DX = Regs->edx; gpVM8086_State->BX = Regs->ebx; gpVM8086_State->BP = Regs->ebp; @@ -160,8 +161,9 @@ void VM8086_GPF(tRegs *Regs) gpVM8086_State->DS = Regs->ds; gpVM8086_State->ES = Regs->es; gpVM8086_State = NULL; // Ensure the caller wakes - //while(Threads_WakeTID(gVM8086_CallingThread) == -EALREADY) - // Threads_Yield(); + while( (ret = Threads_WakeTID(gVM8086_CallingThread)) == -EALREADY) { + Threads_Yield(); + } } //Log_Log("VM8086", "Waiting for something to do"); @@ -406,8 +408,8 @@ void VM8086_Int(tVM8086 *State, Uint8 Interrupt) gpVM8086_State = State; gVM8086_CallingThread = Threads_GetTID(); Threads_WakeTID( gVM8086_WorkerPID ); - while( gpVM8086_State != NULL ) - Threads_Yield(); + Threads_Sleep(); + while( gpVM8086_State != NULL ) Threads_Sleep(); Mutex_Release( &glVM8086_Process ); }