Checking in intermediate FS work before moving code.
This commit is contained in:
parent
a8d10cd9d3
commit
26c06e13d9
|
@ -0,0 +1,36 @@
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* 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. *
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <xenia/kernel/modules/xboxkrnl/async_request.h>
|
||||||
|
|
||||||
|
#include <xenia/kernel/modules/xboxkrnl/xobject.h>
|
||||||
|
#include <xenia/kernel/modules/xboxkrnl/objects/xevent.h>
|
||||||
|
|
||||||
|
|
||||||
|
using namespace xe;
|
||||||
|
using namespace xe::kernel;
|
||||||
|
using namespace xe::kernel::xboxkrnl;
|
||||||
|
|
||||||
|
|
||||||
|
XAsyncRequest::XAsyncRequest(
|
||||||
|
XObject* object,
|
||||||
|
CompletionCallback callback, void* callback_context) :
|
||||||
|
object_(object),
|
||||||
|
callback_(callback), callback_context_(callback_context),
|
||||||
|
wait_event_(0),
|
||||||
|
apc_routine_(0), apc_context_(0) {
|
||||||
|
object_->Retain();
|
||||||
|
}
|
||||||
|
|
||||||
|
XAsyncRequest::~XAsyncRequest() {
|
||||||
|
if (wait_event_) {
|
||||||
|
wait_event_->Release();
|
||||||
|
}
|
||||||
|
object_->Release();
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* 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_XBOXKRNL_ASYNC_REQUEST_H_
|
||||||
|
#define XENIA_KERNEL_MODULES_XBOXKRNL_ASYNC_REQUEST_H_
|
||||||
|
|
||||||
|
#include <xenia/common.h>
|
||||||
|
#include <xenia/core.h>
|
||||||
|
|
||||||
|
#include <xenia/kernel/xbox.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace xe {
|
||||||
|
namespace kernel {
|
||||||
|
namespace xboxkrnl {
|
||||||
|
|
||||||
|
class XEvent;
|
||||||
|
|
||||||
|
|
||||||
|
class XAsyncRequest {
|
||||||
|
public:
|
||||||
|
typedef void (*CompletionCallback)(XAsyncRequest* request, void* context);
|
||||||
|
|
||||||
|
XAsyncRequest(
|
||||||
|
XObject* object,
|
||||||
|
CompletionCallback callback, void* callback_context);
|
||||||
|
virtual ~XAsyncRequest();
|
||||||
|
|
||||||
|
XObject* object() const { return object_; }
|
||||||
|
|
||||||
|
XEvent* wait_event() const { return wait_event_; }
|
||||||
|
uint32_t apc_routine() const { return apc_routine_; }
|
||||||
|
uint32_t apc_context() const { return apc_context_; }
|
||||||
|
|
||||||
|
// Complete(result)
|
||||||
|
|
||||||
|
protected:
|
||||||
|
XObject* object_;
|
||||||
|
CompletionCallback callback_;
|
||||||
|
void* callback_context_;
|
||||||
|
|
||||||
|
XEvent* wait_event_;
|
||||||
|
uint32_t apc_routine_;
|
||||||
|
uint32_t apc_context_;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace xboxkrnl
|
||||||
|
} // namespace kernel
|
||||||
|
} // namespace xe
|
||||||
|
|
||||||
|
|
||||||
|
#endif // XENIA_KERNEL_MODULES_XBOXKRNL_ASYNC_REQUEST_H_
|
|
@ -25,3 +25,8 @@ XFile::XFile(KernelState* kernel_state, FileEntry* entry) :
|
||||||
|
|
||||||
XFile::~XFile() {
|
XFile::~XFile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
X_STATUS XFile::Read(void* buffer, size_t buffer_length, size_t byte_offset,
|
||||||
|
XAsyncRequest* request) {
|
||||||
|
return X_STATUS_ACCESS_DENIED;
|
||||||
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
#include <xenia/kernel/xbox.h>
|
#include <xenia/kernel/xbox.h>
|
||||||
#include <xenia/kernel/fs/entry.h>
|
#include <xenia/kernel/fs/entry.h>
|
||||||
|
#include <xenia/kernel/modules/xboxkrnl/async_request.h>
|
||||||
|
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
|
@ -26,6 +27,9 @@ public:
|
||||||
XFile(KernelState* kernel_state, fs::FileEntry* entry);
|
XFile(KernelState* kernel_state, fs::FileEntry* entry);
|
||||||
virtual ~XFile();
|
virtual ~XFile();
|
||||||
|
|
||||||
|
X_STATUS Read(void* buffer, size_t buffer_length, size_t byte_offset,
|
||||||
|
XAsyncRequest* request);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
fs::FileEntry* entry_;
|
fs::FileEntry* entry_;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# Copyright 2013 Ben Vanik. All Rights Reserved.
|
# Copyright 2013 Ben Vanik. All Rights Reserved.
|
||||||
{
|
{
|
||||||
'sources': [
|
'sources': [
|
||||||
|
'async_request.cc',
|
||||||
|
'async_request.h',
|
||||||
'kernel_state.cc',
|
'kernel_state.cc',
|
||||||
'kernel_state.h',
|
'kernel_state.h',
|
||||||
'module.cc',
|
'module.cc',
|
||||||
|
|
Loading…
Reference in New Issue