mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Use u64 here to avoid warnings, better precision.
The timeout value is u32 anyway, so an int was already a loss.
This commit is contained in:
+4
-4
@@ -250,16 +250,16 @@ void ScheduleEvent(int cyclesIntoFuture, int event_type, u64 userdata)
|
||||
}
|
||||
|
||||
// Returns cycles left in timer.
|
||||
int UnscheduleEvent(int event_type, u64 userdata)
|
||||
u64 UnscheduleEvent(int event_type, u64 userdata)
|
||||
{
|
||||
int result = 0;
|
||||
u64 result = 0;
|
||||
if (!first)
|
||||
return result;
|
||||
while(first)
|
||||
{
|
||||
if (first->type == event_type && first->userdata == userdata)
|
||||
{
|
||||
result = (int)(first->time - globalTimer);
|
||||
result = first->time - globalTimer;
|
||||
|
||||
Event *next = first->next;
|
||||
FreeEvent(first);
|
||||
@@ -278,7 +278,7 @@ int UnscheduleEvent(int event_type, u64 userdata)
|
||||
{
|
||||
if (ptr->type == event_type && ptr->userdata == userdata)
|
||||
{
|
||||
result = (int)(ptr->time - globalTimer);
|
||||
result = ptr->time - globalTimer;
|
||||
|
||||
prev->next = ptr->next;
|
||||
FreeEvent(ptr);
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ namespace CoreTiming
|
||||
void ScheduleEvent(int cyclesIntoFuture, int event_type, u64 userdata=0);
|
||||
void ScheduleEvent_Threadsafe(int cyclesIntoFuture, int event_type, u64 userdata=0);
|
||||
void ScheduleEvent_Threadsafe_Immediate(int event_type, u64 userdata=0);
|
||||
int UnscheduleEvent(int event_type, u64 userdata);
|
||||
u64 UnscheduleEvent(int event_type, u64 userdata);
|
||||
|
||||
void RemoveEvent(int event_type);
|
||||
void RemoveThreadsafeEvent(int event_type);
|
||||
|
||||
@@ -223,8 +223,8 @@ void sceKernelDeleteMutex(SceUID id)
|
||||
if (timeoutPtr != 0 && mutexWaitTimer != 0)
|
||||
{
|
||||
// Remove any event for this thread.
|
||||
int cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
|
||||
Memory::Write_U32(cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
u64 cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
|
||||
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
}
|
||||
|
||||
__KernelResumeThreadFromWait(threadID, SCE_KERNEL_ERROR_WAIT_DELETE);
|
||||
@@ -300,8 +300,8 @@ bool __KernelUnlockMutex(Mutex *mutex, u32 &error)
|
||||
if (timeoutPtr != 0 && mutexWaitTimer != 0)
|
||||
{
|
||||
// Remove any event for this thread.
|
||||
int cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
|
||||
Memory::Write_U32(cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
u64 cyclesLeft = CoreTiming::UnscheduleEvent(mutexWaitTimer, threadID);
|
||||
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
}
|
||||
|
||||
__KernelResumeThreadFromWait(threadID, 0);
|
||||
@@ -554,8 +554,8 @@ void sceKernelDeleteLwMutex(u32 workareaPtr)
|
||||
if (timeoutPtr != 0 && lwMutexWaitTimer != 0)
|
||||
{
|
||||
// Remove any event for this thread.
|
||||
int cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
|
||||
Memory::Write_U32(cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
u64 cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
|
||||
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
}
|
||||
|
||||
__KernelResumeThreadFromWait(threadID, SCE_KERNEL_ERROR_WAIT_DELETE);
|
||||
@@ -648,8 +648,8 @@ bool __KernelUnlockLwMutex(NativeLwMutexWorkarea &workarea, u32 &error)
|
||||
if (timeoutPtr != 0 && lwMutexWaitTimer != 0)
|
||||
{
|
||||
// Remove any event for this thread.
|
||||
int cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
|
||||
Memory::Write_U32(cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
u64 cyclesLeft = CoreTiming::UnscheduleEvent(lwMutexWaitTimer, threadID);
|
||||
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
}
|
||||
|
||||
__KernelResumeThreadFromWait(threadID, 0);
|
||||
|
||||
@@ -87,8 +87,8 @@ bool __KernelClearSemaThreads(Semaphore *s, int reason)
|
||||
if (timeoutPtr != 0 && semaWaitTimer != 0)
|
||||
{
|
||||
// Remove any event for this thread.
|
||||
int cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
|
||||
Memory::Write_U32(cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
u64 cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
|
||||
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
}
|
||||
|
||||
__KernelResumeThreadFromWait(threadID, reason);
|
||||
@@ -257,8 +257,8 @@ retry:
|
||||
if (timeoutPtr != 0 && semaWaitTimer != 0)
|
||||
{
|
||||
// Remove any event for this thread.
|
||||
int cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
|
||||
Memory::Write_U32(cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
u64 cyclesLeft = CoreTiming::UnscheduleEvent(semaWaitTimer, threadID);
|
||||
Memory::Write_U32((u32) cyclesToUs(cyclesLeft), timeoutPtr);
|
||||
}
|
||||
|
||||
__KernelResumeThreadFromWait(threadID, 0);
|
||||
|
||||
Reference in New Issue
Block a user