diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c73f294..4231ff53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,7 @@ set(KERNEL_SOURCE_FILES src/core/kernel/kernel.cpp src/core/kernel/resource_limi src/core/kernel/events.cpp src/core/kernel/threads.cpp src/core/kernel/address_arbiter.cpp src/core/kernel/error.cpp src/core/kernel/file_operations.cpp src/core/kernel/directory_operations.cpp - src/core/kernel/idle_thread.cpp + src/core/kernel/idle_thread.cpp src/core/kernel/timers.cpp ) set(SERVICE_SOURCE_FILES src/core/services/service_manager.cpp src/core/services/apt.cpp src/core/services/hid.cpp src/core/services/fs.cpp src/core/services/gsp_gpu.cpp src/core/services/gsp_lcd.cpp diff --git a/include/kernel/kernel.hpp b/include/kernel/kernel.hpp index e1d521c7..163b19e1 100644 --- a/include/kernel/kernel.hpp +++ b/include/kernel/kernel.hpp @@ -67,6 +67,7 @@ public: Handle makeEvent(ResetType resetType); // Needs to be public to be accessible to the APT/HID services Handle makeMutex(bool locked = false); // Needs to be public to be accessible to the APT/DSP services Handle makeSemaphore(u32 initialCount, u32 maximumCount); // Needs to be public to be accessible to the service manager port + Handle makeTimer(ResetType resetType); // Signals an event, returns true on success or false if the event does not exist bool signalEvent(Handle e); @@ -135,14 +136,18 @@ private: void getThreadPriority(); void sendSyncRequest(); void setThreadPriority(); + void svcCancelTimer(); void svcClearEvent(); + void svcClearTimer(); void svcCloseHandle(); void svcCreateEvent(); void svcCreateMutex(); void svcCreateSemaphore(); + void svcCreateTimer(); void svcReleaseMutex(); void svcReleaseSemaphore(); void svcSignalEvent(); + void svcSetTimer(); void svcSleepThread(); void connectToPort(); void outputDebugString(); diff --git a/src/core/kernel/kernel.cpp b/src/core/kernel/kernel.cpp index 6f3cf081..900ad559 100644 --- a/src/core/kernel/kernel.cpp +++ b/src/core/kernel/kernel.cpp @@ -42,6 +42,10 @@ void Kernel::serviceSVC(u32 svc) { case 0x17: svcCreateEvent(); break; case 0x18: svcSignalEvent(); break; case 0x19: svcClearEvent(); break; + case 0x1A: svcCreateTimer(); break; + case 0x1B: svcSetTimer(); break; + case 0x1C: svcCancelTimer(); break; + case 0x1D: svcClearTimer(); break; case 0x1E: createMemoryBlock(); break; case 0x1F: mapMemoryBlock(); break; case 0x21: createAddressArbiter(); break; diff --git a/src/core/kernel/timers.cpp b/src/core/kernel/timers.cpp new file mode 100644 index 00000000..f4a89407 --- /dev/null +++ b/src/core/kernel/timers.cpp @@ -0,0 +1,6 @@ +#include "kernel.hpp" + +void Kernel::svcCreateTimer() { Helpers::panic("Kernel::CreateTimer"); } +void Kernel::svcSetTimer() { Helpers::panic("Kernel::SetTimer"); } +void Kernel::svcClearTimer() { Helpers::panic("Kernel::ClearTimer"); } +void Kernel::svcCancelTimer() { Helpers::panic("Kernel::CancelTimer"); } \ No newline at end of file