X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fvm8086.c;fp=Kernel%2Farch%2Fx86%2Fvm8086.c;h=5253a62d430772200e82f3f89a371182b27d3edb;hb=7d881c2e5fef91a6570e46ef69a5d4a5cf0e8b4d;hp=86f440d17c6390b4a2ddd5e3807f06945ba5c0cc;hpb=73e8ed89c011abce9b0ae2c5a3eb232bdbe8660e;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/vm8086.c b/Kernel/arch/x86/vm8086.c index 86f440d1..5253a62d 100644 --- a/Kernel/arch/x86/vm8086.c +++ b/Kernel/arch/x86/vm8086.c @@ -44,7 +44,7 @@ tVM8086 *VM8086_Init(void); // === GLOBALS === MODULE_DEFINE(0, 0x100, VM8086, VM8086_Install, NULL, NULL); -tSpinlock glVM8086_Process; +tMutex glVM8086_Process; tPID gVM8086_WorkerPID; tTID gVM8086_CallingThread; tVM8086 volatile * volatile gpVM8086_State = (void*)-1; // Set to -1 to avoid race conditions @@ -55,7 +55,7 @@ int VM8086_Install(char **Arguments) tPID pid; // Lock to avoid race conditions - LOCK( &glVM8086_Process ); + Mutex_Acquire( &glVM8086_Process ); // Create BIOS Call process pid = Proc_Clone(NULL, CLONE_VM); @@ -147,7 +147,7 @@ void VM8086_GPF(tRegs *Regs) { if( gpVM8086_State == (void*)-1 ) { Log_Log("VM8086", "Worker thread ready and waiting"); - RELEASE( &glVM8086_Process ); // Release lock obtained in VM8086_Install + Mutex_Release( &glVM8086_Process ); // Release lock obtained in VM8086_Install gpVM8086_State = NULL; } //Log_Log("VM8086", "gpVM8086_State = %p, gVM8086_CallingThread = %i", @@ -401,7 +401,7 @@ void VM8086_Int(tVM8086 *State, Uint8 Interrupt) State->IP = *(Uint16*)(KERNEL_BASE+4*Interrupt); State->CS = *(Uint16*)(KERNEL_BASE+4*Interrupt+2); - LOCK( &glVM8086_Process ); + Mutex_Acquire( &glVM8086_Process ); gpVM8086_State = State; gVM8086_CallingThread = Threads_GetTID(); @@ -409,5 +409,5 @@ void VM8086_Int(tVM8086 *State, Uint8 Interrupt) while( gpVM8086_State != NULL ) Threads_Yield(); - RELEASE( &glVM8086_Process ); + Mutex_Release( &glVM8086_Process ); }