mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-02 16:35:06 +01:00
svc: Make ResetType an enum class
This commit is contained in:
parent
2f0a61debf
commit
12e92f17de
@ -35,7 +35,7 @@ void Event::Acquire() {
|
|||||||
ASSERT_MSG(!ShouldWait(), "object unavailable!");
|
ASSERT_MSG(!ShouldWait(), "object unavailable!");
|
||||||
|
|
||||||
// Release the event if it's not sticky...
|
// Release the event if it's not sticky...
|
||||||
if (reset_type != RESETTYPE_STICKY)
|
if (reset_type != ResetType::Sticky)
|
||||||
signaled = false;
|
signaled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ bool Timer::ShouldWait() {
|
|||||||
void Timer::Acquire() {
|
void Timer::Acquire() {
|
||||||
ASSERT_MSG( !ShouldWait(), "object unavailable!");
|
ASSERT_MSG( !ShouldWait(), "object unavailable!");
|
||||||
|
|
||||||
if (reset_type == RESETTYPE_ONESHOT)
|
if (reset_type == ResetType::OneShot)
|
||||||
signaled = false;
|
signaled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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(ResetType::OneShot, "APT_U:Notification");
|
||||||
parameter_event = Kernel::Event::Create(RESETTYPE_ONESHOT, "APT_U:Start");
|
parameter_event = Kernel::Event::Create(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;
|
||||||
|
@ -293,10 +293,10 @@ void Init() {
|
|||||||
AddService(new CAM_S_Interface);
|
AddService(new CAM_S_Interface);
|
||||||
AddService(new CAM_U_Interface);
|
AddService(new CAM_U_Interface);
|
||||||
|
|
||||||
completion_event_cam1 = Kernel::Event::Create(RESETTYPE_ONESHOT, "CAM_U::completion_event_cam1");
|
completion_event_cam1 = Kernel::Event::Create(ResetType::OneShot, "CAM_U::completion_event_cam1");
|
||||||
completion_event_cam2 = Kernel::Event::Create(RESETTYPE_ONESHOT, "CAM_U::completion_event_cam2");
|
completion_event_cam2 = Kernel::Event::Create(ResetType::OneShot, "CAM_U::completion_event_cam2");
|
||||||
interrupt_error_event = Kernel::Event::Create(RESETTYPE_ONESHOT, "CAM_U::interrupt_error_event");
|
interrupt_error_event = Kernel::Event::Create(ResetType::OneShot, "CAM_U::interrupt_error_event");
|
||||||
vsync_interrupt_error_event = Kernel::Event::Create(RESETTYPE_ONESHOT, "CAM_U::vsync_interrupt_error_event");
|
vsync_interrupt_error_event = Kernel::Event::Create(ResetType::OneShot, "CAM_U::vsync_interrupt_error_event");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Shutdown() {
|
void Shutdown() {
|
||||||
|
@ -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(ResetType::OneShot, "DSP_DSP::semaphore_event");
|
||||||
read_pipe_count = 0;
|
read_pipe_count = 0;
|
||||||
|
|
||||||
Register(FunctionTable);
|
Register(FunctionTable);
|
||||||
|
@ -201,11 +201,11 @@ void Init() {
|
|||||||
next_touch_index = 0;
|
next_touch_index = 0;
|
||||||
|
|
||||||
// Create event handles
|
// Create event handles
|
||||||
event_pad_or_touch_1 = Event::Create(RESETTYPE_ONESHOT, "HID:EventPadOrTouch1");
|
event_pad_or_touch_1 = Event::Create(ResetType::OneShot, "HID:EventPadOrTouch1");
|
||||||
event_pad_or_touch_2 = Event::Create(RESETTYPE_ONESHOT, "HID:EventPadOrTouch2");
|
event_pad_or_touch_2 = Event::Create(ResetType::OneShot, "HID:EventPadOrTouch2");
|
||||||
event_accelerometer = Event::Create(RESETTYPE_ONESHOT, "HID:EventAccelerometer");
|
event_accelerometer = Event::Create(ResetType::OneShot, "HID:EventAccelerometer");
|
||||||
event_gyroscope = Event::Create(RESETTYPE_ONESHOT, "HID:EventGyroscope");
|
event_gyroscope = Event::Create(ResetType::OneShot, "HID:EventGyroscope");
|
||||||
event_debug_pad = Event::Create(RESETTYPE_ONESHOT, "HID:EventDebugPad");
|
event_debug_pad = Event::Create(ResetType::OneShot, "HID:EventDebugPad");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Shutdown() {
|
void Shutdown() {
|
||||||
|
@ -99,8 +99,8 @@ void Init() {
|
|||||||
transfer_shared_memory = nullptr;
|
transfer_shared_memory = nullptr;
|
||||||
|
|
||||||
// Create event handle(s)
|
// Create event handle(s)
|
||||||
handle_event = Event::Create(RESETTYPE_ONESHOT, "IR:HandleEvent");
|
handle_event = Event::Create(ResetType::OneShot, "IR:HandleEvent");
|
||||||
conn_status_event = Event::Create(RESETTYPE_ONESHOT, "IR:ConnectionStatusEvent");
|
conn_status_event = Event::Create(ResetType::OneShot, "IR:ConnectionStatusEvent");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Shutdown() {
|
void Shutdown() {
|
||||||
|
@ -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(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(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(ResetType::OneShot, "Y2R:Completed");
|
||||||
std::memset(&conversion, 0, sizeof(conversion));
|
std::memset(&conversion, 0, sizeof(conversion));
|
||||||
|
|
||||||
Register(FunctionTable);
|
Register(FunctionTable);
|
||||||
|
@ -20,11 +20,10 @@ struct PageInfo {
|
|||||||
u32 flags;
|
u32 flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ResetType {
|
enum class ResetType {
|
||||||
RESETTYPE_ONESHOT,
|
OneShot,
|
||||||
RESETTYPE_STICKY,
|
Sticky,
|
||||||
RESETTYPE_PULSE,
|
Pulse,
|
||||||
RESETTYPE_MAX_BIT = (1u << 31),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ArbitrationType {
|
enum ArbitrationType {
|
||||||
|
Loading…
Reference in New Issue
Block a user