From 494cba7131ad7b44e47a91669ba468009d3a4128 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 6 Sep 2015 14:10:34 -0700 Subject: [PATCH] Removing unused XAsyncRequest. --- src/xenia/kernel/async_request.cc | 43 ------------------------- src/xenia/kernel/async_request.h | 53 ------------------------------- src/xenia/kernel/objects/xfile.cc | 11 ------- src/xenia/kernel/objects/xfile.h | 4 --- src/xenia/kernel/xboxkrnl_io.cc | 11 ------- 5 files changed, 122 deletions(-) delete mode 100644 src/xenia/kernel/async_request.cc delete mode 100644 src/xenia/kernel/async_request.h diff --git a/src/xenia/kernel/async_request.cc b/src/xenia/kernel/async_request.cc deleted file mode 100644 index 337128858..000000000 --- a/src/xenia/kernel/async_request.cc +++ /dev/null @@ -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 diff --git a/src/xenia/kernel/async_request.h b/src/xenia/kernel/async_request.h deleted file mode 100644 index 98133a472..000000000 --- a/src/xenia/kernel/async_request.h +++ /dev/null @@ -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 - -#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 wait_events_; - uint32_t apc_routine_; - uint32_t apc_context_; -}; - -} // namespace kernel -} // namespace xe - -#endif // XENIA_KERNEL_ASYNC_REQUEST_H_ diff --git a/src/xenia/kernel/objects/xfile.cc b/src/xenia/kernel/objects/xfile.cc index 8cb3e7d3f..70bda198a 100644 --- a/src/xenia/kernel/objects/xfile.cc +++ b/src/xenia/kernel/objects/xfile.cc @@ -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) { diff --git a/src/xenia/kernel/objects/xfile.h b/src/xenia/kernel/objects/xfile.h index 8fa9c5e9d..7f10d2845 100644 --- a/src/xenia/kernel/objects/xfile.h +++ b/src/xenia/kernel/objects/xfile.h @@ -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 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); diff --git a/src/xenia/kernel/xboxkrnl_io.cc b/src/xenia/kernel/xboxkrnl_io.cc index 80a9b7da6..262b6095d 100644 --- a/src/xenia/kernel/xboxkrnl_io.cc +++ b/src/xenia/kernel/xboxkrnl_io.cc @@ -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 io_status_block,