Removing unused XAsyncRequest.

This commit is contained in:
Ben Vanik 2015-09-06 14:10:34 -07:00
parent 8588fbc6cf
commit 494cba7131
5 changed files with 0 additions and 122 deletions

View File

@ -1,43 +0,0 @@
/**
******************************************************************************
* 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/async_request.h"
#include "xenia/kernel/xobject.h"
#include "xenia/kernel/objects/xevent.h"
namespace xe {
namespace kernel {
XAsyncRequest::XAsyncRequest(KernelState* kernel_state, XObject* object,
CompletionCallback callback,
void* callback_context)
: kernel_state_(kernel_state),
object_(object),
callback_(callback),
callback_context_(callback_context),
apc_routine_(0),
apc_context_(0) {
object_->Retain();
}
XAsyncRequest::~XAsyncRequest() {
for (auto it = wait_events_.begin(); it != wait_events_.end(); ++it) {
(*it)->Release();
}
object_->Release();
}
void XAsyncRequest::AddWaitEvent(XEvent* ev) {
ev->Retain();
wait_events_.push_back(ev);
}
} // namespace kernel
} // namespace xe

View File

@ -1,53 +0,0 @@
/**
******************************************************************************
* 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_ASYNC_REQUEST_H_
#define XENIA_KERNEL_ASYNC_REQUEST_H_
#include <vector>
#include "xenia/xbox.h"
namespace xe {
namespace kernel {
class KernelState;
class XEvent;
class XObject;
class XAsyncRequest {
public:
typedef void (*CompletionCallback)(XAsyncRequest* request, void* context);
XAsyncRequest(KernelState* kernel_state, XObject* object,
CompletionCallback callback, void* callback_context);
virtual ~XAsyncRequest();
KernelState* kernel_state() const { return kernel_state_; }
XObject* object() const { return object_; }
void AddWaitEvent(XEvent* ev);
// Complete(result)
protected:
KernelState* kernel_state_;
XObject* object_;
CompletionCallback callback_;
void* callback_context_;
std::vector<XEvent*> wait_events_;
uint32_t apc_routine_;
uint32_t apc_context_;
};
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_ASYNC_REQUEST_H_

View File

@ -10,7 +10,6 @@
#include "xenia/kernel/objects/xfile.h"
#include "xenia/base/math.h"
#include "xenia/kernel/async_request.h"
#include "xenia/kernel/objects/xevent.h"
namespace xe {
@ -98,16 +97,6 @@ X_STATUS XFile::Read(void* buffer, size_t buffer_length, size_t byte_offset,
return result;
}
X_STATUS XFile::Read(void* buffer, size_t buffer_length, size_t byte_offset,
XAsyncRequest* request) {
// Also tack on our event so that any waiters wake.
request->AddWaitEvent(async_event_);
position_ = byte_offset;
// return entry_->ReadAsync(buffer, buffer_length, byte_offset, request);
X_STATUS result = X_STATUS_NOT_IMPLEMENTED;
return result;
}
X_STATUS XFile::Write(const void* buffer, size_t buffer_length,
size_t byte_offset, size_t* out_bytes_written) {
if (byte_offset == -1) {

View File

@ -22,8 +22,6 @@
namespace xe {
namespace kernel {
class XAsyncRequest;
// https://msdn.microsoft.com/en-us/library/windows/hardware/ff545822.aspx
struct X_FILE_NETWORK_OPEN_INFORMATION {
xe::be<uint64_t> creation_time;
@ -96,8 +94,6 @@ class XFile : public XObject {
X_STATUS Read(void* buffer, size_t buffer_length, size_t byte_offset,
size_t* out_bytes_read);
X_STATUS Read(void* buffer, size_t buffer_length, size_t byte_offset,
XAsyncRequest* request);
X_STATUS Write(const void* buffer, size_t buffer_length, size_t byte_offset,
size_t* out_bytes_written);

View File

@ -10,7 +10,6 @@
#include "xenia/base/logging.h"
#include "xenia/base/memory.h"
#include "xenia/cpu/processor.h"
#include "xenia/kernel/async_request.h"
#include "xenia/kernel/kernel_state.h"
#include "xenia/kernel/objects/xevent.h"
#include "xenia/kernel/objects/xfile.h"
@ -155,16 +154,6 @@ dword_result_t NtOpenFile(lpdword_t handle_out, dword_t desired_access,
}
DECLARE_XBOXKRNL_EXPORT(NtOpenFile, ExportTag::kImplemented);
class xeNtReadFileState {
public:
uint32_t x;
};
void xeNtReadFileCompleted(XAsyncRequest* request, xeNtReadFileState* state) {
// TODO(benvanik): set io_status_block_ptr
delete request;
delete state;
}
dword_result_t NtReadFile(dword_t file_handle, dword_t event_handle,
lpvoid_t apc_routine_ptr, lpvoid_t apc_context,
pointer_t<X_IO_STATUS_BLOCK> io_status_block,