Sync objects 0.1

This commit is contained in:
wheremyfoodat 2022-11-16 22:02:52 +02:00
parent 182132cbb1
commit 41e01bbdd4
6 changed files with 66 additions and 21 deletions

View file

@ -64,6 +64,8 @@ class Kernel {
u32 getMaxForResource(const KernelObject* limit, u32 resourceName);
u32 getTLSPointer();
bool isWaitable(const KernelObject* object);
// Functions for the err:f port
void handleErrorSyncRequest(u32 messagePointer);
void throwError(u32 messagePointer);

View file

@ -23,9 +23,9 @@ namespace SVCResult {
}
enum class KernelObjectType : u8 {
AddressArbiter, Archive, File, Port, Process, ResourceLimit, Session, Dummy,
AddressArbiter, Archive, File, Process, ResourceLimit, Session, Dummy,
// Bundle waitable objects together in the enum to let the compiler optimize certain checks better
Event, Mutex, Semaphore, Thread
Event, Mutex, Port, Semaphore, Timer, Thread
};
enum class ResourceLimitCategory : int {
@ -121,6 +121,8 @@ struct Thread {
s64 waitingNanoseconds;
// The tick this thread went to sleep on
u64 sleepTick;
// For WaitSynchronization: A vector of objects this thread is waiting for
std::vector<Handle> waitList;
// Thread context used for switching between threads
std::array<u32, 16> gprs;