mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	svc: Move ResetType enum to the kernel event header
This commit is contained in:
		
							parent
							
								
									31797a242f
								
							
						
					
					
						commit
						856a1d0386
					
				
					 10 changed files with 17 additions and 16 deletions
				
			
		|  | @ -10,6 +10,7 @@ | ||||||
| #include "core/memory.h" | #include "core/memory.h" | ||||||
| #include "core/hle/hle.h" | #include "core/hle/hle.h" | ||||||
| #include "core/hle/result.h" | #include "core/hle/result.h" | ||||||
|  | #include "core/hle/svc.h" | ||||||
| 
 | 
 | ||||||
| namespace HLE { | namespace HLE { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -7,10 +7,16 @@ | ||||||
| #include "common/common_types.h" | #include "common/common_types.h" | ||||||
| 
 | 
 | ||||||
| #include "core/hle/kernel/kernel.h" | #include "core/hle/kernel/kernel.h" | ||||||
| #include "core/hle/svc.h" |  | ||||||
| 
 | 
 | ||||||
| namespace Kernel { | namespace Kernel { | ||||||
| 
 | 
 | ||||||
|  | enum class ResetType { | ||||||
|  |     OneShot, | ||||||
|  |     Sticky, | ||||||
|  |     Pulse, | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| class Event final : public WaitObject { | class Event final : public WaitObject { | ||||||
| public: | public: | ||||||
|     /**
 |     /**
 | ||||||
|  |  | ||||||
|  | @ -6,8 +6,8 @@ | ||||||
| 
 | 
 | ||||||
| #include "common/common_types.h" | #include "common/common_types.h" | ||||||
| 
 | 
 | ||||||
|  | #include "core/hle/kernel/event.h" | ||||||
| #include "core/hle/kernel/kernel.h" | #include "core/hle/kernel/kernel.h" | ||||||
| #include "core/hle/svc.h" |  | ||||||
| 
 | 
 | ||||||
| namespace Kernel { | namespace Kernel { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -434,8 +434,8 @@ void Init() { | ||||||
|     cpu_percent = 0; |     cpu_percent = 0; | ||||||
| 
 | 
 | ||||||
|     // TODO(bunnei): Check if these are created in Initialize or on APT process startup.
 |     // TODO(bunnei): Check if these are created in Initialize or on APT process startup.
 | ||||||
|     notification_event = Kernel::Event::Create(ResetType::OneShot, "APT_U:Notification"); |     notification_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Notification"); | ||||||
|     parameter_event = Kernel::Event::Create(ResetType::OneShot, "APT_U:Start"); |     parameter_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Start"); | ||||||
| 
 | 
 | ||||||
|     next_parameter.signal = static_cast<u32>(SignalType::AppJustStarted); |     next_parameter.signal = static_cast<u32>(SignalType::AppJustStarted); | ||||||
|     next_parameter.destination_id = 0x300; |     next_parameter.destination_id = 0x300; | ||||||
|  |  | ||||||
|  | @ -457,7 +457,7 @@ const Interface::FunctionInfo FunctionTable[] = { | ||||||
| // Interface class
 | // Interface class
 | ||||||
| 
 | 
 | ||||||
| Interface::Interface() { | Interface::Interface() { | ||||||
|     semaphore_event = Kernel::Event::Create(ResetType::OneShot, "DSP_DSP::semaphore_event"); |     semaphore_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "DSP_DSP::semaphore_event"); | ||||||
|     read_pipe_count = 0; |     read_pipe_count = 0; | ||||||
| 
 | 
 | ||||||
|     Register(FunctionTable); |     Register(FunctionTable); | ||||||
|  |  | ||||||
|  | @ -138,7 +138,7 @@ const Interface::FunctionInfo FunctionTable[] = { | ||||||
| // Interface class
 | // Interface class
 | ||||||
| 
 | 
 | ||||||
| Interface::Interface() { | Interface::Interface() { | ||||||
|     handle_event = Kernel::Event::Create(ResetType::OneShot, "NWM_UDS::handle_event"); |     handle_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "NWM_UDS::handle_event"); | ||||||
| 
 | 
 | ||||||
|     Register(FunctionTable); |     Register(FunctionTable); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -25,7 +25,7 @@ static void GetProcSemaphore(Service::Interface* self) { | ||||||
|     u32* cmd_buff = Kernel::GetCommandBuffer(); |     u32* cmd_buff = Kernel::GetCommandBuffer(); | ||||||
| 
 | 
 | ||||||
|     // TODO(bunnei): Change to a semaphore once these have been implemented
 |     // TODO(bunnei): Change to a semaphore once these have been implemented
 | ||||||
|     event_handle = Kernel::Event::Create(ResetType::OneShot, "SRV:Event"); |     event_handle = Kernel::Event::Create(Kernel::ResetType::OneShot, "SRV:Event"); | ||||||
|     event_handle->Clear(); |     event_handle->Clear(); | ||||||
| 
 | 
 | ||||||
|     cmd_buff[1] = 0; // No error
 |     cmd_buff[1] = 0; // No error
 | ||||||
|  |  | ||||||
|  | @ -424,7 +424,7 @@ const Interface::FunctionInfo FunctionTable[] = { | ||||||
| // Interface class
 | // Interface class
 | ||||||
| 
 | 
 | ||||||
| Interface::Interface() { | Interface::Interface() { | ||||||
|     completion_event = Kernel::Event::Create(ResetType::OneShot, "Y2R:Completed"); |     completion_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "Y2R:Completed"); | ||||||
|     std::memset(&conversion, 0, sizeof(conversion)); |     std::memset(&conversion, 0, sizeof(conversion)); | ||||||
| 
 | 
 | ||||||
|     Register(FunctionTable); |     Register(FunctionTable); | ||||||
|  |  | ||||||
|  | @ -661,7 +661,7 @@ static ResultCode QueryMemory(MemoryInfo* memory_info, PageInfo* page_info, u32 | ||||||
| static ResultCode CreateEvent(Handle* out_handle, u32 reset_type) { | static ResultCode CreateEvent(Handle* out_handle, u32 reset_type) { | ||||||
|     using Kernel::Event; |     using Kernel::Event; | ||||||
| 
 | 
 | ||||||
|     SharedPtr<Event> evt = Kernel::Event::Create(static_cast<ResetType>(reset_type)); |     SharedPtr<Event> evt = Event::Create(static_cast<Kernel::ResetType>(reset_type)); | ||||||
|     CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(evt))); |     CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(evt))); | ||||||
| 
 | 
 | ||||||
|     LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", |     LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", | ||||||
|  | @ -707,7 +707,7 @@ static ResultCode ClearEvent(Handle handle) { | ||||||
| static ResultCode CreateTimer(Handle* out_handle, u32 reset_type) { | static ResultCode CreateTimer(Handle* out_handle, u32 reset_type) { | ||||||
|     using Kernel::Timer; |     using Kernel::Timer; | ||||||
| 
 | 
 | ||||||
|     SharedPtr<Timer> timer = Timer::Create(static_cast<ResetType>(reset_type)); |     SharedPtr<Timer> timer = Timer::Create(static_cast<Kernel::ResetType>(reset_type)); | ||||||
|     CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(timer))); |     CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(timer))); | ||||||
| 
 | 
 | ||||||
|     LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", |     LOG_TRACE(Kernel_SVC, "called reset_type=0x%08X : created handle=0x%08X", | ||||||
|  |  | ||||||
|  | @ -20,12 +20,6 @@ struct PageInfo { | ||||||
|     u32 flags; |     u32 flags; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| enum class ResetType { |  | ||||||
|     OneShot, |  | ||||||
|     Sticky, |  | ||||||
|     Pulse, |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| ////////////////////////////////////////////////////////////////////////////////////////////////////
 | ////////////////////////////////////////////////////////////////////////////////////////////////////
 | ||||||
| // Namespace SVC
 | // Namespace SVC
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue