Fixing undefined export names.
This commit is contained in:
parent
5c34b0a73e
commit
19cb13692b
|
@ -13,6 +13,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "xenia/base/math.h"
|
||||||
#include "xenia/cpu/frontend/ppc_context.h"
|
#include "xenia/cpu/frontend/ppc_context.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
|
@ -58,18 +59,19 @@ class Export {
|
||||||
kVariable = 1,
|
kVariable = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
Export(uint16_t ordinal, Type type, std::string name,
|
Export(uint16_t ordinal, Type type, const char* name,
|
||||||
ExportTag::type tags = 0)
|
ExportTag::type tags = 0)
|
||||||
: ordinal(ordinal),
|
: ordinal(ordinal),
|
||||||
type(type),
|
type(type),
|
||||||
name(name),
|
|
||||||
tags(tags),
|
tags(tags),
|
||||||
variable_ptr(0),
|
variable_ptr(0),
|
||||||
function_data({nullptr, nullptr, 0}) {}
|
function_data({nullptr, nullptr, 0}) {
|
||||||
|
std::strncpy(this->name, name, xe::countof(this->name));
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t ordinal;
|
uint16_t ordinal;
|
||||||
Type type;
|
Type type;
|
||||||
std::string name;
|
char name[96];
|
||||||
ExportTag::type tags;
|
ExportTag::type tags;
|
||||||
|
|
||||||
bool is_implemented() const {
|
bool is_implemented() const {
|
||||||
|
|
|
@ -389,7 +389,7 @@ void XUserModule::Dump() {
|
||||||
kernel_export =
|
kernel_export =
|
||||||
export_resolver->GetExportByOrdinal(library->name, info->ordinal);
|
export_resolver->GetExportByOrdinal(library->name, info->ordinal);
|
||||||
if (kernel_export) {
|
if (kernel_export) {
|
||||||
name = kernel_export->name.c_str();
|
name = kernel_export->name;
|
||||||
implemented = kernel_export->is_implemented();
|
implemented = kernel_export->is_implemented();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -388,7 +388,7 @@ auto KernelTrampoline(F&& f, Tuple&& t, std::index_sequence<I...>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <KernelModuleId MODULE, uint16_t ORDINAL, typename R, typename... Ps>
|
template <KernelModuleId MODULE, uint16_t ORDINAL, typename R, typename... Ps>
|
||||||
xe::cpu::Export* RegisterExport(R (*fn)(Ps&...), std::string name,
|
xe::cpu::Export* RegisterExport(R (*fn)(Ps&...), const char* name,
|
||||||
xe::cpu::ExportTag::type tags) {
|
xe::cpu::ExportTag::type tags) {
|
||||||
static const auto export =
|
static const auto export =
|
||||||
new cpu::Export(ORDINAL, xe::cpu::Export::Type::kFunction, name,
|
new cpu::Export(ORDINAL, xe::cpu::Export::Type::kFunction, name,
|
||||||
|
@ -418,7 +418,7 @@ xe::cpu::Export* RegisterExport(R (*fn)(Ps&...), std::string name,
|
||||||
}
|
}
|
||||||
|
|
||||||
template <KernelModuleId MODULE, uint16_t ORDINAL, typename... Ps>
|
template <KernelModuleId MODULE, uint16_t ORDINAL, typename... Ps>
|
||||||
xe::cpu::Export* RegisterExport(void (*fn)(Ps&...), std::string name,
|
xe::cpu::Export* RegisterExport(void (*fn)(Ps&...), const char* name,
|
||||||
xe::cpu::ExportTag::type tags) {
|
xe::cpu::ExportTag::type tags) {
|
||||||
static const auto export =
|
static const auto export =
|
||||||
new cpu::Export(ORDINAL, xe::cpu::Export::Type::kFunction, name,
|
new cpu::Export(ORDINAL, xe::cpu::Export::Type::kFunction, name,
|
||||||
|
@ -450,7 +450,7 @@ using xe::cpu::ExportTag;
|
||||||
const auto EXPORT_##module_name##_##name = \
|
const auto EXPORT_##module_name##_##name = \
|
||||||
RegisterExport_##module_name(xe::kernel::shim::RegisterExport< \
|
RegisterExport_##module_name(xe::kernel::shim::RegisterExport< \
|
||||||
xe::kernel::shim::KernelModuleId::module_name, ordinals::##name>( \
|
xe::kernel::shim::KernelModuleId::module_name, ordinals::##name>( \
|
||||||
&name, std::string(#name), tags));
|
&name, #name, tags));
|
||||||
|
|
||||||
#define DECLARE_XAM_EXPORT(name, tags) DECLARE_EXPORT(xam, name, tags)
|
#define DECLARE_XAM_EXPORT(name, tags) DECLARE_EXPORT(xam, name, tags)
|
||||||
#define DECLARE_XBOXKRNL_EXPORT(name, tags) DECLARE_EXPORT(xboxkrnl, name, tags)
|
#define DECLARE_XBOXKRNL_EXPORT(name, tags) DECLARE_EXPORT(xboxkrnl, name, tags)
|
||||||
|
|
Loading…
Reference in New Issue