From 169cb65d967f1c8f86d8d9cc66011d047cab6bf1 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Sat, 27 Jun 2015 22:08:52 -0500 Subject: [PATCH] Remove unused execution_info_ptr --- src/xenia/kernel/objects/xuser_module.h | 3 --- src/xenia/kernel/util/xex2.cc | 20 -------------------- src/xenia/kernel/util/xex2.h | 21 +++++++++++++++++++-- src/xenia/kernel/xboxkrnl_rtl.cc | 6 ------ 4 files changed, 19 insertions(+), 31 deletions(-) diff --git a/src/xenia/kernel/objects/xuser_module.h b/src/xenia/kernel/objects/xuser_module.h index c312433e1..03ad4c389 100644 --- a/src/xenia/kernel/objects/xuser_module.h +++ b/src/xenia/kernel/objects/xuser_module.h @@ -28,8 +28,6 @@ class XUserModule : public XModule { xe_xex2_ref xex(); const xe_xex2_header_t* xex_header(); - uint32_t execution_info_ptr() const { return execution_info_ptr_; } - X_STATUS LoadFromFile(std::string path); X_STATUS LoadFromMemory(const void* addr, const size_t length); @@ -45,7 +43,6 @@ class XUserModule : public XModule { private: xe_xex2_ref xex_; uint32_t xex_header_; - uint32_t execution_info_ptr_; }; } // namespace kernel diff --git a/src/xenia/kernel/util/xex2.cc b/src/xenia/kernel/util/xex2.cc index 3eccb68cf..36f17fb4b 100644 --- a/src/xenia/kernel/util/xex2.cc +++ b/src/xenia/kernel/util/xex2.cc @@ -29,26 +29,6 @@ namespace xe { namespace kernel { -template -T* xex2_get_opt_header(const xex2_header* header, uint32_t key) { - for (int i = 0; i < header->header_count; i++) { - const xex2_opt_header* opt_header = header->headers[i]; - if (opt_header->key != key) { - continue; - } - - if ((opt_header->key & 0xFF) == 0x01) { - // Data is stored in the opt header - return (T*)&opt_header->value; - } else { - // Data stored at offset. - return (T*)((uint8_t*)&header->headers[0] + opt_header->offset); - } - } - - return nullptr; -} - uint32_t xex2_get_header_size(const xex2_header* header) { return header->exe_offset; } diff --git a/src/xenia/kernel/util/xex2.h b/src/xenia/kernel/util/xex2.h index 536781ceb..82380daee 100644 --- a/src/xenia/kernel/util/xex2.h +++ b/src/xenia/kernel/util/xex2.h @@ -15,8 +15,25 @@ namespace xe { namespace kernel { -template -T* xex2_get_opt_header(const xex2_header* header, uint32_t key); +template +T* xex2_get_opt_header(const xex2_header* header, uint32_t key) { + for (uint32_t i = 0; i < header->header_count; i++) { + const xex2_opt_header& opt_header = header->headers[i]; + if (opt_header.key != key) { + continue; + } + + if ((opt_header.key & 0xFF) == 0x01) { + // Data is stored in the opt header + return (T*)&opt_header.value; + } else { + // Data stored at offset. + return (T*)((uint8_t*)&header->headers[0] + opt_header.offset); + } + } + + return nullptr; +} uint32_t xex2_get_header_size(const xex2_header* header); } // namespace kernel diff --git a/src/xenia/kernel/xboxkrnl_rtl.cc b/src/xenia/kernel/xboxkrnl_rtl.cc index 1045506e9..993344ec3 100644 --- a/src/xenia/kernel/xboxkrnl_rtl.cc +++ b/src/xenia/kernel/xboxkrnl_rtl.cc @@ -409,12 +409,6 @@ SHIM_CALL RtlImageXexHeaderField_shim(PPCContext* ppc_context, assert_true(xex_header_base == 0x80101100); auto module = kernel_state->GetExecutableModule(); - // Special case. - if (image_field == XEX_HEADER_EXECUTION_INFO) { - SHIM_SET_RETURN_32(module->execution_info_ptr()); - return; - } - const xe_xex2_header_t* xex_header = module->xex_header(); for (size_t n = 0; n < xex_header->header_count; n++) { if (xex_header->headers[n].key == image_field) {