OS timers part 1

This commit is contained in:
wheremyfoodat 2023-08-13 03:35:41 +03:00
parent f3a19e28b4
commit 6552f2998c
4 changed files with 16 additions and 1 deletions

View file

@ -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

View file

@ -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();

View file

@ -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;

View file

@ -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"); }