Removing old run loop/ref/core/etc.

This commit is contained in:
Ben Vanik
2014-12-19 22:04:57 -08:00
parent d70f585f5e
commit a0eebf8898
136 changed files with 461 additions and 1601 deletions

View File

@@ -10,10 +10,8 @@
#ifndef XENIA_KERNEL_UTIL_SHIM_UTILS_H_
#define XENIA_KERNEL_UTIL_SHIM_UTILS_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <alloy/frontend/ppc/ppc_context.h>
#include <xenia/common.h>
#include <xenia/export_resolver.h>

View File

@@ -23,11 +23,19 @@
// using namespace alloy;
// TODO(benvanik): remove.
#define XEEXPECTZERO(expr) \
if ((expr) != 0) { \
goto XECLEANUP; \
}
#define XEEXPECTNOTNULL(expr) \
if ((expr) == NULL) { \
goto XECLEANUP; \
}
DEFINE_bool(xex_dev_key, false, "Use the devkit key.");
typedef struct xe_xex2 {
xe_ref_t ref;
xe::Memory *memory;
xe_xex2_header_t header;
@@ -52,7 +60,6 @@ int xe_xex2_find_import_infos(xe_xex2_ref xex,
xe_xex2_ref xe_xex2_load(xe::Memory *memory, const void *addr,
const size_t length, xe_xex2_options_t options) {
xe_xex2_ref xex = (xe_xex2_ref)calloc(1, sizeof(xe_xex2));
xe_ref_init((xe_ref)xex);
xex->memory = memory;
xex->sections = new std::vector<PESection *>();
@@ -74,11 +81,15 @@ xe_xex2_ref xe_xex2_load(xe::Memory *memory, const void *addr,
return xex;
XECLEANUP:
xe_xex2_release(xex);
return NULL;
xe_xex2_dealloc(xex);
return nullptr;
}
void xe_xex2_dealloc(xe_xex2_ref xex) {
if (!xex) {
return;
}
for (std::vector<PESection *>::iterator it = xex->sections->begin();
it != xex->sections->end(); ++it) {
delete *it;
@@ -98,15 +109,6 @@ void xe_xex2_dealloc(xe_xex2_ref xex) {
xex->memory = NULL;
}
xe_xex2_ref xe_xex2_retain(xe_xex2_ref xex) {
xe_ref_retain((xe_ref)xex);
return xex;
}
void xe_xex2_release(xe_xex2_ref xex) {
xe_ref_release((xe_ref)xex, (xe_ref_dealloc_t)xe_xex2_dealloc);
}
const xe_xex2_header_t *xe_xex2_get_header(xe_xex2_ref xex) {
return &xex->header;
}
@@ -720,7 +722,7 @@ int xe_xex2_read_image_compressed(const xe_xex2_header_t *header,
XELOGE("Unable to allocate XEX memory at %.8X-%.8X.", header->exe_address,
uncompressed_size);
result_code = 2;
XEFAIL();
goto XECLEANUP;
}
uint8_t *buffer = memory->Translate(header->exe_address);

View File

@@ -10,8 +10,9 @@
#ifndef XENIA_KERNEL_UTIL_XEX2_H_
#define XENIA_KERNEL_UTIL_XEX2_H_
#include <xenia/core.h>
#include <xenia/common.h>
#include <xenia/kernel/util/xex2_info.h>
#include <xenia/memory.h>
typedef struct { int reserved; } xe_xex2_options_t;
@@ -45,8 +46,7 @@ class PESection {
xe_xex2_ref xe_xex2_load(xe::Memory* memory, const void* addr,
const size_t length, xe_xex2_options_t options);
xe_xex2_ref xe_xex2_retain(xe_xex2_ref xex);
void xe_xex2_release(xe_xex2_ref xex);
void xe_xex2_dealloc(xe_xex2_ref xex);
const xe_xex2_header_t* xe_xex2_get_header(xe_xex2_ref xex);
const PESection* xe_xex2_get_pe_section(xe_xex2_ref xex, const char* name);