hle: add BluetoothHid, DeviceService and Usbd stubs (#1031)

This commit is contained in:
Çağatay Güçlü 2026-10-05 02:04:41 +03:00 committed by GitHub
parent f96a14a0ab
commit bbb98bd490
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 128 additions and 0 deletions

View File

@ -0,0 +1,42 @@
#include "common/abi.h"
#include "common/logging/log.h"
#include "libs/errno.h"
#include "libs/libs.h"
#include "loader/symbolDatabase.h"
namespace Libs {
LIB_VERSION("BluetoothHid", 1, "BluetoothHid", 1, 1);
namespace BluetoothHid {
static int KYTY_SYSV_ABI BluetoothHidInit() {
PRINT_NAME();
return OK;
}
static int KYTY_SYSV_ABI BluetoothHidRegisterDevice() {
PRINT_NAME();
return OK;
}
// Callback signature is unverified; the stub never invokes it.
static int KYTY_SYSV_ABI BluetoothHidRegisterCallback(uint64_t callback_func) {
PRINT_NAME();
LOGF("\t callback_func = 0x%016" PRIx64 "\n", callback_func);
return OK;
}
} // namespace BluetoothHid
LIB_DEFINE(InitBluetoothHid_1) {
LIB_FUNC("tul3-GzejQc", BluetoothHid::BluetoothHidInit);
LIB_FUNC("4FUZ+c52d2k", BluetoothHid::BluetoothHidRegisterDevice);
LIB_FUNC("4Ypfo9RIwfM", BluetoothHid::BluetoothHidRegisterCallback);
}
} // namespace Libs

View File

@ -0,0 +1,36 @@
#include "common/abi.h"
#include "common/logging/log.h"
#include "libs/errno.h"
#include "libs/libs.h"
#include "loader/symbolDatabase.h"
namespace Libs {
LIB_VERSION("DeviceService", 1, "Mbus", 1, 1);
namespace DeviceService {
static int KYTY_SYSV_ABI DeviceServiceInitialize() {
PRINT_NAME();
return OK;
}
static int KYTY_SYSV_ABI DeviceServiceQueryDeviceInfo(uint32_t device_handle, void* out_info) {
PRINT_NAME();
LOGF("\t device_handle = 0x%08" PRIx32 "\n"
"\t out_info = 0x%016" PRIx64 "\n",
device_handle, reinterpret_cast<uint64_t>(out_info));
return OK;
}
} // namespace DeviceService
LIB_DEFINE(InitDeviceService_1) {
LIB_FUNC("84fDxStrG44", DeviceService::DeviceServiceInitialize);
LIB_FUNC("UNMEa+5lrUA", DeviceService::DeviceServiceQueryDeviceInfo);
}
} // namespace Libs

44
src/libs/libUsbd.cpp Normal file
View File

@ -0,0 +1,44 @@
#include "common/abi.h"
#include "common/threads.h"
#include "libs/errno.h"
#include "libs/libs.h"
#include "loader/symbolDatabase.h"
namespace Libs {
LIB_VERSION("Usbd", 1, "Usbd", 1, 1);
namespace Usbd {
constexpr uint32_t POLL_INTERVAL_MS = 16;
static int KYTY_SYSV_ABI UsbdInit() {
PRINT_NAME();
return OK;
}
static int KYTY_SYSV_ABI UsbdExit() {
PRINT_NAME();
return OK;
}
static int KYTY_SYSV_ABI UsbdHandleEventsTimeout() {
PRINT_NAME();
// Avoid a busy loop while USB events are unimplemented.
Common::Thread::SleepMicro(POLL_INTERVAL_MS * 1000);
return OK;
}
} // namespace Usbd
LIB_DEFINE(InitUsbd_1) {
LIB_FUNC("TOhg7P6kTH4", Usbd::UsbdInit);
LIB_FUNC("Fq6+0Fm55xU", Usbd::UsbdExit);
LIB_FUNC("+wU6CGuZcWk", Usbd::UsbdHandleEventsTimeout);
}
} // namespace Libs

View File

@ -79,8 +79,10 @@ LIB_DEFINE(InitVideoOutVrrStatus_1);
LIB_DEFINE(InitAppContent_1);
LIB_DEFINE(InitAudio_1);
LIB_DEFINE(InitBluetoothHid_1);
LIB_DEFINE(InitConvertKeycode_1);
LIB_DEFINE(InitDbgAddressSanitizer_1);
LIB_DEFINE(InitDeviceService_1);
LIB_DEFINE(InitDialog_1);
LIB_DEFINE(InitFont_1);
LIB_DEFINE(InitFontFt_1);
@ -99,6 +101,7 @@ LIB_DEFINE(InitShare_1);
LIB_DEFINE(InitSysmodule_1);
LIB_DEFINE(InitSystemService_1);
LIB_DEFINE(InitTextToSpeech2_1);
LIB_DEFINE(InitUsbd_1);
LIB_DEFINE(InitUserService_1);
LIB_DEFINE(InitWebBrowserDialog_1);
@ -120,6 +123,9 @@ void InitAll(Loader::SymbolDatabase* s) {
InitFont_1(s);
InitFontFt_1(s);
InitAgcDriver_1(s);
InitBluetoothHid_1(s);
InitDeviceService_1(s);
InitUsbd_1(s);
InitHmd2_1(s);
InitLibKernel_1(s);
LibMouse::InitMouse_1(s);