mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-21 14:23:00 +12:00
Hopefully we're good to start sending commands to services now
This commit is contained in:
parent
208c18356b
commit
6154a360c6
10 changed files with 110 additions and 32 deletions
31
include/kernel/handles.hpp
Normal file
31
include/kernel/handles.hpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
#include "helpers.hpp"
|
||||
|
||||
using Handle = u32;
|
||||
|
||||
namespace KernelHandles {
|
||||
enum : u32 {
|
||||
Max = 0xFFFF7FFF, // Max handle the kernel can automagically allocate
|
||||
|
||||
// Hardcoded handles
|
||||
CurrentThread = 0xFFFF8000, // Used by the original kernel
|
||||
CurrentProcess = 0xFFFF8001, // Used by the original kernel
|
||||
APT = 0xFFFF8002, // App Title something service?
|
||||
|
||||
MinServiceHandle = APT,
|
||||
MaxServiceHandle = APT
|
||||
};
|
||||
|
||||
// Returns whether "handle" belongs to one of the OS services
|
||||
static constexpr bool isServiceHandle(Handle handle) {
|
||||
return handle >= MinServiceHandle && handle <= MaxServiceHandle;
|
||||
}
|
||||
|
||||
// Returns the name of a handle as a string based on the given handle
|
||||
static const char* getServiceName(Handle handle) {
|
||||
switch (handle) {
|
||||
case APT: return "APT";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue