mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	svc: updated waitSychronization to not overwrite handle on return, added stub for SleepThread (does nothing)
This commit is contained in:
		
							parent
							
								
									ba98e25e97
								
							
						
					
					
						commit
						f2f638492b
					
				
					 1 changed files with 21 additions and 2 deletions
				
			
		|  | @ -126,6 +126,14 @@ Result WaitSynchronization1(Handle handle, s64 nano_seconds) { | ||||||
|     if (wait) { |     if (wait) { | ||||||
|         Kernel::WaitCurrentThread(WAITTYPE_SYNCH); // TODO(bunnei): Is this correct?
 |         Kernel::WaitCurrentThread(WAITTYPE_SYNCH); // TODO(bunnei): Is this correct?
 | ||||||
|         Kernel::Reschedule(); |         Kernel::Reschedule(); | ||||||
|  | 
 | ||||||
|  |         // Context switch - Function blocked, is not actually returning (will be "called" again)
 | ||||||
|  | 
 | ||||||
|  |         // TODO(bunnei): This saves handle to R0 so that it's correctly reloaded on context switch
 | ||||||
|  |         // (otherwise R0 will be set to whatever is returned, and handle will be invalid when this
 | ||||||
|  |         // thread is resumed). There is probably a better way of keeping track of state so that we
 | ||||||
|  |         // don't necessarily have to do this.
 | ||||||
|  |         return (Result)PARAM(0); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     return res; |     return res; | ||||||
|  | @ -171,7 +179,13 @@ Result WaitSynchronizationN(void* _out, void* _handles, u32 handle_count, u32 wa | ||||||
|     Kernel::WaitCurrentThread(WAITTYPE_SYNCH); // TODO(bunnei): Is this correct?
 |     Kernel::WaitCurrentThread(WAITTYPE_SYNCH); // TODO(bunnei): Is this correct?
 | ||||||
|     Kernel::Reschedule(); |     Kernel::Reschedule(); | ||||||
| 
 | 
 | ||||||
|     return 0; |     // Context switch - Function blocked, is not actually returning (will be "called" again)
 | ||||||
|  | 
 | ||||||
|  |     // TODO(bunnei): This saves handle to R0 so that it's correctly reloaded on context switch
 | ||||||
|  |     // (otherwise R0 will be set to whatever is returned, and handle will be invalid when this
 | ||||||
|  |     // thread is resumed). There is probably a better way of keeping track of state so that we
 | ||||||
|  |     // don't necessarily have to do this.
 | ||||||
|  |     return (Result)PARAM(0); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /// Create an address arbiter (to allocate access to shared resources)
 | /// Create an address arbiter (to allocate access to shared resources)
 | ||||||
|  | @ -289,6 +303,11 @@ Result ClearEvent(Handle evt) { | ||||||
|     return res; |     return res; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /// Sleep the current thread
 | ||||||
|  | void SleepThread(s64 nanoseconds) { | ||||||
|  |     DEBUG_LOG(SVC, "called nanoseconds=%d", nanoseconds); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| const HLE::FunctionDef SVC_Table[] = { | const HLE::FunctionDef SVC_Table[] = { | ||||||
|     {0x00,  NULL,                                       "Unknown"}, |     {0x00,  NULL,                                       "Unknown"}, | ||||||
|     {0x01,  WrapI_VUUUUU<ControlMemory>,                "ControlMemory"}, |     {0x01,  WrapI_VUUUUU<ControlMemory>,                "ControlMemory"}, | ||||||
|  | @ -300,7 +319,7 @@ const HLE::FunctionDef SVC_Table[] = { | ||||||
|     {0x07,  NULL,                                       "SetProcessIdealProcessor"}, |     {0x07,  NULL,                                       "SetProcessIdealProcessor"}, | ||||||
|     {0x08,  WrapI_UUUUU<CreateThread>,                  "CreateThread"}, |     {0x08,  WrapI_UUUUU<CreateThread>,                  "CreateThread"}, | ||||||
|     {0x09,  NULL,                                       "ExitThread"}, |     {0x09,  NULL,                                       "ExitThread"}, | ||||||
|     {0x0A,  NULL,                                       "SleepThread"}, |     {0x0A,  WrapV_S64<SleepThread>,                     "SleepThread"}, | ||||||
|     {0x0B,  NULL,                                       "GetThreadPriority"}, |     {0x0B,  NULL,                                       "GetThreadPriority"}, | ||||||
|     {0x0C,  NULL,                                       "SetThreadPriority"}, |     {0x0C,  NULL,                                       "SetThreadPriority"}, | ||||||
|     {0x0D,  NULL,                                       "GetThreadAffinityMask"}, |     {0x0D,  NULL,                                       "GetThreadAffinityMask"}, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue