benchmark-toolbox: add benchmark-toolbox

a unified benchmarking tool
This commit is contained in:
souldbminersmwc
2026-06-07 21:10:53 -04:00
parent 8ebf887956
commit 4a5e889c40
1252 changed files with 356811 additions and 491 deletions

View File

@@ -0,0 +1,35 @@
#define NX_SERVICE_ASSUME_NON_DOMAIN
#include <assert.h>
#include <switch.h>
#include "hoc_clk.h"
#include <hocclk/clock_manager.h>
#define HOCCLK_SERVICE "hoc:clk"
#define HOCCLK_CMD_GET_CURRENT_CONTEXT 2
static Service g_srv;
static bool g_active = false;
bool hocclk_init(void) {
if (g_active)
return true;
Result rc = smGetService(&g_srv, HOCCLK_SERVICE);
g_active = R_SUCCEEDED(rc);
return g_active;
}
void hocclk_exit(void) {
if (g_active) {
serviceClose(&g_srv);
g_active = false;
}
}
bool hocclk_get(HocClkContext *out) {
if (!g_active)
return false;
Result rc = serviceDispatch(&g_srv, HOCCLK_CMD_GET_CURRENT_CONTEXT, .buffer_attrs = { SfBufferAttr_HipcAutoSelect | SfBufferAttr_Out },
.buffers = { { out, sizeof(*out) } }, );
return R_SUCCEEDED(rc);
}