From 956496fb995344f7fe28c1652ff9f37ea56323d2 Mon Sep 17 00:00:00 2001 From: gibbed Date: Wed, 16 Oct 2013 22:08:41 -0700 Subject: [PATCH] Added KeBugCheck and KeBugCheckEx. --- .../kernel/modules/xboxkrnl/xboxkrnl_misc.cc | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_misc.cc b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_misc.cc index cddb73d8e..adb93107a 100644 --- a/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_misc.cc +++ b/src/xenia/kernel/modules/xboxkrnl/xboxkrnl_misc.cc @@ -25,6 +25,28 @@ namespace kernel { namespace xboxkrnl { +void xeKeBugCheckEx(uint32_t code, uint32_t param1, uint32_t param2, uint32_t param3, uint32_t param4) { + XELOGD("*** STOP: 0x%.8X (0x%.8X, 0x%.8X, 0x%.8X, 0x%.8X)", code, param1, param2, param3, param4); + XEASSERTALWAYS(); +} + +SHIM_CALL KeBugCheck_shim( + xe_ppc_state_t* ppc_state, KernelState* state) { + uint32_t code = SHIM_GET_ARG_32(0); + xeKeBugCheckEx(code, 0, 0, 0, 0); +} + +SHIM_CALL KeBugCheckEx_shim( + xe_ppc_state_t* ppc_state, KernelState* state) { + uint32_t code = SHIM_GET_ARG_32(0); + uint32_t param1 = SHIM_GET_ARG_32(1); + uint32_t param2 = SHIM_GET_ARG_32(2); + uint32_t param3 = SHIM_GET_ARG_32(3); + uint32_t param4 = SHIM_GET_ARG_32(4); + xeKeBugCheckEx(code, param1, param2, param3, param4); +} + + } // namespace xboxkrnl } // namespace kernel } // namespace xe @@ -32,4 +54,6 @@ namespace xboxkrnl { void xe::kernel::xboxkrnl::RegisterMiscExports( ExportResolver* export_resolver, KernelState* state) { + SHIM_SET_MAPPING("xboxkrnl.exe", KeBugCheck, state); + SHIM_SET_MAPPING("xboxkrnl.exe", KeBugCheckEx, state); }