Switching kernel files to the new style.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
'xam_module.cc',
|
||||
'xam_module.h',
|
||||
'xam_ordinals.h',
|
||||
'xam_private.h',
|
||||
'xam_state.cc',
|
||||
'xam_state.h',
|
||||
'xam_table.inc',
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#include <xenia/kernel/modules/xam/xam_info.h>
|
||||
|
||||
#include <xenia/kernel/shim_utils.h>
|
||||
#include <xenia/kernel/xbox.h>
|
||||
#include <xenia/kernel/modules/xam/xam_module.h>
|
||||
#include <xenia/kernel/modules/xam/xam_private.h>
|
||||
#include <xenia/kernel/modules/xam/xam_state.h>
|
||||
|
||||
|
||||
using namespace xe;
|
||||
|
||||
@@ -10,8 +10,10 @@
|
||||
#ifndef XENIA_KERNEL_MODULES_XAM_INFO_H_
|
||||
#define XENIA_KERNEL_MODULES_XAM_INFO_H_
|
||||
|
||||
#include <xenia/kernel/modules/xam/xam_state.h>
|
||||
#include <xenia/kernel/modules/xam/xam_ordinals.h>
|
||||
#include <xenia/common.h>
|
||||
#include <xenia/core.h>
|
||||
|
||||
#include <xenia/kernel/xbox.h>
|
||||
|
||||
|
||||
namespace xe {
|
||||
@@ -19,7 +21,6 @@ namespace kernel {
|
||||
namespace xam {
|
||||
|
||||
|
||||
void RegisterInfoExports(ExportResolver* export_resolver, XamState* state);
|
||||
|
||||
|
||||
} // namespace xam
|
||||
|
||||
@@ -10,7 +10,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_private.h>
|
||||
#include <xenia/kernel/modules/xam/xam_state.h>
|
||||
|
||||
|
||||
using namespace xe;
|
||||
@@ -18,6 +19,9 @@ using namespace xe::kernel;
|
||||
using namespace xe::kernel::xam;
|
||||
|
||||
|
||||
XamState* xe::kernel::xam::shared_xam_state_ = NULL;
|
||||
|
||||
|
||||
XamModule::XamModule(Runtime* runtime) :
|
||||
KernelModule(runtime) {
|
||||
// Build the export table used for resolution.
|
||||
@@ -32,9 +36,15 @@ XamModule::XamModule(Runtime* runtime) :
|
||||
// Setup the xam state instance.
|
||||
xam_state = auto_ptr<XamState>(new XamState(memory_, export_resolver_));
|
||||
|
||||
// Setup the shared global state object.
|
||||
XEASSERTNULL(shared_xam_state_);
|
||||
shared_xam_state_ = xam_state.get();
|
||||
|
||||
// Register all exported functions.
|
||||
RegisterInfoExports(export_resolver_.get(), xam_state.get());
|
||||
}
|
||||
|
||||
XamModule::~XamModule() {
|
||||
// Clear the shared XAM state.
|
||||
shared_xam_state_ = NULL;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
#include <xenia/kernel/kernel_module.h>
|
||||
#include <xenia/kernel/modules/xam/xam_ordinals.h>
|
||||
|
||||
// All of the exported functions:
|
||||
#include <xenia/kernel/modules/xam/xam_info.h>
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace kernel {
|
||||
|
||||
41
src/xenia/kernel/modules/xam/xam_private.h
Normal file
41
src/xenia/kernel/modules/xam/xam_private.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef XENIA_KERNEL_MODULES_XAM_PRIVATE_H_
|
||||
#define XENIA_KERNEL_MODULES_XAM_PRIVATE_H_
|
||||
|
||||
#include <xenia/common.h>
|
||||
#include <xenia/core.h>
|
||||
|
||||
#include <xenia/kernel/modules/xam/xam_ordinals.h>
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace kernel {
|
||||
namespace xam {
|
||||
|
||||
class XamState;
|
||||
|
||||
|
||||
// This is a global object initialized with the XamModule.
|
||||
// It references the current xam state object that all xam methods should
|
||||
// be using to stash their variables.
|
||||
extern XamState* shared_xam_state_;
|
||||
|
||||
|
||||
// Registration functions, one per file.
|
||||
void RegisterInfoExports(ExportResolver* export_resolver, XamState* state);
|
||||
|
||||
|
||||
} // namespace xam
|
||||
} // namespace kernel
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_KERNEL_MODULES_XAM_PRIVATE_H_
|
||||
Reference in New Issue
Block a user