Add empty PTM service for CubicNinja

This commit is contained in:
wheremyfoodat 2022-10-15 14:17:10 +03:00
parent 5d15efe72c
commit 49dc526347
7 changed files with 61 additions and 12 deletions

View file

@ -10,17 +10,18 @@ namespace KernelHandles {
// Hardcoded handles
CurrentThread = 0xFFFF8000, // Used by the original kernel
CurrentProcess = 0xFFFF8001, // Used by the original kernel
APT = 0xFFFF8002, // App Title something service?
CFG = 0xFFFF8003, // Console & region info
HID = 0xFFFF8004, // Handles everything input-related including gyro
FS = 0xFFFF8005, // Filesystem service
GPU = 0xFFFF8006, // GPU service
DSP = 0xFFFF8007, // DSP service (Used for audio decoding and output)
LCD = 0xFFFF8008, // LCD service (Used for configuring the displays)
NDM = 0xFFFF8009, // ?????
APT, // App Title something service?
CFG, // CFG service (Console & region info)
HID, // HID service (Handles everything input-related including gyro)
FS, // Filesystem service
GPU, // GPU service
DSP, // DSP service (Used for audio decoding and output)
LCD, // LCD service (Used for configuring the displays)
NDM, // ?????
PTM, // PTM service (Used for accessing various console info, such as battery, shell and pedometer state)
MinServiceHandle = APT,
MaxServiceHandle = NDM,
MaxServiceHandle = PTM,
GSPSharedMemHandle = MaxServiceHandle + 1, // Handle for the GSP shared memory
HIDSharedMemHandle,
@ -56,6 +57,7 @@ namespace KernelHandles {
case GPU: return "GPU";
case LCD: return "LCD";
case NDM: return "NDM";
case PTM: return "PTM";
default: return "Unknown";
}
}

View file

@ -34,6 +34,7 @@ namespace Log {
static Logger<true> gspGPULogger;
static Logger<true> gspLCDLogger;
static Logger<true> ndmLogger;
static Logger<true> ptmLogger;
static Logger<true> srvLogger;
#define MAKE_LOG_FUNCTION(functionName, logger) \

18
include/services/ptm.hpp Normal file
View file

@ -0,0 +1,18 @@
#pragma once
#include "helpers.hpp"
#include "kernel_types.hpp"
#include "logger.hpp"
#include "memory.hpp"
class PTMService {
Handle handle = KernelHandles::PTM;
Memory& mem;
MAKE_LOG_FUNCTION(log, ptmLogger)
// Service commands
public:
PTMService(Memory& mem) : mem(mem) {}
void reset();
void handleSyncRequest(u32 messagePointer);
};

View file

@ -11,6 +11,7 @@
#include "services/gsp_gpu.hpp"
#include "services/gsp_lcd.hpp"
#include "services/ndm.hpp"
#include "services/ptm.hpp"
class Kernel;
@ -27,6 +28,7 @@ class ServiceManager {
GPUService gsp_gpu;
LCDService gsp_lcd;
NDMService ndm;
PTMService ptm;
// "srv:" commands
void enableNotification(u32 messagePointer);