AddressArbiter: Ported arbitration type 2 from 3dmoo.
(Thanks 3dmoo!)
This commit is contained in:
parent
dd21f986b8
commit
0276a75f24
|
@ -52,6 +52,17 @@ ResultCode ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s3
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ArbitrationType::DecrementAndWaitIfLessThan:
|
||||||
|
{
|
||||||
|
s32 memory_value = Memory::Read32(address) - 1;
|
||||||
|
Memory::Write32(address, memory_value);
|
||||||
|
if (memory_value <= value) {
|
||||||
|
Kernel::WaitCurrentThread(WAITTYPE_ARB, handle, address);
|
||||||
|
HLE::Reschedule(__func__);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_ERROR(Kernel, "unknown type=%d", type);
|
LOG_ERROR(Kernel, "unknown type=%d", type);
|
||||||
return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel, ErrorSummary::WrongArgument, ErrorLevel::Usage);
|
return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel, ErrorSummary::WrongArgument, ErrorLevel::Usage);
|
||||||
|
|
Loading…
Reference in New Issue