Header cleanups and prep.
This commit is contained in:
parent
8ac1f61c64
commit
1104f8e687
|
@ -125,7 +125,7 @@ bool XexModule::SetupLibraryImports(const xe_xex2_import_library_t* library) {
|
||||||
kernel_export =
|
kernel_export =
|
||||||
export_resolver->GetExportByOrdinal(library->name, info->ordinal);
|
export_resolver->GetExportByOrdinal(library->name, info->ordinal);
|
||||||
} else {
|
} else {
|
||||||
XModule* module = kernel_state_->GetModule(library->name);
|
auto module = kernel_state_->GetModule(library->name);
|
||||||
if (module) {
|
if (module) {
|
||||||
user_export_addr = module->GetProcAddressByOrdinal(info->ordinal);
|
user_export_addr = module->GetProcAddressByOrdinal(info->ordinal);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "xenia/gpu/register_file.h"
|
#include "xenia/gpu/register_file.h"
|
||||||
#include "xenia/gpu/tracing.h"
|
#include "xenia/gpu/tracing.h"
|
||||||
#include "xenia/gpu/xenos.h"
|
#include "xenia/gpu/xenos.h"
|
||||||
|
#include "xenia/kernel/objects/xthread.h"
|
||||||
#include "xenia/memory.h"
|
#include "xenia/memory.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "xenia/base/fs.h"
|
#include "xenia/base/fs.h"
|
||||||
|
#include "xenia/kernel/kernel_state.h"
|
||||||
#include "xenia/kernel/xobject.h"
|
#include "xenia/kernel/xobject.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
|
|
|
@ -14,13 +14,13 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "xenia/base/mutex.h"
|
||||||
|
#include "xenia/kernel/xobject.h"
|
||||||
#include "xenia/xbox.h"
|
#include "xenia/xbox.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace kernel {
|
namespace kernel {
|
||||||
|
|
||||||
class XObject;
|
|
||||||
|
|
||||||
class ObjectTable {
|
class ObjectTable {
|
||||||
public:
|
public:
|
||||||
ObjectTable();
|
ObjectTable();
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#ifndef XENIA_KERNEL_XBOXKRNL_XENUMERATOR_H_
|
#ifndef XENIA_KERNEL_XBOXKRNL_XENUMERATOR_H_
|
||||||
#define XENIA_KERNEL_XBOXKRNL_XENUMERATOR_H_
|
#define XENIA_KERNEL_XBOXKRNL_XENUMERATOR_H_
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "xenia/kernel/xobject.h"
|
#include "xenia/kernel/xobject.h"
|
||||||
#include "xenia/xbox.h"
|
#include "xenia/xbox.h"
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#ifndef XENIA_KERNEL_XBOXKRNL_XFILE_H_
|
#ifndef XENIA_KERNEL_XBOXKRNL_XFILE_H_
|
||||||
#define XENIA_KERNEL_XBOXKRNL_XFILE_H_
|
#define XENIA_KERNEL_XBOXKRNL_XFILE_H_
|
||||||
|
|
||||||
|
#include "xenia/kernel/fs/entry.h"
|
||||||
#include "xenia/kernel/xobject.h"
|
#include "xenia/kernel/xobject.h"
|
||||||
|
|
||||||
#include "xenia/xbox.h"
|
#include "xenia/xbox.h"
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "xenia/kernel/objects/xmodule.h"
|
#include "xenia/kernel/objects/xmodule.h"
|
||||||
|
|
||||||
#include "xenia/base/string.h"
|
#include "xenia/base/string.h"
|
||||||
|
#include "xenia/kernel/kernel_state.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace kernel {
|
namespace kernel {
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
#include "xenia/kernel/objects/xnotify_listener.h"
|
#include "xenia/kernel/objects/xnotify_listener.h"
|
||||||
|
|
||||||
|
#include "xenia/kernel/kernel_state.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace kernel {
|
namespace kernel {
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#define XENIA_KERNEL_XBOXKRNL_XNOTIFY_LISTENER_H_
|
#define XENIA_KERNEL_XBOXKRNL_XNOTIFY_LISTENER_H_
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "xenia/kernel/xobject.h"
|
#include "xenia/kernel/xobject.h"
|
||||||
#include "xenia/xbox.h"
|
#include "xenia/xbox.h"
|
||||||
|
|
|
@ -9,10 +9,13 @@
|
||||||
|
|
||||||
#include "xenia/kernel/objects/xthread.h"
|
#include "xenia/kernel/objects/xthread.h"
|
||||||
|
|
||||||
|
#include <gflags/gflags.h>
|
||||||
|
|
||||||
#include "xenia/base/logging.h"
|
#include "xenia/base/logging.h"
|
||||||
#include "xenia/base/math.h"
|
#include "xenia/base/math.h"
|
||||||
#include "xenia/base/threading.h"
|
#include "xenia/base/threading.h"
|
||||||
#include "xenia/cpu/cpu.h"
|
#include "xenia/cpu/cpu.h"
|
||||||
|
#include "xenia/kernel/kernel_state.h"
|
||||||
#include "xenia/kernel/native_list.h"
|
#include "xenia/kernel/native_list.h"
|
||||||
#include "xenia/kernel/objects/xevent.h"
|
#include "xenia/kernel/objects/xevent.h"
|
||||||
#include "xenia/kernel/objects/xuser_module.h"
|
#include "xenia/kernel/objects/xuser_module.h"
|
||||||
|
@ -153,7 +156,7 @@ X_STATUS XThread::Create() {
|
||||||
// Set native info.
|
// Set native info.
|
||||||
SetNativePointer(thread_state_address_, true);
|
SetNativePointer(thread_state_address_, true);
|
||||||
|
|
||||||
XUserModule* module = kernel_state()->GetExecutableModule();
|
auto module = kernel_state()->GetExecutableModule();
|
||||||
|
|
||||||
// Allocate thread scratch.
|
// Allocate thread scratch.
|
||||||
// This is used by interrupts/APCs/etc so we can round-trip pointers through.
|
// This is used by interrupts/APCs/etc so we can round-trip pointers through.
|
||||||
|
|
|
@ -51,9 +51,6 @@ X_STATUS XUserModule::LoadFromFile(std::string path) {
|
||||||
// Map.
|
// Map.
|
||||||
auto mmap = fs_entry->CreateMemoryMapping(fs::Mode::READ, 0, 0);
|
auto mmap = fs_entry->CreateMemoryMapping(fs::Mode::READ, 0, 0);
|
||||||
if (!mmap) {
|
if (!mmap) {
|
||||||
if (file) {
|
|
||||||
file->Release();
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,9 +60,6 @@ X_STATUS XUserModule::LoadFromFile(std::string path) {
|
||||||
X_FILE_NETWORK_OPEN_INFORMATION file_info;
|
X_FILE_NETWORK_OPEN_INFORMATION file_info;
|
||||||
result = fs_entry->QueryInfo(&file_info);
|
result = fs_entry->QueryInfo(&file_info);
|
||||||
if (result) {
|
if (result) {
|
||||||
if (file) {
|
|
||||||
file->Release();
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,8 +361,7 @@ void XUserModule::Dump() {
|
||||||
unimpl_count++;
|
unimpl_count++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// User module
|
auto module = kernel_state_->GetModule(library->name);
|
||||||
XModule* module = kernel_state_->GetModule(library->name);
|
|
||||||
if (module) {
|
if (module) {
|
||||||
uint32_t export_addr =
|
uint32_t export_addr =
|
||||||
module->GetProcAddressByOrdinal(info->ordinal);
|
module->GetProcAddressByOrdinal(info->ordinal);
|
||||||
|
@ -409,7 +402,7 @@ void XUserModule::Dump() {
|
||||||
implemented = kernel_export->is_implemented;
|
implemented = kernel_export->is_implemented;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
XModule* module = kernel_state_->GetModule(library->name);
|
auto module = kernel_state_->GetModule(library->name);
|
||||||
if (module && module->GetProcAddressByOrdinal(info->ordinal)) {
|
if (module && module->GetProcAddressByOrdinal(info->ordinal)) {
|
||||||
// TODO: Name lookup
|
// TODO: Name lookup
|
||||||
implemented = true;
|
implemented = true;
|
||||||
|
|
|
@ -9,10 +9,11 @@
|
||||||
|
|
||||||
#include "xenia/kernel/xobject.h"
|
#include "xenia/kernel/xobject.h"
|
||||||
|
|
||||||
#include "xenia/kernel/xboxkrnl_private.h"
|
#include "xenia/kernel/kernel_state.h"
|
||||||
#include "xenia/kernel/objects/xevent.h"
|
#include "xenia/kernel/objects/xevent.h"
|
||||||
#include "xenia/kernel/objects/xmutant.h"
|
#include "xenia/kernel/objects/xmutant.h"
|
||||||
#include "xenia/kernel/objects/xsemaphore.h"
|
#include "xenia/kernel/objects/xsemaphore.h"
|
||||||
|
#include "xenia/kernel/xboxkrnl_private.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace kernel {
|
namespace kernel {
|
||||||
|
@ -34,6 +35,10 @@ XObject::~XObject() {
|
||||||
assert_zero(pointer_ref_count_);
|
assert_zero(pointer_ref_count_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Emulator* XObject::emulator() const { return kernel_state_->emulator_; }
|
||||||
|
KernelState* XObject::kernel_state() const { return kernel_state_; }
|
||||||
|
Memory* XObject::memory() const { return kernel_state_->memory(); }
|
||||||
|
|
||||||
XObject::Type XObject::type() { return type_; }
|
XObject::Type XObject::type() { return type_; }
|
||||||
|
|
||||||
X_HANDLE XObject::handle() const { return handle_; }
|
X_HANDLE XObject::handle() const { return handle_; }
|
||||||
|
|
|
@ -12,12 +12,18 @@
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
#include "xenia/kernel/kernel_state.h"
|
|
||||||
#include "xenia/xbox.h"
|
#include "xenia/xbox.h"
|
||||||
|
|
||||||
|
namespace xe {
|
||||||
|
class Emulator;
|
||||||
|
class Memory;
|
||||||
|
} // namespace xe
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace kernel {
|
namespace kernel {
|
||||||
|
|
||||||
|
class KernelState;
|
||||||
|
|
||||||
// http://www.nirsoft.net/kernel_struct/vista/DISPATCHER_HEADER.html
|
// http://www.nirsoft.net/kernel_struct/vista/DISPATCHER_HEADER.html
|
||||||
typedef struct {
|
typedef struct {
|
||||||
xe::be<uint32_t> type_flags;
|
xe::be<uint32_t> type_flags;
|
||||||
|
@ -43,9 +49,9 @@ class XObject {
|
||||||
XObject(KernelState* kernel_state, Type type);
|
XObject(KernelState* kernel_state, Type type);
|
||||||
virtual ~XObject();
|
virtual ~XObject();
|
||||||
|
|
||||||
Emulator* emulator() const { return kernel_state_->emulator_; }
|
Emulator* emulator() const;
|
||||||
KernelState* kernel_state() const { return kernel_state_; }
|
KernelState* kernel_state() const;
|
||||||
Memory* memory() const { return kernel_state_->memory(); }
|
Memory* memory() const;
|
||||||
|
|
||||||
Type type();
|
Type type();
|
||||||
X_HANDLE handle() const;
|
X_HANDLE handle() const;
|
||||||
|
|
Loading…
Reference in New Issue