[CPU/Kernel] Cleanup and rework of how kernel exports are declared.

This commit is contained in:
gibbed 2018-11-20 11:01:25 -06:00
parent 613be1425e
commit 394105d359
31 changed files with 399 additions and 502 deletions

View File

@ -19,9 +19,32 @@
namespace xe { namespace xe {
namespace cpu { 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 { struct ExportTag {
typedef uint32_t type; 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. // Export is implemented in some form and can be used.
static const type kImplemented = 1u << 0; static const type kImplemented = 1u << 0;
// Export is a stub and is probably bad. // Export is a stub and is probably bad.
@ -35,17 +58,6 @@ struct ExportTag {
// Export blocks the calling thread // Export blocks the calling thread
static const type kBlocking = 1u << 5; 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. // Export will be logged on each call.
static const type kLog = 1u << 30; static const type kLog = 1u << 30;
// Export's result will be logged on each call. // Export's result will be logged on each call.

View File

@ -531,15 +531,39 @@ xe::cpu::Export* RegisterExport(void (*fn)(Ps&...), const char* name,
using xe::cpu::ExportTag; 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( \ const auto EXPORT_##module_name##_##name = RegisterExport_##module_name( \
xe::kernel::shim::RegisterExport< \ xe::kernel::shim::RegisterExport< \
xe::kernel::shim::KernelModuleId::module_name, ordinals::name>( \ xe::kernel::shim::KernelModuleId::module_name, ordinals::name>( \
&name, #name, tags)); &name, #name, \
tags | (static_cast<xe::cpu::ExportTag::type>( \
xe::cpu::ExportCategory::category) \
<< xe::cpu::ExportTag::CategoryShift)));
#define DECLARE_XAM_EXPORT(name, tags) DECLARE_EXPORT(xam, name, tags) #define DECLARE_XAM_EXPORT_(name, category, tags) \
#define DECLARE_XBDM_EXPORT(name, tags) DECLARE_EXPORT(xbdm, name, tags) DECLARE_EXPORT(xam, name, category, tags)
#define DECLARE_XBOXKRNL_EXPORT(name, tags) DECLARE_EXPORT(xboxkrnl, name, 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 kernel
} // namespace xe } // namespace xe

View File

@ -28,12 +28,12 @@ dword_result_t XamAvatarInitialize(
// Negative to fail. Game should immediately call XamAvatarShutdown. // Negative to fail. Game should immediately call XamAvatarShutdown.
return ~0u; return ~0u;
} }
DECLARE_XAM_EXPORT(XamAvatarInitialize, ExportTag::kStub); DECLARE_XAM_EXPORT1(XamAvatarInitialize, kAvatars, kStub);
void XamAvatarShutdown() { void XamAvatarShutdown() {
// No-op. // No-op.
} }
DECLARE_XAM_EXPORT(XamAvatarShutdown, ExportTag::kStub); DECLARE_XAM_EXPORT1(XamAvatarShutdown, kAvatars, kStub);
void RegisterAvatarExports(xe::cpu::ExportResolver* export_resolver, void RegisterAvatarExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -197,7 +197,7 @@ dword_result_t XamContentCreateEnumerator(dword_t user_index, dword_t device_id,
*handle_out = e->handle(); *handle_out = e->handle();
return X_ERROR_SUCCESS; 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, dword_result_t XamContentCreateEx(dword_t user_index, lpstring_t root_name,
lpvoid_t content_data_ptr, dword_t flags, 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; 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, dword_result_t XamContentCreate(dword_t user_index, lpstring_t root_name,
lpvoid_t content_data_ptr, dword_t flags, 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, disposition_ptr, license_mask_ptr, 0, 0,
overlapped_ptr); 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, dword_result_t XamContentOpenFile(dword_t user_index, lpstring_t root_name,
lpstring_t path, dword_t flags, 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. // TODO(gibbed): arguments assumed based on XamContentCreate.
return X_ERROR_FILE_NOT_FOUND; 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, SHIM_CALL XamContentFlush_shim(PPCContext* ppc_context,
KernelState* kernel_state) { KernelState* kernel_state) {

View File

@ -32,12 +32,12 @@ dword_result_t XamGetSystemVersion() {
// 0x20096B00 // 0x20096B00
return 0; return 0;
} }
DECLARE_XAM_EXPORT(XamGetSystemVersion, ExportTag::kStub); DECLARE_XAM_EXPORT1(XamGetSystemVersion, kNone, kStub);
void XCustomRegisterDynamicActions() { void XCustomRegisterDynamicActions() {
// ??? // ???
} }
DECLARE_XAM_EXPORT(XCustomRegisterDynamicActions, ExportTag::kStub); DECLARE_XAM_EXPORT1(XCustomRegisterDynamicActions, kNone, kStub);
dword_result_t XGetAVPack() { dword_result_t XGetAVPack() {
// DWORD // DWORD
@ -47,10 +47,10 @@ dword_result_t XGetAVPack() {
// they explode with errors if not in PAL mode. // they explode with errors if not in PAL mode.
return 6; return 6;
} }
DECLARE_XAM_EXPORT(XGetAVPack, ExportTag::kStub); DECLARE_XAM_EXPORT1(XGetAVPack, kNone, kStub);
dword_result_t XGetGameRegion() { return 0xFFFF; } dword_result_t XGetGameRegion() { return 0xFFFF; }
DECLARE_XAM_EXPORT(XGetGameRegion, ExportTag::kStub); DECLARE_XAM_EXPORT1(XGetGameRegion, kNone, kStub);
dword_result_t XGetLanguage() { dword_result_t XGetLanguage() {
uint32_t desired_language = X_LANGUAGE_ENGLISH; uint32_t desired_language = X_LANGUAGE_ENGLISH;
@ -67,7 +67,7 @@ dword_result_t XGetLanguage() {
return desired_language; return desired_language;
} }
DECLARE_XAM_EXPORT(XGetLanguage, ExportTag::kImplemented); DECLARE_XAM_EXPORT1(XGetLanguage, kNone, kImplemented);
dword_result_t XamGetExecutionId(lpdword_t info_ptr) { dword_result_t XamGetExecutionId(lpdword_t info_ptr) {
auto module = kernel_state()->GetExecutableModule(); auto module = kernel_state()->GetExecutableModule();
@ -84,7 +84,7 @@ dword_result_t XamGetExecutionId(lpdword_t info_ptr) {
*info_ptr = guest_hdr_ptr; *info_ptr = guest_hdr_ptr;
return X_STATUS_SUCCESS; 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) { dword_result_t XamLoaderSetLaunchData(lpvoid_t data, dword_t size) {
auto xam = kernel_state()->GetKernelModule<XamModule>("xam.xex"); auto xam = kernel_state()->GetKernelModule<XamModule>("xam.xex");
@ -97,7 +97,7 @@ dword_result_t XamLoaderSetLaunchData(lpvoid_t data, dword_t size) {
// FIXME: Unknown return value. // FIXME: Unknown return value.
return 0; return 0;
} }
DECLARE_XAM_EXPORT(XamLoaderSetLaunchData, ExportTag::kSketchy); DECLARE_XAM_EXPORT1(XamLoaderSetLaunchData, kNone, kSketchy);
dword_result_t XamLoaderGetLaunchDataSize(lpdword_t size_ptr) { dword_result_t XamLoaderGetLaunchDataSize(lpdword_t size_ptr) {
auto xam = kernel_state()->GetKernelModule<XamModule>("xam.xex"); auto xam = kernel_state()->GetKernelModule<XamModule>("xam.xex");
@ -115,7 +115,7 @@ dword_result_t XamLoaderGetLaunchDataSize(lpdword_t size_ptr) {
*size_ptr = 0; *size_ptr = 0;
return X_ERROR_NOT_FOUND; 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_result_t XamLoaderGetLaunchData(lpvoid_t buffer_ptr,
dword_t buffer_size) { 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); std::memcpy(buffer_ptr, loader_data.launch_data.data(), copy_size);
return X_ERROR_SUCCESS; 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) { void XamLoaderLaunchTitle(lpstring_t raw_name, dword_t flags) {
auto xam = kernel_state()->GetKernelModule<XamModule>("xam.xex"); auto xam = kernel_state()->GetKernelModule<XamModule>("xam.xex");
@ -158,13 +158,13 @@ void XamLoaderLaunchTitle(lpstring_t raw_name, dword_t flags) {
// This function does not return. // This function does not return.
kernel_state()->TerminateTitle(); kernel_state()->TerminateTitle();
} }
DECLARE_XAM_EXPORT(XamLoaderLaunchTitle, ExportTag::kSketchy); DECLARE_XAM_EXPORT1(XamLoaderLaunchTitle, kNone, kSketchy);
void XamLoaderTerminateTitle() { void XamLoaderTerminateTitle() {
// This function does not return. // This function does not return.
kernel_state()->TerminateTitle(); 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) { dword_result_t XamAlloc(dword_t unk, dword_t size, lpdword_t out_ptr) {
assert_true(unk == 0); 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; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamAlloc, ExportTag::kImplemented); DECLARE_XAM_EXPORT1(XamAlloc, kMemory, kImplemented);
dword_result_t XamFree(lpdword_t ptr) { dword_result_t XamFree(lpdword_t ptr) {
kernel_state()->memory()->SystemHeapFree(ptr.guest_address()); kernel_state()->memory()->SystemHeapFree(ptr.guest_address());
return X_ERROR_SUCCESS; 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 // 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, 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; 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, dword_result_t XamCreateEnumeratorHandle(unknown_t unk1, unknown_t unk2,
unknown_t unk3, unknown_t unk4, 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) { unknown_t unk7, unknown_t unk8) {
return X_ERROR_INVALID_PARAMETER; return X_ERROR_INVALID_PARAMETER;
} }
DECLARE_XAM_EXPORT(XamCreateEnumeratorHandle, ExportTag::kStub); DECLARE_XAM_EXPORT1(XamCreateEnumeratorHandle, kNone, kStub);
dword_result_t XamGetPrivateEnumStructureFromHandle(unknown_t unk1, dword_result_t XamGetPrivateEnumStructureFromHandle(unknown_t unk1,
unknown_t unk2) { unknown_t unk2) {
return X_ERROR_INVALID_PARAMETER; return X_ERROR_INVALID_PARAMETER;
} }
DECLARE_XAM_EXPORT(XamGetPrivateEnumStructureFromHandle, ExportTag::kStub); DECLARE_XAM_EXPORT1(XamGetPrivateEnumStructureFromHandle, kNone, kStub);
void RegisterInfoExports(xe::cpu::ExportResolver* export_resolver, void RegisterInfoExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -31,13 +31,12 @@ constexpr uint32_t XINPUT_FLAG_ANY_USER = 1 << 30;
void XamResetInactivity() { void XamResetInactivity() {
// Do we need to do anything? // 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) { dword_result_t XamEnableInactivityProcessing(dword_t unk, dword_t enable) {
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamEnableInactivityProcessing, DECLARE_XAM_EXPORT1(XamEnableInactivityProcessing, kInput, kStub);
ExportTag::kInput | ExportTag::kStub);
// http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputgetcapabilities(v=vs.85).aspx // 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, 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(); auto input_system = kernel_state()->emulator()->input_system();
return input_system->GetCapabilities(actual_user_index, flags, caps); return input_system->GetCapabilities(actual_user_index, flags, caps);
} }
DECLARE_XAM_EXPORT(XamInputGetCapabilities, DECLARE_XAM_EXPORT1(XamInputGetCapabilities, kInput, kSketchy);
ExportTag::kInput | ExportTag::kSketchy);
dword_result_t XamInputGetCapabilitiesEx(dword_t unk, dword_t user_index, dword_result_t XamInputGetCapabilitiesEx(dword_t unk, dword_t user_index,
dword_t flags, 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(); auto input_system = kernel_state()->emulator()->input_system();
return input_system->GetCapabilities(actual_user_index, flags, caps); return input_system->GetCapabilities(actual_user_index, flags, caps);
} }
DECLARE_XAM_EXPORT(XamInputGetCapabilitiesEx, DECLARE_XAM_EXPORT1(XamInputGetCapabilitiesEx, kInput, kSketchy);
ExportTag::kInput | ExportTag::kSketchy);
// http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputgetstate(v=vs.85).aspx // 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, 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(); auto input_system = kernel_state()->emulator()->input_system();
return input_system->GetState(user_index, input_state); return input_system->GetState(user_index, input_state);
} }
DECLARE_XAM_EXPORT(XamInputGetState, DECLARE_XAM_EXPORT1(XamInputGetState, kInput, kImplemented);
ExportTag::kInput | ExportTag::kImplemented);
// http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputsetstate(v=vs.85).aspx // 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, 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(); auto input_system = kernel_state()->emulator()->input_system();
return input_system->SetState(user_index, vibration); return input_system->SetState(user_index, vibration);
} }
DECLARE_XAM_EXPORT(XamInputSetState, DECLARE_XAM_EXPORT1(XamInputSetState, kInput, kImplemented);
ExportTag::kInput | ExportTag::kImplemented);
// http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputgetkeystroke(v=vs.85).aspx // 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, 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(); auto input_system = kernel_state()->emulator()->input_system();
return input_system->GetKeystroke(user_index, flags, keystroke); return input_system->GetKeystroke(user_index, flags, keystroke);
} }
DECLARE_XAM_EXPORT(XamInputGetKeystroke, DECLARE_XAM_EXPORT1(XamInputGetKeystroke, kInput, kImplemented);
ExportTag::kInput | ExportTag::kImplemented);
// Same as non-ex, just takes a pointer to user index. // Same as non-ex, just takes a pointer to user index.
dword_result_t XamInputGetKeystrokeEx(lpdword_t user_index_ptr, dword_t flags, 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; return result;
} }
DECLARE_XAM_EXPORT(XamInputGetKeystrokeEx, DECLARE_XAM_EXPORT1(XamInputGetKeystrokeEx, kInput, kImplemented);
ExportTag::kInput | ExportTag::kImplemented);
X_HRESULT_result_t XamUserGetDeviceContext(dword_t user_index, dword_t unk, X_HRESULT_result_t XamUserGetDeviceContext(dword_t user_index, dword_t unk,
lpdword_t out_ptr) { 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; return X_E_DEVICE_NOT_CONNECTED;
} }
} }
DECLARE_XAM_EXPORT(XamUserGetDeviceContext, DECLARE_XAM_EXPORT1(XamUserGetDeviceContext, kInput, kStub);
ExportTag::kInput | ExportTag::kStub);
void RegisterInputExports(xe::cpu::ExportResolver* export_resolver, void RegisterInputExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -27,7 +27,7 @@ dword_result_t XMsgInProcessCall(dword_t app, dword_t message, dword_t arg1,
} }
return result; 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_result_t XMsgSystemProcessCall(dword_t app, dword_t message,
dword_t buffer, dword_t buffer_length) { dword_t buffer, dword_t buffer_length) {
@ -38,7 +38,7 @@ dword_result_t XMsgSystemProcessCall(dword_t app, dword_t message,
} }
return result; return result;
} }
DECLARE_XAM_EXPORT(XMsgSystemProcessCall, ExportTag::kImplemented); DECLARE_XAM_EXPORT1(XMsgSystemProcessCall, kNone, kImplemented);
dword_result_t XMsgStartIORequest(dword_t app, dword_t message, dword_result_t XMsgStartIORequest(dword_t app, dword_t message,
pointer_t<XAM_OVERLAPPED> overlapped_ptr, pointer_t<XAM_OVERLAPPED> overlapped_ptr,
@ -54,7 +54,7 @@ dword_result_t XMsgStartIORequest(dword_t app, dword_t message,
} }
return result; return result;
} }
DECLARE_XAM_EXPORT(XMsgStartIORequest, ExportTag::kImplemented); DECLARE_XAM_EXPORT1(XMsgStartIORequest, kNone, kImplemented);
dword_result_t XMsgStartIORequestEx(dword_t app, dword_t message, dword_result_t XMsgStartIORequestEx(dword_t app, dword_t message,
pointer_t<XAM_OVERLAPPED> overlapped_ptr, pointer_t<XAM_OVERLAPPED> overlapped_ptr,
@ -71,7 +71,7 @@ dword_result_t XMsgStartIORequestEx(dword_t app, dword_t message,
} }
return result; return result;
} }
DECLARE_XAM_EXPORT(XMsgStartIORequestEx, ExportTag::kImplemented); DECLARE_XAM_EXPORT1(XMsgStartIORequestEx, kNone, kImplemented);
dword_result_t XMsgCancelIORequest(pointer_t<XAM_OVERLAPPED> overlapped_ptr, dword_result_t XMsgCancelIORequest(pointer_t<XAM_OVERLAPPED> overlapped_ptr,
dword_t wait) { dword_t wait) {
@ -86,7 +86,7 @@ dword_result_t XMsgCancelIORequest(pointer_t<XAM_OVERLAPPED> overlapped_ptr,
return 0; return 0;
} }
DECLARE_XAM_EXPORT(XMsgCancelIORequest, ExportTag::kImplemented); DECLARE_XAM_EXPORT1(XMsgCancelIORequest, kNone, kImplemented);
void RegisterMsgExports(xe::cpu::ExportResolver* export_resolver, void RegisterMsgExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -170,8 +170,7 @@ dword_result_t NetDll_XNetStartup(dword_t caller,
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_XNetStartup, DECLARE_XAM_EXPORT1(NetDll_XNetStartup, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kImplemented);
dword_result_t NetDll_XNetCleanup(dword_t caller, lpvoid_t params) { dword_result_t NetDll_XNetCleanup(dword_t caller, lpvoid_t params) {
auto xam = kernel_state()->GetKernelModule<XamModule>("xam.xex"); auto xam = kernel_state()->GetKernelModule<XamModule>("xam.xex");
@ -183,8 +182,7 @@ dword_result_t NetDll_XNetCleanup(dword_t caller, lpvoid_t params) {
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_XNetCleanup, DECLARE_XAM_EXPORT1(NetDll_XNetCleanup, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kImplemented);
dword_result_t NetDll_XNetGetOpt(dword_t one, dword_t option_id, dword_result_t NetDll_XNetGetOpt(dword_t one, dword_t option_id,
lpvoid_t buffer_ptr, lpdword_t buffer_size) { 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 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_result_t NetDll_XNetRandom(dword_t caller, lpvoid_t buffer_ptr,
dword_t length) { dword_t length) {
@ -212,8 +210,7 @@ dword_result_t NetDll_XNetRandom(dword_t caller, lpvoid_t buffer_ptr,
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_XNetRandom, DECLARE_XAM_EXPORT1(NetDll_XNetRandom, kNetworking, kStub);
ExportTag::kNetworking | ExportTag::kStub);
dword_result_t NetDll_WSAStartup(dword_t caller, word_t version, dword_result_t NetDll_WSAStartup(dword_t caller, word_t version,
pointer_t<X_WSADATA> data_ptr) { pointer_t<X_WSADATA> data_ptr) {
@ -263,19 +260,16 @@ dword_result_t NetDll_WSAStartup(dword_t caller, word_t version,
return ret; return ret;
} }
DECLARE_XAM_EXPORT(NetDll_WSAStartup, DECLARE_XAM_EXPORT1(NetDll_WSAStartup, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kImplemented);
dword_result_t NetDll_WSACleanup(dword_t caller) { dword_result_t NetDll_WSACleanup(dword_t caller) {
// This does nothing. Xenia needs WSA running. // This does nothing. Xenia needs WSA running.
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_WSACleanup, DECLARE_XAM_EXPORT1(NetDll_WSACleanup, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kImplemented);
dword_result_t NetDll_WSAGetLastError() { return XThread::GetLastError(); } dword_result_t NetDll_WSAGetLastError() { return XThread::GetLastError(); }
DECLARE_XAM_EXPORT(NetDll_WSAGetLastError, DECLARE_XAM_EXPORT1(NetDll_WSAGetLastError, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kImplemented);
dword_result_t NetDll_WSARecvFrom(dword_t caller, dword_t socket, dword_result_t NetDll_WSARecvFrom(dword_t caller, dword_t socket,
pointer_t<XWSABUF> buffers_ptr, pointer_t<XWSABUF> buffers_ptr,
@ -295,7 +289,7 @@ dword_result_t NetDll_WSARecvFrom(dword_t caller, dword_t socket,
return 0; 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 // If the socket is a VDP socket, buffer 0 is the game data length, and buffer 1
// is the unencrypted game data. // is the unencrypted game data.
@ -340,8 +334,7 @@ dword_result_t NetDll_WSASendTo(dword_t caller, dword_t socket_handle,
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_WSASendTo, DECLARE_XAM_EXPORT1(NetDll_WSASendTo, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kImplemented);
dword_result_t NetDll_WSAWaitForMultipleEvents(dword_t num_events, dword_result_t NetDll_WSAWaitForMultipleEvents(dword_t num_events,
lpdword_t events, lpdword_t events,
@ -369,17 +362,15 @@ dword_result_t NetDll_WSAWaitForMultipleEvents(dword_t num_events,
} }
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_WSAWaitForMultipleEvents, ExportTag::kNetworking | DECLARE_XAM_EXPORT2(NetDll_WSAWaitForMultipleEvents, kNetworking, kImplemented,
ExportTag::kThreading | kBlocking);
ExportTag::kBlocking);
dword_result_t NetDll_WSACreateEvent() { dword_result_t NetDll_WSACreateEvent() {
XEvent* ev = new XEvent(kernel_state()); XEvent* ev = new XEvent(kernel_state());
ev->Initialize(true, false); ev->Initialize(true, false);
return ev->handle(); return ev->handle();
} }
DECLARE_XAM_EXPORT(NetDll_WSACreateEvent, DECLARE_XAM_EXPORT1(NetDll_WSACreateEvent, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kThreading);
dword_result_t NetDll_WSACloseEvent(dword_t event_handle) { dword_result_t NetDll_WSACloseEvent(dword_t event_handle) {
X_STATUS result = kernel_state()->object_table()->ReleaseHandle(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; return 1;
} }
DECLARE_XAM_EXPORT(NetDll_WSACloseEvent, DECLARE_XAM_EXPORT1(NetDll_WSACloseEvent, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kThreading);
dword_result_t NetDll_WSAResetEvent(dword_t event_handle) { dword_result_t NetDll_WSAResetEvent(dword_t event_handle) {
X_STATUS result = xboxkrnl::NtClearEvent(event_handle); X_STATUS result = xboxkrnl::NtClearEvent(event_handle);
@ -402,8 +392,7 @@ dword_result_t NetDll_WSAResetEvent(dword_t event_handle) {
} }
return 1; return 1;
} }
DECLARE_XAM_EXPORT(NetDll_WSAResetEvent, DECLARE_XAM_EXPORT1(NetDll_WSAResetEvent, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kThreading);
dword_result_t NetDll_WSASetEvent(dword_t event_handle) { dword_result_t NetDll_WSASetEvent(dword_t event_handle) {
X_STATUS result = xboxkrnl::NtSetEvent(event_handle, nullptr); X_STATUS result = xboxkrnl::NtSetEvent(event_handle, nullptr);
@ -414,8 +403,7 @@ dword_result_t NetDll_WSASetEvent(dword_t event_handle) {
} }
return 1; return 1;
} }
DECLARE_XAM_EXPORT(NetDll_WSASetEvent, DECLARE_XAM_EXPORT1(NetDll_WSASetEvent, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kThreading);
struct XnAddrStatus { struct XnAddrStatus {
// Address acquisition is not yet complete // Address acquisition is not yet complete
@ -452,8 +440,7 @@ dword_result_t NetDll_XNetGetTitleXnAddr(dword_t caller,
return XnAddrStatus::XNET_GET_XNADDR_STATIC; return XnAddrStatus::XNET_GET_XNADDR_STATIC;
} }
DECLARE_XAM_EXPORT(NetDll_XNetGetTitleXnAddr, DECLARE_XAM_EXPORT1(NetDll_XNetGetTitleXnAddr, kNetworking, kStub);
ExportTag::kNetworking | ExportTag::kStub);
dword_result_t NetDll_XNetGetDebugXnAddr(dword_t caller, dword_result_t NetDll_XNetGetDebugXnAddr(dword_t caller,
pointer_t<XNADDR> addr_ptr) { pointer_t<XNADDR> addr_ptr) {
@ -462,8 +449,7 @@ dword_result_t NetDll_XNetGetDebugXnAddr(dword_t caller,
// XNET_GET_XNADDR_NONE causes caller to gracefully return. // XNET_GET_XNADDR_NONE causes caller to gracefully return.
return XnAddrStatus::XNET_GET_XNADDR_NONE; return XnAddrStatus::XNET_GET_XNADDR_NONE;
} }
DECLARE_XAM_EXPORT(NetDll_XNetGetDebugXnAddr, DECLARE_XAM_EXPORT1(NetDll_XNetGetDebugXnAddr, kNetworking, kStub);
ExportTag::kNetworking | ExportTag::kStub);
dword_result_t NetDll_XNetXnAddrToMachineId(dword_t caller, dword_result_t NetDll_XNetXnAddrToMachineId(dword_t caller,
pointer_t<XNADDR> addr_ptr, pointer_t<XNADDR> 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) // Tell the caller we're not signed in to live (non-zero ret)
return 1; return 1;
} }
DECLARE_XAM_EXPORT(NetDll_XNetXnAddrToMachineId, DECLARE_XAM_EXPORT1(NetDll_XNetXnAddrToMachineId, kNetworking, kStub);
ExportTag::kNetworking | ExportTag::kStub);
void NetDll_XNetInAddrToString(dword_t caller, dword_t in_addr, void NetDll_XNetInAddrToString(dword_t caller, dword_t in_addr,
lpstring_t string_out, dword_t string_size) { lpstring_t string_out, dword_t string_size) {
strncpy(string_out, "666.666.666.666", string_size); strncpy(string_out, "666.666.666.666", string_size);
} }
DECLARE_XAM_EXPORT(NetDll_XNetInAddrToString, DECLARE_XAM_EXPORT1(NetDll_XNetInAddrToString, kNetworking, kStub);
ExportTag::kNetworking | ExportTag::kStub);
// This converts a XNet address to an IN_ADDR. The IN_ADDR is used for // 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) // 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) { lpvoid_t xid, lpvoid_t in_addr) {
return 1; return 1;
} }
DECLARE_XAM_EXPORT(NetDll_XNetXnAddrToInAddr, DECLARE_XAM_EXPORT1(NetDll_XNetXnAddrToInAddr, kNetworking, kStub);
ExportTag::kNetworking | ExportTag::kStub);
// Does the reverse of the above. // Does the reverse of the above.
// FIXME: Arguments may not be correct. // 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) { lpvoid_t xid) {
return 1; return 1;
} }
DECLARE_XAM_EXPORT(NetDll_XNetInAddrToXnAddr, DECLARE_XAM_EXPORT1(NetDll_XNetInAddrToXnAddr, kNetworking, kStub);
ExportTag::kNetworking | ExportTag::kStub);
// http://www.google.com/patents/WO2008112448A1?cl=en // http://www.google.com/patents/WO2008112448A1?cl=en
// Reserves a port for use by system link // Reserves a port for use by system link
dword_result_t NetDll_XNetSetSystemLinkPort(dword_t caller, dword_t port) { dword_result_t NetDll_XNetSetSystemLinkPort(dword_t caller, dword_t port) {
return 1; return 1;
} }
DECLARE_XAM_EXPORT(NetDll_XNetSetSystemLinkPort, DECLARE_XAM_EXPORT1(NetDll_XNetSetSystemLinkPort, kNetworking, kStub);
ExportTag::kNetworking | ExportTag::kStub);
// https://github.com/ILOVEPIE/Cxbx-Reloaded/blob/master/src/CxbxKrnl/EmuXOnline.h#L39 // https://github.com/ILOVEPIE/Cxbx-Reloaded/blob/master/src/CxbxKrnl/EmuXOnline.h#L39
struct XEthernetStatus { struct XEthernetStatus {
@ -519,8 +500,7 @@ struct XEthernetStatus {
}; };
dword_result_t NetDll_XNetGetEthernetLinkStatus(dword_t caller) { return 0; } dword_result_t NetDll_XNetGetEthernetLinkStatus(dword_t caller) { return 0; }
DECLARE_XAM_EXPORT(NetDll_XNetGetEthernetLinkStatus, DECLARE_XAM_EXPORT1(NetDll_XNetGetEthernetLinkStatus, kNetworking, kStub);
ExportTag::kStub | ExportTag::kNetworking);
dword_result_t NetDll_XNetDnsLookup(dword_t caller, lpstring_t host, dword_result_t NetDll_XNetDnsLookup(dword_t caller, lpstring_t host,
dword_t event_handle, lpdword_t pdns) { dword_t event_handle, lpdword_t pdns) {
@ -539,8 +519,7 @@ dword_result_t NetDll_XNetDnsLookup(dword_t caller, lpstring_t host,
} }
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_XNetDnsLookup, DECLARE_XAM_EXPORT1(NetDll_XNetDnsLookup, kNetworking, kStub);
ExportTag::kStub | ExportTag::kNetworking);
dword_result_t NetDll_XNetDnsRelease(dword_t caller, pointer_t<XNDNS> dns) { dword_result_t NetDll_XNetDnsRelease(dword_t caller, pointer_t<XNDNS> dns) {
if (!dns) { if (!dns) {
@ -549,8 +528,7 @@ dword_result_t NetDll_XNetDnsRelease(dword_t caller, pointer_t<XNDNS> dns) {
kernel_memory()->SystemHeapFree(dns.guest_address()); kernel_memory()->SystemHeapFree(dns.guest_address());
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_XNetDnsRelease, DECLARE_XAM_EXPORT1(NetDll_XNetDnsRelease, kNetworking, kStub);
ExportTag::kStub | ExportTag::kNetworking);
SHIM_CALL NetDll_XNetQosServiceLookup_shim(PPCContext* ppc_context, SHIM_CALL NetDll_XNetQosServiceLookup_shim(PPCContext* ppc_context,
KernelState* kernel_state) { KernelState* kernel_state) {
@ -571,15 +549,13 @@ dword_result_t NetDll_XNetQosListen(dword_t caller, lpvoid_t id, lpvoid_t data,
dword_t flags) { dword_t flags) {
return X_ERROR_FUNCTION_FAILED; return X_ERROR_FUNCTION_FAILED;
} }
DECLARE_XAM_EXPORT(NetDll_XNetQosListen, DECLARE_XAM_EXPORT1(NetDll_XNetQosListen, kNetworking, kStub);
ExportTag::kStub | ExportTag::kNetworking);
dword_result_t NetDll_inet_addr(lpstring_t addr_ptr) { dword_result_t NetDll_inet_addr(lpstring_t addr_ptr) {
uint32_t addr = inet_addr(addr_ptr); uint32_t addr = inet_addr(addr_ptr);
return xe::byte_swap(addr); return xe::byte_swap(addr);
} }
DECLARE_XAM_EXPORT(NetDll_inet_addr, DECLARE_XAM_EXPORT1(NetDll_inet_addr, kNetworking, kImplemented);
ExportTag::kImplemented | ExportTag::kNetworking);
dword_result_t NetDll_socket(dword_t caller, dword_t af, dword_t type, dword_result_t NetDll_socket(dword_t caller, dword_t af, dword_t type,
dword_t protocol) { dword_t protocol) {
@ -598,8 +574,7 @@ dword_result_t NetDll_socket(dword_t caller, dword_t af, dword_t type,
return socket->handle(); return socket->handle();
} }
DECLARE_XAM_EXPORT(NetDll_socket, DECLARE_XAM_EXPORT1(NetDll_socket, kNetworking, kImplemented);
ExportTag::kImplemented | ExportTag::kNetworking);
dword_result_t NetDll_closesocket(dword_t caller, dword_t socket_handle) { dword_result_t NetDll_closesocket(dword_t caller, dword_t socket_handle) {
auto socket = auto socket =
@ -616,8 +591,7 @@ dword_result_t NetDll_closesocket(dword_t caller, dword_t socket_handle) {
socket->ReleaseHandle(); socket->ReleaseHandle();
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_closesocket, DECLARE_XAM_EXPORT1(NetDll_closesocket, kNetworking, kImplemented);
ExportTag::kImplemented | ExportTag::kNetworking);
int_result_t NetDll_shutdown(dword_t caller, dword_t socket_handle, int_t how) { int_result_t NetDll_shutdown(dword_t caller, dword_t socket_handle, int_t how) {
auto socket = auto socket =
@ -639,8 +613,7 @@ int_result_t NetDll_shutdown(dword_t caller, dword_t socket_handle, int_t how) {
} }
return ret; return ret;
} }
DECLARE_XAM_EXPORT(NetDll_shutdown, DECLARE_XAM_EXPORT1(NetDll_shutdown, kNetworking, kImplemented);
ExportTag::kImplemented | ExportTag::kNetworking);
dword_result_t NetDll_setsockopt(dword_t caller, dword_t socket_handle, dword_result_t NetDll_setsockopt(dword_t caller, dword_t socket_handle,
dword_t level, dword_t optname, 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); X_STATUS status = socket->SetOption(level, optname, optval_ptr, optlen);
return XSUCCEEDED(status) ? 0 : -1; return XSUCCEEDED(status) ? 0 : -1;
} }
DECLARE_XAM_EXPORT(NetDll_setsockopt, DECLARE_XAM_EXPORT1(NetDll_setsockopt, kNetworking, kImplemented);
ExportTag::kImplemented | ExportTag::kNetworking);
dword_result_t NetDll_ioctlsocket(dword_t caller, dword_t socket_handle, dword_result_t NetDll_ioctlsocket(dword_t caller, dword_t socket_handle,
dword_t cmd, lpvoid_t arg_ptr) { dword_t cmd, lpvoid_t arg_ptr) {
@ -678,8 +650,7 @@ dword_result_t NetDll_ioctlsocket(dword_t caller, dword_t socket_handle,
// TODO // TODO
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_ioctlsocket, DECLARE_XAM_EXPORT1(NetDll_ioctlsocket, kNetworking, kImplemented);
ExportTag::kImplemented | ExportTag::kNetworking);
dword_result_t NetDll_bind(dword_t caller, dword_t socket_handle, dword_result_t NetDll_bind(dword_t caller, dword_t socket_handle,
pointer_t<XSOCKADDR_IN> name, dword_t namelen) { pointer_t<XSOCKADDR_IN> name, dword_t namelen) {
@ -700,8 +671,7 @@ dword_result_t NetDll_bind(dword_t caller, dword_t socket_handle,
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_bind, DECLARE_XAM_EXPORT1(NetDll_bind, kNetworking, kImplemented);
ExportTag::kImplemented | ExportTag::kNetworking);
dword_result_t NetDll_connect(dword_t caller, dword_t socket_handle, dword_result_t NetDll_connect(dword_t caller, dword_t socket_handle,
pointer_t<XSOCKADDR> name, dword_t namelen) { pointer_t<XSOCKADDR> name, dword_t namelen) {
@ -722,8 +692,7 @@ dword_result_t NetDll_connect(dword_t caller, dword_t socket_handle,
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_connect, DECLARE_XAM_EXPORT1(NetDll_connect, kNetworking, kImplemented);
ExportTag::kImplemented | ExportTag::kNetworking);
dword_result_t NetDll_listen(dword_t caller, dword_t socket_handle, dword_result_t NetDll_listen(dword_t caller, dword_t socket_handle,
int_t backlog) { int_t backlog) {
@ -743,8 +712,7 @@ dword_result_t NetDll_listen(dword_t caller, dword_t socket_handle,
return 0; return 0;
} }
DECLARE_XAM_EXPORT(NetDll_listen, DECLARE_XAM_EXPORT1(NetDll_listen, kNetworking, kImplemented);
ExportTag::kImplemented | ExportTag::kNetworking);
dword_result_t NetDll_accept(dword_t caller, dword_t socket_handle, dword_result_t NetDll_accept(dword_t caller, dword_t socket_handle,
pointer_t<XSOCKADDR> addr_ptr, pointer_t<XSOCKADDR> addr_ptr,
@ -776,8 +744,7 @@ dword_result_t NetDll_accept(dword_t caller, dword_t socket_handle,
return -1; return -1;
} }
} }
DECLARE_XAM_EXPORT(NetDll_accept, DECLARE_XAM_EXPORT1(NetDll_accept, kNetworking, kImplemented);
ExportTag::kImplemented | ExportTag::kNetworking);
struct x_fd_set { struct x_fd_set {
xe::be<uint32_t> fd_count; xe::be<uint32_t> 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? // TODO(gibbed): modify ret to be what's actually copied to the guest fd_sets?
return ret; return ret;
} }
DECLARE_XAM_EXPORT(NetDll_select, DECLARE_XAM_EXPORT1(NetDll_select, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kImplemented);
dword_result_t NetDll_recv(dword_t caller, dword_t socket_handle, dword_result_t NetDll_recv(dword_t caller, dword_t socket_handle,
lpvoid_t buf_ptr, dword_t buf_len, dword_t flags) { 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); return socket->Recv(buf_ptr, buf_len, flags);
} }
DECLARE_XAM_EXPORT(NetDll_recv, DECLARE_XAM_EXPORT1(NetDll_recv, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kImplemented);
dword_result_t NetDll_recvfrom(dword_t caller, dword_t socket_handle, dword_result_t NetDll_recvfrom(dword_t caller, dword_t socket_handle,
lpvoid_t buf_ptr, dword_t buf_len, dword_t flags, 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; return ret;
} }
DECLARE_XAM_EXPORT(NetDll_recvfrom, DECLARE_XAM_EXPORT1(NetDll_recvfrom, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kImplemented);
dword_result_t NetDll_send(dword_t caller, dword_t socket_handle, dword_result_t NetDll_send(dword_t caller, dword_t socket_handle,
lpvoid_t buf_ptr, dword_t buf_len, dword_t flags) { 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); return socket->Send(buf_ptr, buf_len, flags);
} }
DECLARE_XAM_EXPORT(NetDll_send, DECLARE_XAM_EXPORT1(NetDll_send, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kImplemented);
dword_result_t NetDll_sendto(dword_t caller, dword_t socket_handle, dword_result_t NetDll_sendto(dword_t caller, dword_t socket_handle,
lpvoid_t buf_ptr, dword_t buf_len, dword_t flags, 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); N_XSOCKADDR_IN native_to(to_ptr);
return socket->SendTo(buf_ptr, buf_len, flags, &native_to, to_len); return socket->SendTo(buf_ptr, buf_len, flags, &native_to, to_len);
} }
DECLARE_XAM_EXPORT(NetDll_sendto, DECLARE_XAM_EXPORT1(NetDll_sendto, kNetworking, kImplemented);
ExportTag::kNetworking | ExportTag::kImplemented);
void RegisterNetExports(xe::cpu::ExportResolver* export_resolver, void RegisterNetExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) { KernelState* kernel_state) {

View File

@ -30,7 +30,7 @@ dword_result_t XamNotifyCreateListener(qword_t mask, dword_t one) {
return handle; return handle;
} }
DECLARE_XAM_EXPORT(XamNotifyCreateListener, ExportTag::kImplemented); DECLARE_XAM_EXPORT1(XamNotifyCreateListener, kNone, kImplemented);
// http://ffplay360.googlecode.com/svn/Test/Common/AtgSignIn.cpp // http://ffplay360.googlecode.com/svn/Test/Common/AtgSignIn.cpp
dword_result_t XNotifyGetNext(dword_t handle, dword_t match_id, 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; return dequeued ? 1 : 0;
} }
DECLARE_XAM_EXPORT(XNotifyGetNext, DECLARE_XAM_EXPORT2(XNotifyGetNext, kNone, kImplemented, kHighFrequency);
ExportTag::kImplemented | ExportTag::kHighFrequency);
dword_result_t XNotifyDelayUI(dword_t delay_ms) { dword_result_t XNotifyDelayUI(dword_t delay_ms) {
// Ignored. // Ignored.
return 0; return 0;
} }
DECLARE_XAM_EXPORT(XNotifyDelayUI, ExportTag::kStub); DECLARE_XAM_EXPORT1(XNotifyDelayUI, kNone, kStub);
void XNotifyPositionUI(dword_t position) { void XNotifyPositionUI(dword_t position) {
// Ignored. // Ignored.
} }
DECLARE_XAM_EXPORT(XNotifyPositionUI, ExportTag::kStub); DECLARE_XAM_EXPORT1(XNotifyPositionUI, kNone, kStub);
void RegisterNotifyExports(xe::cpu::ExportResolver* export_resolver, void RegisterNotifyExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -36,7 +36,7 @@ void XamNuiGetDeviceStatus(pointer_t<X_NUI_DEVICE_STATUS> status_ptr) {
status_ptr.Zero(); status_ptr.Zero();
status_ptr->status = 0; // Not connected. 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, dword_result_t XamShowNuiTroubleshooterUI(unknown_t unk1, unknown_t unk2,
unknown_t unk3) { unknown_t unk3) {
@ -61,7 +61,7 @@ dword_result_t XamShowNuiTroubleshooterUI(unknown_t unk1, unknown_t unk2,
return 0; return 0;
} }
DECLARE_XAM_EXPORT(XamShowNuiTroubleshooterUI, ExportTag::kStub); DECLARE_XAM_EXPORT1(XamShowNuiTroubleshooterUI, kNone, kStub);
void RegisterNuiExports(xe::cpu::ExportResolver* export_resolver, void RegisterNuiExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -285,7 +285,7 @@ dword_result_t XamShowKeyboardUI(dword_t user_index, dword_t flags,
return X_ERROR_SUCCESS; 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_result_t XamShowDeviceSelectorUI(dword_t user_index, dword_t content_type,
dword_t content_flags, dword_t content_flags,
@ -316,7 +316,7 @@ dword_result_t XamShowDeviceSelectorUI(dword_t user_index, dword_t content_type,
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
} }
DECLARE_XAM_EXPORT(XamShowDeviceSelectorUI, ExportTag::kImplemented); DECLARE_XAM_EXPORT1(XamShowDeviceSelectorUI, kUI, kImplemented);
SHIM_CALL XamShowDirtyDiscErrorUI_shim(PPCContext* ppc_context, SHIM_CALL XamShowDirtyDiscErrorUI_shim(PPCContext* ppc_context,
KernelState* kernel_state) { KernelState* kernel_state) {

View File

@ -32,8 +32,7 @@ X_HRESULT_result_t XamUserGetXUID(dword_t user_index, dword_t unk,
} }
return X_E_SUCCESS; return X_E_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamUserGetXUID, DECLARE_XAM_EXPORT1(XamUserGetXUID, kUserProfiles, kImplemented);
ExportTag::kUserProfiles | ExportTag::kImplemented);
dword_result_t XamUserGetSigninState(dword_t user_index) { dword_result_t XamUserGetSigninState(dword_t user_index) {
// Yield, as some games spam this. // Yield, as some games spam this.
@ -50,8 +49,7 @@ dword_result_t XamUserGetSigninState(dword_t user_index) {
return 0; return 0;
} }
} }
DECLARE_XAM_EXPORT(XamUserGetSigninState, DECLARE_XAM_EXPORT1(XamUserGetSigninState, kUserProfiles, kImplemented);
ExportTag::kUserProfiles | ExportTag::kImplemented);
typedef struct { typedef struct {
xe::be<uint64_t> xuid; xe::be<uint64_t> 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); std::strncpy(info->name, user_profile->name().data(), 15);
return X_E_SUCCESS; return X_E_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamUserGetSigninInfo, DECLARE_XAM_EXPORT1(XamUserGetSigninInfo, kUserProfiles, kImplemented);
ExportTag::kUserProfiles | ExportTag::kImplemented);
dword_result_t XamUserGetName(dword_t user_index, lpstring_t buffer, dword_result_t XamUserGetName(dword_t user_index, lpstring_t buffer,
dword_t buffer_len) { 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); std::strncpy(buffer, user_profile->name().data(), buffer_len);
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamUserGetName, DECLARE_XAM_EXPORT1(XamUserGetName, kUserProfiles, kImplemented);
ExportTag::kUserProfiles | ExportTag::kImplemented);
typedef struct { typedef struct {
xe::be<uint32_t> setting_count; xe::be<uint32_t> setting_count;
@ -227,8 +223,7 @@ dword_result_t XamUserReadProfileSettings(
} }
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamUserReadProfileSettings, DECLARE_XAM_EXPORT1(XamUserReadProfileSettings, kUserProfiles, kImplemented);
ExportTag::kUserProfiles | ExportTag::kImplemented);
typedef struct { typedef struct {
xe::be<uint32_t> from; xe::be<uint32_t> from;
@ -332,8 +327,7 @@ dword_result_t XamUserWriteProfileSettings(
} }
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamUserWriteProfileSettings, DECLARE_XAM_EXPORT1(XamUserWriteProfileSettings, kUserProfiles, kImplemented);
ExportTag::kUserProfiles | ExportTag::kImplemented);
dword_result_t XamUserCheckPrivilege(dword_t user_index, dword_t mask, dword_result_t XamUserCheckPrivilege(dword_t user_index, dword_t mask,
lpdword_t out_value) { lpdword_t out_value) {
@ -351,8 +345,7 @@ dword_result_t XamUserCheckPrivilege(dword_t user_index, dword_t mask,
*out_value = 0; *out_value = 0;
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamUserCheckPrivilege, DECLARE_XAM_EXPORT1(XamUserCheckPrivilege, kUserProfiles, kStub);
ExportTag::kUserProfiles | ExportTag::kStub);
dword_result_t XamUserContentRestrictionGetFlags(dword_t user_index, dword_result_t XamUserContentRestrictionGetFlags(dword_t user_index,
lpdword_t out_flags) { lpdword_t out_flags) {
@ -370,8 +363,7 @@ dword_result_t XamUserContentRestrictionGetFlags(dword_t user_index,
*out_flags = 0; *out_flags = 0;
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamUserContentRestrictionGetFlags, DECLARE_XAM_EXPORT1(XamUserContentRestrictionGetFlags, kUserProfiles, kStub);
ExportTag::kUserProfiles | ExportTag::kStub);
dword_result_t XamUserContentRestrictionGetRating(dword_t user_index, dword_result_t XamUserContentRestrictionGetRating(dword_t user_index,
dword_t unk1, dword_t unk1,
@ -393,8 +385,7 @@ dword_result_t XamUserContentRestrictionGetRating(dword_t user_index,
*out_unk3 = 0; *out_unk3 = 0;
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamUserContentRestrictionGetRating, DECLARE_XAM_EXPORT1(XamUserContentRestrictionGetRating, kUserProfiles, kStub);
ExportTag::kUserProfiles | ExportTag::kStub);
dword_result_t XamUserContentRestrictionCheckAccess(dword_t user_index, dword_result_t XamUserContentRestrictionCheckAccess(dword_t user_index,
dword_t unk1, dword_t unk2, dword_t unk1, dword_t unk2,
@ -411,8 +402,7 @@ dword_result_t XamUserContentRestrictionCheckAccess(dword_t user_index,
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamUserContentRestrictionCheckAccess, DECLARE_XAM_EXPORT1(XamUserContentRestrictionCheckAccess, kUserProfiles, kStub);
ExportTag::kUserProfiles | ExportTag::kStub);
dword_result_t XamUserAreUsersFriends(dword_t user_index, dword_t unk1, dword_result_t XamUserAreUsersFriends(dword_t user_index, dword_t unk1,
dword_t unk2, lpdword_t out_value, dword_t unk2, lpdword_t out_value,
@ -446,8 +436,7 @@ dword_result_t XamUserAreUsersFriends(dword_t user_index, dword_t unk1,
} }
return result; return result;
} }
DECLARE_XAM_EXPORT(XamUserAreUsersFriends, DECLARE_XAM_EXPORT1(XamUserAreUsersFriends, kUserProfiles, kStub);
ExportTag::kUserProfiles | ExportTag::kStub);
dword_result_t XamShowSigninUI(dword_t unk, dword_t unk_mask) { dword_result_t XamShowSigninUI(dword_t unk, dword_t unk_mask) {
// Mask values vary. Probably matching user types? Local/remote? // 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); kernel_state()->BroadcastNotification(0x00000009, 0);
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamShowSigninUI, DECLARE_XAM_EXPORT1(XamShowSigninUI, kUserProfiles, kStub);
ExportTag::kUserProfiles | ExportTag::kStub);
dword_result_t XamUserCreateAchievementEnumerator(dword_t title_id, dword_result_t XamUserCreateAchievementEnumerator(dword_t title_id,
dword_t user_index, dword_t user_index,
@ -476,8 +464,8 @@ dword_result_t XamUserCreateAchievementEnumerator(dword_t title_id,
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamUserCreateAchievementEnumerator, DECLARE_XAM_EXPORT1(XamUserCreateAchievementEnumerator, kUserProfiles,
ExportTag::kUserProfiles | ExportTag::kSketchy); kSketchy);
dword_result_t XamParseGamerTileKey(lpdword_t key_ptr, lpdword_t out1_ptr, dword_result_t XamParseGamerTileKey(lpdword_t key_ptr, lpdword_t out1_ptr,
lpdword_t out2_ptr, lpdword_t out3_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; *out3_ptr = 0xC0DE0003;
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamParseGamerTileKey, DECLARE_XAM_EXPORT1(XamParseGamerTileKey, kUserProfiles, kStub);
ExportTag::kUserProfiles | ExportTag::kStub);
dword_result_t XamReadTileToTexture(dword_t unk1, dword_t unk2, dword_t unk3, dword_result_t XamReadTileToTexture(dword_t unk1, dword_t unk2, dword_t unk3,
dword_t unk4, lpvoid_t buffer_ptr, 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; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamReadTileToTexture, DECLARE_XAM_EXPORT1(XamReadTileToTexture, kUserProfiles, kStub);
ExportTag::kUserProfiles | ExportTag::kStub);
dword_result_t XamWriteGamerTile(dword_t arg1, dword_t arg2, dword_t arg3, dword_result_t XamWriteGamerTile(dword_t arg1, dword_t arg2, dword_t arg3,
dword_t arg4, dword_t arg5, 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; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamWriteGamerTile, DECLARE_XAM_EXPORT1(XamWriteGamerTile, kUserProfiles, kStub);
ExportTag::kUserProfiles | ExportTag::kStub);
dword_result_t XamSessionCreateHandle(lpdword_t handle_ptr) { dword_result_t XamSessionCreateHandle(lpdword_t handle_ptr) {
*handle_ptr = 0xCAFEDEAD; *handle_ptr = 0xCAFEDEAD;
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XAM_EXPORT(XamSessionCreateHandle, DECLARE_XAM_EXPORT1(XamSessionCreateHandle, kUserProfiles, kStub);
ExportTag::kUserProfiles | ExportTag::kStub);
dword_result_t XamSessionRefObjByHandle(dword_t handle, lpdword_t obj_ptr) { dword_result_t XamSessionRefObjByHandle(dword_t handle, lpdword_t obj_ptr) {
assert_true(handle == 0xCAFEDEAD); assert_true(handle == 0xCAFEDEAD);
*obj_ptr = 0; *obj_ptr = 0;
return X_ERROR_FUNCTION_FAILED; return X_ERROR_FUNCTION_FAILED;
} }
DECLARE_XAM_EXPORT(XamSessionRefObjByHandle, DECLARE_XAM_EXPORT1(XamSessionRefObjByHandle, kUserProfiles, kStub);
ExportTag::kUserProfiles | ExportTag::kStub);
} // namespace xam } // namespace xam
} // namespace kernel } // namespace kernel

View File

@ -22,10 +22,10 @@ void XGetVideoMode(pointer_t<X_VIDEO_MODE> video_mode) {
// TODO(benvanik): actually check to see if these are the same. // TODO(benvanik): actually check to see if these are the same.
xboxkrnl::VdQueryVideoMode(std::move(video_mode)); 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; } 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, void RegisterVideoExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -21,7 +21,7 @@ dword_result_t XamVoiceIsActiveProcess() {
// Returning 0 here will short-circuit a bunch of voice stuff. // Returning 0 here will short-circuit a bunch of voice stuff.
return 0; return 0;
} }
DECLARE_XAM_EXPORT(XamVoiceIsActiveProcess, ExportTag::kStub); DECLARE_XAM_EXPORT1(XamVoiceIsActiveProcess, kNone, kStub);
dword_result_t XamVoiceCreate(unknown_t unk1, // 0 dword_result_t XamVoiceCreate(unknown_t unk1, // 0
unknown_t unk2, // 0xF unknown_t unk2, // 0xF
@ -30,13 +30,13 @@ dword_result_t XamVoiceCreate(unknown_t unk1, // 0
out_voice_ptr.Zero(); out_voice_ptr.Zero();
return X_ERROR_ACCESS_DENIED; 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; } 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; } 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, void RegisterVoiceExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -19,30 +19,28 @@ namespace kernel {
namespace xbdm { namespace xbdm {
void DmCloseLoadedModules(lpdword_t unk0_ptr) {} 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) {} void DmSendNotificationString(lpdword_t unk0_ptr) {}
DECLARE_XBDM_EXPORT(DmSendNotificationString, DECLARE_XBDM_EXPORT1(DmSendNotificationString, kDebug, kStub);
ExportTag::kStub | ExportTag::kDebug);
dword_result_t DmWalkLoadedModules(lpdword_t unk0_ptr, lpdword_t unk1_ptr) { dword_result_t DmWalkLoadedModules(lpdword_t unk0_ptr, lpdword_t unk1_ptr) {
return X_STATUS_INVALID_PARAMETER; 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) { dword_result_t DmCaptureStackBackTrace(lpdword_t unk0_ptr, lpdword_t unk1_ptr) {
return X_STATUS_INVALID_PARAMETER; return X_STATUS_INVALID_PARAMETER;
} }
DECLARE_XBDM_EXPORT(DmCaptureStackBackTrace, DECLARE_XBDM_EXPORT1(DmCaptureStackBackTrace, kDebug, kStub);
ExportTag::kStub | ExportTag::kDebug);
void DmMapDevkitDrive() {} 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) { dword_result_t DmFindPdbSignature(lpdword_t unk0_ptr, lpdword_t unk1_ptr) {
return X_STATUS_INVALID_PARAMETER; 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, void RegisterMiscExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -23,8 +23,7 @@ dword_result_t XAudioGetSpeakerConfig(lpdword_t config_ptr) {
*config_ptr = 0x00010001; *config_ptr = 0x00010001;
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(XAudioGetSpeakerConfig, DECLARE_XBOXKRNL_EXPORT1(XAudioGetSpeakerConfig, kAudio, kImplemented);
ExportTag::kImplemented | ExportTag::kAudio);
dword_result_t XAudioGetVoiceCategoryVolumeChangeMask(lpunknown_t driver_ptr, dword_result_t XAudioGetVoiceCategoryVolumeChangeMask(lpunknown_t driver_ptr,
lpdword_t out_ptr) { lpdword_t out_ptr) {
@ -37,9 +36,8 @@ dword_result_t XAudioGetVoiceCategoryVolumeChangeMask(lpunknown_t driver_ptr,
*out_ptr = 0; *out_ptr = 0;
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(XAudioGetVoiceCategoryVolumeChangeMask, DECLARE_XBOXKRNL_EXPORT2(XAudioGetVoiceCategoryVolumeChangeMask, kAudio, kStub,
ExportTag::kStub | ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XAudioGetVoiceCategoryVolume(dword_t unk, lpfloat_t out_ptr) { dword_result_t XAudioGetVoiceCategoryVolume(dword_t unk, lpfloat_t out_ptr) {
// Expects a floating point single. Volume %? // 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; return X_ERROR_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(XAudioGetVoiceCategoryVolume, DECLARE_XBOXKRNL_EXPORT1(XAudioGetVoiceCategoryVolume, kAudio, kStub);
ExportTag::kStub | ExportTag::kAudio);
dword_result_t XAudioEnableDucker(dword_t unk) { return X_ERROR_SUCCESS; } dword_result_t XAudioEnableDucker(dword_t unk) { return X_ERROR_SUCCESS; }
DECLARE_XBOXKRNL_EXPORT(XAudioEnableDucker, DECLARE_XBOXKRNL_EXPORT1(XAudioEnableDucker, kAudio, kStub);
ExportTag::kStub | ExportTag::kAudio);
dword_result_t XAudioRegisterRenderDriverClient(lpdword_t callback_ptr, dword_result_t XAudioRegisterRenderDriverClient(lpdword_t callback_ptr,
lpdword_t driver_ptr) { lpdword_t driver_ptr) {
@ -71,8 +67,8 @@ dword_result_t XAudioRegisterRenderDriverClient(lpdword_t callback_ptr,
*driver_ptr = 0x41550000 | (static_cast<uint32_t>(index) & 0x0000FFFF); *driver_ptr = 0x41550000 | (static_cast<uint32_t>(index) & 0x0000FFFF);
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(XAudioRegisterRenderDriverClient, DECLARE_XBOXKRNL_EXPORT1(XAudioRegisterRenderDriverClient, kAudio,
ExportTag::kImplemented | ExportTag::kAudio); kImplemented);
dword_result_t XAudioUnregisterRenderDriverClient(lpunknown_t driver_ptr) { dword_result_t XAudioUnregisterRenderDriverClient(lpunknown_t driver_ptr) {
assert_true((driver_ptr.guest_address() & 0xFFFF0000) == 0x41550000); 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); audio_system->UnregisterClient(driver_ptr.guest_address() & 0x0000FFFF);
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(XAudioUnregisterRenderDriverClient, DECLARE_XBOXKRNL_EXPORT1(XAudioUnregisterRenderDriverClient, kAudio,
ExportTag::kImplemented | ExportTag::kAudio); kImplemented);
dword_result_t XAudioSubmitRenderDriverFrame(lpunknown_t driver_ptr, dword_result_t XAudioSubmitRenderDriverFrame(lpunknown_t driver_ptr,
lpunknown_t samples_ptr) { lpunknown_t samples_ptr) {
@ -94,9 +90,8 @@ dword_result_t XAudioSubmitRenderDriverFrame(lpunknown_t driver_ptr,
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(XAudioSubmitRenderDriverFrame, DECLARE_XBOXKRNL_EXPORT2(XAudioSubmitRenderDriverFrame, kAudio, kImplemented,
ExportTag::kImplemented | ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
void RegisterAudioExports(xe::cpu::ExportResolver* export_resolver, void RegisterAudioExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) { KernelState* kernel_state) {

View File

@ -66,18 +66,16 @@ dword_result_t XMACreateContext(lpdword_t context_out_ptr) {
} }
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(XMACreateContext, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMACreateContext, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMAReleaseContext(lpvoid_t context_ptr) { dword_result_t XMAReleaseContext(lpvoid_t context_ptr) {
auto xma_decoder = kernel_state()->emulator()->audio_system()->xma_decoder(); auto xma_decoder = kernel_state()->emulator()->audio_system()->xma_decoder();
xma_decoder->ReleaseContext(context_ptr); xma_decoder->ReleaseContext(context_ptr);
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMAReleaseContext, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMAReleaseContext, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
void StoreXmaContextIndexedRegister(KernelState* kernel_state, void StoreXmaContextIndexedRegister(KernelState* kernel_state,
uint32_t base_reg, uint32_t context_ptr) { uint32_t base_reg, uint32_t context_ptr) {
@ -147,9 +145,8 @@ dword_result_t XMAInitializeContext(lpvoid_t context_ptr,
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMAInitializeContext, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMAInitializeContext, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMASetLoopData(lpvoid_t context_ptr, dword_result_t XMASetLoopData(lpvoid_t context_ptr,
pointer_t<XMA_CONTEXT_DATA> loop_data) { pointer_t<XMA_CONTEXT_DATA> loop_data) {
@ -165,17 +162,14 @@ dword_result_t XMASetLoopData(lpvoid_t context_ptr,
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMASetLoopData, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMASetLoopData, kAudio, kImplemented, kHighFrequency);
ExportTag::kAudio |
ExportTag::kHighFrequency);
dword_result_t XMAGetInputBufferReadOffset(lpvoid_t context_ptr) { dword_result_t XMAGetInputBufferReadOffset(lpvoid_t context_ptr) {
XMA_CONTEXT_DATA context(context_ptr); XMA_CONTEXT_DATA context(context_ptr);
return context.input_buffer_read_offset; return context.input_buffer_read_offset;
} }
DECLARE_XBOXKRNL_EXPORT(XMAGetInputBufferReadOffset, DECLARE_XBOXKRNL_EXPORT2(XMAGetInputBufferReadOffset, kAudio, kImplemented,
ExportTag::kImplemented | ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMASetInputBufferReadOffset(lpvoid_t context_ptr, dword_result_t XMASetInputBufferReadOffset(lpvoid_t context_ptr,
dword_t value) { dword_t value) {
@ -185,9 +179,8 @@ dword_result_t XMASetInputBufferReadOffset(lpvoid_t context_ptr,
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMASetInputBufferReadOffset, DECLARE_XBOXKRNL_EXPORT2(XMASetInputBufferReadOffset, kAudio, kImplemented,
ExportTag::kImplemented | ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMASetInputBuffer0(lpvoid_t context_ptr, lpvoid_t buffer, dword_result_t XMASetInputBuffer0(lpvoid_t context_ptr, lpvoid_t buffer,
dword_t packet_count) { dword_t packet_count) {
@ -200,17 +193,15 @@ dword_result_t XMASetInputBuffer0(lpvoid_t context_ptr, lpvoid_t buffer,
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMASetInputBuffer0, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMASetInputBuffer0, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMAIsInputBuffer0Valid(lpvoid_t context_ptr) { dword_result_t XMAIsInputBuffer0Valid(lpvoid_t context_ptr) {
XMA_CONTEXT_DATA context(context_ptr); XMA_CONTEXT_DATA context(context_ptr);
return context.input_buffer_0_valid; return context.input_buffer_0_valid;
} }
DECLARE_XBOXKRNL_EXPORT(XMAIsInputBuffer0Valid, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMAIsInputBuffer0Valid, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMASetInputBuffer0Valid(lpvoid_t context_ptr) { dword_result_t XMASetInputBuffer0Valid(lpvoid_t context_ptr) {
XMA_CONTEXT_DATA context(context_ptr); XMA_CONTEXT_DATA context(context_ptr);
@ -219,9 +210,8 @@ dword_result_t XMASetInputBuffer0Valid(lpvoid_t context_ptr) {
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMASetInputBuffer0Valid, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMASetInputBuffer0Valid, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMASetInputBuffer1(lpvoid_t context_ptr, lpvoid_t buffer, dword_result_t XMASetInputBuffer1(lpvoid_t context_ptr, lpvoid_t buffer,
dword_t packet_count) { dword_t packet_count) {
@ -234,17 +224,15 @@ dword_result_t XMASetInputBuffer1(lpvoid_t context_ptr, lpvoid_t buffer,
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMASetInputBuffer1, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMASetInputBuffer1, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMAIsInputBuffer1Valid(lpvoid_t context_ptr) { dword_result_t XMAIsInputBuffer1Valid(lpvoid_t context_ptr) {
XMA_CONTEXT_DATA context(context_ptr); XMA_CONTEXT_DATA context(context_ptr);
return context.input_buffer_1_valid; return context.input_buffer_1_valid;
} }
DECLARE_XBOXKRNL_EXPORT(XMAIsInputBuffer1Valid, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMAIsInputBuffer1Valid, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMASetInputBuffer1Valid(lpvoid_t context_ptr) { dword_result_t XMASetInputBuffer1Valid(lpvoid_t context_ptr) {
XMA_CONTEXT_DATA context(context_ptr); XMA_CONTEXT_DATA context(context_ptr);
@ -253,17 +241,15 @@ dword_result_t XMASetInputBuffer1Valid(lpvoid_t context_ptr) {
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMASetInputBuffer1Valid, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMASetInputBuffer1Valid, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMAIsOutputBufferValid(lpvoid_t context_ptr) { dword_result_t XMAIsOutputBufferValid(lpvoid_t context_ptr) {
XMA_CONTEXT_DATA context(context_ptr); XMA_CONTEXT_DATA context(context_ptr);
return context.output_buffer_valid; return context.output_buffer_valid;
} }
DECLARE_XBOXKRNL_EXPORT(XMAIsOutputBufferValid, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMAIsOutputBufferValid, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMASetOutputBufferValid(lpvoid_t context_ptr) { dword_result_t XMASetOutputBufferValid(lpvoid_t context_ptr) {
XMA_CONTEXT_DATA context(context_ptr); XMA_CONTEXT_DATA context(context_ptr);
@ -272,17 +258,15 @@ dword_result_t XMASetOutputBufferValid(lpvoid_t context_ptr) {
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMASetOutputBufferValid, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMASetOutputBufferValid, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMAGetOutputBufferReadOffset(lpvoid_t context_ptr) { dword_result_t XMAGetOutputBufferReadOffset(lpvoid_t context_ptr) {
XMA_CONTEXT_DATA context(context_ptr); XMA_CONTEXT_DATA context(context_ptr);
return context.output_buffer_read_offset; return context.output_buffer_read_offset;
} }
DECLARE_XBOXKRNL_EXPORT(XMAGetOutputBufferReadOffset, DECLARE_XBOXKRNL_EXPORT2(XMAGetOutputBufferReadOffset, kAudio, kImplemented,
ExportTag::kImplemented | ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMASetOutputBufferReadOffset(lpvoid_t context_ptr, dword_result_t XMASetOutputBufferReadOffset(lpvoid_t context_ptr,
dword_t value) { dword_t value) {
@ -292,32 +276,28 @@ dword_result_t XMASetOutputBufferReadOffset(lpvoid_t context_ptr,
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMASetOutputBufferReadOffset, DECLARE_XBOXKRNL_EXPORT2(XMASetOutputBufferReadOffset, kAudio, kImplemented,
ExportTag::kImplemented | ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMAGetOutputBufferWriteOffset(lpvoid_t context_ptr) { dword_result_t XMAGetOutputBufferWriteOffset(lpvoid_t context_ptr) {
XMA_CONTEXT_DATA context(context_ptr); XMA_CONTEXT_DATA context(context_ptr);
return context.output_buffer_write_offset; return context.output_buffer_write_offset;
} }
DECLARE_XBOXKRNL_EXPORT(XMAGetOutputBufferWriteOffset, DECLARE_XBOXKRNL_EXPORT2(XMAGetOutputBufferWriteOffset, kAudio, kImplemented,
ExportTag::kImplemented | ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMAGetPacketMetadata(lpvoid_t context_ptr) { dword_result_t XMAGetPacketMetadata(lpvoid_t context_ptr) {
XMA_CONTEXT_DATA context(context_ptr); XMA_CONTEXT_DATA context(context_ptr);
return context.packet_metadata; return context.packet_metadata;
} }
DECLARE_XBOXKRNL_EXPORT(XMAGetPacketMetadata, DECLARE_XBOXKRNL_EXPORT1(XMAGetPacketMetadata, kAudio, kImplemented);
ExportTag::kImplemented | ExportTag::kAudio);
dword_result_t XMAEnableContext(lpvoid_t context_ptr) { dword_result_t XMAEnableContext(lpvoid_t context_ptr) {
StoreXmaContextIndexedRegister(kernel_state(), 0x1940, context_ptr); StoreXmaContextIndexedRegister(kernel_state(), 0x1940, context_ptr);
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMAEnableContext, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMAEnableContext, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMADisableContext(lpvoid_t context_ptr, dword_t wait) { dword_result_t XMADisableContext(lpvoid_t context_ptr, dword_t wait) {
X_HRESULT result = X_E_SUCCESS; X_HRESULT result = X_E_SUCCESS;
@ -331,9 +311,8 @@ dword_result_t XMADisableContext(lpvoid_t context_ptr, dword_t wait) {
} }
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(XMADisableContext, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMADisableContext, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t XMABlockWhileInUse(lpvoid_t context_ptr) { dword_result_t XMABlockWhileInUse(lpvoid_t context_ptr) {
do { do {
@ -345,9 +324,8 @@ dword_result_t XMABlockWhileInUse(lpvoid_t context_ptr) {
} while (true); } while (true);
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XMABlockWhileInUse, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(XMABlockWhileInUse, kAudio, kImplemented,
ExportTag::kAudio | kHighFrequency);
ExportTag::kHighFrequency);
void RegisterAudioXmaExports(xe::cpu::ExportResolver* export_resolver, void RegisterAudioXmaExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -58,7 +58,7 @@ void XeCryptShaInit(pointer_t<XECRYPT_SHA_STATE> sha_state) {
sha_state->state[3] = 0x10325476; sha_state->state[3] = 0x10325476;
sha_state->state[4] = 0xC3D2E1F0; sha_state->state[4] = 0xC3D2E1F0;
} }
DECLARE_XBOXKRNL_EXPORT(XeCryptShaInit, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(XeCryptShaInit, kNone, kImplemented);
void XeCryptShaUpdate(pointer_t<XECRYPT_SHA_STATE> sha_state, lpvoid_t input, void XeCryptShaUpdate(pointer_t<XECRYPT_SHA_STATE> sha_state, lpvoid_t input,
dword_t input_size) { dword_t input_size) {
@ -69,7 +69,7 @@ void XeCryptShaUpdate(pointer_t<XECRYPT_SHA_STATE> sha_state, lpvoid_t input,
StoreSha1(&sha, sha_state); StoreSha1(&sha, sha_state);
} }
DECLARE_XBOXKRNL_EXPORT(XeCryptShaUpdate, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(XeCryptShaUpdate, kNone, kImplemented);
void XeCryptShaFinal(pointer_t<XECRYPT_SHA_STATE> sha_state, void XeCryptShaFinal(pointer_t<XECRYPT_SHA_STATE> sha_state,
pointer_t<xe::be<uint32_t>> out, dword_t out_size) { pointer_t<xe::be<uint32_t>> out, dword_t out_size) {
@ -82,7 +82,7 @@ void XeCryptShaFinal(pointer_t<XECRYPT_SHA_STATE> sha_state,
std::memcpy(out, digest, std::min((uint32_t)out_size, 0x14u)); std::memcpy(out, digest, std::min((uint32_t)out_size, 0x14u));
std::memcpy(sha_state->state, digest, 0x14); 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, 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, 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); sha.finalize(digest);
std::memcpy(output, digest, std::min((uint32_t)output_size, 0x14u)); 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. // TODO: Size of this struct hasn't been confirmed yet.
typedef struct { typedef struct {
@ -124,7 +124,7 @@ void XeCryptSha256Init(pointer_t<XECRYPT_SHA256_STATE> sha_state) {
sha_state->state[6] = 0x1f83d9ab; sha_state->state[6] = 0x1f83d9ab;
sha_state->state[7] = 0x5be0cd19; sha_state->state[7] = 0x5be0cd19;
} }
DECLARE_XBOXKRNL_EXPORT(XeCryptSha256Init, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(XeCryptSha256Init, kNone, kImplemented);
void XeCryptSha256Update(pointer_t<XECRYPT_SHA256_STATE> sha_state, void XeCryptSha256Update(pointer_t<XECRYPT_SHA256_STATE> sha_state,
lpvoid_t input, dword_t input_size) { lpvoid_t input, dword_t input_size) {
@ -139,7 +139,7 @@ void XeCryptSha256Update(pointer_t<XECRYPT_SHA256_STATE> sha_state,
std::memcpy(sha_state->buffer, sha.getBuffer(), 64); std::memcpy(sha_state->buffer, sha.getBuffer(), 64);
sha_state->count = uint32_t(sha.getTotalSize()); sha_state->count = uint32_t(sha.getTotalSize());
} }
DECLARE_XBOXKRNL_EXPORT(XeCryptSha256Update, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(XeCryptSha256Update, kNone, kImplemented);
void XeCryptSha256Final(pointer_t<XECRYPT_SHA256_STATE> sha_state, void XeCryptSha256Final(pointer_t<XECRYPT_SHA256_STATE> sha_state,
pointer_t<xe::be<uint32_t>> out, dword_t out_size) { pointer_t<xe::be<uint32_t>> out, dword_t out_size) {
@ -154,33 +154,33 @@ void XeCryptSha256Final(pointer_t<XECRYPT_SHA256_STATE> sha_state,
std::memcpy(out, hash, std::min(uint32_t(out_size), 32u)); std::memcpy(out, hash, std::min(uint32_t(out_size), 32u));
std::memcpy(sha_state->buffer, hash, 32); std::memcpy(sha_state->buffer, hash, 32);
} }
DECLARE_XBOXKRNL_EXPORT(XeCryptSha256Final, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(XeCryptSha256Final, kNone, kImplemented);
// Byteswap? // Byteswap?
dword_result_t XeCryptBnQw_SwapDwQwLeBe(lpqword_t qw_inp, lpqword_t qw_out, dword_result_t XeCryptBnQw_SwapDwQwLeBe(lpqword_t qw_inp, lpqword_t qw_out,
dword_t size) { dword_t size) {
return 0; 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, dword_result_t XeCryptBnQwNeRsaPubCrypt(lpqword_t qw_a, lpqword_t qw_b,
lpvoid_t rsa) { lpvoid_t rsa) {
// 0 indicates failure (but not a BOOL return value) // 0 indicates failure (but not a BOOL return value)
return 1; 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_result_t XeCryptBnDwLePkcs1Verify(lpvoid_t hash, lpvoid_t sig,
dword_t size) { dword_t size) {
// BOOL return value // BOOL return value
return 1; return 1;
} }
DECLARE_XBOXKRNL_EXPORT(XeCryptBnDwLePkcs1Verify, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(XeCryptBnDwLePkcs1Verify, kNone, kStub);
void XeCryptRandom(lpvoid_t buf, dword_t buf_size) { void XeCryptRandom(lpvoid_t buf, dword_t buf_size) {
std::memset(buf, 0xFD, buf_size); std::memset(buf, 0xFD, buf_size);
} }
DECLARE_XBOXKRNL_EXPORT(XeCryptRandom, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(XeCryptRandom, kNone, kStub);
struct XECRYPT_DES_STATE { struct XECRYPT_DES_STATE {
uint32_t keytab[16][2]; 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) { void XeCryptDesParity(lpvoid_t inp, dword_t inp_size, lpvoid_t out_ptr) {
DES::set_parity(inp, inp_size, 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 { struct XECRYPT_DES3_STATE {
XECRYPT_DES_STATE des_state[3]; XECRYPT_DES_STATE des_state[3];
@ -205,7 +205,7 @@ void XeCryptDes3Key(pointer_t<XECRYPT_DES3_STATE> state_ptr, lpqword_t key) {
std::memcpy(state_ptr->des_state[i].keytab, des[i].get_sub_key(), 128); 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<XECRYPT_DES3_STATE> state_ptr, lpqword_t inp, void XeCryptDes3Ecb(pointer_t<XECRYPT_DES3_STATE> state_ptr, lpqword_t inp,
lpqword_t out, dword_t encrypt) { lpqword_t out, dword_t encrypt) {
@ -219,7 +219,7 @@ void XeCryptDes3Ecb(pointer_t<XECRYPT_DES3_STATE> state_ptr, lpqword_t inp,
*out = des3.decrypt(*inp); *out = des3.decrypt(*inp);
} }
} }
DECLARE_XBOXKRNL_EXPORT(XeCryptDes3Ecb, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(XeCryptDes3Ecb, kNone, kImplemented);
void XeCryptDes3Cbc(pointer_t<XECRYPT_DES3_STATE> state_ptr, lpqword_t inp, void XeCryptDes3Cbc(pointer_t<XECRYPT_DES3_STATE> state_ptr, lpqword_t inp,
dword_t inp_size, lpqword_t out, lpqword_t feed, dword_t inp_size, lpqword_t out, lpqword_t feed,
@ -245,7 +245,7 @@ void XeCryptDes3Cbc(pointer_t<XECRYPT_DES3_STATE> state_ptr, lpqword_t inp,
*feed = last_block; *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, 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, 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)); std::memcpy(out, digest, std::min((uint32_t)out_size, 0x14u));
} }
DECLARE_XBOXKRNL_EXPORT(XeCryptHmacSha, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(XeCryptHmacSha, kNone, kImplemented);
// Keys // Keys
// TODO: Array of keys we need // 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; return X_STATUS_UNSUCCESSFUL;
} }
DECLARE_XBOXKRNL_EXPORT(XeKeysHmacSha, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(XeKeysHmacSha, kNone, kImplemented);
void RegisterCryptExports(xe::cpu::ExportResolver* export_resolver, void RegisterCryptExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -20,7 +20,7 @@ namespace kernel {
namespace xboxkrnl { namespace xboxkrnl {
void DbgBreakPoint() { xe::debugging::Break(); } 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 // https://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
typedef struct { typedef struct {
@ -80,7 +80,7 @@ void RtlRaiseException(pointer_t<X_EXCEPTION_RECORD> record) {
// This is going to suck. // This is going to suck.
xe::debugging::Break(); 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, void KeBugCheckEx(dword_t code, dword_t param1, dword_t param2, dword_t param3,
dword_t param4) { dword_t param4) {
@ -90,10 +90,10 @@ void KeBugCheckEx(dword_t code, dword_t param1, dword_t param2, dword_t param3,
xe::debugging::Break(); xe::debugging::Break();
assert_always(); 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); } 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, void RegisterDebugExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -1010,8 +1010,7 @@ dword_result_t RtlNtStatusToDosError(dword_t source_status) {
XELOGE("RtlNtStatusToDosError lookup NOT IMPLEMENTED"); XELOGE("RtlNtStatusToDosError lookup NOT IMPLEMENTED");
return 317; // ERROR_MR_MID_NOT_FOUND return 317; // ERROR_MR_MID_NOT_FOUND
} }
DECLARE_XBOXKRNL_EXPORT(RtlNtStatusToDosError, DECLARE_XBOXKRNL_EXPORT2(RtlNtStatusToDosError, kNone, kImportant, kLogResult);
ExportTag::kImportant | ExportTag::kLogResult);
void RegisterErrorExports(xe::cpu::ExportResolver* export_resolver, void RegisterErrorExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -29,7 +29,7 @@ void HalReturnToFirmware(dword_t routine) {
XELOGE("Game requested shutdown via HalReturnToFirmware"); XELOGE("Game requested shutdown via HalReturnToFirmware");
exit(0); exit(0);
} }
DECLARE_XBOXKRNL_EXPORT(HalReturnToFirmware, ExportTag::kImportant); DECLARE_XBOXKRNL_EXPORT2(HalReturnToFirmware, kNone, kStub, kImportant);
void RegisterHalExports(xe::cpu::ExportResolver* export_resolver, void RegisterHalExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -30,7 +30,7 @@ dword_result_t HidReadKeys(dword_t unk1, unknown_t unk2, unknown_t unk3) {
*/ */
return 0xC000009D; return 0xC000009D;
} }
DECLARE_XBOXKRNL_EXPORT(HidReadKeys, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(HidReadKeys, kInput, kStub);
void RegisterHidExports(xe::cpu::ExportResolver* export_resolver, void RegisterHidExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -133,7 +133,7 @@ dword_result_t NtCreateFile(lpdword_t handle_out, dword_t desired_access,
return result; 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, dword_result_t NtOpenFile(lpdword_t handle_out, dword_t desired_access,
pointer_t<X_OBJECT_ATTRIBUTES> object_attributes, pointer_t<X_OBJECT_ATTRIBUTES> object_attributes,
@ -144,7 +144,7 @@ dword_result_t NtOpenFile(lpdword_t handle_out, dword_t desired_access,
static_cast<uint32_t>(xe::vfs::FileDisposition::kOpen), static_cast<uint32_t>(xe::vfs::FileDisposition::kOpen),
open_options); 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, dword_result_t NtReadFile(dword_t file_handle, dword_t event_handle,
lpvoid_t apc_routine_ptr, lpvoid_t apc_context, 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; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtReadFile, DECLARE_XBOXKRNL_EXPORT2(NtReadFile, kFileSystem, kImplemented, kHighFrequency);
ExportTag::kImplemented | ExportTag::kHighFrequency);
dword_result_t NtWriteFile(dword_t file_handle, dword_t event_handle, dword_result_t NtWriteFile(dword_t file_handle, dword_t event_handle,
function_t apc_routine, lpvoid_t apc_context, 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; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtWriteFile, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(NtWriteFile, kFileSystem, kImplemented);
dword_result_t NtCreateIoCompletion(lpdword_t out_handle, dword_result_t NtCreateIoCompletion(lpdword_t out_handle,
dword_t desired_access, dword_t desired_access,
@ -324,7 +323,7 @@ dword_result_t NtCreateIoCompletion(lpdword_t out_handle,
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(NtCreateIoCompletion, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(NtCreateIoCompletion, kFileSystem, kImplemented);
// Dequeues a packet from the completion port. // Dequeues a packet from the completion port.
dword_result_t NtRemoveIoCompletion( dword_result_t NtRemoveIoCompletion(
@ -359,7 +358,7 @@ dword_result_t NtRemoveIoCompletion(
return status; return status;
} }
DECLARE_XBOXKRNL_EXPORT(NtRemoveIoCompletion, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(NtRemoveIoCompletion, kFileSystem, kImplemented);
dword_result_t NtSetInformationFile( dword_result_t NtSetInformationFile(
dword_t file_handle, pointer_t<X_IO_STATUS_BLOCK> io_status_block, dword_t file_handle, pointer_t<X_IO_STATUS_BLOCK> io_status_block,
@ -434,8 +433,8 @@ dword_result_t NtSetInformationFile(
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtSetInformationFile, DECLARE_XBOXKRNL_EXPORT2(NtSetInformationFile, kFileSystem, kImplemented,
ExportTag::kImplemented | ExportTag::kHighFrequency); kHighFrequency);
struct X_IO_STATUS_BLOCK { struct X_IO_STATUS_BLOCK {
union { union {
@ -550,8 +549,7 @@ dword_result_t NtQueryInformationFile(
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtQueryInformationFile, DECLARE_XBOXKRNL_EXPORT1(NtQueryInformationFile, kFileSystem, kImplemented);
ExportTag::kImplemented | ExportTag::kFileSystem);
dword_result_t NtQueryFullAttributesFile( dword_result_t NtQueryFullAttributesFile(
pointer_t<X_OBJECT_ATTRIBUTES> obj_attribs, pointer_t<X_OBJECT_ATTRIBUTES> obj_attribs,
@ -587,7 +585,7 @@ dword_result_t NtQueryFullAttributesFile(
return X_STATUS_NO_SUCH_FILE; return X_STATUS_NO_SUCH_FILE;
} }
DECLARE_XBOXKRNL_EXPORT(NtQueryFullAttributesFile, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(NtQueryFullAttributesFile, kFileSystem, kImplemented);
dword_result_t NtQueryVolumeInformationFile( dword_result_t NtQueryVolumeInformationFile(
dword_t file_handle, pointer_t<X_IO_STATUS_BLOCK> io_status_block_ptr, dword_t file_handle, pointer_t<X_IO_STATUS_BLOCK> io_status_block_ptr,
@ -662,7 +660,8 @@ dword_result_t NtQueryVolumeInformationFile(
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtQueryVolumeInformationFile, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(NtQueryVolumeInformationFile, kFileSystem,
kImplemented);
dword_result_t NtQueryDirectoryFile( dword_result_t NtQueryDirectoryFile(
dword_t file_handle, dword_t event_handle, function_t apc_routine, dword_t file_handle, dword_t event_handle, function_t apc_routine,
@ -702,7 +701,7 @@ dword_result_t NtQueryDirectoryFile(
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtQueryDirectoryFile, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(NtQueryDirectoryFile, kFileSystem, kImplemented);
dword_result_t NtFlushBuffersFile( dword_result_t NtFlushBuffersFile(
dword_t file_handle, pointer_t<X_IO_STATUS_BLOCK> io_status_block_ptr) { dword_t file_handle, pointer_t<X_IO_STATUS_BLOCK> io_status_block_ptr) {
@ -715,17 +714,17 @@ dword_result_t NtFlushBuffersFile(
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtFlushBuffersFile, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(NtFlushBuffersFile, kFileSystem, kStub);
dword_result_t FscGetCacheElementCount(dword_t r3) { return 0; } 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) { dword_result_t FscSetCacheElementCount(dword_t unk_0, dword_t unk_1) {
// unk_0 = 0 // unk_0 = 0
// unk_1 looks like a count? in what units? 256 is a common value // unk_1 looks like a count? in what units? 256 is a common value
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(FscSetCacheElementCount, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(FscSetCacheElementCount, kFileSystem, kStub);
void RegisterIoExports(xe::cpu::ExportResolver* export_resolver, void RegisterIoExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -161,8 +161,7 @@ dword_result_t NtAllocateVirtualMemory(lpdword_t base_addr_ptr,
*region_size_ptr = adjusted_size; *region_size_ptr = adjusted_size;
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(NtAllocateVirtualMemory, DECLARE_XBOXKRNL_EXPORT1(NtAllocateVirtualMemory, kMemory, kImplemented);
ExportTag::kImplemented | ExportTag::kMemory);
dword_result_t NtProtectVirtualMemory(lpdword_t base_addr_ptr, dword_result_t NtProtectVirtualMemory(lpdword_t base_addr_ptr,
lpdword_t region_size_ptr, lpdword_t region_size_ptr,
@ -210,8 +209,7 @@ dword_result_t NtProtectVirtualMemory(lpdword_t base_addr_ptr,
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(NtProtectVirtualMemory, DECLARE_XBOXKRNL_EXPORT1(NtProtectVirtualMemory, kMemory, kImplemented);
ExportTag::kImplemented | ExportTag::kMemory);
dword_result_t NtFreeVirtualMemory(lpdword_t base_addr_ptr, dword_result_t NtFreeVirtualMemory(lpdword_t base_addr_ptr,
lpdword_t region_size_ptr, dword_t free_type, 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; *region_size_ptr = region_size_value;
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(NtFreeVirtualMemory, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(NtFreeVirtualMemory, kMemory, kImplemented);
struct X_MEMORY_BASIC_INFORMATION { struct X_MEMORY_BASIC_INFORMATION {
be<uint32_t> base_address; be<uint32_t> base_address;
@ -291,7 +289,7 @@ dword_result_t NtQueryVirtualMemory(
return X_STATUS_SUCCESS; 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_result_t MmAllocatePhysicalMemoryEx(dword_t flags, dword_t region_size,
dword_t protect_bits, dword_t protect_bits,
@ -344,16 +342,14 @@ dword_result_t MmAllocatePhysicalMemoryEx(dword_t flags, dword_t region_size,
return base_address; return base_address;
} }
DECLARE_XBOXKRNL_EXPORT(MmAllocatePhysicalMemoryEx, DECLARE_XBOXKRNL_EXPORT1(MmAllocatePhysicalMemoryEx, kMemory, kImplemented);
ExportTag::kImplemented | ExportTag::kMemory);
dword_result_t MmAllocatePhysicalMemory(dword_t flags, dword_t region_size, dword_result_t MmAllocatePhysicalMemory(dword_t flags, dword_t region_size,
dword_t protect_bits) { dword_t protect_bits) {
return MmAllocatePhysicalMemoryEx(flags, region_size, protect_bits, 0, return MmAllocatePhysicalMemoryEx(flags, region_size, protect_bits, 0,
0xFFFFFFFFu, 0); 0xFFFFFFFFu, 0);
} }
DECLARE_XBOXKRNL_EXPORT(MmAllocatePhysicalMemory, DECLARE_XBOXKRNL_EXPORT1(MmAllocatePhysicalMemory, kMemory, kImplemented);
ExportTag::kImplemented | ExportTag::kMemory);
void MmFreePhysicalMemory(dword_t type, dword_t base_address) { void MmFreePhysicalMemory(dword_t type, dword_t base_address) {
// base_address = result of MmAllocatePhysicalMemory. // 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); auto heap = kernel_state()->memory()->LookupHeap(base_address);
heap->Release(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) { dword_result_t MmQueryAddressProtect(dword_t base_address) {
auto heap = kernel_state()->memory()->LookupHeap(base_address); auto heap = kernel_state()->memory()->LookupHeap(base_address);
@ -375,7 +371,7 @@ dword_result_t MmQueryAddressProtect(dword_t base_address) {
return access; return access;
} }
DECLARE_XBOXKRNL_EXPORT(MmQueryAddressProtect, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(MmQueryAddressProtect, kMemory, kImplemented);
void MmSetAddressProtect(lpvoid_t base_address, dword_t region_size, void MmSetAddressProtect(lpvoid_t base_address, dword_t region_size,
dword_t protect_bits) { 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); auto heap = kernel_memory()->LookupHeap(base_address);
heap->Protect(base_address.guest_address(), region_size, protect); heap->Protect(base_address.guest_address(), region_size, protect);
} }
DECLARE_XBOXKRNL_EXPORT(MmSetAddressProtect, DECLARE_XBOXKRNL_EXPORT1(MmSetAddressProtect, kMemory, kImplemented);
ExportTag::kImplemented | ExportTag::kMemory);
dword_result_t MmQueryAllocationSize(lpvoid_t base_address) { dword_result_t MmQueryAllocationSize(lpvoid_t base_address) {
auto heap = kernel_state()->memory()->LookupHeap(base_address); auto heap = kernel_state()->memory()->LookupHeap(base_address);
@ -395,7 +390,7 @@ dword_result_t MmQueryAllocationSize(lpvoid_t base_address) {
return size; 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 // https://code.google.com/p/vdash/source/browse/trunk/vdash/include/kernel.h
struct X_MM_QUERY_STATISTICS_SECTION { struct X_MM_QUERY_STATISTICS_SECTION {
@ -498,7 +493,7 @@ dword_result_t MmQueryStatistics(
return X_STATUS_SUCCESS; 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 // http://msdn.microsoft.com/en-us/library/windows/hardware/ff554547(v=vs.85).aspx
dword_result_t MmGetPhysicalAddress(dword_t base_address) { dword_result_t MmGetPhysicalAddress(dword_t base_address) {
@ -515,7 +510,7 @@ dword_result_t MmGetPhysicalAddress(dword_t base_address) {
return physical_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_result_t MmMapIoSpace(dword_t unk0, lpvoid_t src_address, dword_t size,
dword_t flags) { 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(); 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_result_t ExAllocatePoolTypeWithTag(dword_t size, dword_t tag,
dword_t zero) { dword_t zero) {
@ -545,27 +540,27 @@ dword_result_t ExAllocatePoolTypeWithTag(dword_t size, dword_t tag,
return addr; return addr;
} }
DECLARE_XBOXKRNL_EXPORT(ExAllocatePoolTypeWithTag, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(ExAllocatePoolTypeWithTag, kMemory, kImplemented);
void ExFreePool(lpvoid_t base_address) { void ExFreePool(lpvoid_t base_address) {
kernel_state()->memory()->SystemHeapFree(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) { dword_result_t KeGetImagePageTableEntry(lpvoid_t address) {
// Unknown // Unknown
return 1; return 1;
} }
DECLARE_XBOXKRNL_EXPORT(KeGetImagePageTableEntry, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(KeGetImagePageTableEntry, kMemory, kStub);
dword_result_t KeLockL2() { dword_result_t KeLockL2() {
// TODO // TODO
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(KeLockL2, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(KeLockL2, kMemory, kStub);
void KeUnlockL2() {} 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) { dword_result_t MmCreateKernelStack(dword_t stack_size, dword_t r4) {
assert_zero(r4); // Unknown argument. assert_zero(r4); // Unknown argument.
@ -582,7 +577,7 @@ dword_result_t MmCreateKernelStack(dword_t stack_size, dword_t r4) {
&stack_address); &stack_address);
return stack_address + stack_size; 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) { dword_result_t MmDeleteKernelStack(lpvoid_t stack_base, lpvoid_t stack_end) {
// Release the stack (where stack_end is the low address) // 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; return X_STATUS_UNSUCCESSFUL;
} }
DECLARE_XBOXKRNL_EXPORT(MmDeleteKernelStack, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(MmDeleteKernelStack, kMemory, kImplemented);
void RegisterMemoryExports(xe::cpu::ExportResolver* export_resolver, void RegisterMemoryExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -21,7 +21,7 @@ namespace xboxkrnl {
void KeEnableFpuExceptions(dword_t enabled) { void KeEnableFpuExceptions(dword_t enabled) {
// TODO(benvanik): can we do anything about exceptions? // 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, void RegisterMiscExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -113,8 +113,7 @@ dword_result_t ExGetXConfigSetting(word_t category, word_t setting,
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(ExGetXConfigSetting, DECLARE_XBOXKRNL_EXPORT1(ExGetXConfigSetting, kModules, kImplemented);
ExportTag::kImplemented | ExportTag::kModules);
dword_result_t XexCheckExecutablePrivilege(dword_t privilege) { dword_result_t XexCheckExecutablePrivilege(dword_t privilege) {
// BOOL // BOOL
@ -134,8 +133,7 @@ dword_result_t XexCheckExecutablePrivilege(dword_t privilege) {
return (flags & mask) > 0; return (flags & mask) > 0;
} }
DECLARE_XBOXKRNL_EXPORT(XexCheckExecutablePrivilege, DECLARE_XBOXKRNL_EXPORT1(XexCheckExecutablePrivilege, kModules, kImplemented);
ExportTag::kImplemented | ExportTag::kModules);
dword_result_t XexGetModuleHandle(lpstring_t module_name, dword_result_t XexGetModuleHandle(lpstring_t module_name,
lpdword_t hmodule_ptr) { lpdword_t hmodule_ptr) {
@ -157,8 +155,7 @@ dword_result_t XexGetModuleHandle(lpstring_t module_name,
return X_ERROR_SUCCESS; return X_ERROR_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(XexGetModuleHandle, DECLARE_XBOXKRNL_EXPORT1(XexGetModuleHandle, kModules, kImplemented);
ExportTag::kImplemented | ExportTag::kModules);
dword_result_t XexGetModuleSection(lpvoid_t hmodule, lpstring_t name, dword_result_t XexGetModuleSection(lpvoid_t hmodule, lpstring_t name,
lpdword_t data_ptr, lpdword_t size_ptr) { lpdword_t data_ptr, lpdword_t size_ptr) {
@ -179,8 +176,7 @@ dword_result_t XexGetModuleSection(lpvoid_t hmodule, lpstring_t name,
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(XexGetModuleSection, DECLARE_XBOXKRNL_EXPORT1(XexGetModuleSection, kModules, kImplemented);
ExportTag::kImplemented | ExportTag::kModules);
dword_result_t XexLoadImage(lpstring_t module_name, dword_t module_flags, dword_result_t XexLoadImage(lpstring_t module_name, dword_t module_flags,
dword_t min_version, lpdword_t hmodule_ptr) { 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; return result;
} }
DECLARE_XBOXKRNL_EXPORT(XexLoadImage, DECLARE_XBOXKRNL_EXPORT1(XexLoadImage, kModules, kImplemented);
ExportTag::kImplemented | ExportTag::kModules);
dword_result_t XexUnloadImage(lpvoid_t hmodule) { dword_result_t XexUnloadImage(lpvoid_t hmodule) {
auto module = XModule::GetFromHModule(kernel_state(), hmodule); auto module = XModule::GetFromHModule(kernel_state(), hmodule);
@ -234,8 +229,7 @@ dword_result_t XexUnloadImage(lpvoid_t hmodule) {
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(XexUnloadImage, DECLARE_XBOXKRNL_EXPORT1(XexUnloadImage, kModules, kImplemented);
ExportTag::kImplemented | ExportTag::kModules);
dword_result_t XexGetProcedureAddress(lpvoid_t hmodule, dword_t ordinal, dword_result_t XexGetProcedureAddress(lpvoid_t hmodule, dword_t ordinal,
lpdword_t out_function_ptr) { lpdword_t out_function_ptr) {
@ -273,7 +267,7 @@ dword_result_t XexGetProcedureAddress(lpvoid_t hmodule, dword_t ordinal,
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(XexGetProcedureAddress, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(XexGetProcedureAddress, kModules, kImplemented);
void ExRegisterTitleTerminateNotification( void ExRegisterTitleTerminateNotification(
pointer_t<X_EX_TITLE_TERMINATE_REGISTRATION> reg, dword_t create) { pointer_t<X_EX_TITLE_TERMINATE_REGISTRATION> reg, dword_t create) {
@ -286,8 +280,8 @@ void ExRegisterTitleTerminateNotification(
kernel_state()->RemoveTitleTerminateNotification(reg->notification_routine); kernel_state()->RemoveTitleTerminateNotification(reg->notification_routine);
} }
} }
DECLARE_XBOXKRNL_EXPORT(ExRegisterTitleTerminateNotification, DECLARE_XBOXKRNL_EXPORT1(ExRegisterTitleTerminateNotification, kModules,
ExportTag::kImplemented); kImplemented);
void RegisterModuleExports(xe::cpu::ExportResolver* export_resolver, void RegisterModuleExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -44,7 +44,7 @@ dword_result_t ObOpenObjectByName(lpunknown_t obj_attributes_ptr,
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(ObOpenObjectByName, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(ObOpenObjectByName, kNone, kImplemented);
dword_result_t ObOpenObjectByPointer(lpvoid_t object_ptr, dword_result_t ObOpenObjectByPointer(lpvoid_t object_ptr,
lpdword_t out_handle_ptr) { lpdword_t out_handle_ptr) {
@ -58,7 +58,7 @@ dword_result_t ObOpenObjectByPointer(lpvoid_t object_ptr,
*out_handle_ptr = object->handle(); *out_handle_ptr = object->handle();
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(ObOpenObjectByPointer, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(ObOpenObjectByPointer, kNone, kImplemented);
dword_result_t ObLookupThreadByThreadId(dword_t thread_id, dword_result_t ObLookupThreadByThreadId(dword_t thread_id,
lpdword_t out_object_ptr) { lpdword_t out_object_ptr) {
@ -72,7 +72,7 @@ dword_result_t ObLookupThreadByThreadId(dword_t thread_id,
*out_object_ptr = thread->guest_object(); *out_object_ptr = thread->guest_object();
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(ObLookupThreadByThreadId, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(ObLookupThreadByThreadId, kNone, kImplemented);
dword_result_t ObReferenceObjectByHandle(dword_t handle, dword_result_t ObReferenceObjectByHandle(dword_t handle,
dword_t object_type_ptr, dword_t object_type_ptr,
@ -137,7 +137,7 @@ dword_result_t ObReferenceObjectByHandle(dword_t handle,
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(ObReferenceObjectByHandle, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(ObReferenceObjectByHandle, kNone, kImplemented);
dword_result_t ObDereferenceObject(dword_t native_ptr) { dword_result_t ObDereferenceObject(dword_t native_ptr) {
// Check if a dummy value from ObReferenceObjectByHandle. // Check if a dummy value from ObReferenceObjectByHandle.
@ -153,7 +153,7 @@ dword_result_t ObDereferenceObject(dword_t native_ptr) {
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(ObDereferenceObject, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(ObDereferenceObject, kNone, kImplemented);
dword_result_t ObCreateSymbolicLink(pointer_t<X_ANSI_STRING> path, dword_result_t ObCreateSymbolicLink(pointer_t<X_ANSI_STRING> path,
pointer_t<X_ANSI_STRING> target) { pointer_t<X_ANSI_STRING> target) {
@ -174,7 +174,7 @@ dword_result_t ObCreateSymbolicLink(pointer_t<X_ANSI_STRING> path,
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(ObCreateSymbolicLink, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(ObCreateSymbolicLink, kNone, kImplemented);
dword_result_t ObDeleteSymbolicLink(pointer_t<X_ANSI_STRING> path) { dword_result_t ObDeleteSymbolicLink(pointer_t<X_ANSI_STRING> path) {
auto path_str = path->to_string(kernel_memory()->virtual_membase()); auto path_str = path->to_string(kernel_memory()->virtual_membase());
@ -184,7 +184,7 @@ dword_result_t ObDeleteSymbolicLink(pointer_t<X_ANSI_STRING> path) {
return X_STATUS_SUCCESS; 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_result_t NtDuplicateObject(dword_t handle, lpdword_t new_handle_ptr,
dword_t options) { dword_t options) {
@ -209,12 +209,12 @@ dword_result_t NtDuplicateObject(dword_t handle, lpdword_t new_handle_ptr,
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtDuplicateObject, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(NtDuplicateObject, kNone, kImplemented);
dword_result_t NtClose(dword_t handle) { dword_result_t NtClose(dword_t handle) {
return kernel_state()->object_table()->ReleaseHandle(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, void RegisterObExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -52,7 +52,7 @@ dword_result_t RtlCompareMemory(lpvoid_t source1, lpvoid_t source2,
return c; return c;
} }
DECLARE_XBOXKRNL_EXPORT(RtlCompareMemory, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlCompareMemory, kMemory, kImplemented);
// http://msdn.microsoft.com/en-us/library/ff552123 // http://msdn.microsoft.com/en-us/library/ff552123
dword_result_t RtlCompareMemoryUlong(lpvoid_t source, dword_t length, 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; return n;
} }
DECLARE_XBOXKRNL_EXPORT(RtlCompareMemoryUlong, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlCompareMemoryUlong, kMemory, kImplemented);
// http://msdn.microsoft.com/en-us/library/ff552263 // http://msdn.microsoft.com/en-us/library/ff552263
void RtlFillMemoryUlong(lpvoid_t destination, dword_t length, dword_t pattern) { 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; *p = swapped_pattern;
} }
} }
DECLARE_XBOXKRNL_EXPORT(RtlFillMemoryUlong, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlFillMemoryUlong, kMemory, kImplemented);
dword_result_t RtlUpperChar(dword_t in) { dword_result_t RtlUpperChar(dword_t in) {
char c = in & 0xFF; char c = in & 0xFF;
@ -96,7 +96,7 @@ dword_result_t RtlUpperChar(dword_t in) {
return c; return c;
} }
DECLARE_XBOXKRNL_EXPORT(RtlUpperChar, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlUpperChar, kNone, kImplemented);
dword_result_t RtlLowerChar(dword_t in) { dword_result_t RtlLowerChar(dword_t in) {
char c = in & 0xFF; char c = in & 0xFF;
@ -106,7 +106,7 @@ dword_result_t RtlLowerChar(dword_t in) {
return c; 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_result_t RtlCompareString(lpstring_t string_1, lpstring_t string_2,
dword_t case_insensitive) { dword_t case_insensitive) {
@ -115,7 +115,7 @@ dword_result_t RtlCompareString(lpstring_t string_1, lpstring_t string_2,
return ret; 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, dword_result_t RtlCompareStringN(lpstring_t string_1, dword_t string_1_len,
lpstring_t string_2, dword_t string_2_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; return ret;
} }
DECLARE_XBOXKRNL_EXPORT(RtlCompareStringN, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlCompareStringN, kNone, kImplemented);
// http://msdn.microsoft.com/en-us/library/ff561918 // http://msdn.microsoft.com/en-us/library/ff561918
void RtlInitAnsiString(pointer_t<X_ANSI_STRING> destination, void RtlInitAnsiString(pointer_t<X_ANSI_STRING> destination,
@ -151,7 +151,7 @@ void RtlInitAnsiString(pointer_t<X_ANSI_STRING> destination,
destination->pointer = source.guest_address(); 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 // http://msdn.microsoft.com/en-us/library/ff561899
void RtlFreeAnsiString(pointer_t<X_ANSI_STRING> string) { void RtlFreeAnsiString(pointer_t<X_ANSI_STRING> string) {
@ -161,7 +161,7 @@ void RtlFreeAnsiString(pointer_t<X_ANSI_STRING> string) {
string->reset(); string->reset();
} }
DECLARE_XBOXKRNL_EXPORT(RtlFreeAnsiString, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlFreeAnsiString, kNone, kImplemented);
// http://msdn.microsoft.com/en-us/library/ff561934 // http://msdn.microsoft.com/en-us/library/ff561934
void RtlInitUnicodeString(pointer_t<X_UNICODE_STRING> destination, void RtlInitUnicodeString(pointer_t<X_UNICODE_STRING> destination,
@ -174,7 +174,7 @@ void RtlInitUnicodeString(pointer_t<X_UNICODE_STRING> destination,
destination->reset(); destination->reset();
} }
} }
DECLARE_XBOXKRNL_EXPORT(RtlInitUnicodeString, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlInitUnicodeString, kNone, kImplemented);
// http://msdn.microsoft.com/en-us/library/ff561903 // http://msdn.microsoft.com/en-us/library/ff561903
void RtlFreeUnicodeString(pointer_t<X_UNICODE_STRING> string) { void RtlFreeUnicodeString(pointer_t<X_UNICODE_STRING> string) {
@ -184,7 +184,7 @@ void RtlFreeUnicodeString(pointer_t<X_UNICODE_STRING> string) {
string->reset(); string->reset();
} }
DECLARE_XBOXKRNL_EXPORT(RtlFreeUnicodeString, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlFreeUnicodeString, kNone, kImplemented);
void RtlCopyString(pointer_t<X_ANSI_STRING> destination, void RtlCopyString(pointer_t<X_ANSI_STRING> destination,
pointer_t<X_ANSI_STRING> source) { pointer_t<X_ANSI_STRING> source) {
@ -201,7 +201,7 @@ void RtlCopyString(pointer_t<X_ANSI_STRING> destination,
} }
destination->length = length; destination->length = length;
} }
DECLARE_XBOXKRNL_EXPORT(RtlCopyString, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlCopyString, kNone, kImplemented);
void RtlCopyUnicodeString(pointer_t<X_UNICODE_STRING> destination, void RtlCopyUnicodeString(pointer_t<X_UNICODE_STRING> destination,
pointer_t<X_UNICODE_STRING> source) { pointer_t<X_UNICODE_STRING> source) {
@ -218,7 +218,7 @@ void RtlCopyUnicodeString(pointer_t<X_UNICODE_STRING> destination,
} }
destination->length = length; destination->length = length;
} }
DECLARE_XBOXKRNL_EXPORT(RtlCopyUnicodeString, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlCopyUnicodeString, kNone, kImplemented);
// http://msdn.microsoft.com/en-us/library/ff562969 // http://msdn.microsoft.com/en-us/library/ff562969
dword_result_t RtlUnicodeStringToAnsiString( dword_result_t RtlUnicodeStringToAnsiString(
@ -262,7 +262,7 @@ dword_result_t RtlUnicodeStringToAnsiString(
} }
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(RtlUnicodeStringToAnsiString, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlUnicodeStringToAnsiString, kNone, kImplemented);
// https://msdn.microsoft.com/en-us/library/ff553113 // https://msdn.microsoft.com/en-us/library/ff553113
dword_result_t RtlMultiByteToUnicodeN(lpword_t destination_ptr, dword_result_t RtlMultiByteToUnicodeN(lpword_t destination_ptr,
@ -286,8 +286,7 @@ dword_result_t RtlMultiByteToUnicodeN(lpword_t destination_ptr,
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(RtlMultiByteToUnicodeN, DECLARE_XBOXKRNL_EXPORT2(RtlMultiByteToUnicodeN, kNone, kImplemented, kSketchy);
ExportTag::kImplemented | ExportTag::kSketchy);
// https://msdn.microsoft.com/en-us/library/ff553261 // https://msdn.microsoft.com/en-us/library/ff553261
dword_result_t RtlUnicodeToMultiByteN(pointer_t<uint8_t> destination_ptr, dword_result_t RtlUnicodeToMultiByteN(pointer_t<uint8_t> destination_ptr,
@ -309,8 +308,7 @@ dword_result_t RtlUnicodeToMultiByteN(pointer_t<uint8_t> destination_ptr,
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(RtlUnicodeToMultiByteN, DECLARE_XBOXKRNL_EXPORT2(RtlUnicodeToMultiByteN, kNone, kImplemented, kSketchy);
ExportTag::kImplemented | ExportTag::kSketchy);
pointer_result_t RtlImageXexHeaderField(pointer_t<xex2_header> xex_header, pointer_result_t RtlImageXexHeaderField(pointer_t<xex2_header> xex_header,
dword_t field_dword) { dword_t field_dword) {
@ -322,7 +320,7 @@ pointer_result_t RtlImageXexHeaderField(pointer_t<xex2_header> xex_header,
return field_value; 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 // 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 // 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<X_RTL_CRITICAL_SECTION> cs) { void RtlInitializeCriticalSection(pointer_t<X_RTL_CRITICAL_SECTION> cs) {
xeRtlInitializeCriticalSection(cs, cs.guest_address()); 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, X_STATUS xeRtlInitializeCriticalSectionAndSpinCount(X_RTL_CRITICAL_SECTION* cs,
uint32_t cs_ptr, uint32_t cs_ptr,
@ -391,8 +389,8 @@ dword_result_t RtlInitializeCriticalSectionAndSpinCount(
return xeRtlInitializeCriticalSectionAndSpinCount(cs, cs.guest_address(), return xeRtlInitializeCriticalSectionAndSpinCount(cs, cs.guest_address(),
spin_count); spin_count);
} }
DECLARE_XBOXKRNL_EXPORT(RtlInitializeCriticalSectionAndSpinCount, DECLARE_XBOXKRNL_EXPORT1(RtlInitializeCriticalSectionAndSpinCount, kNone,
ExportTag::kImplemented); kImplemented);
void RtlEnterCriticalSection(pointer_t<X_RTL_CRITICAL_SECTION> cs) { void RtlEnterCriticalSection(pointer_t<X_RTL_CRITICAL_SECTION> cs) {
uint32_t cur_thread = XThread::GetCurrentThread()->guest_object(); uint32_t cur_thread = XThread::GetCurrentThread()->guest_object();
@ -425,8 +423,8 @@ void RtlEnterCriticalSection(pointer_t<X_RTL_CRITICAL_SECTION> cs) {
cs->owning_thread = cur_thread; cs->owning_thread = cur_thread;
cs->recursion_count = 1; cs->recursion_count = 1;
} }
DECLARE_XBOXKRNL_EXPORT(RtlEnterCriticalSection, DECLARE_XBOXKRNL_EXPORT2(RtlEnterCriticalSection, kNone, kImplemented,
ExportTag::kImplemented | ExportTag::kHighFrequency); kHighFrequency);
dword_result_t RtlTryEnterCriticalSection( dword_result_t RtlTryEnterCriticalSection(
pointer_t<X_RTL_CRITICAL_SECTION> cs) { pointer_t<X_RTL_CRITICAL_SECTION> cs) {
@ -447,8 +445,8 @@ dword_result_t RtlTryEnterCriticalSection(
// Failed to acquire lock. // Failed to acquire lock.
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(RtlTryEnterCriticalSection, DECLARE_XBOXKRNL_EXPORT2(RtlTryEnterCriticalSection, kNone, kImplemented,
ExportTag::kImplemented | ExportTag::kHighFrequency); kHighFrequency);
void RtlLeaveCriticalSection(pointer_t<X_RTL_CRITICAL_SECTION> cs) { void RtlLeaveCriticalSection(pointer_t<X_RTL_CRITICAL_SECTION> cs) {
assert_true(cs->owning_thread == XThread::GetCurrentThread()->guest_object()); assert_true(cs->owning_thread == XThread::GetCurrentThread()->guest_object());
@ -469,8 +467,8 @@ void RtlLeaveCriticalSection(pointer_t<X_RTL_CRITICAL_SECTION> cs) {
KeSetEvent(reinterpret_cast<X_KEVENT*>(cs.host_address()), 1, 0); KeSetEvent(reinterpret_cast<X_KEVENT*>(cs.host_address()), 1, 0);
} }
} }
DECLARE_XBOXKRNL_EXPORT(RtlLeaveCriticalSection, DECLARE_XBOXKRNL_EXPORT2(RtlLeaveCriticalSection, kNone, kImplemented,
ExportTag::kImplemented | ExportTag::kHighFrequency); kHighFrequency);
struct X_TIME_FIELDS { struct X_TIME_FIELDS {
xe::be<uint16_t> year; xe::be<uint16_t> year;
@ -500,7 +498,7 @@ void RtlTimeToTimeFields(lpqword_t time_ptr,
time_fields_ptr->milliseconds = time_ms % 1000; time_fields_ptr->milliseconds = time_ms % 1000;
time_fields_ptr->weekday = tm->tm_wday; 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<X_TIME_FIELDS> time_fields_ptr, dword_result_t RtlTimeFieldsToTime(pointer_t<X_TIME_FIELDS> time_fields_ptr,
lpqword_t time_ptr) { lpqword_t time_ptr) {
@ -522,7 +520,7 @@ dword_result_t RtlTimeFieldsToTime(pointer_t<X_TIME_FIELDS> time_fields_ptr,
*time_ptr = time; *time_ptr = time;
return 1; return 1;
} }
DECLARE_XBOXKRNL_EXPORT(RtlTimeFieldsToTime, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(RtlTimeFieldsToTime, kNone, kImplemented);
void RegisterRtlExports(xe::cpu::ExportResolver* export_resolver, void RegisterRtlExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -243,8 +243,7 @@ void KeSetCurrentStackPointers(lpvoid_t stack_ptr,
// TODO: Do we need to set the stack info on cur_thread? // TODO: Do we need to set the stack info on cur_thread?
} }
DECLARE_XBOXKRNL_EXPORT(KeSetCurrentStackPointers, DECLARE_XBOXKRNL_EXPORT1(KeSetCurrentStackPointers, kThreading, kImplemented);
ExportTag::kThreading | ExportTag::kImplemented);
SHIM_CALL KeSetAffinityThread_shim(PPCContext* ppc_context, SHIM_CALL KeSetAffinityThread_shim(PPCContext* ppc_context,
KernelState* kernel_state) { KernelState* kernel_state) {
@ -352,9 +351,8 @@ dword_result_t KeDelayExecutionThread(dword_t processor_mode, dword_t alertable,
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(KeDelayExecutionThread, DECLARE_XBOXKRNL_EXPORT3(KeDelayExecutionThread, kThreading, kImplemented,
ExportTag::kImplemented | ExportTag::kThreading | kBlocking, kHighFrequency);
ExportTag::kHighFrequency | ExportTag::kBlocking);
SHIM_CALL NtYieldExecution_shim(PPCContext* ppc_context, SHIM_CALL NtYieldExecution_shim(PPCContext* ppc_context,
KernelState* kernel_state) { KernelState* kernel_state) {
@ -383,7 +381,7 @@ dword_result_t KeTlsAlloc() {
return slot; return slot;
} }
DECLARE_XBOXKRNL_EXPORT(KeTlsAlloc, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(KeTlsAlloc, kThreading, kImplemented);
// http://msdn.microsoft.com/en-us/library/ms686804 // http://msdn.microsoft.com/en-us/library/ms686804
dword_result_t KeTlsFree(dword_t tls_index) { 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); kernel_state()->FreeTLS(tls_index);
return 1; return 1;
} }
DECLARE_XBOXKRNL_EXPORT(KeTlsFree, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(KeTlsFree, kThreading, kImplemented);
// http://msdn.microsoft.com/en-us/library/ms686812 // http://msdn.microsoft.com/en-us/library/ms686812
dword_result_t KeTlsGetValue(dword_t tls_index) { dword_result_t KeTlsGetValue(dword_t tls_index) {
@ -407,8 +405,8 @@ dword_result_t KeTlsGetValue(dword_t tls_index) {
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(KeTlsGetValue, DECLARE_XBOXKRNL_EXPORT2(KeTlsGetValue, kThreading, kImplemented,
ExportTag::kImplemented | ExportTag::kHighFrequency); kHighFrequency);
// http://msdn.microsoft.com/en-us/library/ms686818 // http://msdn.microsoft.com/en-us/library/ms686818
dword_result_t KeTlsSetValue(dword_t tls_index, dword_t tls_value) { 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; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(KeTlsSetValue, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(KeTlsSetValue, kThreading, kImplemented);
void KeInitializeEvent(pointer_t<X_KEVENT> event_ptr, dword_t event_type, void KeInitializeEvent(pointer_t<X_KEVENT> event_ptr, dword_t event_type,
dword_t initial_state) { dword_t initial_state) {
@ -434,8 +432,7 @@ void KeInitializeEvent(pointer_t<X_KEVENT> event_ptr, dword_t event_type,
return; return;
} }
} }
DECLARE_XBOXKRNL_EXPORT(KeInitializeEvent, DECLARE_XBOXKRNL_EXPORT1(KeInitializeEvent, kThreading, kImplemented);
ExportTag::kImplemented | ExportTag::kThreading);
dword_result_t KeSetEvent(pointer_t<X_KEVENT> event_ptr, dword_t increment, dword_result_t KeSetEvent(pointer_t<X_KEVENT> event_ptr, dword_t increment,
dword_t wait) { dword_t wait) {
@ -447,9 +444,7 @@ dword_result_t KeSetEvent(pointer_t<X_KEVENT> event_ptr, dword_t increment,
return ev->Set(increment, !!wait); return ev->Set(increment, !!wait);
} }
DECLARE_XBOXKRNL_EXPORT(KeSetEvent, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(KeSetEvent, kThreading, kImplemented, kHighFrequency);
ExportTag::kThreading |
ExportTag::kHighFrequency);
dword_result_t KePulseEvent(pointer_t<X_KEVENT> event_ptr, dword_t increment, dword_result_t KePulseEvent(pointer_t<X_KEVENT> event_ptr, dword_t increment,
dword_t wait) { dword_t wait) {
@ -461,9 +456,8 @@ dword_result_t KePulseEvent(pointer_t<X_KEVENT> event_ptr, dword_t increment,
return ev->Pulse(increment, !!wait); return ev->Pulse(increment, !!wait);
} }
DECLARE_XBOXKRNL_EXPORT(KePulseEvent, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(KePulseEvent, kThreading, kImplemented,
ExportTag::kThreading | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t KeResetEvent(pointer_t<X_KEVENT> event_ptr) { dword_result_t KeResetEvent(pointer_t<X_KEVENT> event_ptr) {
auto ev = XObject::GetNativeObject<XEvent>(kernel_state(), event_ptr); auto ev = XObject::GetNativeObject<XEvent>(kernel_state(), event_ptr);
@ -474,8 +468,7 @@ dword_result_t KeResetEvent(pointer_t<X_KEVENT> event_ptr) {
return ev->Reset(); return ev->Reset();
} }
DECLARE_XBOXKRNL_EXPORT(KeResetEvent, DECLARE_XBOXKRNL_EXPORT1(KeResetEvent, kThreading, kImplemented);
ExportTag::kImplemented | ExportTag::kThreading);
dword_result_t NtCreateEvent(lpdword_t handle_ptr, dword_result_t NtCreateEvent(lpdword_t handle_ptr,
pointer_t<X_OBJECT_ATTRIBUTES> obj_attributes_ptr, pointer_t<X_OBJECT_ATTRIBUTES> obj_attributes_ptr,
@ -508,8 +501,7 @@ dword_result_t NtCreateEvent(lpdword_t handle_ptr,
} }
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(NtCreateEvent, DECLARE_XBOXKRNL_EXPORT1(NtCreateEvent, kThreading, kImplemented);
ExportTag::kImplemented | ExportTag::kThreading);
dword_result_t NtSetEvent(dword_t handle, lpdword_t previous_state_ptr) { dword_result_t NtSetEvent(dword_t handle, lpdword_t previous_state_ptr) {
X_STATUS result = X_STATUS_SUCCESS; X_STATUS result = X_STATUS_SUCCESS;
@ -526,9 +518,7 @@ dword_result_t NtSetEvent(dword_t handle, lpdword_t previous_state_ptr) {
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtSetEvent, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(NtSetEvent, kThreading, kImplemented, kHighFrequency);
ExportTag::kThreading |
ExportTag::kHighFrequency);
dword_result_t NtPulseEvent(dword_t handle, lpdword_t previous_state_ptr) { dword_result_t NtPulseEvent(dword_t handle, lpdword_t previous_state_ptr) {
X_STATUS result = X_STATUS_SUCCESS; X_STATUS result = X_STATUS_SUCCESS;
@ -545,9 +535,8 @@ dword_result_t NtPulseEvent(dword_t handle, lpdword_t previous_state_ptr) {
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtPulseEvent, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(NtPulseEvent, kThreading, kImplemented,
ExportTag::kThreading | kHighFrequency);
ExportTag::kHighFrequency);
dword_result_t NtClearEvent(dword_t handle) { dword_result_t NtClearEvent(dword_t handle) {
X_STATUS result = X_STATUS_SUCCESS; X_STATUS result = X_STATUS_SUCCESS;
@ -561,9 +550,8 @@ dword_result_t NtClearEvent(dword_t handle) {
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtClearEvent, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(NtClearEvent, kThreading, kImplemented,
ExportTag::kThreading | kHighFrequency);
ExportTag::kHighFrequency);
// https://msdn.microsoft.com/en-us/library/windows/hardware/ff552150(v=vs.85).aspx // https://msdn.microsoft.com/en-us/library/windows/hardware/ff552150(v=vs.85).aspx
void KeInitializeSemaphore(pointer_t<X_KSEMAPHORE> semaphore_ptr, dword_t count, void KeInitializeSemaphore(pointer_t<X_KSEMAPHORE> semaphore_ptr, dword_t count,
@ -579,8 +567,7 @@ void KeInitializeSemaphore(pointer_t<X_KSEMAPHORE> semaphore_ptr, dword_t count,
return; return;
} }
} }
DECLARE_XBOXKRNL_EXPORT(KeInitializeSemaphore, DECLARE_XBOXKRNL_EXPORT1(KeInitializeSemaphore, kThreading, kImplemented);
ExportTag::kImplemented | ExportTag::kThreading);
dword_result_t KeReleaseSemaphore(pointer_t<X_KSEMAPHORE> semaphore_ptr, dword_result_t KeReleaseSemaphore(pointer_t<X_KSEMAPHORE> semaphore_ptr,
dword_t increment, dword_t adjustment, dword_t increment, dword_t adjustment,
@ -597,8 +584,7 @@ dword_result_t KeReleaseSemaphore(pointer_t<X_KSEMAPHORE> semaphore_ptr,
return sem->ReleaseSemaphore(adjustment); return sem->ReleaseSemaphore(adjustment);
} }
DECLARE_XBOXKRNL_EXPORT(KeReleaseSemaphore, DECLARE_XBOXKRNL_EXPORT1(KeReleaseSemaphore, kThreading, kImplemented);
ExportTag::kImplemented | ExportTag::kThreading);
SHIM_CALL NtCreateSemaphore_shim(PPCContext* ppc_context, SHIM_CALL NtCreateSemaphore_shim(PPCContext* ppc_context,
KernelState* kernel_state) { KernelState* kernel_state) {
@ -698,7 +684,7 @@ dword_result_t NtCreateMutant(lpdword_t handle_out,
return X_STATUS_SUCCESS; return X_STATUS_SUCCESS;
} }
DECLARE_XBOXKRNL_EXPORT(NtCreateMutant, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(NtCreateMutant, kThreading, kImplemented);
SHIM_CALL NtReleaseMutant_shim(PPCContext* ppc_context, SHIM_CALL NtReleaseMutant_shim(PPCContext* ppc_context,
KernelState* kernel_state) { KernelState* kernel_state) {
@ -844,9 +830,8 @@ dword_result_t KeWaitForSingleObject(lpvoid_t object_ptr, dword_t wait_reason,
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(KeWaitForSingleObject, DECLARE_XBOXKRNL_EXPORT3(KeWaitForSingleObject, kThreading, kImplemented,
ExportTag::kImplemented | ExportTag::kThreading | kBlocking, kHighFrequency);
ExportTag::kBlocking | ExportTag::kHighFrequency);
dword_result_t NtWaitForSingleObjectEx(dword_t object_handle, dword_t wait_mode, dword_result_t NtWaitForSingleObjectEx(dword_t object_handle, dword_t wait_mode,
dword_t alertable, dword_t alertable,
@ -865,9 +850,8 @@ dword_result_t NtWaitForSingleObjectEx(dword_t object_handle, dword_t wait_mode,
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtWaitForSingleObjectEx, DECLARE_XBOXKRNL_EXPORT3(NtWaitForSingleObjectEx, kThreading, kImplemented,
ExportTag::kImplemented | ExportTag::kThreading | kBlocking, kHighFrequency);
ExportTag::kBlocking | ExportTag::kHighFrequency);
dword_result_t KeWaitForMultipleObjects(dword_t count, lpdword_t objects_ptr, dword_result_t KeWaitForMultipleObjects(dword_t count, lpdword_t objects_ptr,
dword_t wait_type, dword_t wait_reason, 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; return result;
} }
DECLARE_XBOXKRNL_EXPORT(KeWaitForMultipleObjects, DECLARE_XBOXKRNL_EXPORT3(KeWaitForMultipleObjects, kThreading, kImplemented,
ExportTag::kImplemented | ExportTag::kThreading | kBlocking, kHighFrequency);
ExportTag::kBlocking | ExportTag::kHighFrequency);
dword_result_t NtWaitForMultipleObjectsEx(dword_t count, lpdword_t handles, dword_result_t NtWaitForMultipleObjectsEx(dword_t count, lpdword_t handles,
dword_t wait_type, dword_t wait_mode, dword_t wait_type, dword_t wait_mode,
@ -928,9 +911,8 @@ dword_result_t NtWaitForMultipleObjectsEx(dword_t count, lpdword_t handles,
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtWaitForMultipleObjectsEx, DECLARE_XBOXKRNL_EXPORT3(NtWaitForMultipleObjectsEx, kThreading, kImplemented,
ExportTag::kImplemented | ExportTag::kThreading | kBlocking, kHighFrequency);
ExportTag::kBlocking | ExportTag::kHighFrequency);
dword_result_t NtSignalAndWaitForSingleObjectEx(dword_t signal_handle, dword_result_t NtSignalAndWaitForSingleObjectEx(dword_t signal_handle,
dword_t wait_handle, dword_t wait_handle,
@ -953,9 +935,8 @@ dword_result_t NtSignalAndWaitForSingleObjectEx(dword_t signal_handle,
return result; return result;
} }
DECLARE_XBOXKRNL_EXPORT(NtSignalAndWaitForSingleObjectEx, DECLARE_XBOXKRNL_EXPORT3(NtSignalAndWaitForSingleObjectEx, kThreading,
ExportTag::kImplemented | ExportTag::kThreading | kImplemented, kBlocking, kHighFrequency);
ExportTag::kBlocking | ExportTag::kHighFrequency);
dword_result_t KfAcquireSpinLock(lpdword_t lock_ptr) { dword_result_t KfAcquireSpinLock(lpdword_t lock_ptr) {
// XELOGD( // XELOGD(
@ -976,9 +957,8 @@ dword_result_t KfAcquireSpinLock(lpdword_t lock_ptr) {
return old_irql; return old_irql;
} }
DECLARE_XBOXKRNL_EXPORT(KfAcquireSpinLock, DECLARE_XBOXKRNL_EXPORT3(KfAcquireSpinLock, kThreading, kImplemented, kBlocking,
ExportTag::kImplemented | ExportTag::kThreading | kHighFrequency);
ExportTag::kHighFrequency | ExportTag::kBlocking);
void KfReleaseSpinLock(lpdword_t lock_ptr, dword_t old_irql) { void KfReleaseSpinLock(lpdword_t lock_ptr, dword_t old_irql) {
// Restore IRQL. // Restore IRQL.
@ -989,9 +969,8 @@ void KfReleaseSpinLock(lpdword_t lock_ptr, dword_t old_irql) {
auto lock = reinterpret_cast<uint32_t*>(lock_ptr.host_address()); auto lock = reinterpret_cast<uint32_t*>(lock_ptr.host_address());
xe::atomic_dec(lock); xe::atomic_dec(lock);
} }
DECLARE_XBOXKRNL_EXPORT(KfReleaseSpinLock, ExportTag::kImplemented | DECLARE_XBOXKRNL_EXPORT2(KfReleaseSpinLock, kThreading, kImplemented,
ExportTag::kThreading | kHighFrequency);
ExportTag::kHighFrequency);
void KeAcquireSpinLockAtRaisedIrql(lpdword_t lock_ptr) { void KeAcquireSpinLockAtRaisedIrql(lpdword_t lock_ptr) {
// Lock. // Lock.
@ -1001,18 +980,16 @@ void KeAcquireSpinLockAtRaisedIrql(lpdword_t lock_ptr) {
// TODO(benvanik): error on deadlock? // TODO(benvanik): error on deadlock?
} }
} }
DECLARE_XBOXKRNL_EXPORT(KeAcquireSpinLockAtRaisedIrql, DECLARE_XBOXKRNL_EXPORT3(KeAcquireSpinLockAtRaisedIrql, kThreading,
ExportTag::kImplemented | ExportTag::kThreading | kImplemented, kBlocking, kHighFrequency);
ExportTag::kHighFrequency | ExportTag::kBlocking);
void KeReleaseSpinLockFromRaisedIrql(lpdword_t lock_ptr) { void KeReleaseSpinLockFromRaisedIrql(lpdword_t lock_ptr) {
// Unlock. // Unlock.
auto lock = reinterpret_cast<uint32_t*>(lock_ptr.host_address()); auto lock = reinterpret_cast<uint32_t*>(lock_ptr.host_address());
xe::atomic_dec(lock); xe::atomic_dec(lock);
} }
DECLARE_XBOXKRNL_EXPORT(KeReleaseSpinLockFromRaisedIrql, DECLARE_XBOXKRNL_EXPORT2(KeReleaseSpinLockFromRaisedIrql, kThreading,
ExportTag::kImplemented | ExportTag::kThreading | kImplemented, kHighFrequency);
ExportTag::kHighFrequency);
SHIM_CALL KeEnterCriticalRegion_shim(PPCContext* ppc_context, SHIM_CALL KeEnterCriticalRegion_shim(PPCContext* ppc_context,
KernelState* kernel_state) { KernelState* kernel_state) {
@ -1270,8 +1247,7 @@ void ExInitializeReadWriteLock(pointer_t<X_ERWLOCK> lock_ptr) {
KeInitializeEvent(&lock_ptr->writer_event, 1, 0); KeInitializeEvent(&lock_ptr->writer_event, 1, 0);
KeInitializeSemaphore(&lock_ptr->reader_semaphore, 0, 0x7FFFFFFF); KeInitializeSemaphore(&lock_ptr->reader_semaphore, 0, 0x7FFFFFFF);
} }
DECLARE_XBOXKRNL_EXPORT(ExInitializeReadWriteLock, DECLARE_XBOXKRNL_EXPORT1(ExInitializeReadWriteLock, kThreading, kImplemented);
ExportTag::kThreading | ExportTag::kImplemented);
// NOTE: This function is very commonly inlined, and probably won't be called! // NOTE: This function is very commonly inlined, and probably won't be called!
pointer_result_t InterlockedPushEntrySList( pointer_result_t InterlockedPushEntrySList(
@ -1296,8 +1272,8 @@ pointer_result_t InterlockedPushEntrySList(
return old_head; return old_head;
} }
DECLARE_XBOXKRNL_EXPORT(InterlockedPushEntrySList, DECLARE_XBOXKRNL_EXPORT2(InterlockedPushEntrySList, kThreading, kImplemented,
ExportTag::kImplemented | ExportTag::kHighFrequency); kHighFrequency);
pointer_result_t InterlockedPopEntrySList(pointer_t<X_SLIST_HEADER> plist_ptr) { pointer_result_t InterlockedPopEntrySList(pointer_t<X_SLIST_HEADER> plist_ptr) {
assert_not_null(plist_ptr); assert_not_null(plist_ptr);
@ -1323,8 +1299,8 @@ pointer_result_t InterlockedPopEntrySList(pointer_t<X_SLIST_HEADER> plist_ptr) {
return popped; return popped;
} }
DECLARE_XBOXKRNL_EXPORT(InterlockedPopEntrySList, DECLARE_XBOXKRNL_EXPORT2(InterlockedPopEntrySList, kThreading, kImplemented,
ExportTag::kImplemented | ExportTag::kHighFrequency); kHighFrequency);
pointer_result_t InterlockedFlushSList(pointer_t<X_SLIST_HEADER> plist_ptr) { pointer_result_t InterlockedFlushSList(pointer_t<X_SLIST_HEADER> plist_ptr) {
assert_not_null(plist_ptr); assert_not_null(plist_ptr);
@ -1344,7 +1320,7 @@ pointer_result_t InterlockedFlushSList(pointer_t<X_SLIST_HEADER> plist_ptr) {
return first; return first;
} }
DECLARE_XBOXKRNL_EXPORT(InterlockedFlushSList, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT1(InterlockedFlushSList, kThreading, kImplemented);
void RegisterThreadingExports(xe::cpu::ExportResolver* export_resolver, void RegisterThreadingExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) { KernelState* kernel_state) {

View File

@ -23,13 +23,13 @@ dword_result_t XUsbcamCreate(unknown_t unk1, // E
// 0 = success. // 0 = success.
return X_ERROR_DEVICE_NOT_CONNECTED; return X_ERROR_DEVICE_NOT_CONNECTED;
} }
DECLARE_XBOXKRNL_EXPORT(XUsbcamCreate, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(XUsbcamCreate, kNone, kStub);
dword_result_t XUsbcamGetState() { dword_result_t XUsbcamGetState() {
// 0 = not connected. // 0 = not connected.
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XUsbcamGetState, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT1(XUsbcamGetState, kNone, kStub);
void RegisterUsbcamExports(xe::cpu::ExportResolver* export_resolver, void RegisterUsbcamExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {} KernelState* kernel_state) {}

View File

@ -48,7 +48,7 @@ void VdGetCurrentDisplayGamma(lpdword_t type_ptr, lpfloat_t unknown_ptr) {
*type_ptr = 1; *type_ptr = 1;
*unknown_ptr = 2.22222233f; // maybe brightness? *unknown_ptr = 2.22222233f; // maybe brightness?
} }
DECLARE_XBOXKRNL_EXPORT(VdGetCurrentDisplayGamma, ExportTag::kVideo); DECLARE_XBOXKRNL_EXPORT1(VdGetCurrentDisplayGamma, kVideo, kStub);
struct X_D3DPRIVATE_RECT { struct X_D3DPRIVATE_RECT {
xe::be<uint32_t> x1; // 0x0 xe::be<uint32_t> x1; // 0x0
@ -121,7 +121,7 @@ void VdGetCurrentDisplayInformation(pointer_t<X_DISPLAY_INFO> display_info) {
display_info->display_refresh_rate = mode.refresh_rate; display_info->display_refresh_rate = mode.refresh_rate;
display_info->actual_display_width = (uint16_t)mode.display_width; 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<X_VIDEO_MODE> video_mode) { void VdQueryVideoMode(pointer_t<X_VIDEO_MODE> video_mode) {
// TODO(benvanik): get info from actual display. // TODO(benvanik): get info from actual display.
@ -136,7 +136,7 @@ void VdQueryVideoMode(pointer_t<X_VIDEO_MODE> video_mode) {
video_mode->unknown_0x8a = 0x4A; video_mode->unknown_0x8a = 0x4A;
video_mode->unknown_0x01 = 0x01; video_mode->unknown_0x01 = 0x01;
} }
DECLARE_XBOXKRNL_EXPORT(VdQueryVideoMode, ExportTag::kVideo); DECLARE_XBOXKRNL_EXPORT1(VdQueryVideoMode, kVideo, kStub);
dword_result_t VdQueryVideoFlags() { dword_result_t VdQueryVideoFlags() {
X_VIDEO_MODE mode; X_VIDEO_MODE mode;
@ -149,7 +149,7 @@ dword_result_t VdQueryVideoFlags() {
return flags; return flags;
} }
DECLARE_XBOXKRNL_EXPORT(VdQueryVideoFlags, ExportTag::kVideo); DECLARE_XBOXKRNL_EXPORT1(VdQueryVideoFlags, kVideo, kStub);
dword_result_t VdSetDisplayMode(dword_t flags) { dword_result_t VdSetDisplayMode(dword_t flags) {
// Often 0x40000000. // Often 0x40000000.
@ -168,7 +168,7 @@ dword_result_t VdSetDisplayMode(dword_t flags) {
return 0; 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, dword_result_t VdSetDisplayModeOverride(unknown_t unk0, unknown_t unk1,
double_t refresh_rate, unknown_t unk3, 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. // refresh_rate = 0, 50, 59.9, etc.
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(VdSetDisplayModeOverride, DECLARE_XBOXKRNL_EXPORT1(VdSetDisplayModeOverride, kVideo, kStub);
ExportTag::kVideo | ExportTag::kStub);
dword_result_t VdInitializeEngines(unknown_t unk0, function_t callback, dword_result_t VdInitializeEngines(unknown_t unk0, function_t callback,
lpvoid_t arg, lpdword_t pfp_ptr, lpvoid_t arg, lpdword_t pfp_ptr,
@ -189,29 +188,27 @@ dword_result_t VdInitializeEngines(unknown_t unk0, function_t callback,
// r7 = ME Microcode // r7 = ME Microcode
return 1; return 1;
} }
DECLARE_XBOXKRNL_EXPORT(VdInitializeEngines, DECLARE_XBOXKRNL_EXPORT1(VdInitializeEngines, kVideo, kStub);
ExportTag::kVideo | ExportTag::kStub);
void VdShutdownEngines() { void VdShutdownEngines() {
// Ignored for now. // Ignored for now.
// Games seem to call an Initialize/Shutdown pair to query info, then // Games seem to call an Initialize/Shutdown pair to query info, then
// re-initialize. // re-initialize.
} }
DECLARE_XBOXKRNL_EXPORT(VdShutdownEngines, DECLARE_XBOXKRNL_EXPORT1(VdShutdownEngines, kVideo, kStub);
ExportTag::kVideo | ExportTag::kStub);
dword_result_t VdGetGraphicsAsicID() { dword_result_t VdGetGraphicsAsicID() {
// Games compare for < 0x10 and do VdInitializeEDRAM, else other // Games compare for < 0x10 and do VdInitializeEDRAM, else other
// (retrain/etc). // (retrain/etc).
return 0x11; return 0x11;
} }
DECLARE_XBOXKRNL_EXPORT(VdGetGraphicsAsicID, ExportTag::kVideo); DECLARE_XBOXKRNL_EXPORT1(VdGetGraphicsAsicID, kVideo, kStub);
dword_result_t VdEnableDisableClockGating(dword_t enabled) { dword_result_t VdEnableDisableClockGating(dword_t enabled) {
// Ignored, as it really doesn't matter. // Ignored, as it really doesn't matter.
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(VdEnableDisableClockGating, ExportTag::kVideo); DECLARE_XBOXKRNL_EXPORT1(VdEnableDisableClockGating, kVideo, kStub);
void VdSetGraphicsInterruptCallback(function_t callback, lpvoid_t user_data) { void VdSetGraphicsInterruptCallback(function_t callback, lpvoid_t user_data) {
// callback takes 2 params // 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(); auto graphics_system = kernel_state()->emulator()->graphics_system();
graphics_system->SetInterruptCallback(callback, user_data); 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) { void VdInitializeRingBuffer(lpvoid_t ptr, int_t log2_size) {
// r3 = result of MmGetPhysicalAddress // 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(); auto graphics_system = kernel_state()->emulator()->graphics_system();
graphics_system->InitializeRingBuffer(ptr, log2_size); 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) { void VdEnableRingBufferRPtrWriteBack(lpvoid_t ptr, int_t block_size) {
// r4 = 6, usually --- <=19 // r4 = 6, usually --- <=19
auto graphics_system = kernel_state()->emulator()->graphics_system(); auto graphics_system = kernel_state()->emulator()->graphics_system();
graphics_system->EnableReadPointerWriteBack(ptr, block_size); 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) { void VdGetSystemCommandBuffer(lpunknown_t p0_ptr, lpunknown_t p1_ptr) {
p0_ptr.Zero(0x94); p0_ptr.Zero(0x94);
xe::store_and_swap<uint32_t>(p0_ptr, 0xBEEF0000); xe::store_and_swap<uint32_t>(p0_ptr, 0xBEEF0000);
xe::store_and_swap<uint32_t>(p1_ptr, 0xBEEF0001); xe::store_and_swap<uint32_t>(p1_ptr, 0xBEEF0001);
} }
DECLARE_XBOXKRNL_EXPORT(VdGetSystemCommandBuffer, DECLARE_XBOXKRNL_EXPORT1(VdGetSystemCommandBuffer, kVideo, kStub);
ExportTag::kVideo | ExportTag::kStub);
void VdSetSystemCommandBufferGpuIdentifierAddress(lpunknown_t unk) { void VdSetSystemCommandBufferGpuIdentifierAddress(lpunknown_t unk) {
// r3 = 0x2B10(d3d?) + 8 // r3 = 0x2B10(d3d?) + 8
} }
DECLARE_XBOXKRNL_EXPORT(VdSetSystemCommandBufferGpuIdentifierAddress, DECLARE_XBOXKRNL_EXPORT1(VdSetSystemCommandBufferGpuIdentifierAddress, kVideo,
ExportTag::kVideo | ExportTag::kStub); kStub);
// VdVerifyMEInitCommand // VdVerifyMEInitCommand
// r3 // r3
@ -281,8 +277,8 @@ dword_result_t VdInitializeScalerCommandBuffer(
} }
return (uint32_t)dest_count; return (uint32_t)dest_count;
} }
DECLARE_XBOXKRNL_EXPORT(VdInitializeScalerCommandBuffer, DECLARE_XBOXKRNL_EXPORT2(VdInitializeScalerCommandBuffer, kVideo, kImplemented,
ExportTag::kVideo | ExportTag::kSketchy); kSketchy);
struct BufferScaling { struct BufferScaling {
xe::be<uint16_t> fb_width; xe::be<uint16_t> fb_width;
@ -305,15 +301,14 @@ dword_result_t VdCallGraphicsNotificationRoutines(
// callbacks get 0, r3, r4 // callbacks get 0, r3, r4
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(VdCallGraphicsNotificationRoutines, DECLARE_XBOXKRNL_EXPORT2(VdCallGraphicsNotificationRoutines, kVideo,
ExportTag::kVideo | ExportTag::kSketchy); kImplemented, kSketchy);
dword_result_t VdIsHSIOTrainingSucceeded() { dword_result_t VdIsHSIOTrainingSucceeded() {
// BOOL return value // BOOL return value
return 1; return 1;
} }
DECLARE_XBOXKRNL_EXPORT(VdIsHSIOTrainingSucceeded, DECLARE_XBOXKRNL_EXPORT1(VdIsHSIOTrainingSucceeded, kVideo, kStub);
ExportTag::kVideo | ExportTag::kStub);
dword_result_t VdPersistDisplay(unknown_t unk0, lpdword_t unk1_ptr) { dword_result_t VdPersistDisplay(unknown_t unk0, lpdword_t unk1_ptr) {
// unk1_ptr needs to be populated with a pointer passed to // 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; return 1;
} }
DECLARE_XBOXKRNL_EXPORT(VdPersistDisplay, DECLARE_XBOXKRNL_EXPORT2(VdPersistDisplay, kVideo, kImplemented, kSketchy);
ExportTag::kVideo | ExportTag::kSketchy);
dword_result_t VdRetrainEDRAMWorker(unknown_t unk0) { return 0; } dword_result_t VdRetrainEDRAMWorker(unknown_t unk0) { return 0; }
DECLARE_XBOXKRNL_EXPORT(VdRetrainEDRAMWorker, DECLARE_XBOXKRNL_EXPORT1(VdRetrainEDRAMWorker, kVideo, kStub);
ExportTag::kVideo | ExportTag::kStub);
dword_result_t VdRetrainEDRAM(unknown_t unk0, unknown_t unk1, unknown_t unk2, dword_result_t VdRetrainEDRAM(unknown_t unk0, unknown_t unk1, unknown_t unk2,
unknown_t unk3, unknown_t unk4, unknown_t unk5) { unknown_t unk3, unknown_t unk4, unknown_t unk5) {
return 0; 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 void VdSwap(lpvoid_t buffer_ptr, // ptr into primary ringbuffer
lpvoid_t fetch_ptr, // frontbuffer texture fetch 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(); 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, void RegisterVideoExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) { KernelState* kernel_state) {