Shuffling kernel/.

This commit is contained in:
Ben Vanik
2015-09-06 18:07:52 -07:00
parent 494cba7131
commit e5fbf840d2
118 changed files with 749 additions and 620 deletions

46
src/xenia/kernel/xtimer.h Normal file
View File

@@ -0,0 +1,46 @@
/**
******************************************************************************
* 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_XTIMER_H_
#define XENIA_KERNEL_XTIMER_H_
#include "xenia/base/threading.h"
#include "xenia/kernel/xobject.h"
#include "xenia/xbox.h"
namespace xe {
namespace kernel {
class XThread;
class XTimer : public XObject {
public:
explicit XTimer(KernelState* kernel_state);
~XTimer() override;
void Initialize(uint32_t timer_type);
X_STATUS SetTimer(int64_t due_time, uint32_t period_ms, uint32_t routine,
uint32_t routine_arg, bool resume);
X_STATUS Cancel();
xe::threading::WaitHandle* GetWaitHandle() override { return timer_.get(); }
private:
std::unique_ptr<xe::threading::Timer> timer_;
XThread* callback_thread_ = nullptr;
uint32_t callback_routine_ = 0;
uint32_t callback_routine_arg_ = 0;
};
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XTIMER_H_