From 613be1425ed8bb82a60417d0844f97590dcfd6f4 Mon Sep 17 00:00:00 2001 From: gibbed Date: Tue, 20 Nov 2018 10:51:15 -0600 Subject: [PATCH 1/2] [Kernel] Update XamContentOpenFile argument names. --- src/xenia/kernel/xam/xam_content.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/xenia/kernel/xam/xam_content.cc b/src/xenia/kernel/xam/xam_content.cc index f1fc56c91..8ff114a61 100644 --- a/src/xenia/kernel/xam/xam_content.cc +++ b/src/xenia/kernel/xam/xam_content.cc @@ -302,9 +302,12 @@ dword_result_t XamContentCreate(dword_t user_index, lpstring_t root_name, } DECLARE_XAM_EXPORT(XamContentCreate, ExportTag::kImplemented); -dword_result_t XamContentOpenFile(dword_t r3, lpstring_t r4, lpstring_t r5, - dword_t r6, dword_t r7, dword_t r8, - dword_t r9) { +dword_result_t XamContentOpenFile(dword_t user_index, lpstring_t root_name, + lpstring_t path, dword_t flags, + lpdword_t disposition_ptr, + lpdword_t license_mask_ptr, + lpvoid_t overlapped_ptr) { + // TODO(gibbed): arguments assumed based on XamContentCreate. return X_ERROR_FILE_NOT_FOUND; } DECLARE_XAM_EXPORT(XamContentOpenFile, ExportTag::kStub); From 394105d359e3a6501d545555331ca5dc29f4e0ab Mon Sep 17 00:00:00 2001 From: gibbed Date: Tue, 20 Nov 2018 11:01:25 -0600 Subject: [PATCH 2/2] [CPU/Kernel] Cleanup and rework of how kernel exports are declared. --- src/xenia/cpu/export_resolver.h | 34 +++-- src/xenia/kernel/util/shim_utils.h | 34 ++++- src/xenia/kernel/xam/xam_avatar.cc | 4 +- src/xenia/kernel/xam/xam_content.cc | 8 +- src/xenia/kernel/xam/xam_info.cc | 32 ++--- src/xenia/kernel/xam/xam_input.cc | 26 ++-- src/xenia/kernel/xam/xam_msg.cc | 10 +- src/xenia/kernel/xam/xam_net.cc | 120 ++++++------------ src/xenia/kernel/xam/xam_notify.cc | 9 +- src/xenia/kernel/xam/xam_nui.cc | 4 +- src/xenia/kernel/xam/xam_ui.cc | 4 +- src/xenia/kernel/xam/xam_user.cc | 55 +++----- src/xenia/kernel/xam/xam_video.cc | 4 +- src/xenia/kernel/xam/xam_voice.cc | 8 +- src/xenia/kernel/xbdm/xbdm_misc.cc | 14 +- src/xenia/kernel/xboxkrnl/xboxkrnl_audio.cc | 27 ++-- .../kernel/xboxkrnl/xboxkrnl_audio_xma.cc | 102 ++++++--------- src/xenia/kernel/xboxkrnl/xboxkrnl_crypt.cc | 34 ++--- src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc | 8 +- src/xenia/kernel/xboxkrnl/xboxkrnl_error.cc | 3 +- src/xenia/kernel/xboxkrnl/xboxkrnl_hal.cc | 2 +- src/xenia/kernel/xboxkrnl/xboxkrnl_hid.cc | 2 +- src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc | 33 +++-- src/xenia/kernel/xboxkrnl/xboxkrnl_memory.cc | 45 +++---- src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc | 2 +- src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc | 24 ++-- src/xenia/kernel/xboxkrnl/xboxkrnl_ob.cc | 18 +-- src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc | 58 ++++----- .../kernel/xboxkrnl/xboxkrnl_threading.cc | 116 +++++++---------- src/xenia/kernel/xboxkrnl/xboxkrnl_usbcam.cc | 4 +- src/xenia/kernel/xboxkrnl/xboxkrnl_video.cc | 57 ++++----- 31 files changed, 399 insertions(+), 502 deletions(-) diff --git a/src/xenia/cpu/export_resolver.h b/src/xenia/cpu/export_resolver.h index 8e08f2b2a..df92b2c0c 100644 --- a/src/xenia/cpu/export_resolver.h +++ b/src/xenia/cpu/export_resolver.h @@ -19,9 +19,32 @@ namespace xe { namespace cpu { +enum class ExportCategory : uint8_t { + kNone = 0, + kAudio, + kAvatars, + kContent, + kDebug, + kFileSystem, + kInput, + kMemory, + kMisc, + kModules, + kNetworking, + kThreading, + kUI, + kUserProfiles, + kVideo, +}; + struct ExportTag { typedef uint32_t type; + // packed like so: + // ll...... cccccccc ........ ..bihssi + + static const int CategoryShift = 16; + // Export is implemented in some form and can be used. static const type kImplemented = 1u << 0; // Export is a stub and is probably bad. @@ -35,17 +58,6 @@ struct ExportTag { // Export blocks the calling thread static const type kBlocking = 1u << 5; - static const type kThreading = 1u << 10; - static const type kInput = 1u << 11; - static const type kAudio = 1u << 12; - static const type kVideo = 1u << 13; - static const type kFileSystem = 1u << 14; - static const type kModules = 1u << 15; - static const type kUserProfiles = 1u << 16; - static const type kNetworking = 1u << 17; - static const type kMemory = 1u << 18; - static const type kDebug = 1u << 19; - // Export will be logged on each call. static const type kLog = 1u << 30; // Export's result will be logged on each call. diff --git a/src/xenia/kernel/util/shim_utils.h b/src/xenia/kernel/util/shim_utils.h index e478223ab..a309dcdd1 100644 --- a/src/xenia/kernel/util/shim_utils.h +++ b/src/xenia/kernel/util/shim_utils.h @@ -531,15 +531,39 @@ xe::cpu::Export* RegisterExport(void (*fn)(Ps&...), const char* name, using xe::cpu::ExportTag; -#define DECLARE_EXPORT(module_name, name, tags) \ +#define DECLARE_EXPORT(module_name, name, category, tags) \ const auto EXPORT_##module_name##_##name = RegisterExport_##module_name( \ xe::kernel::shim::RegisterExport< \ xe::kernel::shim::KernelModuleId::module_name, ordinals::name>( \ - &name, #name, tags)); + &name, #name, \ + tags | (static_cast( \ + xe::cpu::ExportCategory::category) \ + << xe::cpu::ExportTag::CategoryShift))); -#define DECLARE_XAM_EXPORT(name, tags) DECLARE_EXPORT(xam, name, tags) -#define DECLARE_XBDM_EXPORT(name, tags) DECLARE_EXPORT(xbdm, name, tags) -#define DECLARE_XBOXKRNL_EXPORT(name, tags) DECLARE_EXPORT(xboxkrnl, name, tags) +#define DECLARE_XAM_EXPORT_(name, category, tags) \ + DECLARE_EXPORT(xam, name, category, tags) +#define DECLARE_XAM_EXPORT1(name, category, tag) \ + DECLARE_EXPORT(xam, name, category, xe::cpu::ExportTag::tag) +#define DECLARE_XAM_EXPORT2(name, category, tag1, tag2) \ + DECLARE_EXPORT(xam, name, category, \ + xe::cpu::ExportTag::tag1 | xe::cpu::ExportTag::tag2) + +#define DECLARE_XBDM_EXPORT_(name, category, tags) \ + DECLARE_EXPORT(xbdm, name, category, tags) +#define DECLARE_XBDM_EXPORT1(name, category, tag) \ + DECLARE_EXPORT(xbdm, name, category, xe::cpu::ExportTag::tag) + +#define DECLARE_XBOXKRNL_EXPORT_(name, category, tags) \ + DECLARE_EXPORT(xboxkrnl, name, category, tags) +#define DECLARE_XBOXKRNL_EXPORT1(name, category, tag) \ + DECLARE_EXPORT(xboxkrnl, name, category, xe::cpu::ExportTag::tag) +#define DECLARE_XBOXKRNL_EXPORT2(name, category, tag1, tag2) \ + DECLARE_EXPORT(xboxkrnl, name, category, \ + xe::cpu::ExportTag::tag1 | xe::cpu::ExportTag::tag2) +#define DECLARE_XBOXKRNL_EXPORT3(name, category, tag1, tag2, tag3) \ + DECLARE_EXPORT(xboxkrnl, name, category, \ + xe::cpu::ExportTag::tag1 | xe::cpu::ExportTag::tag2 | \ + xe::cpu::ExportTag::tag3) } // namespace kernel } // namespace xe diff --git a/src/xenia/kernel/xam/xam_avatar.cc b/src/xenia/kernel/xam/xam_avatar.cc index 3c2049b38..a949e91b2 100644 --- a/src/xenia/kernel/xam/xam_avatar.cc +++ b/src/xenia/kernel/xam/xam_avatar.cc @@ -28,12 +28,12 @@ dword_result_t XamAvatarInitialize( // Negative to fail. Game should immediately call XamAvatarShutdown. return ~0u; } -DECLARE_XAM_EXPORT(XamAvatarInitialize, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamAvatarInitialize, kAvatars, kStub); void XamAvatarShutdown() { // No-op. } -DECLARE_XAM_EXPORT(XamAvatarShutdown, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamAvatarShutdown, kAvatars, kStub); void RegisterAvatarExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xam/xam_content.cc b/src/xenia/kernel/xam/xam_content.cc index 8ff114a61..ec7a3d4e6 100644 --- a/src/xenia/kernel/xam/xam_content.cc +++ b/src/xenia/kernel/xam/xam_content.cc @@ -197,7 +197,7 @@ dword_result_t XamContentCreateEnumerator(dword_t user_index, dword_t device_id, *handle_out = e->handle(); return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamContentCreateEnumerator, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamContentCreateEnumerator, kContent, kImplemented); dword_result_t XamContentCreateEx(dword_t user_index, lpstring_t root_name, lpvoid_t content_data_ptr, dword_t flags, @@ -289,7 +289,7 @@ dword_result_t XamContentCreateEx(dword_t user_index, lpstring_t root_name, return result; } } -DECLARE_XAM_EXPORT(XamContentCreateEx, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamContentCreateEx, kContent, kImplemented); dword_result_t XamContentCreate(dword_t user_index, lpstring_t root_name, lpvoid_t content_data_ptr, dword_t flags, @@ -300,7 +300,7 @@ dword_result_t XamContentCreate(dword_t user_index, lpstring_t root_name, disposition_ptr, license_mask_ptr, 0, 0, overlapped_ptr); } -DECLARE_XAM_EXPORT(XamContentCreate, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamContentCreate, kContent, kImplemented); dword_result_t XamContentOpenFile(dword_t user_index, lpstring_t root_name, lpstring_t path, dword_t flags, @@ -310,7 +310,7 @@ dword_result_t XamContentOpenFile(dword_t user_index, lpstring_t root_name, // TODO(gibbed): arguments assumed based on XamContentCreate. return X_ERROR_FILE_NOT_FOUND; } -DECLARE_XAM_EXPORT(XamContentOpenFile, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamContentOpenFile, kContent, kStub); SHIM_CALL XamContentFlush_shim(PPCContext* ppc_context, KernelState* kernel_state) { diff --git a/src/xenia/kernel/xam/xam_info.cc b/src/xenia/kernel/xam/xam_info.cc index b4afb14ba..5729a584a 100644 --- a/src/xenia/kernel/xam/xam_info.cc +++ b/src/xenia/kernel/xam/xam_info.cc @@ -32,12 +32,12 @@ dword_result_t XamGetSystemVersion() { // 0x20096B00 return 0; } -DECLARE_XAM_EXPORT(XamGetSystemVersion, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamGetSystemVersion, kNone, kStub); void XCustomRegisterDynamicActions() { // ??? } -DECLARE_XAM_EXPORT(XCustomRegisterDynamicActions, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XCustomRegisterDynamicActions, kNone, kStub); dword_result_t XGetAVPack() { // DWORD @@ -47,10 +47,10 @@ dword_result_t XGetAVPack() { // they explode with errors if not in PAL mode. return 6; } -DECLARE_XAM_EXPORT(XGetAVPack, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XGetAVPack, kNone, kStub); dword_result_t XGetGameRegion() { return 0xFFFF; } -DECLARE_XAM_EXPORT(XGetGameRegion, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XGetGameRegion, kNone, kStub); dword_result_t XGetLanguage() { uint32_t desired_language = X_LANGUAGE_ENGLISH; @@ -67,7 +67,7 @@ dword_result_t XGetLanguage() { return desired_language; } -DECLARE_XAM_EXPORT(XGetLanguage, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XGetLanguage, kNone, kImplemented); dword_result_t XamGetExecutionId(lpdword_t info_ptr) { auto module = kernel_state()->GetExecutableModule(); @@ -84,7 +84,7 @@ dword_result_t XamGetExecutionId(lpdword_t info_ptr) { *info_ptr = guest_hdr_ptr; return X_STATUS_SUCCESS; } -DECLARE_XAM_EXPORT(XamGetExecutionId, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamGetExecutionId, kNone, kImplemented); dword_result_t XamLoaderSetLaunchData(lpvoid_t data, dword_t size) { auto xam = kernel_state()->GetKernelModule("xam.xex"); @@ -97,7 +97,7 @@ dword_result_t XamLoaderSetLaunchData(lpvoid_t data, dword_t size) { // FIXME: Unknown return value. return 0; } -DECLARE_XAM_EXPORT(XamLoaderSetLaunchData, ExportTag::kSketchy); +DECLARE_XAM_EXPORT1(XamLoaderSetLaunchData, kNone, kSketchy); dword_result_t XamLoaderGetLaunchDataSize(lpdword_t size_ptr) { auto xam = kernel_state()->GetKernelModule("xam.xex"); @@ -115,7 +115,7 @@ dword_result_t XamLoaderGetLaunchDataSize(lpdword_t size_ptr) { *size_ptr = 0; return X_ERROR_NOT_FOUND; } -DECLARE_XAM_EXPORT(XamLoaderGetLaunchDataSize, ExportTag::kSketchy); +DECLARE_XAM_EXPORT1(XamLoaderGetLaunchDataSize, kNone, kSketchy); dword_result_t XamLoaderGetLaunchData(lpvoid_t buffer_ptr, dword_t buffer_size) { @@ -130,7 +130,7 @@ dword_result_t XamLoaderGetLaunchData(lpvoid_t buffer_ptr, std::memcpy(buffer_ptr, loader_data.launch_data.data(), copy_size); return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamLoaderGetLaunchData, ExportTag::kSketchy); +DECLARE_XAM_EXPORT1(XamLoaderGetLaunchData, kNone, kSketchy); void XamLoaderLaunchTitle(lpstring_t raw_name, dword_t flags) { auto xam = kernel_state()->GetKernelModule("xam.xex"); @@ -158,13 +158,13 @@ void XamLoaderLaunchTitle(lpstring_t raw_name, dword_t flags) { // This function does not return. kernel_state()->TerminateTitle(); } -DECLARE_XAM_EXPORT(XamLoaderLaunchTitle, ExportTag::kSketchy); +DECLARE_XAM_EXPORT1(XamLoaderLaunchTitle, kNone, kSketchy); void XamLoaderTerminateTitle() { // This function does not return. kernel_state()->TerminateTitle(); } -DECLARE_XAM_EXPORT(XamLoaderTerminateTitle, ExportTag::kSketchy); +DECLARE_XAM_EXPORT1(XamLoaderTerminateTitle, kNone, kSketchy); dword_result_t XamAlloc(dword_t unk, dword_t size, lpdword_t out_ptr) { assert_true(unk == 0); @@ -176,14 +176,14 @@ dword_result_t XamAlloc(dword_t unk, dword_t size, lpdword_t out_ptr) { return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamAlloc, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamAlloc, kMemory, kImplemented); dword_result_t XamFree(lpdword_t ptr) { kernel_state()->memory()->SystemHeapFree(ptr.guest_address()); return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamFree, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamFree, kMemory, kImplemented); // https://github.com/LestaD/SourceEngine2007/blob/master/se2007/engine/xboxsystem.cpp#L518 dword_result_t XamEnumerate(dword_t handle, dword_t flags, lpvoid_t buffer, @@ -241,7 +241,7 @@ dword_result_t XamEnumerate(dword_t handle, dword_t flags, lpvoid_t buffer, return X_ERROR_INVALID_PARAMETER; } } -DECLARE_XAM_EXPORT(XamEnumerate, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamEnumerate, kNone, kImplemented); dword_result_t XamCreateEnumeratorHandle(unknown_t unk1, unknown_t unk2, unknown_t unk3, unknown_t unk4, @@ -249,13 +249,13 @@ dword_result_t XamCreateEnumeratorHandle(unknown_t unk1, unknown_t unk2, unknown_t unk7, unknown_t unk8) { return X_ERROR_INVALID_PARAMETER; } -DECLARE_XAM_EXPORT(XamCreateEnumeratorHandle, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamCreateEnumeratorHandle, kNone, kStub); dword_result_t XamGetPrivateEnumStructureFromHandle(unknown_t unk1, unknown_t unk2) { return X_ERROR_INVALID_PARAMETER; } -DECLARE_XAM_EXPORT(XamGetPrivateEnumStructureFromHandle, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamGetPrivateEnumStructureFromHandle, kNone, kStub); void RegisterInfoExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xam/xam_input.cc b/src/xenia/kernel/xam/xam_input.cc index 164d36651..66957a5a7 100644 --- a/src/xenia/kernel/xam/xam_input.cc +++ b/src/xenia/kernel/xam/xam_input.cc @@ -31,13 +31,12 @@ constexpr uint32_t XINPUT_FLAG_ANY_USER = 1 << 30; void XamResetInactivity() { // Do we need to do anything? } -DECLARE_XAM_EXPORT(XamResetInactivity, ExportTag::kInput | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamResetInactivity, kInput, kStub); dword_result_t XamEnableInactivityProcessing(dword_t unk, dword_t enable) { return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamEnableInactivityProcessing, - ExportTag::kInput | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamEnableInactivityProcessing, kInput, kStub); // http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputgetcapabilities(v=vs.85).aspx dword_result_t XamInputGetCapabilities(dword_t user_index, dword_t flags, @@ -60,8 +59,7 @@ dword_result_t XamInputGetCapabilities(dword_t user_index, dword_t flags, auto input_system = kernel_state()->emulator()->input_system(); return input_system->GetCapabilities(actual_user_index, flags, caps); } -DECLARE_XAM_EXPORT(XamInputGetCapabilities, - ExportTag::kInput | ExportTag::kSketchy); +DECLARE_XAM_EXPORT1(XamInputGetCapabilities, kInput, kSketchy); dword_result_t XamInputGetCapabilitiesEx(dword_t unk, dword_t user_index, dword_t flags, @@ -84,8 +82,7 @@ dword_result_t XamInputGetCapabilitiesEx(dword_t unk, dword_t user_index, auto input_system = kernel_state()->emulator()->input_system(); return input_system->GetCapabilities(actual_user_index, flags, caps); } -DECLARE_XAM_EXPORT(XamInputGetCapabilitiesEx, - ExportTag::kInput | ExportTag::kSketchy); +DECLARE_XAM_EXPORT1(XamInputGetCapabilitiesEx, kInput, kSketchy); // http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputgetstate(v=vs.85).aspx dword_result_t XamInputGetState(dword_t user_index, dword_t flags, @@ -106,8 +103,7 @@ dword_result_t XamInputGetState(dword_t user_index, dword_t flags, auto input_system = kernel_state()->emulator()->input_system(); return input_system->GetState(user_index, input_state); } -DECLARE_XAM_EXPORT(XamInputGetState, - ExportTag::kInput | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamInputGetState, kInput, kImplemented); // http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputsetstate(v=vs.85).aspx dword_result_t XamInputSetState(dword_t user_index, dword_t unk, @@ -125,8 +121,7 @@ dword_result_t XamInputSetState(dword_t user_index, dword_t unk, auto input_system = kernel_state()->emulator()->input_system(); return input_system->SetState(user_index, vibration); } -DECLARE_XAM_EXPORT(XamInputSetState, - ExportTag::kInput | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamInputSetState, kInput, kImplemented); // http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputgetkeystroke(v=vs.85).aspx dword_result_t XamInputGetKeystroke(dword_t user_index, dword_t flags, @@ -153,8 +148,7 @@ dword_result_t XamInputGetKeystroke(dword_t user_index, dword_t flags, auto input_system = kernel_state()->emulator()->input_system(); return input_system->GetKeystroke(user_index, flags, keystroke); } -DECLARE_XAM_EXPORT(XamInputGetKeystroke, - ExportTag::kInput | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamInputGetKeystroke, kInput, kImplemented); // Same as non-ex, just takes a pointer to user index. dword_result_t XamInputGetKeystrokeEx(lpdword_t user_index_ptr, dword_t flags, @@ -181,8 +175,7 @@ dword_result_t XamInputGetKeystrokeEx(lpdword_t user_index_ptr, dword_t flags, } return result; } -DECLARE_XAM_EXPORT(XamInputGetKeystrokeEx, - ExportTag::kInput | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamInputGetKeystrokeEx, kInput, kImplemented); X_HRESULT_result_t XamUserGetDeviceContext(dword_t user_index, dword_t unk, lpdword_t out_ptr) { @@ -196,8 +189,7 @@ X_HRESULT_result_t XamUserGetDeviceContext(dword_t user_index, dword_t unk, return X_E_DEVICE_NOT_CONNECTED; } } -DECLARE_XAM_EXPORT(XamUserGetDeviceContext, - ExportTag::kInput | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamUserGetDeviceContext, kInput, kStub); void RegisterInputExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xam/xam_msg.cc b/src/xenia/kernel/xam/xam_msg.cc index a1e7a3156..3dec932a2 100644 --- a/src/xenia/kernel/xam/xam_msg.cc +++ b/src/xenia/kernel/xam/xam_msg.cc @@ -27,7 +27,7 @@ dword_result_t XMsgInProcessCall(dword_t app, dword_t message, dword_t arg1, } return result; } -DECLARE_XAM_EXPORT(XMsgInProcessCall, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XMsgInProcessCall, kNone, kImplemented); dword_result_t XMsgSystemProcessCall(dword_t app, dword_t message, dword_t buffer, dword_t buffer_length) { @@ -38,7 +38,7 @@ dword_result_t XMsgSystemProcessCall(dword_t app, dword_t message, } return result; } -DECLARE_XAM_EXPORT(XMsgSystemProcessCall, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XMsgSystemProcessCall, kNone, kImplemented); dword_result_t XMsgStartIORequest(dword_t app, dword_t message, pointer_t overlapped_ptr, @@ -54,7 +54,7 @@ dword_result_t XMsgStartIORequest(dword_t app, dword_t message, } return result; } -DECLARE_XAM_EXPORT(XMsgStartIORequest, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XMsgStartIORequest, kNone, kImplemented); dword_result_t XMsgStartIORequestEx(dword_t app, dword_t message, pointer_t overlapped_ptr, @@ -71,7 +71,7 @@ dword_result_t XMsgStartIORequestEx(dword_t app, dword_t message, } return result; } -DECLARE_XAM_EXPORT(XMsgStartIORequestEx, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XMsgStartIORequestEx, kNone, kImplemented); dword_result_t XMsgCancelIORequest(pointer_t overlapped_ptr, dword_t wait) { @@ -86,7 +86,7 @@ dword_result_t XMsgCancelIORequest(pointer_t overlapped_ptr, return 0; } -DECLARE_XAM_EXPORT(XMsgCancelIORequest, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XMsgCancelIORequest, kNone, kImplemented); void RegisterMsgExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xam/xam_net.cc b/src/xenia/kernel/xam/xam_net.cc index 9016ffb94..577fb92cc 100644 --- a/src/xenia/kernel/xam/xam_net.cc +++ b/src/xenia/kernel/xam/xam_net.cc @@ -170,8 +170,7 @@ dword_result_t NetDll_XNetStartup(dword_t caller, return 0; } -DECLARE_XAM_EXPORT(NetDll_XNetStartup, - ExportTag::kNetworking | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(NetDll_XNetStartup, kNetworking, kImplemented); dword_result_t NetDll_XNetCleanup(dword_t caller, lpvoid_t params) { auto xam = kernel_state()->GetKernelModule("xam.xex"); @@ -183,8 +182,7 @@ dword_result_t NetDll_XNetCleanup(dword_t caller, lpvoid_t params) { return 0; } -DECLARE_XAM_EXPORT(NetDll_XNetCleanup, - ExportTag::kNetworking | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(NetDll_XNetCleanup, kNetworking, kImplemented); dword_result_t NetDll_XNetGetOpt(dword_t one, dword_t option_id, lpvoid_t buffer_ptr, lpdword_t buffer_size) { @@ -202,7 +200,7 @@ dword_result_t NetDll_XNetGetOpt(dword_t one, dword_t option_id, return 0x2726; // WSAEINVAL } } -DECLARE_XAM_EXPORT(NetDll_XNetGetOpt, ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_XNetGetOpt, kNetworking, kSketchy); dword_result_t NetDll_XNetRandom(dword_t caller, lpvoid_t buffer_ptr, dword_t length) { @@ -212,8 +210,7 @@ dword_result_t NetDll_XNetRandom(dword_t caller, lpvoid_t buffer_ptr, return 0; } -DECLARE_XAM_EXPORT(NetDll_XNetRandom, - ExportTag::kNetworking | ExportTag::kStub); +DECLARE_XAM_EXPORT1(NetDll_XNetRandom, kNetworking, kStub); dword_result_t NetDll_WSAStartup(dword_t caller, word_t version, pointer_t data_ptr) { @@ -263,19 +260,16 @@ dword_result_t NetDll_WSAStartup(dword_t caller, word_t version, return ret; } -DECLARE_XAM_EXPORT(NetDll_WSAStartup, - ExportTag::kNetworking | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(NetDll_WSAStartup, kNetworking, kImplemented); dword_result_t NetDll_WSACleanup(dword_t caller) { // This does nothing. Xenia needs WSA running. return 0; } -DECLARE_XAM_EXPORT(NetDll_WSACleanup, - ExportTag::kNetworking | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(NetDll_WSACleanup, kNetworking, kImplemented); dword_result_t NetDll_WSAGetLastError() { return XThread::GetLastError(); } -DECLARE_XAM_EXPORT(NetDll_WSAGetLastError, - ExportTag::kNetworking | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(NetDll_WSAGetLastError, kNetworking, kImplemented); dword_result_t NetDll_WSARecvFrom(dword_t caller, dword_t socket, pointer_t buffers_ptr, @@ -295,7 +289,7 @@ dword_result_t NetDll_WSARecvFrom(dword_t caller, dword_t socket, return 0; } -DECLARE_XAM_EXPORT(NetDll_WSARecvFrom, ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_WSARecvFrom, kNetworking, kStub); // If the socket is a VDP socket, buffer 0 is the game data length, and buffer 1 // is the unencrypted game data. @@ -340,8 +334,7 @@ dword_result_t NetDll_WSASendTo(dword_t caller, dword_t socket_handle, return 0; } -DECLARE_XAM_EXPORT(NetDll_WSASendTo, - ExportTag::kNetworking | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(NetDll_WSASendTo, kNetworking, kImplemented); dword_result_t NetDll_WSAWaitForMultipleEvents(dword_t num_events, lpdword_t events, @@ -369,17 +362,15 @@ dword_result_t NetDll_WSAWaitForMultipleEvents(dword_t num_events, } return 0; } -DECLARE_XAM_EXPORT(NetDll_WSAWaitForMultipleEvents, ExportTag::kNetworking | - ExportTag::kThreading | - ExportTag::kBlocking); +DECLARE_XAM_EXPORT2(NetDll_WSAWaitForMultipleEvents, kNetworking, kImplemented, + kBlocking); dword_result_t NetDll_WSACreateEvent() { XEvent* ev = new XEvent(kernel_state()); ev->Initialize(true, false); return ev->handle(); } -DECLARE_XAM_EXPORT(NetDll_WSACreateEvent, - ExportTag::kNetworking | ExportTag::kThreading); +DECLARE_XAM_EXPORT1(NetDll_WSACreateEvent, kNetworking, kImplemented); dword_result_t NetDll_WSACloseEvent(dword_t event_handle) { X_STATUS result = kernel_state()->object_table()->ReleaseHandle(event_handle); @@ -390,8 +381,7 @@ dword_result_t NetDll_WSACloseEvent(dword_t event_handle) { } return 1; } -DECLARE_XAM_EXPORT(NetDll_WSACloseEvent, - ExportTag::kNetworking | ExportTag::kThreading); +DECLARE_XAM_EXPORT1(NetDll_WSACloseEvent, kNetworking, kImplemented); dword_result_t NetDll_WSAResetEvent(dword_t event_handle) { X_STATUS result = xboxkrnl::NtClearEvent(event_handle); @@ -402,8 +392,7 @@ dword_result_t NetDll_WSAResetEvent(dword_t event_handle) { } return 1; } -DECLARE_XAM_EXPORT(NetDll_WSAResetEvent, - ExportTag::kNetworking | ExportTag::kThreading); +DECLARE_XAM_EXPORT1(NetDll_WSAResetEvent, kNetworking, kImplemented); dword_result_t NetDll_WSASetEvent(dword_t event_handle) { X_STATUS result = xboxkrnl::NtSetEvent(event_handle, nullptr); @@ -414,8 +403,7 @@ dword_result_t NetDll_WSASetEvent(dword_t event_handle) { } return 1; } -DECLARE_XAM_EXPORT(NetDll_WSASetEvent, - ExportTag::kNetworking | ExportTag::kThreading); +DECLARE_XAM_EXPORT1(NetDll_WSASetEvent, kNetworking, kImplemented); struct XnAddrStatus { // Address acquisition is not yet complete @@ -452,8 +440,7 @@ dword_result_t NetDll_XNetGetTitleXnAddr(dword_t caller, return XnAddrStatus::XNET_GET_XNADDR_STATIC; } -DECLARE_XAM_EXPORT(NetDll_XNetGetTitleXnAddr, - ExportTag::kNetworking | ExportTag::kStub); +DECLARE_XAM_EXPORT1(NetDll_XNetGetTitleXnAddr, kNetworking, kStub); dword_result_t NetDll_XNetGetDebugXnAddr(dword_t caller, pointer_t addr_ptr) { @@ -462,8 +449,7 @@ dword_result_t NetDll_XNetGetDebugXnAddr(dword_t caller, // XNET_GET_XNADDR_NONE causes caller to gracefully return. return XnAddrStatus::XNET_GET_XNADDR_NONE; } -DECLARE_XAM_EXPORT(NetDll_XNetGetDebugXnAddr, - ExportTag::kNetworking | ExportTag::kStub); +DECLARE_XAM_EXPORT1(NetDll_XNetGetDebugXnAddr, kNetworking, kStub); dword_result_t NetDll_XNetXnAddrToMachineId(dword_t caller, pointer_t addr_ptr, @@ -471,15 +457,13 @@ dword_result_t NetDll_XNetXnAddrToMachineId(dword_t caller, // Tell the caller we're not signed in to live (non-zero ret) return 1; } -DECLARE_XAM_EXPORT(NetDll_XNetXnAddrToMachineId, - ExportTag::kNetworking | ExportTag::kStub); +DECLARE_XAM_EXPORT1(NetDll_XNetXnAddrToMachineId, kNetworking, kStub); void NetDll_XNetInAddrToString(dword_t caller, dword_t in_addr, lpstring_t string_out, dword_t string_size) { strncpy(string_out, "666.666.666.666", string_size); } -DECLARE_XAM_EXPORT(NetDll_XNetInAddrToString, - ExportTag::kNetworking | ExportTag::kStub); +DECLARE_XAM_EXPORT1(NetDll_XNetInAddrToString, kNetworking, kStub); // This converts a XNet address to an IN_ADDR. The IN_ADDR is used for // subsequent socket calls (like a handle to a XNet address) @@ -488,8 +472,7 @@ dword_result_t NetDll_XNetXnAddrToInAddr(dword_t caller, lpvoid_t xid, lpvoid_t in_addr) { return 1; } -DECLARE_XAM_EXPORT(NetDll_XNetXnAddrToInAddr, - ExportTag::kNetworking | ExportTag::kStub); +DECLARE_XAM_EXPORT1(NetDll_XNetXnAddrToInAddr, kNetworking, kStub); // Does the reverse of the above. // FIXME: Arguments may not be correct. @@ -498,16 +481,14 @@ dword_result_t NetDll_XNetInAddrToXnAddr(dword_t caller, lpvoid_t in_addr, lpvoid_t xid) { return 1; } -DECLARE_XAM_EXPORT(NetDll_XNetInAddrToXnAddr, - ExportTag::kNetworking | ExportTag::kStub); +DECLARE_XAM_EXPORT1(NetDll_XNetInAddrToXnAddr, kNetworking, kStub); // http://www.google.com/patents/WO2008112448A1?cl=en // Reserves a port for use by system link dword_result_t NetDll_XNetSetSystemLinkPort(dword_t caller, dword_t port) { return 1; } -DECLARE_XAM_EXPORT(NetDll_XNetSetSystemLinkPort, - ExportTag::kNetworking | ExportTag::kStub); +DECLARE_XAM_EXPORT1(NetDll_XNetSetSystemLinkPort, kNetworking, kStub); // https://github.com/ILOVEPIE/Cxbx-Reloaded/blob/master/src/CxbxKrnl/EmuXOnline.h#L39 struct XEthernetStatus { @@ -519,8 +500,7 @@ struct XEthernetStatus { }; dword_result_t NetDll_XNetGetEthernetLinkStatus(dword_t caller) { return 0; } -DECLARE_XAM_EXPORT(NetDll_XNetGetEthernetLinkStatus, - ExportTag::kStub | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_XNetGetEthernetLinkStatus, kNetworking, kStub); dword_result_t NetDll_XNetDnsLookup(dword_t caller, lpstring_t host, dword_t event_handle, lpdword_t pdns) { @@ -539,8 +519,7 @@ dword_result_t NetDll_XNetDnsLookup(dword_t caller, lpstring_t host, } return 0; } -DECLARE_XAM_EXPORT(NetDll_XNetDnsLookup, - ExportTag::kStub | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_XNetDnsLookup, kNetworking, kStub); dword_result_t NetDll_XNetDnsRelease(dword_t caller, pointer_t dns) { if (!dns) { @@ -549,8 +528,7 @@ dword_result_t NetDll_XNetDnsRelease(dword_t caller, pointer_t dns) { kernel_memory()->SystemHeapFree(dns.guest_address()); return 0; } -DECLARE_XAM_EXPORT(NetDll_XNetDnsRelease, - ExportTag::kStub | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_XNetDnsRelease, kNetworking, kStub); SHIM_CALL NetDll_XNetQosServiceLookup_shim(PPCContext* ppc_context, KernelState* kernel_state) { @@ -571,15 +549,13 @@ dword_result_t NetDll_XNetQosListen(dword_t caller, lpvoid_t id, lpvoid_t data, dword_t flags) { return X_ERROR_FUNCTION_FAILED; } -DECLARE_XAM_EXPORT(NetDll_XNetQosListen, - ExportTag::kStub | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_XNetQosListen, kNetworking, kStub); dword_result_t NetDll_inet_addr(lpstring_t addr_ptr) { uint32_t addr = inet_addr(addr_ptr); return xe::byte_swap(addr); } -DECLARE_XAM_EXPORT(NetDll_inet_addr, - ExportTag::kImplemented | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_inet_addr, kNetworking, kImplemented); dword_result_t NetDll_socket(dword_t caller, dword_t af, dword_t type, dword_t protocol) { @@ -598,8 +574,7 @@ dword_result_t NetDll_socket(dword_t caller, dword_t af, dword_t type, return socket->handle(); } -DECLARE_XAM_EXPORT(NetDll_socket, - ExportTag::kImplemented | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_socket, kNetworking, kImplemented); dword_result_t NetDll_closesocket(dword_t caller, dword_t socket_handle) { auto socket = @@ -616,8 +591,7 @@ dword_result_t NetDll_closesocket(dword_t caller, dword_t socket_handle) { socket->ReleaseHandle(); return 0; } -DECLARE_XAM_EXPORT(NetDll_closesocket, - ExportTag::kImplemented | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_closesocket, kNetworking, kImplemented); int_result_t NetDll_shutdown(dword_t caller, dword_t socket_handle, int_t how) { auto socket = @@ -639,8 +613,7 @@ int_result_t NetDll_shutdown(dword_t caller, dword_t socket_handle, int_t how) { } return ret; } -DECLARE_XAM_EXPORT(NetDll_shutdown, - ExportTag::kImplemented | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_shutdown, kNetworking, kImplemented); dword_result_t NetDll_setsockopt(dword_t caller, dword_t socket_handle, dword_t level, dword_t optname, @@ -656,8 +629,7 @@ dword_result_t NetDll_setsockopt(dword_t caller, dword_t socket_handle, X_STATUS status = socket->SetOption(level, optname, optval_ptr, optlen); return XSUCCEEDED(status) ? 0 : -1; } -DECLARE_XAM_EXPORT(NetDll_setsockopt, - ExportTag::kImplemented | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_setsockopt, kNetworking, kImplemented); dword_result_t NetDll_ioctlsocket(dword_t caller, dword_t socket_handle, dword_t cmd, lpvoid_t arg_ptr) { @@ -678,8 +650,7 @@ dword_result_t NetDll_ioctlsocket(dword_t caller, dword_t socket_handle, // TODO return 0; } -DECLARE_XAM_EXPORT(NetDll_ioctlsocket, - ExportTag::kImplemented | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_ioctlsocket, kNetworking, kImplemented); dword_result_t NetDll_bind(dword_t caller, dword_t socket_handle, pointer_t name, dword_t namelen) { @@ -700,8 +671,7 @@ dword_result_t NetDll_bind(dword_t caller, dword_t socket_handle, return 0; } -DECLARE_XAM_EXPORT(NetDll_bind, - ExportTag::kImplemented | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_bind, kNetworking, kImplemented); dword_result_t NetDll_connect(dword_t caller, dword_t socket_handle, pointer_t name, dword_t namelen) { @@ -722,8 +692,7 @@ dword_result_t NetDll_connect(dword_t caller, dword_t socket_handle, return 0; } -DECLARE_XAM_EXPORT(NetDll_connect, - ExportTag::kImplemented | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_connect, kNetworking, kImplemented); dword_result_t NetDll_listen(dword_t caller, dword_t socket_handle, int_t backlog) { @@ -743,8 +712,7 @@ dword_result_t NetDll_listen(dword_t caller, dword_t socket_handle, return 0; } -DECLARE_XAM_EXPORT(NetDll_listen, - ExportTag::kImplemented | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_listen, kNetworking, kImplemented); dword_result_t NetDll_accept(dword_t caller, dword_t socket_handle, pointer_t addr_ptr, @@ -776,8 +744,7 @@ dword_result_t NetDll_accept(dword_t caller, dword_t socket_handle, return -1; } } -DECLARE_XAM_EXPORT(NetDll_accept, - ExportTag::kImplemented | ExportTag::kNetworking); +DECLARE_XAM_EXPORT1(NetDll_accept, kNetworking, kImplemented); struct x_fd_set { xe::be fd_count; @@ -884,8 +851,7 @@ int_result_t NetDll_select(int_t caller, int_t nfds, // TODO(gibbed): modify ret to be what's actually copied to the guest fd_sets? return ret; } -DECLARE_XAM_EXPORT(NetDll_select, - ExportTag::kNetworking | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(NetDll_select, kNetworking, kImplemented); dword_result_t NetDll_recv(dword_t caller, dword_t socket_handle, lpvoid_t buf_ptr, dword_t buf_len, dword_t flags) { @@ -899,8 +865,7 @@ dword_result_t NetDll_recv(dword_t caller, dword_t socket_handle, return socket->Recv(buf_ptr, buf_len, flags); } -DECLARE_XAM_EXPORT(NetDll_recv, - ExportTag::kNetworking | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(NetDll_recv, kNetworking, kImplemented); dword_result_t NetDll_recvfrom(dword_t caller, dword_t socket_handle, lpvoid_t buf_ptr, dword_t buf_len, dword_t flags, @@ -944,8 +909,7 @@ dword_result_t NetDll_recvfrom(dword_t caller, dword_t socket_handle, return ret; } -DECLARE_XAM_EXPORT(NetDll_recvfrom, - ExportTag::kNetworking | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(NetDll_recvfrom, kNetworking, kImplemented); dword_result_t NetDll_send(dword_t caller, dword_t socket_handle, lpvoid_t buf_ptr, dword_t buf_len, dword_t flags) { @@ -959,8 +923,7 @@ dword_result_t NetDll_send(dword_t caller, dword_t socket_handle, return socket->Send(buf_ptr, buf_len, flags); } -DECLARE_XAM_EXPORT(NetDll_send, - ExportTag::kNetworking | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(NetDll_send, kNetworking, kImplemented); dword_result_t NetDll_sendto(dword_t caller, dword_t socket_handle, lpvoid_t buf_ptr, dword_t buf_len, dword_t flags, @@ -976,8 +939,7 @@ dword_result_t NetDll_sendto(dword_t caller, dword_t socket_handle, N_XSOCKADDR_IN native_to(to_ptr); return socket->SendTo(buf_ptr, buf_len, flags, &native_to, to_len); } -DECLARE_XAM_EXPORT(NetDll_sendto, - ExportTag::kNetworking | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(NetDll_sendto, kNetworking, kImplemented); void RegisterNetExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) { diff --git a/src/xenia/kernel/xam/xam_notify.cc b/src/xenia/kernel/xam/xam_notify.cc index fa31ca930..1e7bc0660 100644 --- a/src/xenia/kernel/xam/xam_notify.cc +++ b/src/xenia/kernel/xam/xam_notify.cc @@ -30,7 +30,7 @@ dword_result_t XamNotifyCreateListener(qword_t mask, dword_t one) { return handle; } -DECLARE_XAM_EXPORT(XamNotifyCreateListener, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamNotifyCreateListener, kNone, kImplemented); // http://ffplay360.googlecode.com/svn/Test/Common/AtgSignIn.cpp dword_result_t XNotifyGetNext(dword_t handle, dword_t match_id, @@ -68,19 +68,18 @@ dword_result_t XNotifyGetNext(dword_t handle, dword_t match_id, return dequeued ? 1 : 0; } -DECLARE_XAM_EXPORT(XNotifyGetNext, - ExportTag::kImplemented | ExportTag::kHighFrequency); +DECLARE_XAM_EXPORT2(XNotifyGetNext, kNone, kImplemented, kHighFrequency); dword_result_t XNotifyDelayUI(dword_t delay_ms) { // Ignored. return 0; } -DECLARE_XAM_EXPORT(XNotifyDelayUI, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XNotifyDelayUI, kNone, kStub); void XNotifyPositionUI(dword_t position) { // Ignored. } -DECLARE_XAM_EXPORT(XNotifyPositionUI, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XNotifyPositionUI, kNone, kStub); void RegisterNotifyExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xam/xam_nui.cc b/src/xenia/kernel/xam/xam_nui.cc index f8655d7ee..1327bef3d 100644 --- a/src/xenia/kernel/xam/xam_nui.cc +++ b/src/xenia/kernel/xam/xam_nui.cc @@ -36,7 +36,7 @@ void XamNuiGetDeviceStatus(pointer_t status_ptr) { status_ptr.Zero(); status_ptr->status = 0; // Not connected. } -DECLARE_XAM_EXPORT(XamNuiGetDeviceStatus, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamNuiGetDeviceStatus, kNone, kStub); dword_result_t XamShowNuiTroubleshooterUI(unknown_t unk1, unknown_t unk2, unknown_t unk3) { @@ -61,7 +61,7 @@ dword_result_t XamShowNuiTroubleshooterUI(unknown_t unk1, unknown_t unk2, return 0; } -DECLARE_XAM_EXPORT(XamShowNuiTroubleshooterUI, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamShowNuiTroubleshooterUI, kNone, kStub); void RegisterNuiExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xam/xam_ui.cc b/src/xenia/kernel/xam/xam_ui.cc index a8dd37d38..debbb03f0 100644 --- a/src/xenia/kernel/xam/xam_ui.cc +++ b/src/xenia/kernel/xam/xam_ui.cc @@ -285,7 +285,7 @@ dword_result_t XamShowKeyboardUI(dword_t user_index, dword_t flags, return X_ERROR_SUCCESS; } } -DECLARE_XAM_EXPORT(XamShowKeyboardUI, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamShowKeyboardUI, kUI, kImplemented); dword_result_t XamShowDeviceSelectorUI(dword_t user_index, dword_t content_type, dword_t content_flags, @@ -316,7 +316,7 @@ dword_result_t XamShowDeviceSelectorUI(dword_t user_index, dword_t content_type, return X_ERROR_SUCCESS; } } -DECLARE_XAM_EXPORT(XamShowDeviceSelectorUI, ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamShowDeviceSelectorUI, kUI, kImplemented); SHIM_CALL XamShowDirtyDiscErrorUI_shim(PPCContext* ppc_context, KernelState* kernel_state) { diff --git a/src/xenia/kernel/xam/xam_user.cc b/src/xenia/kernel/xam/xam_user.cc index 4a15d3662..5ffdcea24 100644 --- a/src/xenia/kernel/xam/xam_user.cc +++ b/src/xenia/kernel/xam/xam_user.cc @@ -32,8 +32,7 @@ X_HRESULT_result_t XamUserGetXUID(dword_t user_index, dword_t unk, } return X_E_SUCCESS; } -DECLARE_XAM_EXPORT(XamUserGetXUID, - ExportTag::kUserProfiles | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamUserGetXUID, kUserProfiles, kImplemented); dword_result_t XamUserGetSigninState(dword_t user_index) { // Yield, as some games spam this. @@ -50,8 +49,7 @@ dword_result_t XamUserGetSigninState(dword_t user_index) { return 0; } } -DECLARE_XAM_EXPORT(XamUserGetSigninState, - ExportTag::kUserProfiles | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamUserGetSigninState, kUserProfiles, kImplemented); typedef struct { xe::be xuid; @@ -80,8 +78,7 @@ X_HRESULT_result_t XamUserGetSigninInfo(dword_t user_index, dword_t flags, std::strncpy(info->name, user_profile->name().data(), 15); return X_E_SUCCESS; } -DECLARE_XAM_EXPORT(XamUserGetSigninInfo, - ExportTag::kUserProfiles | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamUserGetSigninInfo, kUserProfiles, kImplemented); dword_result_t XamUserGetName(dword_t user_index, lpstring_t buffer, dword_t buffer_len) { @@ -92,8 +89,7 @@ dword_result_t XamUserGetName(dword_t user_index, lpstring_t buffer, std::strncpy(buffer, user_profile->name().data(), buffer_len); return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamUserGetName, - ExportTag::kUserProfiles | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamUserGetName, kUserProfiles, kImplemented); typedef struct { xe::be setting_count; @@ -227,8 +223,7 @@ dword_result_t XamUserReadProfileSettings( } return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamUserReadProfileSettings, - ExportTag::kUserProfiles | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamUserReadProfileSettings, kUserProfiles, kImplemented); typedef struct { xe::be from; @@ -332,8 +327,7 @@ dword_result_t XamUserWriteProfileSettings( } return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamUserWriteProfileSettings, - ExportTag::kUserProfiles | ExportTag::kImplemented); +DECLARE_XAM_EXPORT1(XamUserWriteProfileSettings, kUserProfiles, kImplemented); dword_result_t XamUserCheckPrivilege(dword_t user_index, dword_t mask, lpdword_t out_value) { @@ -351,8 +345,7 @@ dword_result_t XamUserCheckPrivilege(dword_t user_index, dword_t mask, *out_value = 0; return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamUserCheckPrivilege, - ExportTag::kUserProfiles | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamUserCheckPrivilege, kUserProfiles, kStub); dword_result_t XamUserContentRestrictionGetFlags(dword_t user_index, lpdword_t out_flags) { @@ -370,8 +363,7 @@ dword_result_t XamUserContentRestrictionGetFlags(dword_t user_index, *out_flags = 0; return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamUserContentRestrictionGetFlags, - ExportTag::kUserProfiles | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamUserContentRestrictionGetFlags, kUserProfiles, kStub); dword_result_t XamUserContentRestrictionGetRating(dword_t user_index, dword_t unk1, @@ -393,8 +385,7 @@ dword_result_t XamUserContentRestrictionGetRating(dword_t user_index, *out_unk3 = 0; return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamUserContentRestrictionGetRating, - ExportTag::kUserProfiles | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamUserContentRestrictionGetRating, kUserProfiles, kStub); dword_result_t XamUserContentRestrictionCheckAccess(dword_t user_index, dword_t unk1, dword_t unk2, @@ -411,8 +402,7 @@ dword_result_t XamUserContentRestrictionCheckAccess(dword_t user_index, return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamUserContentRestrictionCheckAccess, - ExportTag::kUserProfiles | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamUserContentRestrictionCheckAccess, kUserProfiles, kStub); dword_result_t XamUserAreUsersFriends(dword_t user_index, dword_t unk1, dword_t unk2, lpdword_t out_value, @@ -446,8 +436,7 @@ dword_result_t XamUserAreUsersFriends(dword_t user_index, dword_t unk1, } return result; } -DECLARE_XAM_EXPORT(XamUserAreUsersFriends, - ExportTag::kUserProfiles | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamUserAreUsersFriends, kUserProfiles, kStub); dword_result_t XamShowSigninUI(dword_t unk, dword_t unk_mask) { // Mask values vary. Probably matching user types? Local/remote? @@ -455,8 +444,7 @@ dword_result_t XamShowSigninUI(dword_t unk, dword_t unk_mask) { kernel_state()->BroadcastNotification(0x00000009, 0); return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamShowSigninUI, - ExportTag::kUserProfiles | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamShowSigninUI, kUserProfiles, kStub); dword_result_t XamUserCreateAchievementEnumerator(dword_t title_id, dword_t user_index, @@ -476,8 +464,8 @@ dword_result_t XamUserCreateAchievementEnumerator(dword_t title_id, return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamUserCreateAchievementEnumerator, - ExportTag::kUserProfiles | ExportTag::kSketchy); +DECLARE_XAM_EXPORT1(XamUserCreateAchievementEnumerator, kUserProfiles, + kSketchy); dword_result_t XamParseGamerTileKey(lpdword_t key_ptr, lpdword_t out1_ptr, lpdword_t out2_ptr, lpdword_t out3_ptr) { @@ -486,8 +474,7 @@ dword_result_t XamParseGamerTileKey(lpdword_t key_ptr, lpdword_t out1_ptr, *out3_ptr = 0xC0DE0003; return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamParseGamerTileKey, - ExportTag::kUserProfiles | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamParseGamerTileKey, kUserProfiles, kStub); dword_result_t XamReadTileToTexture(dword_t unk1, dword_t unk2, dword_t unk3, dword_t unk4, lpvoid_t buffer_ptr, @@ -505,8 +492,7 @@ dword_result_t XamReadTileToTexture(dword_t unk1, dword_t unk2, dword_t unk3, } return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamReadTileToTexture, - ExportTag::kUserProfiles | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamReadTileToTexture, kUserProfiles, kStub); dword_result_t XamWriteGamerTile(dword_t arg1, dword_t arg2, dword_t arg3, dword_t arg4, dword_t arg5, @@ -518,23 +504,20 @@ dword_result_t XamWriteGamerTile(dword_t arg1, dword_t arg2, dword_t arg3, } return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamWriteGamerTile, - ExportTag::kUserProfiles | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamWriteGamerTile, kUserProfiles, kStub); dword_result_t XamSessionCreateHandle(lpdword_t handle_ptr) { *handle_ptr = 0xCAFEDEAD; return X_ERROR_SUCCESS; } -DECLARE_XAM_EXPORT(XamSessionCreateHandle, - ExportTag::kUserProfiles | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamSessionCreateHandle, kUserProfiles, kStub); dword_result_t XamSessionRefObjByHandle(dword_t handle, lpdword_t obj_ptr) { assert_true(handle == 0xCAFEDEAD); *obj_ptr = 0; return X_ERROR_FUNCTION_FAILED; } -DECLARE_XAM_EXPORT(XamSessionRefObjByHandle, - ExportTag::kUserProfiles | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamSessionRefObjByHandle, kUserProfiles, kStub); } // namespace xam } // namespace kernel diff --git a/src/xenia/kernel/xam/xam_video.cc b/src/xenia/kernel/xam/xam_video.cc index 157af39fd..8cdf63869 100644 --- a/src/xenia/kernel/xam/xam_video.cc +++ b/src/xenia/kernel/xam/xam_video.cc @@ -22,10 +22,10 @@ void XGetVideoMode(pointer_t video_mode) { // TODO(benvanik): actually check to see if these are the same. xboxkrnl::VdQueryVideoMode(std::move(video_mode)); } -DECLARE_XAM_EXPORT(XGetVideoMode, ExportTag::kVideo | ExportTag::kSketchy); +DECLARE_XAM_EXPORT1(XGetVideoMode, kVideo, ExportTag::kSketchy); dword_result_t XGetVideoCapabilities() { return 0; } -DECLARE_XAM_EXPORT(XGetVideoCapabilities, ExportTag::kVideo | ExportTag::kStub); +DECLARE_XAM_EXPORT1(XGetVideoCapabilities, kVideo, kStub); void RegisterVideoExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xam/xam_voice.cc b/src/xenia/kernel/xam/xam_voice.cc index 96de3db66..2cd70b2ca 100644 --- a/src/xenia/kernel/xam/xam_voice.cc +++ b/src/xenia/kernel/xam/xam_voice.cc @@ -21,7 +21,7 @@ dword_result_t XamVoiceIsActiveProcess() { // Returning 0 here will short-circuit a bunch of voice stuff. return 0; } -DECLARE_XAM_EXPORT(XamVoiceIsActiveProcess, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamVoiceIsActiveProcess, kNone, kStub); dword_result_t XamVoiceCreate(unknown_t unk1, // 0 unknown_t unk2, // 0xF @@ -30,13 +30,13 @@ dword_result_t XamVoiceCreate(unknown_t unk1, // 0 out_voice_ptr.Zero(); return X_ERROR_ACCESS_DENIED; } -DECLARE_XAM_EXPORT(XamVoiceCreate, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamVoiceCreate, kNone, kStub); dword_result_t XamVoiceClose(lpunknown_t voice_ptr) { return 0; } -DECLARE_XAM_EXPORT(XamVoiceClose, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamVoiceClose, kNone, kStub); dword_result_t XamVoiceHeadsetPresent(lpunknown_t voice_ptr) { return 0; } -DECLARE_XAM_EXPORT(XamVoiceHeadsetPresent, ExportTag::kStub); +DECLARE_XAM_EXPORT1(XamVoiceHeadsetPresent, kNone, kStub); void RegisterVoiceExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xbdm/xbdm_misc.cc b/src/xenia/kernel/xbdm/xbdm_misc.cc index 2075a8c3c..53f3113d9 100644 --- a/src/xenia/kernel/xbdm/xbdm_misc.cc +++ b/src/xenia/kernel/xbdm/xbdm_misc.cc @@ -19,30 +19,28 @@ namespace kernel { namespace xbdm { void DmCloseLoadedModules(lpdword_t unk0_ptr) {} -DECLARE_XBDM_EXPORT(DmCloseLoadedModules, ExportTag::kStub | ExportTag::kDebug); +DECLARE_XBDM_EXPORT1(DmCloseLoadedModules, kDebug, kStub); void DmSendNotificationString(lpdword_t unk0_ptr) {} -DECLARE_XBDM_EXPORT(DmSendNotificationString, - ExportTag::kStub | ExportTag::kDebug); +DECLARE_XBDM_EXPORT1(DmSendNotificationString, kDebug, kStub); dword_result_t DmWalkLoadedModules(lpdword_t unk0_ptr, lpdword_t unk1_ptr) { return X_STATUS_INVALID_PARAMETER; } -DECLARE_XBDM_EXPORT(DmWalkLoadedModules, ExportTag::kStub | ExportTag::kDebug); +DECLARE_XBDM_EXPORT1(DmWalkLoadedModules, kDebug, kStub); dword_result_t DmCaptureStackBackTrace(lpdword_t unk0_ptr, lpdword_t unk1_ptr) { return X_STATUS_INVALID_PARAMETER; } -DECLARE_XBDM_EXPORT(DmCaptureStackBackTrace, - ExportTag::kStub | ExportTag::kDebug); +DECLARE_XBDM_EXPORT1(DmCaptureStackBackTrace, kDebug, kStub); void DmMapDevkitDrive() {} -DECLARE_XBDM_EXPORT(DmMapDevkitDrive, ExportTag::kStub | ExportTag::kDebug); +DECLARE_XBDM_EXPORT1(DmMapDevkitDrive, kDebug, kStub); dword_result_t DmFindPdbSignature(lpdword_t unk0_ptr, lpdword_t unk1_ptr) { return X_STATUS_INVALID_PARAMETER; } -DECLARE_XBDM_EXPORT(DmFindPdbSignature, ExportTag::kStub | ExportTag::kDebug); +DECLARE_XBDM_EXPORT1(DmFindPdbSignature, kDebug, kStub); void RegisterMiscExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_audio.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_audio.cc index 1a8bafaa1..3c3c1e910 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_audio.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_audio.cc @@ -23,8 +23,7 @@ dword_result_t XAudioGetSpeakerConfig(lpdword_t config_ptr) { *config_ptr = 0x00010001; return X_ERROR_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(XAudioGetSpeakerConfig, - ExportTag::kImplemented | ExportTag::kAudio); +DECLARE_XBOXKRNL_EXPORT1(XAudioGetSpeakerConfig, kAudio, kImplemented); dword_result_t XAudioGetVoiceCategoryVolumeChangeMask(lpunknown_t driver_ptr, lpdword_t out_ptr) { @@ -37,9 +36,8 @@ dword_result_t XAudioGetVoiceCategoryVolumeChangeMask(lpunknown_t driver_ptr, *out_ptr = 0; return X_ERROR_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(XAudioGetVoiceCategoryVolumeChangeMask, - ExportTag::kStub | ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XAudioGetVoiceCategoryVolumeChangeMask, kAudio, kStub, + kHighFrequency); dword_result_t XAudioGetVoiceCategoryVolume(dword_t unk, lpfloat_t out_ptr) { // Expects a floating point single. Volume %? @@ -47,12 +45,10 @@ dword_result_t XAudioGetVoiceCategoryVolume(dword_t unk, lpfloat_t out_ptr) { return X_ERROR_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(XAudioGetVoiceCategoryVolume, - ExportTag::kStub | ExportTag::kAudio); +DECLARE_XBOXKRNL_EXPORT1(XAudioGetVoiceCategoryVolume, kAudio, kStub); dword_result_t XAudioEnableDucker(dword_t unk) { return X_ERROR_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(XAudioEnableDucker, - ExportTag::kStub | ExportTag::kAudio); +DECLARE_XBOXKRNL_EXPORT1(XAudioEnableDucker, kAudio, kStub); dword_result_t XAudioRegisterRenderDriverClient(lpdword_t callback_ptr, lpdword_t driver_ptr) { @@ -71,8 +67,8 @@ dword_result_t XAudioRegisterRenderDriverClient(lpdword_t callback_ptr, *driver_ptr = 0x41550000 | (static_cast(index) & 0x0000FFFF); return X_ERROR_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(XAudioRegisterRenderDriverClient, - ExportTag::kImplemented | ExportTag::kAudio); +DECLARE_XBOXKRNL_EXPORT1(XAudioRegisterRenderDriverClient, kAudio, + kImplemented); dword_result_t XAudioUnregisterRenderDriverClient(lpunknown_t driver_ptr) { assert_true((driver_ptr.guest_address() & 0xFFFF0000) == 0x41550000); @@ -81,8 +77,8 @@ dword_result_t XAudioUnregisterRenderDriverClient(lpunknown_t driver_ptr) { audio_system->UnregisterClient(driver_ptr.guest_address() & 0x0000FFFF); return X_ERROR_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(XAudioUnregisterRenderDriverClient, - ExportTag::kImplemented | ExportTag::kAudio); +DECLARE_XBOXKRNL_EXPORT1(XAudioUnregisterRenderDriverClient, kAudio, + kImplemented); dword_result_t XAudioSubmitRenderDriverFrame(lpunknown_t driver_ptr, lpunknown_t samples_ptr) { @@ -94,9 +90,8 @@ dword_result_t XAudioSubmitRenderDriverFrame(lpunknown_t driver_ptr, return X_ERROR_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(XAudioSubmitRenderDriverFrame, - ExportTag::kImplemented | ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XAudioSubmitRenderDriverFrame, kAudio, kImplemented, + kHighFrequency); void RegisterAudioExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) { diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_audio_xma.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_audio_xma.cc index c312bd554..c27e2351b 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_audio_xma.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_audio_xma.cc @@ -66,18 +66,16 @@ dword_result_t XMACreateContext(lpdword_t context_out_ptr) { } return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(XMACreateContext, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMACreateContext, kAudio, kImplemented, + kHighFrequency); dword_result_t XMAReleaseContext(lpvoid_t context_ptr) { auto xma_decoder = kernel_state()->emulator()->audio_system()->xma_decoder(); xma_decoder->ReleaseContext(context_ptr); return 0; } -DECLARE_XBOXKRNL_EXPORT(XMAReleaseContext, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMAReleaseContext, kAudio, kImplemented, + kHighFrequency); void StoreXmaContextIndexedRegister(KernelState* kernel_state, uint32_t base_reg, uint32_t context_ptr) { @@ -147,9 +145,8 @@ dword_result_t XMAInitializeContext(lpvoid_t context_ptr, return 0; } -DECLARE_XBOXKRNL_EXPORT(XMAInitializeContext, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMAInitializeContext, kAudio, kImplemented, + kHighFrequency); dword_result_t XMASetLoopData(lpvoid_t context_ptr, pointer_t loop_data) { @@ -165,17 +162,14 @@ dword_result_t XMASetLoopData(lpvoid_t context_ptr, return 0; } -DECLARE_XBOXKRNL_EXPORT(XMASetLoopData, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMASetLoopData, kAudio, kImplemented, kHighFrequency); dword_result_t XMAGetInputBufferReadOffset(lpvoid_t context_ptr) { XMA_CONTEXT_DATA context(context_ptr); return context.input_buffer_read_offset; } -DECLARE_XBOXKRNL_EXPORT(XMAGetInputBufferReadOffset, - ExportTag::kImplemented | ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMAGetInputBufferReadOffset, kAudio, kImplemented, + kHighFrequency); dword_result_t XMASetInputBufferReadOffset(lpvoid_t context_ptr, dword_t value) { @@ -185,9 +179,8 @@ dword_result_t XMASetInputBufferReadOffset(lpvoid_t context_ptr, return 0; } -DECLARE_XBOXKRNL_EXPORT(XMASetInputBufferReadOffset, - ExportTag::kImplemented | ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMASetInputBufferReadOffset, kAudio, kImplemented, + kHighFrequency); dword_result_t XMASetInputBuffer0(lpvoid_t context_ptr, lpvoid_t buffer, dword_t packet_count) { @@ -200,17 +193,15 @@ dword_result_t XMASetInputBuffer0(lpvoid_t context_ptr, lpvoid_t buffer, return 0; } -DECLARE_XBOXKRNL_EXPORT(XMASetInputBuffer0, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMASetInputBuffer0, kAudio, kImplemented, + kHighFrequency); dword_result_t XMAIsInputBuffer0Valid(lpvoid_t context_ptr) { XMA_CONTEXT_DATA context(context_ptr); return context.input_buffer_0_valid; } -DECLARE_XBOXKRNL_EXPORT(XMAIsInputBuffer0Valid, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMAIsInputBuffer0Valid, kAudio, kImplemented, + kHighFrequency); dword_result_t XMASetInputBuffer0Valid(lpvoid_t context_ptr) { XMA_CONTEXT_DATA context(context_ptr); @@ -219,9 +210,8 @@ dword_result_t XMASetInputBuffer0Valid(lpvoid_t context_ptr) { return 0; } -DECLARE_XBOXKRNL_EXPORT(XMASetInputBuffer0Valid, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMASetInputBuffer0Valid, kAudio, kImplemented, + kHighFrequency); dword_result_t XMASetInputBuffer1(lpvoid_t context_ptr, lpvoid_t buffer, dword_t packet_count) { @@ -234,17 +224,15 @@ dword_result_t XMASetInputBuffer1(lpvoid_t context_ptr, lpvoid_t buffer, return 0; } -DECLARE_XBOXKRNL_EXPORT(XMASetInputBuffer1, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMASetInputBuffer1, kAudio, kImplemented, + kHighFrequency); dword_result_t XMAIsInputBuffer1Valid(lpvoid_t context_ptr) { XMA_CONTEXT_DATA context(context_ptr); return context.input_buffer_1_valid; } -DECLARE_XBOXKRNL_EXPORT(XMAIsInputBuffer1Valid, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMAIsInputBuffer1Valid, kAudio, kImplemented, + kHighFrequency); dword_result_t XMASetInputBuffer1Valid(lpvoid_t context_ptr) { XMA_CONTEXT_DATA context(context_ptr); @@ -253,17 +241,15 @@ dword_result_t XMASetInputBuffer1Valid(lpvoid_t context_ptr) { return 0; } -DECLARE_XBOXKRNL_EXPORT(XMASetInputBuffer1Valid, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMASetInputBuffer1Valid, kAudio, kImplemented, + kHighFrequency); dword_result_t XMAIsOutputBufferValid(lpvoid_t context_ptr) { XMA_CONTEXT_DATA context(context_ptr); return context.output_buffer_valid; } -DECLARE_XBOXKRNL_EXPORT(XMAIsOutputBufferValid, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMAIsOutputBufferValid, kAudio, kImplemented, + kHighFrequency); dword_result_t XMASetOutputBufferValid(lpvoid_t context_ptr) { XMA_CONTEXT_DATA context(context_ptr); @@ -272,17 +258,15 @@ dword_result_t XMASetOutputBufferValid(lpvoid_t context_ptr) { return 0; } -DECLARE_XBOXKRNL_EXPORT(XMASetOutputBufferValid, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMASetOutputBufferValid, kAudio, kImplemented, + kHighFrequency); dword_result_t XMAGetOutputBufferReadOffset(lpvoid_t context_ptr) { XMA_CONTEXT_DATA context(context_ptr); return context.output_buffer_read_offset; } -DECLARE_XBOXKRNL_EXPORT(XMAGetOutputBufferReadOffset, - ExportTag::kImplemented | ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMAGetOutputBufferReadOffset, kAudio, kImplemented, + kHighFrequency); dword_result_t XMASetOutputBufferReadOffset(lpvoid_t context_ptr, dword_t value) { @@ -292,32 +276,28 @@ dword_result_t XMASetOutputBufferReadOffset(lpvoid_t context_ptr, return 0; } -DECLARE_XBOXKRNL_EXPORT(XMASetOutputBufferReadOffset, - ExportTag::kImplemented | ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMASetOutputBufferReadOffset, kAudio, kImplemented, + kHighFrequency); dword_result_t XMAGetOutputBufferWriteOffset(lpvoid_t context_ptr) { XMA_CONTEXT_DATA context(context_ptr); return context.output_buffer_write_offset; } -DECLARE_XBOXKRNL_EXPORT(XMAGetOutputBufferWriteOffset, - ExportTag::kImplemented | ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMAGetOutputBufferWriteOffset, kAudio, kImplemented, + kHighFrequency); dword_result_t XMAGetPacketMetadata(lpvoid_t context_ptr) { XMA_CONTEXT_DATA context(context_ptr); return context.packet_metadata; } -DECLARE_XBOXKRNL_EXPORT(XMAGetPacketMetadata, - ExportTag::kImplemented | ExportTag::kAudio); +DECLARE_XBOXKRNL_EXPORT1(XMAGetPacketMetadata, kAudio, kImplemented); dword_result_t XMAEnableContext(lpvoid_t context_ptr) { StoreXmaContextIndexedRegister(kernel_state(), 0x1940, context_ptr); return 0; } -DECLARE_XBOXKRNL_EXPORT(XMAEnableContext, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMAEnableContext, kAudio, kImplemented, + kHighFrequency); dword_result_t XMADisableContext(lpvoid_t context_ptr, dword_t wait) { X_HRESULT result = X_E_SUCCESS; @@ -331,9 +311,8 @@ dword_result_t XMADisableContext(lpvoid_t context_ptr, dword_t wait) { } return result; } -DECLARE_XBOXKRNL_EXPORT(XMADisableContext, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMADisableContext, kAudio, kImplemented, + kHighFrequency); dword_result_t XMABlockWhileInUse(lpvoid_t context_ptr) { do { @@ -345,9 +324,8 @@ dword_result_t XMABlockWhileInUse(lpvoid_t context_ptr) { } while (true); return 0; } -DECLARE_XBOXKRNL_EXPORT(XMABlockWhileInUse, ExportTag::kImplemented | - ExportTag::kAudio | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(XMABlockWhileInUse, kAudio, kImplemented, + kHighFrequency); void RegisterAudioXmaExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_crypt.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_crypt.cc index 86f0d301b..410a9ea23 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_crypt.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_crypt.cc @@ -58,7 +58,7 @@ void XeCryptShaInit(pointer_t sha_state) { sha_state->state[3] = 0x10325476; sha_state->state[4] = 0xC3D2E1F0; } -DECLARE_XBOXKRNL_EXPORT(XeCryptShaInit, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(XeCryptShaInit, kNone, kImplemented); void XeCryptShaUpdate(pointer_t sha_state, lpvoid_t input, dword_t input_size) { @@ -69,7 +69,7 @@ void XeCryptShaUpdate(pointer_t sha_state, lpvoid_t input, StoreSha1(&sha, sha_state); } -DECLARE_XBOXKRNL_EXPORT(XeCryptShaUpdate, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(XeCryptShaUpdate, kNone, kImplemented); void XeCryptShaFinal(pointer_t sha_state, pointer_t> out, dword_t out_size) { @@ -82,7 +82,7 @@ void XeCryptShaFinal(pointer_t sha_state, std::memcpy(out, digest, std::min((uint32_t)out_size, 0x14u)); std::memcpy(sha_state->state, digest, 0x14); } -DECLARE_XBOXKRNL_EXPORT(XeCryptShaFinal, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(XeCryptShaFinal, kNone, kImplemented); void XeCryptSha(lpvoid_t input_1, dword_t input_1_size, lpvoid_t input_2, dword_t input_2_size, lpvoid_t input_3, dword_t input_3_size, @@ -103,7 +103,7 @@ void XeCryptSha(lpvoid_t input_1, dword_t input_1_size, lpvoid_t input_2, sha.finalize(digest); std::memcpy(output, digest, std::min((uint32_t)output_size, 0x14u)); } -DECLARE_XBOXKRNL_EXPORT(XeCryptSha, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(XeCryptSha, kNone, kImplemented); // TODO: Size of this struct hasn't been confirmed yet. typedef struct { @@ -124,7 +124,7 @@ void XeCryptSha256Init(pointer_t sha_state) { sha_state->state[6] = 0x1f83d9ab; sha_state->state[7] = 0x5be0cd19; } -DECLARE_XBOXKRNL_EXPORT(XeCryptSha256Init, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(XeCryptSha256Init, kNone, kImplemented); void XeCryptSha256Update(pointer_t sha_state, lpvoid_t input, dword_t input_size) { @@ -139,7 +139,7 @@ void XeCryptSha256Update(pointer_t sha_state, std::memcpy(sha_state->buffer, sha.getBuffer(), 64); sha_state->count = uint32_t(sha.getTotalSize()); } -DECLARE_XBOXKRNL_EXPORT(XeCryptSha256Update, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(XeCryptSha256Update, kNone, kImplemented); void XeCryptSha256Final(pointer_t sha_state, pointer_t> out, dword_t out_size) { @@ -154,33 +154,33 @@ void XeCryptSha256Final(pointer_t sha_state, std::memcpy(out, hash, std::min(uint32_t(out_size), 32u)); std::memcpy(sha_state->buffer, hash, 32); } -DECLARE_XBOXKRNL_EXPORT(XeCryptSha256Final, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(XeCryptSha256Final, kNone, kImplemented); // Byteswap? dword_result_t XeCryptBnQw_SwapDwQwLeBe(lpqword_t qw_inp, lpqword_t qw_out, dword_t size) { return 0; } -DECLARE_XBOXKRNL_EXPORT(XeCryptBnQw_SwapDwQwLeBe, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(XeCryptBnQw_SwapDwQwLeBe, kNone, kStub); dword_result_t XeCryptBnQwNeRsaPubCrypt(lpqword_t qw_a, lpqword_t qw_b, lpvoid_t rsa) { // 0 indicates failure (but not a BOOL return value) return 1; } -DECLARE_XBOXKRNL_EXPORT(XeCryptBnQwNeRsaPubCrypt, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(XeCryptBnQwNeRsaPubCrypt, kNone, kStub); dword_result_t XeCryptBnDwLePkcs1Verify(lpvoid_t hash, lpvoid_t sig, dword_t size) { // BOOL return value return 1; } -DECLARE_XBOXKRNL_EXPORT(XeCryptBnDwLePkcs1Verify, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(XeCryptBnDwLePkcs1Verify, kNone, kStub); void XeCryptRandom(lpvoid_t buf, dword_t buf_size) { std::memset(buf, 0xFD, buf_size); } -DECLARE_XBOXKRNL_EXPORT(XeCryptRandom, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(XeCryptRandom, kNone, kStub); struct XECRYPT_DES_STATE { uint32_t keytab[16][2]; @@ -190,7 +190,7 @@ struct XECRYPT_DES_STATE { void XeCryptDesParity(lpvoid_t inp, dword_t inp_size, lpvoid_t out_ptr) { DES::set_parity(inp, inp_size, out_ptr); } -DECLARE_XBOXKRNL_EXPORT(XeCryptDesParity, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(XeCryptDesParity, kNone, kImplemented); struct XECRYPT_DES3_STATE { XECRYPT_DES_STATE des_state[3]; @@ -205,7 +205,7 @@ void XeCryptDes3Key(pointer_t state_ptr, lpqword_t key) { std::memcpy(state_ptr->des_state[i].keytab, des[i].get_sub_key(), 128); } } -DECLARE_XBOXKRNL_EXPORT(XeCryptDes3Key, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(XeCryptDes3Key, kNone, kImplemented); void XeCryptDes3Ecb(pointer_t state_ptr, lpqword_t inp, lpqword_t out, dword_t encrypt) { @@ -219,7 +219,7 @@ void XeCryptDes3Ecb(pointer_t state_ptr, lpqword_t inp, *out = des3.decrypt(*inp); } } -DECLARE_XBOXKRNL_EXPORT(XeCryptDes3Ecb, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(XeCryptDes3Ecb, kNone, kImplemented); void XeCryptDes3Cbc(pointer_t state_ptr, lpqword_t inp, dword_t inp_size, lpqword_t out, lpqword_t feed, @@ -245,7 +245,7 @@ void XeCryptDes3Cbc(pointer_t state_ptr, lpqword_t inp, *feed = last_block; } -DECLARE_XBOXKRNL_EXPORT(XeCryptDes3Cbc, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(XeCryptDes3Cbc, kNone, kImplemented); void XeCryptHmacSha(lpvoid_t key, dword_t key_size_in, lpvoid_t inp_1, dword_t inp_1_size, lpvoid_t inp_2, dword_t inp_2_size, @@ -302,7 +302,7 @@ void XeCryptHmacSha(lpvoid_t key, dword_t key_size_in, lpvoid_t inp_1, std::memcpy(out, digest, std::min((uint32_t)out_size, 0x14u)); } -DECLARE_XBOXKRNL_EXPORT(XeCryptHmacSha, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(XeCryptHmacSha, kNone, kImplemented); // Keys // TODO: Array of keys we need @@ -330,7 +330,7 @@ dword_result_t XeKeysHmacSha(dword_t key_num, lpvoid_t inp_1, return X_STATUS_UNSUCCESSFUL; } -DECLARE_XBOXKRNL_EXPORT(XeKeysHmacSha, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(XeKeysHmacSha, kNone, kImplemented); void RegisterCryptExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc index 51878814c..2b6f9e5f2 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_debug.cc @@ -20,7 +20,7 @@ namespace kernel { namespace xboxkrnl { void DbgBreakPoint() { xe::debugging::Break(); } -DECLARE_XBOXKRNL_EXPORT(DbgBreakPoint, ExportTag::kImportant); +DECLARE_XBOXKRNL_EXPORT2(DbgBreakPoint, kDebug, kStub, kImportant); // https://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx typedef struct { @@ -80,7 +80,7 @@ void RtlRaiseException(pointer_t record) { // This is going to suck. xe::debugging::Break(); } -DECLARE_XBOXKRNL_EXPORT(RtlRaiseException, ExportTag::kImportant); +DECLARE_XBOXKRNL_EXPORT2(RtlRaiseException, kDebug, kStub, kImportant); void KeBugCheckEx(dword_t code, dword_t param1, dword_t param2, dword_t param3, dword_t param4) { @@ -90,10 +90,10 @@ void KeBugCheckEx(dword_t code, dword_t param1, dword_t param2, dword_t param3, xe::debugging::Break(); assert_always(); } -DECLARE_XBOXKRNL_EXPORT(KeBugCheckEx, ExportTag::kImportant); +DECLARE_XBOXKRNL_EXPORT2(KeBugCheckEx, kDebug, kStub, kImportant); void KeBugCheck(dword_t code) { KeBugCheckEx(code, 0, 0, 0, 0); } -DECLARE_XBOXKRNL_EXPORT(KeBugCheck, ExportTag::kImportant); +DECLARE_XBOXKRNL_EXPORT2(KeBugCheck, kDebug, kImplemented, kImportant); void RegisterDebugExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_error.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_error.cc index 6718b130b..8e533398c 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_error.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_error.cc @@ -1010,8 +1010,7 @@ dword_result_t RtlNtStatusToDosError(dword_t source_status) { XELOGE("RtlNtStatusToDosError lookup NOT IMPLEMENTED"); return 317; // ERROR_MR_MID_NOT_FOUND } -DECLARE_XBOXKRNL_EXPORT(RtlNtStatusToDosError, - ExportTag::kImportant | ExportTag::kLogResult); +DECLARE_XBOXKRNL_EXPORT2(RtlNtStatusToDosError, kNone, kImportant, kLogResult); void RegisterErrorExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_hal.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_hal.cc index 658275483..658cc0d24 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_hal.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_hal.cc @@ -29,7 +29,7 @@ void HalReturnToFirmware(dword_t routine) { XELOGE("Game requested shutdown via HalReturnToFirmware"); exit(0); } -DECLARE_XBOXKRNL_EXPORT(HalReturnToFirmware, ExportTag::kImportant); +DECLARE_XBOXKRNL_EXPORT2(HalReturnToFirmware, kNone, kStub, kImportant); void RegisterHalExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_hid.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_hid.cc index bf63b923b..0bcf33fd9 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_hid.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_hid.cc @@ -30,7 +30,7 @@ dword_result_t HidReadKeys(dword_t unk1, unknown_t unk2, unknown_t unk3) { */ return 0xC000009D; } -DECLARE_XBOXKRNL_EXPORT(HidReadKeys, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(HidReadKeys, kInput, kStub); void RegisterHidExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc index c3bbb5e7e..b2db28cdc 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc @@ -133,7 +133,7 @@ dword_result_t NtCreateFile(lpdword_t handle_out, dword_t desired_access, return result; } -DECLARE_XBOXKRNL_EXPORT(NtCreateFile, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtCreateFile, kFileSystem, kImplemented); dword_result_t NtOpenFile(lpdword_t handle_out, dword_t desired_access, pointer_t object_attributes, @@ -144,7 +144,7 @@ dword_result_t NtOpenFile(lpdword_t handle_out, dword_t desired_access, static_cast(xe::vfs::FileDisposition::kOpen), open_options); } -DECLARE_XBOXKRNL_EXPORT(NtOpenFile, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtOpenFile, kFileSystem, kImplemented); dword_result_t NtReadFile(dword_t file_handle, dword_t event_handle, lpvoid_t apc_routine_ptr, lpvoid_t apc_context, @@ -235,8 +235,7 @@ dword_result_t NtReadFile(dword_t file_handle, dword_t event_handle, return result; } -DECLARE_XBOXKRNL_EXPORT(NtReadFile, - ExportTag::kImplemented | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(NtReadFile, kFileSystem, kImplemented, kHighFrequency); dword_result_t NtWriteFile(dword_t file_handle, dword_t event_handle, function_t apc_routine, lpvoid_t apc_context, @@ -311,7 +310,7 @@ dword_result_t NtWriteFile(dword_t file_handle, dword_t event_handle, return result; } -DECLARE_XBOXKRNL_EXPORT(NtWriteFile, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtWriteFile, kFileSystem, kImplemented); dword_result_t NtCreateIoCompletion(lpdword_t out_handle, dword_t desired_access, @@ -324,7 +323,7 @@ dword_result_t NtCreateIoCompletion(lpdword_t out_handle, return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(NtCreateIoCompletion, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtCreateIoCompletion, kFileSystem, kImplemented); // Dequeues a packet from the completion port. dword_result_t NtRemoveIoCompletion( @@ -359,7 +358,7 @@ dword_result_t NtRemoveIoCompletion( return status; } -DECLARE_XBOXKRNL_EXPORT(NtRemoveIoCompletion, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtRemoveIoCompletion, kFileSystem, kImplemented); dword_result_t NtSetInformationFile( dword_t file_handle, pointer_t io_status_block, @@ -434,8 +433,8 @@ dword_result_t NtSetInformationFile( return result; } -DECLARE_XBOXKRNL_EXPORT(NtSetInformationFile, - ExportTag::kImplemented | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(NtSetInformationFile, kFileSystem, kImplemented, + kHighFrequency); struct X_IO_STATUS_BLOCK { union { @@ -550,8 +549,7 @@ dword_result_t NtQueryInformationFile( return result; } -DECLARE_XBOXKRNL_EXPORT(NtQueryInformationFile, - ExportTag::kImplemented | ExportTag::kFileSystem); +DECLARE_XBOXKRNL_EXPORT1(NtQueryInformationFile, kFileSystem, kImplemented); dword_result_t NtQueryFullAttributesFile( pointer_t obj_attribs, @@ -587,7 +585,7 @@ dword_result_t NtQueryFullAttributesFile( return X_STATUS_NO_SUCH_FILE; } -DECLARE_XBOXKRNL_EXPORT(NtQueryFullAttributesFile, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtQueryFullAttributesFile, kFileSystem, kImplemented); dword_result_t NtQueryVolumeInformationFile( dword_t file_handle, pointer_t io_status_block_ptr, @@ -662,7 +660,8 @@ dword_result_t NtQueryVolumeInformationFile( return result; } -DECLARE_XBOXKRNL_EXPORT(NtQueryVolumeInformationFile, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(NtQueryVolumeInformationFile, kFileSystem, + kImplemented); dword_result_t NtQueryDirectoryFile( dword_t file_handle, dword_t event_handle, function_t apc_routine, @@ -702,7 +701,7 @@ dword_result_t NtQueryDirectoryFile( return result; } -DECLARE_XBOXKRNL_EXPORT(NtQueryDirectoryFile, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtQueryDirectoryFile, kFileSystem, kImplemented); dword_result_t NtFlushBuffersFile( dword_t file_handle, pointer_t io_status_block_ptr) { @@ -715,17 +714,17 @@ dword_result_t NtFlushBuffersFile( return result; } -DECLARE_XBOXKRNL_EXPORT(NtFlushBuffersFile, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(NtFlushBuffersFile, kFileSystem, kStub); dword_result_t FscGetCacheElementCount(dword_t r3) { return 0; } -DECLARE_XBOXKRNL_EXPORT(FscGetCacheElementCount, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(FscGetCacheElementCount, kFileSystem, kStub); dword_result_t FscSetCacheElementCount(dword_t unk_0, dword_t unk_1) { // unk_0 = 0 // unk_1 looks like a count? in what units? 256 is a common value return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(FscSetCacheElementCount, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(FscSetCacheElementCount, kFileSystem, kStub); void RegisterIoExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_memory.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_memory.cc index 899704404..d735cf36a 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_memory.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_memory.cc @@ -161,8 +161,7 @@ dword_result_t NtAllocateVirtualMemory(lpdword_t base_addr_ptr, *region_size_ptr = adjusted_size; return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(NtAllocateVirtualMemory, - ExportTag::kImplemented | ExportTag::kMemory); +DECLARE_XBOXKRNL_EXPORT1(NtAllocateVirtualMemory, kMemory, kImplemented); dword_result_t NtProtectVirtualMemory(lpdword_t base_addr_ptr, lpdword_t region_size_ptr, @@ -210,8 +209,7 @@ dword_result_t NtProtectVirtualMemory(lpdword_t base_addr_ptr, return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(NtProtectVirtualMemory, - ExportTag::kImplemented | ExportTag::kMemory); +DECLARE_XBOXKRNL_EXPORT1(NtProtectVirtualMemory, kMemory, kImplemented); dword_result_t NtFreeVirtualMemory(lpdword_t base_addr_ptr, lpdword_t region_size_ptr, dword_t free_type, @@ -252,7 +250,7 @@ dword_result_t NtFreeVirtualMemory(lpdword_t base_addr_ptr, *region_size_ptr = region_size_value; return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(NtFreeVirtualMemory, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtFreeVirtualMemory, kMemory, kImplemented); struct X_MEMORY_BASIC_INFORMATION { be base_address; @@ -291,7 +289,7 @@ dword_result_t NtQueryVirtualMemory( return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(NtQueryVirtualMemory, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtQueryVirtualMemory, kMemory, kImplemented); dword_result_t MmAllocatePhysicalMemoryEx(dword_t flags, dword_t region_size, dword_t protect_bits, @@ -344,16 +342,14 @@ dword_result_t MmAllocatePhysicalMemoryEx(dword_t flags, dword_t region_size, return base_address; } -DECLARE_XBOXKRNL_EXPORT(MmAllocatePhysicalMemoryEx, - ExportTag::kImplemented | ExportTag::kMemory); +DECLARE_XBOXKRNL_EXPORT1(MmAllocatePhysicalMemoryEx, kMemory, kImplemented); dword_result_t MmAllocatePhysicalMemory(dword_t flags, dword_t region_size, dword_t protect_bits) { return MmAllocatePhysicalMemoryEx(flags, region_size, protect_bits, 0, 0xFFFFFFFFu, 0); } -DECLARE_XBOXKRNL_EXPORT(MmAllocatePhysicalMemory, - ExportTag::kImplemented | ExportTag::kMemory); +DECLARE_XBOXKRNL_EXPORT1(MmAllocatePhysicalMemory, kMemory, kImplemented); void MmFreePhysicalMemory(dword_t type, dword_t base_address) { // base_address = result of MmAllocatePhysicalMemory. @@ -363,7 +359,7 @@ void MmFreePhysicalMemory(dword_t type, dword_t base_address) { auto heap = kernel_state()->memory()->LookupHeap(base_address); heap->Release(base_address); } -DECLARE_XBOXKRNL_EXPORT(MmFreePhysicalMemory, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(MmFreePhysicalMemory, kMemory, kImplemented); dword_result_t MmQueryAddressProtect(dword_t base_address) { auto heap = kernel_state()->memory()->LookupHeap(base_address); @@ -375,7 +371,7 @@ dword_result_t MmQueryAddressProtect(dword_t base_address) { return access; } -DECLARE_XBOXKRNL_EXPORT(MmQueryAddressProtect, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(MmQueryAddressProtect, kMemory, kImplemented); void MmSetAddressProtect(lpvoid_t base_address, dword_t region_size, dword_t protect_bits) { @@ -383,8 +379,7 @@ void MmSetAddressProtect(lpvoid_t base_address, dword_t region_size, auto heap = kernel_memory()->LookupHeap(base_address); heap->Protect(base_address.guest_address(), region_size, protect); } -DECLARE_XBOXKRNL_EXPORT(MmSetAddressProtect, - ExportTag::kImplemented | ExportTag::kMemory); +DECLARE_XBOXKRNL_EXPORT1(MmSetAddressProtect, kMemory, kImplemented); dword_result_t MmQueryAllocationSize(lpvoid_t base_address) { auto heap = kernel_state()->memory()->LookupHeap(base_address); @@ -395,7 +390,7 @@ dword_result_t MmQueryAllocationSize(lpvoid_t base_address) { return size; } -DECLARE_XBOXKRNL_EXPORT(MmQueryAllocationSize, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(MmQueryAllocationSize, kMemory, kImplemented); // https://code.google.com/p/vdash/source/browse/trunk/vdash/include/kernel.h struct X_MM_QUERY_STATISTICS_SECTION { @@ -498,7 +493,7 @@ dword_result_t MmQueryStatistics( return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(MmQueryStatistics, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(MmQueryStatistics, kMemory, kImplemented); // http://msdn.microsoft.com/en-us/library/windows/hardware/ff554547(v=vs.85).aspx dword_result_t MmGetPhysicalAddress(dword_t base_address) { @@ -515,7 +510,7 @@ dword_result_t MmGetPhysicalAddress(dword_t base_address) { return physical_address; } -DECLARE_XBOXKRNL_EXPORT(MmGetPhysicalAddress, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(MmGetPhysicalAddress, kMemory, kImplemented); dword_result_t MmMapIoSpace(dword_t unk0, lpvoid_t src_address, dword_t size, dword_t flags) { @@ -528,7 +523,7 @@ dword_result_t MmMapIoSpace(dword_t unk0, lpvoid_t src_address, dword_t size, return src_address.guest_address(); } -DECLARE_XBOXKRNL_EXPORT(MmMapIoSpace, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(MmMapIoSpace, kMemory, kImplemented); dword_result_t ExAllocatePoolTypeWithTag(dword_t size, dword_t tag, dword_t zero) { @@ -545,27 +540,27 @@ dword_result_t ExAllocatePoolTypeWithTag(dword_t size, dword_t tag, return addr; } -DECLARE_XBOXKRNL_EXPORT(ExAllocatePoolTypeWithTag, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(ExAllocatePoolTypeWithTag, kMemory, kImplemented); void ExFreePool(lpvoid_t base_address) { kernel_state()->memory()->SystemHeapFree(base_address); } -DECLARE_XBOXKRNL_EXPORT(ExFreePool, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(ExFreePool, kMemory, kImplemented); dword_result_t KeGetImagePageTableEntry(lpvoid_t address) { // Unknown return 1; } -DECLARE_XBOXKRNL_EXPORT(KeGetImagePageTableEntry, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(KeGetImagePageTableEntry, kMemory, kStub); dword_result_t KeLockL2() { // TODO return 0; } -DECLARE_XBOXKRNL_EXPORT(KeLockL2, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(KeLockL2, kMemory, kStub); void KeUnlockL2() {} -DECLARE_XBOXKRNL_EXPORT(KeUnlockL2, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(KeUnlockL2, kMemory, kStub); dword_result_t MmCreateKernelStack(dword_t stack_size, dword_t r4) { assert_zero(r4); // Unknown argument. @@ -582,7 +577,7 @@ dword_result_t MmCreateKernelStack(dword_t stack_size, dword_t r4) { &stack_address); return stack_address + stack_size; } -DECLARE_XBOXKRNL_EXPORT(MmCreateKernelStack, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(MmCreateKernelStack, kMemory, kImplemented); dword_result_t MmDeleteKernelStack(lpvoid_t stack_base, lpvoid_t stack_end) { // Release the stack (where stack_end is the low address) @@ -592,7 +587,7 @@ dword_result_t MmDeleteKernelStack(lpvoid_t stack_base, lpvoid_t stack_end) { return X_STATUS_UNSUCCESSFUL; } -DECLARE_XBOXKRNL_EXPORT(MmDeleteKernelStack, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(MmDeleteKernelStack, kMemory, kImplemented); void RegisterMemoryExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc index 2524c396f..834b5102f 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc @@ -21,7 +21,7 @@ namespace xboxkrnl { void KeEnableFpuExceptions(dword_t enabled) { // TODO(benvanik): can we do anything about exceptions? } -DECLARE_XBOXKRNL_EXPORT(KeEnableFpuExceptions, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(KeEnableFpuExceptions, kNone, kStub); void RegisterMiscExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc index 1a6031422..7bdd6584f 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc @@ -113,8 +113,7 @@ dword_result_t ExGetXConfigSetting(word_t category, word_t setting, return result; } -DECLARE_XBOXKRNL_EXPORT(ExGetXConfigSetting, - ExportTag::kImplemented | ExportTag::kModules); +DECLARE_XBOXKRNL_EXPORT1(ExGetXConfigSetting, kModules, kImplemented); dword_result_t XexCheckExecutablePrivilege(dword_t privilege) { // BOOL @@ -134,8 +133,7 @@ dword_result_t XexCheckExecutablePrivilege(dword_t privilege) { return (flags & mask) > 0; } -DECLARE_XBOXKRNL_EXPORT(XexCheckExecutablePrivilege, - ExportTag::kImplemented | ExportTag::kModules); +DECLARE_XBOXKRNL_EXPORT1(XexCheckExecutablePrivilege, kModules, kImplemented); dword_result_t XexGetModuleHandle(lpstring_t module_name, lpdword_t hmodule_ptr) { @@ -157,8 +155,7 @@ dword_result_t XexGetModuleHandle(lpstring_t module_name, return X_ERROR_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(XexGetModuleHandle, - ExportTag::kImplemented | ExportTag::kModules); +DECLARE_XBOXKRNL_EXPORT1(XexGetModuleHandle, kModules, kImplemented); dword_result_t XexGetModuleSection(lpvoid_t hmodule, lpstring_t name, lpdword_t data_ptr, lpdword_t size_ptr) { @@ -179,8 +176,7 @@ dword_result_t XexGetModuleSection(lpvoid_t hmodule, lpstring_t name, return result; } -DECLARE_XBOXKRNL_EXPORT(XexGetModuleSection, - ExportTag::kImplemented | ExportTag::kModules); +DECLARE_XBOXKRNL_EXPORT1(XexGetModuleSection, kModules, kImplemented); dword_result_t XexLoadImage(lpstring_t module_name, dword_t module_flags, dword_t min_version, lpdword_t hmodule_ptr) { @@ -213,8 +209,7 @@ dword_result_t XexLoadImage(lpstring_t module_name, dword_t module_flags, return result; } -DECLARE_XBOXKRNL_EXPORT(XexLoadImage, - ExportTag::kImplemented | ExportTag::kModules); +DECLARE_XBOXKRNL_EXPORT1(XexLoadImage, kModules, kImplemented); dword_result_t XexUnloadImage(lpvoid_t hmodule) { auto module = XModule::GetFromHModule(kernel_state(), hmodule); @@ -234,8 +229,7 @@ dword_result_t XexUnloadImage(lpvoid_t hmodule) { return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(XexUnloadImage, - ExportTag::kImplemented | ExportTag::kModules); +DECLARE_XBOXKRNL_EXPORT1(XexUnloadImage, kModules, kImplemented); dword_result_t XexGetProcedureAddress(lpvoid_t hmodule, dword_t ordinal, lpdword_t out_function_ptr) { @@ -273,7 +267,7 @@ dword_result_t XexGetProcedureAddress(lpvoid_t hmodule, dword_t ordinal, return result; } -DECLARE_XBOXKRNL_EXPORT(XexGetProcedureAddress, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(XexGetProcedureAddress, kModules, kImplemented); void ExRegisterTitleTerminateNotification( pointer_t reg, dword_t create) { @@ -286,8 +280,8 @@ void ExRegisterTitleTerminateNotification( kernel_state()->RemoveTitleTerminateNotification(reg->notification_routine); } } -DECLARE_XBOXKRNL_EXPORT(ExRegisterTitleTerminateNotification, - ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(ExRegisterTitleTerminateNotification, kModules, + kImplemented); void RegisterModuleExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_ob.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_ob.cc index 55a55c559..70ed29c38 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_ob.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_ob.cc @@ -44,7 +44,7 @@ dword_result_t ObOpenObjectByName(lpunknown_t obj_attributes_ptr, return result; } -DECLARE_XBOXKRNL_EXPORT(ObOpenObjectByName, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(ObOpenObjectByName, kNone, kImplemented); dword_result_t ObOpenObjectByPointer(lpvoid_t object_ptr, lpdword_t out_handle_ptr) { @@ -58,7 +58,7 @@ dword_result_t ObOpenObjectByPointer(lpvoid_t object_ptr, *out_handle_ptr = object->handle(); return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(ObOpenObjectByPointer, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(ObOpenObjectByPointer, kNone, kImplemented); dword_result_t ObLookupThreadByThreadId(dword_t thread_id, lpdword_t out_object_ptr) { @@ -72,7 +72,7 @@ dword_result_t ObLookupThreadByThreadId(dword_t thread_id, *out_object_ptr = thread->guest_object(); return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(ObLookupThreadByThreadId, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(ObLookupThreadByThreadId, kNone, kImplemented); dword_result_t ObReferenceObjectByHandle(dword_t handle, dword_t object_type_ptr, @@ -137,7 +137,7 @@ dword_result_t ObReferenceObjectByHandle(dword_t handle, return result; } -DECLARE_XBOXKRNL_EXPORT(ObReferenceObjectByHandle, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(ObReferenceObjectByHandle, kNone, kImplemented); dword_result_t ObDereferenceObject(dword_t native_ptr) { // Check if a dummy value from ObReferenceObjectByHandle. @@ -153,7 +153,7 @@ dword_result_t ObDereferenceObject(dword_t native_ptr) { return 0; } -DECLARE_XBOXKRNL_EXPORT(ObDereferenceObject, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(ObDereferenceObject, kNone, kImplemented); dword_result_t ObCreateSymbolicLink(pointer_t path, pointer_t target) { @@ -174,7 +174,7 @@ dword_result_t ObCreateSymbolicLink(pointer_t path, return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(ObCreateSymbolicLink, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(ObCreateSymbolicLink, kNone, kImplemented); dword_result_t ObDeleteSymbolicLink(pointer_t path) { auto path_str = path->to_string(kernel_memory()->virtual_membase()); @@ -184,7 +184,7 @@ dword_result_t ObDeleteSymbolicLink(pointer_t path) { return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(ObDeleteSymbolicLink, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(ObDeleteSymbolicLink, kNone, kImplemented); dword_result_t NtDuplicateObject(dword_t handle, lpdword_t new_handle_ptr, dword_t options) { @@ -209,12 +209,12 @@ dword_result_t NtDuplicateObject(dword_t handle, lpdword_t new_handle_ptr, return result; } -DECLARE_XBOXKRNL_EXPORT(NtDuplicateObject, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtDuplicateObject, kNone, kImplemented); dword_result_t NtClose(dword_t handle) { return kernel_state()->object_table()->ReleaseHandle(handle); } -DECLARE_XBOXKRNL_EXPORT(NtClose, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtClose, kNone, kImplemented); void RegisterObExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc index 86852889b..ff628fd45 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_rtl.cc @@ -52,7 +52,7 @@ dword_result_t RtlCompareMemory(lpvoid_t source1, lpvoid_t source2, return c; } -DECLARE_XBOXKRNL_EXPORT(RtlCompareMemory, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlCompareMemory, kMemory, kImplemented); // http://msdn.microsoft.com/en-us/library/ff552123 dword_result_t RtlCompareMemoryUlong(lpvoid_t source, dword_t length, @@ -73,7 +73,7 @@ dword_result_t RtlCompareMemoryUlong(lpvoid_t source, dword_t length, return n; } -DECLARE_XBOXKRNL_EXPORT(RtlCompareMemoryUlong, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlCompareMemoryUlong, kMemory, kImplemented); // http://msdn.microsoft.com/en-us/library/ff552263 void RtlFillMemoryUlong(lpvoid_t destination, dword_t length, dword_t pattern) { @@ -86,7 +86,7 @@ void RtlFillMemoryUlong(lpvoid_t destination, dword_t length, dword_t pattern) { *p = swapped_pattern; } } -DECLARE_XBOXKRNL_EXPORT(RtlFillMemoryUlong, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlFillMemoryUlong, kMemory, kImplemented); dword_result_t RtlUpperChar(dword_t in) { char c = in & 0xFF; @@ -96,7 +96,7 @@ dword_result_t RtlUpperChar(dword_t in) { return c; } -DECLARE_XBOXKRNL_EXPORT(RtlUpperChar, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlUpperChar, kNone, kImplemented); dword_result_t RtlLowerChar(dword_t in) { char c = in & 0xFF; @@ -106,7 +106,7 @@ dword_result_t RtlLowerChar(dword_t in) { return c; } -DECLARE_XBOXKRNL_EXPORT(RtlLowerChar, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlLowerChar, kNone, kImplemented); dword_result_t RtlCompareString(lpstring_t string_1, lpstring_t string_2, dword_t case_insensitive) { @@ -115,7 +115,7 @@ dword_result_t RtlCompareString(lpstring_t string_1, lpstring_t string_2, return ret; } -DECLARE_XBOXKRNL_EXPORT(RtlCompareString, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlCompareString, kNone, kImplemented); dword_result_t RtlCompareStringN(lpstring_t string_1, dword_t string_1_len, lpstring_t string_2, dword_t string_2_len, @@ -136,7 +136,7 @@ dword_result_t RtlCompareStringN(lpstring_t string_1, dword_t string_1_len, return ret; } -DECLARE_XBOXKRNL_EXPORT(RtlCompareStringN, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlCompareStringN, kNone, kImplemented); // http://msdn.microsoft.com/en-us/library/ff561918 void RtlInitAnsiString(pointer_t destination, @@ -151,7 +151,7 @@ void RtlInitAnsiString(pointer_t destination, destination->pointer = source.guest_address(); } -DECLARE_XBOXKRNL_EXPORT(RtlInitAnsiString, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlInitAnsiString, kNone, kImplemented); // http://msdn.microsoft.com/en-us/library/ff561899 void RtlFreeAnsiString(pointer_t string) { @@ -161,7 +161,7 @@ void RtlFreeAnsiString(pointer_t string) { string->reset(); } -DECLARE_XBOXKRNL_EXPORT(RtlFreeAnsiString, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlFreeAnsiString, kNone, kImplemented); // http://msdn.microsoft.com/en-us/library/ff561934 void RtlInitUnicodeString(pointer_t destination, @@ -174,7 +174,7 @@ void RtlInitUnicodeString(pointer_t destination, destination->reset(); } } -DECLARE_XBOXKRNL_EXPORT(RtlInitUnicodeString, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlInitUnicodeString, kNone, kImplemented); // http://msdn.microsoft.com/en-us/library/ff561903 void RtlFreeUnicodeString(pointer_t string) { @@ -184,7 +184,7 @@ void RtlFreeUnicodeString(pointer_t string) { string->reset(); } -DECLARE_XBOXKRNL_EXPORT(RtlFreeUnicodeString, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlFreeUnicodeString, kNone, kImplemented); void RtlCopyString(pointer_t destination, pointer_t source) { @@ -201,7 +201,7 @@ void RtlCopyString(pointer_t destination, } destination->length = length; } -DECLARE_XBOXKRNL_EXPORT(RtlCopyString, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlCopyString, kNone, kImplemented); void RtlCopyUnicodeString(pointer_t destination, pointer_t source) { @@ -218,7 +218,7 @@ void RtlCopyUnicodeString(pointer_t destination, } destination->length = length; } -DECLARE_XBOXKRNL_EXPORT(RtlCopyUnicodeString, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlCopyUnicodeString, kNone, kImplemented); // http://msdn.microsoft.com/en-us/library/ff562969 dword_result_t RtlUnicodeStringToAnsiString( @@ -262,7 +262,7 @@ dword_result_t RtlUnicodeStringToAnsiString( } return result; } -DECLARE_XBOXKRNL_EXPORT(RtlUnicodeStringToAnsiString, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlUnicodeStringToAnsiString, kNone, kImplemented); // https://msdn.microsoft.com/en-us/library/ff553113 dword_result_t RtlMultiByteToUnicodeN(lpword_t destination_ptr, @@ -286,8 +286,7 @@ dword_result_t RtlMultiByteToUnicodeN(lpword_t destination_ptr, return 0; } -DECLARE_XBOXKRNL_EXPORT(RtlMultiByteToUnicodeN, - ExportTag::kImplemented | ExportTag::kSketchy); +DECLARE_XBOXKRNL_EXPORT2(RtlMultiByteToUnicodeN, kNone, kImplemented, kSketchy); // https://msdn.microsoft.com/en-us/library/ff553261 dword_result_t RtlUnicodeToMultiByteN(pointer_t destination_ptr, @@ -309,8 +308,7 @@ dword_result_t RtlUnicodeToMultiByteN(pointer_t destination_ptr, return 0; } -DECLARE_XBOXKRNL_EXPORT(RtlUnicodeToMultiByteN, - ExportTag::kImplemented | ExportTag::kSketchy); +DECLARE_XBOXKRNL_EXPORT2(RtlUnicodeToMultiByteN, kNone, kImplemented, kSketchy); pointer_result_t RtlImageXexHeaderField(pointer_t xex_header, dword_t field_dword) { @@ -322,7 +320,7 @@ pointer_result_t RtlImageXexHeaderField(pointer_t xex_header, return field_value; } -DECLARE_XBOXKRNL_EXPORT(RtlImageXexHeaderField, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlImageXexHeaderField, kNone, kImplemented); // Unfortunately the Windows RTL_CRITICAL_SECTION object is bigger than the one // on the 360 (32b vs. 28b). This means that we can't do in-place splatting of @@ -364,7 +362,7 @@ void xeRtlInitializeCriticalSection(X_RTL_CRITICAL_SECTION* cs, void RtlInitializeCriticalSection(pointer_t cs) { xeRtlInitializeCriticalSection(cs, cs.guest_address()); } -DECLARE_XBOXKRNL_EXPORT(RtlInitializeCriticalSection, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlInitializeCriticalSection, kNone, kImplemented); X_STATUS xeRtlInitializeCriticalSectionAndSpinCount(X_RTL_CRITICAL_SECTION* cs, uint32_t cs_ptr, @@ -391,8 +389,8 @@ dword_result_t RtlInitializeCriticalSectionAndSpinCount( return xeRtlInitializeCriticalSectionAndSpinCount(cs, cs.guest_address(), spin_count); } -DECLARE_XBOXKRNL_EXPORT(RtlInitializeCriticalSectionAndSpinCount, - ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlInitializeCriticalSectionAndSpinCount, kNone, + kImplemented); void RtlEnterCriticalSection(pointer_t cs) { uint32_t cur_thread = XThread::GetCurrentThread()->guest_object(); @@ -425,8 +423,8 @@ void RtlEnterCriticalSection(pointer_t cs) { cs->owning_thread = cur_thread; cs->recursion_count = 1; } -DECLARE_XBOXKRNL_EXPORT(RtlEnterCriticalSection, - ExportTag::kImplemented | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(RtlEnterCriticalSection, kNone, kImplemented, + kHighFrequency); dword_result_t RtlTryEnterCriticalSection( pointer_t cs) { @@ -447,8 +445,8 @@ dword_result_t RtlTryEnterCriticalSection( // Failed to acquire lock. return 0; } -DECLARE_XBOXKRNL_EXPORT(RtlTryEnterCriticalSection, - ExportTag::kImplemented | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(RtlTryEnterCriticalSection, kNone, kImplemented, + kHighFrequency); void RtlLeaveCriticalSection(pointer_t cs) { assert_true(cs->owning_thread == XThread::GetCurrentThread()->guest_object()); @@ -469,8 +467,8 @@ void RtlLeaveCriticalSection(pointer_t cs) { KeSetEvent(reinterpret_cast(cs.host_address()), 1, 0); } } -DECLARE_XBOXKRNL_EXPORT(RtlLeaveCriticalSection, - ExportTag::kImplemented | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(RtlLeaveCriticalSection, kNone, kImplemented, + kHighFrequency); struct X_TIME_FIELDS { xe::be year; @@ -500,7 +498,7 @@ void RtlTimeToTimeFields(lpqword_t time_ptr, time_fields_ptr->milliseconds = time_ms % 1000; time_fields_ptr->weekday = tm->tm_wday; } -DECLARE_XBOXKRNL_EXPORT(RtlTimeToTimeFields, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlTimeToTimeFields, kNone, kImplemented); dword_result_t RtlTimeFieldsToTime(pointer_t time_fields_ptr, lpqword_t time_ptr) { @@ -522,7 +520,7 @@ dword_result_t RtlTimeFieldsToTime(pointer_t time_fields_ptr, *time_ptr = time; return 1; } -DECLARE_XBOXKRNL_EXPORT(RtlTimeFieldsToTime, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(RtlTimeFieldsToTime, kNone, kImplemented); void RegisterRtlExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc index 46d11acad..5a5caddd7 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc @@ -243,8 +243,7 @@ void KeSetCurrentStackPointers(lpvoid_t stack_ptr, // TODO: Do we need to set the stack info on cur_thread? } -DECLARE_XBOXKRNL_EXPORT(KeSetCurrentStackPointers, - ExportTag::kThreading | ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(KeSetCurrentStackPointers, kThreading, kImplemented); SHIM_CALL KeSetAffinityThread_shim(PPCContext* ppc_context, KernelState* kernel_state) { @@ -352,9 +351,8 @@ dword_result_t KeDelayExecutionThread(dword_t processor_mode, dword_t alertable, return result; } -DECLARE_XBOXKRNL_EXPORT(KeDelayExecutionThread, - ExportTag::kImplemented | ExportTag::kThreading | - ExportTag::kHighFrequency | ExportTag::kBlocking); +DECLARE_XBOXKRNL_EXPORT3(KeDelayExecutionThread, kThreading, kImplemented, + kBlocking, kHighFrequency); SHIM_CALL NtYieldExecution_shim(PPCContext* ppc_context, KernelState* kernel_state) { @@ -383,7 +381,7 @@ dword_result_t KeTlsAlloc() { return slot; } -DECLARE_XBOXKRNL_EXPORT(KeTlsAlloc, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(KeTlsAlloc, kThreading, kImplemented); // http://msdn.microsoft.com/en-us/library/ms686804 dword_result_t KeTlsFree(dword_t tls_index) { @@ -394,7 +392,7 @@ dword_result_t KeTlsFree(dword_t tls_index) { kernel_state()->FreeTLS(tls_index); return 1; } -DECLARE_XBOXKRNL_EXPORT(KeTlsFree, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(KeTlsFree, kThreading, kImplemented); // http://msdn.microsoft.com/en-us/library/ms686812 dword_result_t KeTlsGetValue(dword_t tls_index) { @@ -407,8 +405,8 @@ dword_result_t KeTlsGetValue(dword_t tls_index) { return 0; } -DECLARE_XBOXKRNL_EXPORT(KeTlsGetValue, - ExportTag::kImplemented | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(KeTlsGetValue, kThreading, kImplemented, + kHighFrequency); // http://msdn.microsoft.com/en-us/library/ms686818 dword_result_t KeTlsSetValue(dword_t tls_index, dword_t tls_value) { @@ -420,7 +418,7 @@ dword_result_t KeTlsSetValue(dword_t tls_index, dword_t tls_value) { return 0; } -DECLARE_XBOXKRNL_EXPORT(KeTlsSetValue, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(KeTlsSetValue, kThreading, kImplemented); void KeInitializeEvent(pointer_t event_ptr, dword_t event_type, dword_t initial_state) { @@ -434,8 +432,7 @@ void KeInitializeEvent(pointer_t event_ptr, dword_t event_type, return; } } -DECLARE_XBOXKRNL_EXPORT(KeInitializeEvent, - ExportTag::kImplemented | ExportTag::kThreading); +DECLARE_XBOXKRNL_EXPORT1(KeInitializeEvent, kThreading, kImplemented); dword_result_t KeSetEvent(pointer_t event_ptr, dword_t increment, dword_t wait) { @@ -447,9 +444,7 @@ dword_result_t KeSetEvent(pointer_t event_ptr, dword_t increment, return ev->Set(increment, !!wait); } -DECLARE_XBOXKRNL_EXPORT(KeSetEvent, ExportTag::kImplemented | - ExportTag::kThreading | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(KeSetEvent, kThreading, kImplemented, kHighFrequency); dword_result_t KePulseEvent(pointer_t event_ptr, dword_t increment, dword_t wait) { @@ -461,9 +456,8 @@ dword_result_t KePulseEvent(pointer_t event_ptr, dword_t increment, return ev->Pulse(increment, !!wait); } -DECLARE_XBOXKRNL_EXPORT(KePulseEvent, ExportTag::kImplemented | - ExportTag::kThreading | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(KePulseEvent, kThreading, kImplemented, + kHighFrequency); dword_result_t KeResetEvent(pointer_t event_ptr) { auto ev = XObject::GetNativeObject(kernel_state(), event_ptr); @@ -474,8 +468,7 @@ dword_result_t KeResetEvent(pointer_t event_ptr) { return ev->Reset(); } -DECLARE_XBOXKRNL_EXPORT(KeResetEvent, - ExportTag::kImplemented | ExportTag::kThreading); +DECLARE_XBOXKRNL_EXPORT1(KeResetEvent, kThreading, kImplemented); dword_result_t NtCreateEvent(lpdword_t handle_ptr, pointer_t obj_attributes_ptr, @@ -508,8 +501,7 @@ dword_result_t NtCreateEvent(lpdword_t handle_ptr, } return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(NtCreateEvent, - ExportTag::kImplemented | ExportTag::kThreading); +DECLARE_XBOXKRNL_EXPORT1(NtCreateEvent, kThreading, kImplemented); dword_result_t NtSetEvent(dword_t handle, lpdword_t previous_state_ptr) { X_STATUS result = X_STATUS_SUCCESS; @@ -526,9 +518,7 @@ dword_result_t NtSetEvent(dword_t handle, lpdword_t previous_state_ptr) { return result; } -DECLARE_XBOXKRNL_EXPORT(NtSetEvent, ExportTag::kImplemented | - ExportTag::kThreading | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(NtSetEvent, kThreading, kImplemented, kHighFrequency); dword_result_t NtPulseEvent(dword_t handle, lpdword_t previous_state_ptr) { X_STATUS result = X_STATUS_SUCCESS; @@ -545,9 +535,8 @@ dword_result_t NtPulseEvent(dword_t handle, lpdword_t previous_state_ptr) { return result; } -DECLARE_XBOXKRNL_EXPORT(NtPulseEvent, ExportTag::kImplemented | - ExportTag::kThreading | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(NtPulseEvent, kThreading, kImplemented, + kHighFrequency); dword_result_t NtClearEvent(dword_t handle) { X_STATUS result = X_STATUS_SUCCESS; @@ -561,9 +550,8 @@ dword_result_t NtClearEvent(dword_t handle) { return result; } -DECLARE_XBOXKRNL_EXPORT(NtClearEvent, ExportTag::kImplemented | - ExportTag::kThreading | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(NtClearEvent, kThreading, kImplemented, + kHighFrequency); // https://msdn.microsoft.com/en-us/library/windows/hardware/ff552150(v=vs.85).aspx void KeInitializeSemaphore(pointer_t semaphore_ptr, dword_t count, @@ -579,8 +567,7 @@ void KeInitializeSemaphore(pointer_t semaphore_ptr, dword_t count, return; } } -DECLARE_XBOXKRNL_EXPORT(KeInitializeSemaphore, - ExportTag::kImplemented | ExportTag::kThreading); +DECLARE_XBOXKRNL_EXPORT1(KeInitializeSemaphore, kThreading, kImplemented); dword_result_t KeReleaseSemaphore(pointer_t semaphore_ptr, dword_t increment, dword_t adjustment, @@ -597,8 +584,7 @@ dword_result_t KeReleaseSemaphore(pointer_t semaphore_ptr, return sem->ReleaseSemaphore(adjustment); } -DECLARE_XBOXKRNL_EXPORT(KeReleaseSemaphore, - ExportTag::kImplemented | ExportTag::kThreading); +DECLARE_XBOXKRNL_EXPORT1(KeReleaseSemaphore, kThreading, kImplemented); SHIM_CALL NtCreateSemaphore_shim(PPCContext* ppc_context, KernelState* kernel_state) { @@ -698,7 +684,7 @@ dword_result_t NtCreateMutant(lpdword_t handle_out, return X_STATUS_SUCCESS; } -DECLARE_XBOXKRNL_EXPORT(NtCreateMutant, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(NtCreateMutant, kThreading, kImplemented); SHIM_CALL NtReleaseMutant_shim(PPCContext* ppc_context, KernelState* kernel_state) { @@ -844,9 +830,8 @@ dword_result_t KeWaitForSingleObject(lpvoid_t object_ptr, dword_t wait_reason, return result; } -DECLARE_XBOXKRNL_EXPORT(KeWaitForSingleObject, - ExportTag::kImplemented | ExportTag::kThreading | - ExportTag::kBlocking | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT3(KeWaitForSingleObject, kThreading, kImplemented, + kBlocking, kHighFrequency); dword_result_t NtWaitForSingleObjectEx(dword_t object_handle, dword_t wait_mode, dword_t alertable, @@ -865,9 +850,8 @@ dword_result_t NtWaitForSingleObjectEx(dword_t object_handle, dword_t wait_mode, return result; } -DECLARE_XBOXKRNL_EXPORT(NtWaitForSingleObjectEx, - ExportTag::kImplemented | ExportTag::kThreading | - ExportTag::kBlocking | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT3(NtWaitForSingleObjectEx, kThreading, kImplemented, + kBlocking, kHighFrequency); dword_result_t KeWaitForMultipleObjects(dword_t count, lpdword_t objects_ptr, dword_t wait_type, dword_t wait_reason, @@ -899,9 +883,8 @@ dword_result_t KeWaitForMultipleObjects(dword_t count, lpdword_t objects_ptr, return result; } -DECLARE_XBOXKRNL_EXPORT(KeWaitForMultipleObjects, - ExportTag::kImplemented | ExportTag::kThreading | - ExportTag::kBlocking | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT3(KeWaitForMultipleObjects, kThreading, kImplemented, + kBlocking, kHighFrequency); dword_result_t NtWaitForMultipleObjectsEx(dword_t count, lpdword_t handles, dword_t wait_type, dword_t wait_mode, @@ -928,9 +911,8 @@ dword_result_t NtWaitForMultipleObjectsEx(dword_t count, lpdword_t handles, return result; } -DECLARE_XBOXKRNL_EXPORT(NtWaitForMultipleObjectsEx, - ExportTag::kImplemented | ExportTag::kThreading | - ExportTag::kBlocking | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT3(NtWaitForMultipleObjectsEx, kThreading, kImplemented, + kBlocking, kHighFrequency); dword_result_t NtSignalAndWaitForSingleObjectEx(dword_t signal_handle, dword_t wait_handle, @@ -953,9 +935,8 @@ dword_result_t NtSignalAndWaitForSingleObjectEx(dword_t signal_handle, return result; } -DECLARE_XBOXKRNL_EXPORT(NtSignalAndWaitForSingleObjectEx, - ExportTag::kImplemented | ExportTag::kThreading | - ExportTag::kBlocking | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT3(NtSignalAndWaitForSingleObjectEx, kThreading, + kImplemented, kBlocking, kHighFrequency); dword_result_t KfAcquireSpinLock(lpdword_t lock_ptr) { // XELOGD( @@ -976,9 +957,8 @@ dword_result_t KfAcquireSpinLock(lpdword_t lock_ptr) { return old_irql; } -DECLARE_XBOXKRNL_EXPORT(KfAcquireSpinLock, - ExportTag::kImplemented | ExportTag::kThreading | - ExportTag::kHighFrequency | ExportTag::kBlocking); +DECLARE_XBOXKRNL_EXPORT3(KfAcquireSpinLock, kThreading, kImplemented, kBlocking, + kHighFrequency); void KfReleaseSpinLock(lpdword_t lock_ptr, dword_t old_irql) { // Restore IRQL. @@ -989,9 +969,8 @@ void KfReleaseSpinLock(lpdword_t lock_ptr, dword_t old_irql) { auto lock = reinterpret_cast(lock_ptr.host_address()); xe::atomic_dec(lock); } -DECLARE_XBOXKRNL_EXPORT(KfReleaseSpinLock, ExportTag::kImplemented | - ExportTag::kThreading | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(KfReleaseSpinLock, kThreading, kImplemented, + kHighFrequency); void KeAcquireSpinLockAtRaisedIrql(lpdword_t lock_ptr) { // Lock. @@ -1001,18 +980,16 @@ void KeAcquireSpinLockAtRaisedIrql(lpdword_t lock_ptr) { // TODO(benvanik): error on deadlock? } } -DECLARE_XBOXKRNL_EXPORT(KeAcquireSpinLockAtRaisedIrql, - ExportTag::kImplemented | ExportTag::kThreading | - ExportTag::kHighFrequency | ExportTag::kBlocking); +DECLARE_XBOXKRNL_EXPORT3(KeAcquireSpinLockAtRaisedIrql, kThreading, + kImplemented, kBlocking, kHighFrequency); void KeReleaseSpinLockFromRaisedIrql(lpdword_t lock_ptr) { // Unlock. auto lock = reinterpret_cast(lock_ptr.host_address()); xe::atomic_dec(lock); } -DECLARE_XBOXKRNL_EXPORT(KeReleaseSpinLockFromRaisedIrql, - ExportTag::kImplemented | ExportTag::kThreading | - ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(KeReleaseSpinLockFromRaisedIrql, kThreading, + kImplemented, kHighFrequency); SHIM_CALL KeEnterCriticalRegion_shim(PPCContext* ppc_context, KernelState* kernel_state) { @@ -1270,8 +1247,7 @@ void ExInitializeReadWriteLock(pointer_t lock_ptr) { KeInitializeEvent(&lock_ptr->writer_event, 1, 0); KeInitializeSemaphore(&lock_ptr->reader_semaphore, 0, 0x7FFFFFFF); } -DECLARE_XBOXKRNL_EXPORT(ExInitializeReadWriteLock, - ExportTag::kThreading | ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(ExInitializeReadWriteLock, kThreading, kImplemented); // NOTE: This function is very commonly inlined, and probably won't be called! pointer_result_t InterlockedPushEntrySList( @@ -1296,8 +1272,8 @@ pointer_result_t InterlockedPushEntrySList( return old_head; } -DECLARE_XBOXKRNL_EXPORT(InterlockedPushEntrySList, - ExportTag::kImplemented | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(InterlockedPushEntrySList, kThreading, kImplemented, + kHighFrequency); pointer_result_t InterlockedPopEntrySList(pointer_t plist_ptr) { assert_not_null(plist_ptr); @@ -1323,8 +1299,8 @@ pointer_result_t InterlockedPopEntrySList(pointer_t plist_ptr) { return popped; } -DECLARE_XBOXKRNL_EXPORT(InterlockedPopEntrySList, - ExportTag::kImplemented | ExportTag::kHighFrequency); +DECLARE_XBOXKRNL_EXPORT2(InterlockedPopEntrySList, kThreading, kImplemented, + kHighFrequency); pointer_result_t InterlockedFlushSList(pointer_t plist_ptr) { assert_not_null(plist_ptr); @@ -1344,7 +1320,7 @@ pointer_result_t InterlockedFlushSList(pointer_t plist_ptr) { return first; } -DECLARE_XBOXKRNL_EXPORT(InterlockedFlushSList, ExportTag::kImplemented); +DECLARE_XBOXKRNL_EXPORT1(InterlockedFlushSList, kThreading, kImplemented); void RegisterThreadingExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) { diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_usbcam.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_usbcam.cc index 28c85abb1..8c02e50c6 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_usbcam.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_usbcam.cc @@ -23,13 +23,13 @@ dword_result_t XUsbcamCreate(unknown_t unk1, // E // 0 = success. return X_ERROR_DEVICE_NOT_CONNECTED; } -DECLARE_XBOXKRNL_EXPORT(XUsbcamCreate, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(XUsbcamCreate, kNone, kStub); dword_result_t XUsbcamGetState() { // 0 = not connected. return 0; } -DECLARE_XBOXKRNL_EXPORT(XUsbcamGetState, ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(XUsbcamGetState, kNone, kStub); void RegisterUsbcamExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {} diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_video.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_video.cc index 1f5d40f5f..fcf2b369a 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_video.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_video.cc @@ -48,7 +48,7 @@ void VdGetCurrentDisplayGamma(lpdword_t type_ptr, lpfloat_t unknown_ptr) { *type_ptr = 1; *unknown_ptr = 2.22222233f; // maybe brightness? } -DECLARE_XBOXKRNL_EXPORT(VdGetCurrentDisplayGamma, ExportTag::kVideo); +DECLARE_XBOXKRNL_EXPORT1(VdGetCurrentDisplayGamma, kVideo, kStub); struct X_D3DPRIVATE_RECT { xe::be x1; // 0x0 @@ -121,7 +121,7 @@ void VdGetCurrentDisplayInformation(pointer_t display_info) { display_info->display_refresh_rate = mode.refresh_rate; display_info->actual_display_width = (uint16_t)mode.display_width; } -DECLARE_XBOXKRNL_EXPORT(VdGetCurrentDisplayInformation, ExportTag::kVideo); +DECLARE_XBOXKRNL_EXPORT1(VdGetCurrentDisplayInformation, kVideo, kStub); void VdQueryVideoMode(pointer_t video_mode) { // TODO(benvanik): get info from actual display. @@ -136,7 +136,7 @@ void VdQueryVideoMode(pointer_t video_mode) { video_mode->unknown_0x8a = 0x4A; video_mode->unknown_0x01 = 0x01; } -DECLARE_XBOXKRNL_EXPORT(VdQueryVideoMode, ExportTag::kVideo); +DECLARE_XBOXKRNL_EXPORT1(VdQueryVideoMode, kVideo, kStub); dword_result_t VdQueryVideoFlags() { X_VIDEO_MODE mode; @@ -149,7 +149,7 @@ dword_result_t VdQueryVideoFlags() { return flags; } -DECLARE_XBOXKRNL_EXPORT(VdQueryVideoFlags, ExportTag::kVideo); +DECLARE_XBOXKRNL_EXPORT1(VdQueryVideoFlags, kVideo, kStub); dword_result_t VdSetDisplayMode(dword_t flags) { // Often 0x40000000. @@ -168,7 +168,7 @@ dword_result_t VdSetDisplayMode(dword_t flags) { return 0; } -DECLARE_XBOXKRNL_EXPORT(VdSetDisplayMode, ExportTag::kVideo | ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(VdSetDisplayMode, kVideo, kStub); dword_result_t VdSetDisplayModeOverride(unknown_t unk0, unknown_t unk1, double_t refresh_rate, unknown_t unk3, @@ -176,8 +176,7 @@ dword_result_t VdSetDisplayModeOverride(unknown_t unk0, unknown_t unk1, // refresh_rate = 0, 50, 59.9, etc. return 0; } -DECLARE_XBOXKRNL_EXPORT(VdSetDisplayModeOverride, - ExportTag::kVideo | ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(VdSetDisplayModeOverride, kVideo, kStub); dword_result_t VdInitializeEngines(unknown_t unk0, function_t callback, lpvoid_t arg, lpdword_t pfp_ptr, @@ -189,29 +188,27 @@ dword_result_t VdInitializeEngines(unknown_t unk0, function_t callback, // r7 = ME Microcode return 1; } -DECLARE_XBOXKRNL_EXPORT(VdInitializeEngines, - ExportTag::kVideo | ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(VdInitializeEngines, kVideo, kStub); void VdShutdownEngines() { // Ignored for now. // Games seem to call an Initialize/Shutdown pair to query info, then // re-initialize. } -DECLARE_XBOXKRNL_EXPORT(VdShutdownEngines, - ExportTag::kVideo | ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(VdShutdownEngines, kVideo, kStub); dword_result_t VdGetGraphicsAsicID() { // Games compare for < 0x10 and do VdInitializeEDRAM, else other // (retrain/etc). return 0x11; } -DECLARE_XBOXKRNL_EXPORT(VdGetGraphicsAsicID, ExportTag::kVideo); +DECLARE_XBOXKRNL_EXPORT1(VdGetGraphicsAsicID, kVideo, kStub); dword_result_t VdEnableDisableClockGating(dword_t enabled) { // Ignored, as it really doesn't matter. return 0; } -DECLARE_XBOXKRNL_EXPORT(VdEnableDisableClockGating, ExportTag::kVideo); +DECLARE_XBOXKRNL_EXPORT1(VdEnableDisableClockGating, kVideo, kStub); void VdSetGraphicsInterruptCallback(function_t callback, lpvoid_t user_data) { // callback takes 2 params @@ -220,7 +217,7 @@ void VdSetGraphicsInterruptCallback(function_t callback, lpvoid_t user_data) { auto graphics_system = kernel_state()->emulator()->graphics_system(); graphics_system->SetInterruptCallback(callback, user_data); } -DECLARE_XBOXKRNL_EXPORT(VdSetGraphicsInterruptCallback, ExportTag::kVideo); +DECLARE_XBOXKRNL_EXPORT1(VdSetGraphicsInterruptCallback, kVideo, kImplemented); void VdInitializeRingBuffer(lpvoid_t ptr, int_t log2_size) { // r3 = result of MmGetPhysicalAddress @@ -229,28 +226,27 @@ void VdInitializeRingBuffer(lpvoid_t ptr, int_t log2_size) { auto graphics_system = kernel_state()->emulator()->graphics_system(); graphics_system->InitializeRingBuffer(ptr, log2_size); } -DECLARE_XBOXKRNL_EXPORT(VdInitializeRingBuffer, ExportTag::kVideo); +DECLARE_XBOXKRNL_EXPORT1(VdInitializeRingBuffer, kVideo, kImplemented); void VdEnableRingBufferRPtrWriteBack(lpvoid_t ptr, int_t block_size) { // r4 = 6, usually --- <=19 auto graphics_system = kernel_state()->emulator()->graphics_system(); graphics_system->EnableReadPointerWriteBack(ptr, block_size); } -DECLARE_XBOXKRNL_EXPORT(VdEnableRingBufferRPtrWriteBack, ExportTag::kVideo); +DECLARE_XBOXKRNL_EXPORT1(VdEnableRingBufferRPtrWriteBack, kVideo, kImplemented); void VdGetSystemCommandBuffer(lpunknown_t p0_ptr, lpunknown_t p1_ptr) { p0_ptr.Zero(0x94); xe::store_and_swap(p0_ptr, 0xBEEF0000); xe::store_and_swap(p1_ptr, 0xBEEF0001); } -DECLARE_XBOXKRNL_EXPORT(VdGetSystemCommandBuffer, - ExportTag::kVideo | ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(VdGetSystemCommandBuffer, kVideo, kStub); void VdSetSystemCommandBufferGpuIdentifierAddress(lpunknown_t unk) { // r3 = 0x2B10(d3d?) + 8 } -DECLARE_XBOXKRNL_EXPORT(VdSetSystemCommandBufferGpuIdentifierAddress, - ExportTag::kVideo | ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(VdSetSystemCommandBufferGpuIdentifierAddress, kVideo, + kStub); // VdVerifyMEInitCommand // r3 @@ -281,8 +277,8 @@ dword_result_t VdInitializeScalerCommandBuffer( } return (uint32_t)dest_count; } -DECLARE_XBOXKRNL_EXPORT(VdInitializeScalerCommandBuffer, - ExportTag::kVideo | ExportTag::kSketchy); +DECLARE_XBOXKRNL_EXPORT2(VdInitializeScalerCommandBuffer, kVideo, kImplemented, + kSketchy); struct BufferScaling { xe::be fb_width; @@ -305,15 +301,14 @@ dword_result_t VdCallGraphicsNotificationRoutines( // callbacks get 0, r3, r4 return 0; } -DECLARE_XBOXKRNL_EXPORT(VdCallGraphicsNotificationRoutines, - ExportTag::kVideo | ExportTag::kSketchy); +DECLARE_XBOXKRNL_EXPORT2(VdCallGraphicsNotificationRoutines, kVideo, + kImplemented, kSketchy); dword_result_t VdIsHSIOTrainingSucceeded() { // BOOL return value return 1; } -DECLARE_XBOXKRNL_EXPORT(VdIsHSIOTrainingSucceeded, - ExportTag::kVideo | ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(VdIsHSIOTrainingSucceeded, kVideo, kStub); dword_result_t VdPersistDisplay(unknown_t unk0, lpdword_t unk1_ptr) { // unk1_ptr needs to be populated with a pointer passed to @@ -328,18 +323,16 @@ dword_result_t VdPersistDisplay(unknown_t unk0, lpdword_t unk1_ptr) { return 1; } -DECLARE_XBOXKRNL_EXPORT(VdPersistDisplay, - ExportTag::kVideo | ExportTag::kSketchy); +DECLARE_XBOXKRNL_EXPORT2(VdPersistDisplay, kVideo, kImplemented, kSketchy); dword_result_t VdRetrainEDRAMWorker(unknown_t unk0) { return 0; } -DECLARE_XBOXKRNL_EXPORT(VdRetrainEDRAMWorker, - ExportTag::kVideo | ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(VdRetrainEDRAMWorker, kVideo, kStub); dword_result_t VdRetrainEDRAM(unknown_t unk0, unknown_t unk1, unknown_t unk2, unknown_t unk3, unknown_t unk4, unknown_t unk5) { return 0; } -DECLARE_XBOXKRNL_EXPORT(VdRetrainEDRAM, ExportTag::kVideo | ExportTag::kStub); +DECLARE_XBOXKRNL_EXPORT1(VdRetrainEDRAM, kVideo, kStub); void VdSwap(lpvoid_t buffer_ptr, // ptr into primary ringbuffer lpvoid_t fetch_ptr, // frontbuffer texture fetch @@ -408,7 +401,7 @@ void VdSwap(lpvoid_t buffer_ptr, // ptr into primary ringbuffer dwords[i] = xenos::MakePacketType2(); } } -DECLARE_XBOXKRNL_EXPORT(VdSwap, ExportTag::kVideo | ExportTag::kImportant); +DECLARE_XBOXKRNL_EXPORT2(VdSwap, kVideo, kImplemented, kImportant); void RegisterVideoExports(xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {