Kernel: Replace GetStaticHandleType by HANDLE_TYPE constants

merge-requests/60/head
Yuri Kunde Schlesner 2014-12-21 08:40:29 +07:00
parent 73fba22c01
commit 23f2142009
8 changed files with 15 additions and 15 deletions

@ -20,8 +20,8 @@ public:
std::string GetTypeName() const override { return "Arbiter"; }
std::string GetName() const override { return name; }
static Kernel::HandleType GetStaticHandleType() { return HandleType::AddressArbiter; }
Kernel::HandleType GetHandleType() const override { return HandleType::AddressArbiter; }
static const HandleType HANDLE_TYPE = HandleType::AddressArbiter;
HandleType GetHandleType() const override { return HANDLE_TYPE; }
std::string name; ///< Name of address arbiter object (optional)
};

@ -19,8 +19,8 @@ public:
std::string GetTypeName() const override { return "Event"; }
std::string GetName() const override { return name; }
static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Event; }
Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Event; }
static const HandleType HANDLE_TYPE = HandleType::Event;
HandleType GetHandleType() const override { return HANDLE_TYPE; }
ResetType intitial_reset_type; ///< ResetType specified at Event initialization
ResetType reset_type; ///< Current ResetType

@ -96,7 +96,7 @@ public:
return nullptr;
} else {
Object* t = pool[handle - HANDLE_OFFSET];
if (t->GetHandleType() != T::GetStaticHandleType()) {
if (t->GetHandleType() != T::HANDLE_TYPE) {
LOG_ERROR(Kernel, "Wrong object type for %08x", handle);
return nullptr;
}

@ -18,8 +18,8 @@ public:
std::string GetTypeName() const override { return "Mutex"; }
std::string GetName() const override { return name; }
static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Mutex; }
Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Mutex; }
static const HandleType HANDLE_TYPE = HandleType::Mutex;
HandleType GetHandleType() const override { return HANDLE_TYPE; }
bool initial_locked; ///< Initial lock state when mutex was created
bool locked; ///< Current locked state

@ -17,8 +17,8 @@ public:
std::string GetTypeName() const override { return "Semaphore"; }
std::string GetName() const override { return name; }
static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Semaphore; }
Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Semaphore; }
static const HandleType HANDLE_TYPE = HandleType::Semaphore;
HandleType GetHandleType() const override { return HANDLE_TYPE; }
s32 max_count; ///< Maximum number of simultaneous holders the semaphore can have
s32 available_count; ///< Number of free slots left in the semaphore

@ -45,8 +45,8 @@ class Session : public Object {
public:
std::string GetTypeName() const override { return "Session"; }
static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Session; }
Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Session; }
static const HandleType HANDLE_TYPE = HandleType::Session;
HandleType GetHandleType() const override { return HANDLE_TYPE; }
/**
* Handles a synchronous call to this session using HLE emulation. Emulated <-> emulated calls

@ -13,8 +13,8 @@ class SharedMemory : public Object {
public:
std::string GetTypeName() const override { return "SharedMemory"; }
static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::SharedMemory; }
Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::SharedMemory; }
static const HandleType HANDLE_TYPE = HandleType::SharedMemory;
HandleType GetHandleType() const override { return HANDLE_TYPE; }
u32 base_address; ///< Address of shared memory block in RAM
MemoryPermission permissions; ///< Permissions of shared memory block (SVC field)

@ -26,8 +26,8 @@ public:
std::string GetName() const override { return name; }
std::string GetTypeName() const override { return "Thread"; }
static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Thread; }
Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Thread; }
static const HandleType HANDLE_TYPE = HandleType::Thread;
HandleType GetHandleType() const override { return HANDLE_TYPE; }
inline bool IsRunning() const { return (status & THREADSTATUS_RUNNING) != 0; }
inline bool IsStopped() const { return (status & THREADSTATUS_DORMANT) != 0; }