Prepping kernel export tables for various uses.

This commit is contained in:
Ben Vanik 2013-05-26 18:57:41 -07:00
parent 1b07aace73
commit 9f320ba4a7
11 changed files with 1481 additions and 1458 deletions

View File

@ -7,6 +7,6 @@
'xam_module.h',
'xam_state.cc',
'xam_state.h',
'xam_table.h',
'xam_table.inc',
],
}

View File

@ -9,8 +9,8 @@
#include <xenia/kernel/modules/xam/xam_module.h>
#include <xenia/kernel/export.h>
#include <xenia/kernel/modules/xam/xam_info.h>
#include <xenia/kernel/modules/xam/xam_table.h>
using namespace xe;
@ -20,6 +20,12 @@ using namespace xe::kernel::xam;
XamModule::XamModule(Runtime* runtime) :
KernelModule(runtime) {
// Build the export table used for resolution.
#include <xenia/kernel/util/export_table_pre.inc>
static KernelExport xam_export_table[] = {
#include <xenia/kernel/modules/xam/xam_table.inc>
};
#include <xenia/kernel/util/export_table_post.inc>
export_resolver_->RegisterTable(
"xam.xex", xam_export_table, XECOUNT(xam_export_table));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -11,9 +11,9 @@
#include <gflags/gflags.h>
#include <xenia/kernel/export.h>
#include <xenia/kernel/modules/xboxkrnl/kernel_state.h>
#include <xenia/kernel/modules/xboxkrnl/objects/xmodule.h>
#include <xenia/kernel/modules/xboxkrnl/xboxkrnl_table.h>
#include <xenia/kernel/modules/xboxkrnl/xboxkrnl_hal.h>
#include <xenia/kernel/modules/xboxkrnl/xboxkrnl_memory.h>
@ -35,6 +35,12 @@ XboxkrnlModule::XboxkrnlModule(Runtime* runtime) :
KernelModule(runtime) {
ExportResolver* resolver = export_resolver_.get();
// Build the export table used for resolution.
#include <xenia/kernel/util/export_table_pre.inc>
static KernelExport xboxkrnl_export_table[] = {
#include <xenia/kernel/modules/xboxkrnl/xboxkrnl_table.inc>
};
#include <xenia/kernel/util/export_table_post.inc>
resolver->RegisterTable(
"xboxkrnl.exe", xboxkrnl_export_table, XECOUNT(xboxkrnl_export_table));

View File

@ -13,7 +13,7 @@
'xboxkrnl_module.h',
'xboxkrnl_rtl.cc',
'xboxkrnl_rtl.h',
'xboxkrnl_table.h',
'xboxkrnl_table.inc',
'xboxkrnl_threading.cc',
'xboxkrnl_threading.h',
'xobject.cc',

View File

@ -7,21 +7,10 @@
******************************************************************************
*/
#ifndef XENIA_KERNEL_MODULES_XBOXKRNL_TABLE_H_
#define XENIA_KERNEL_MODULES_XBOXKRNL_TABLE_H_
#include <xenia/kernel/export.h>
// This is a partial file designed to be included by other files when
// constructing various tables.
namespace xe {
namespace kernel {
namespace xboxkrnl {
#define FLAG(t) kXEKernelExportFlag##t
static KernelExport xboxkrnl_export_table[] = {
XE_DECLARE_EXPORT(xboxkrnl, 0x00000001, DbgBreakPoint, ? , Function, 0),
XE_DECLARE_EXPORT(xboxkrnl, 0x00000002, DbgBreakPointWithStatus, ? , Function, 0),
XE_DECLARE_EXPORT(xboxkrnl, 0x00000003, DbgPrint, ? , Function, 0),
@ -881,15 +870,3 @@ XE_DECLARE_EXPORT(xboxkrnl, 0x00000358, XAudioSetDuckerHoldTime,
XE_DECLARE_EXPORT(xboxkrnl, 0x00000359, DevAuthShouldAlwaysEnforce, ? , Function, 0),
XE_DECLARE_EXPORT(xboxkrnl, 0x0000035A, XAudioGetUnderrunCount, ? , Function, 0),
XE_DECLARE_EXPORT(xboxkrnl, 0x0000035C, XVoicedIsActiveProcess, ? , Function, 0),
};
#undef FLAG
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_MODULES_XBOXKRNL_TABLE_H_

View File

@ -17,5 +17,6 @@
'includes': [
'fs/sources.gypi',
'modules/sources.gypi',
'util/sources.gypi',
],
}

View File

@ -0,0 +1,14 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
// Post-include file for an export table.
#undef FLAG
#undef XE_EXPORT

View File

@ -0,0 +1,35 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
/**
* Pre-include file for an export table.
* Use this to build tables of exports:
*
* // Build the export table used for resolution.
* #include <xenia/kernel/util/export_table_pre.inc>
* static KernelExport my_module_export_table[] = {
* #include <xenia/kernel/modules/my_module/my_module_table.inc>
* };
* #include <xenia/kernel/util/export_table_post.inc>
* export_resolver_->RegisterTable(
* "my_module.xex",
* my_module_export_table, XECOUNT(my_module_export_table));
*/
#define XE_EXPORT(module, ordinal, name, signature, type, flags) \
{ \
ordinal, \
KernelExport::type, \
flags, \
#signature, \
#name, \
}
#define FLAG(t) kXEKernelExportFlag##t

View File

@ -0,0 +1,7 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'export_table_post.inc',
'export_table_pre.inc',
],
}