summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/kernel.h
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
commitdc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch)
tree569a7f13128450bbab973236615587ff00bced5f /src/core/hle/kernel/kernel.h
parentTravis: Import Dolphin’s clang-format hook. (diff)
downloadyuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/kernel.h66
1 files changed, 38 insertions, 28 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 27ba3f912..cc39652d5 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -23,48 +23,55 @@ class Thread;
// TODO: Verify code
const ResultCode ERR_OUT_OF_HANDLES(ErrorDescription::OutOfMemory, ErrorModule::Kernel,
- ErrorSummary::OutOfResource, ErrorLevel::Temporary);
+ ErrorSummary::OutOfResource, ErrorLevel::Temporary);
// TOOD: Verify code
const ResultCode ERR_INVALID_HANDLE(ErrorDescription::InvalidHandle, ErrorModule::Kernel,
- ErrorSummary::InvalidArgument, ErrorLevel::Permanent);
+ ErrorSummary::InvalidArgument, ErrorLevel::Permanent);
enum KernelHandle : Handle {
- CurrentThread = 0xFFFF8000,
- CurrentProcess = 0xFFFF8001,
+ CurrentThread = 0xFFFF8000,
+ CurrentProcess = 0xFFFF8001,
};
enum class HandleType : u32 {
- Unknown = 0,
-
- Session = 2,
- Event = 3,
- Mutex = 4,
- SharedMemory = 5,
- Redirection = 6,
- Thread = 7,
- Process = 8,
- AddressArbiter = 9,
- Semaphore = 10,
- Timer = 11,
- ResourceLimit = 12,
- CodeSet = 13,
- ClientPort = 14,
- ServerPort = 15,
+ Unknown = 0,
+
+ Session = 2,
+ Event = 3,
+ Mutex = 4,
+ SharedMemory = 5,
+ Redirection = 6,
+ Thread = 7,
+ Process = 8,
+ AddressArbiter = 9,
+ Semaphore = 10,
+ Timer = 11,
+ ResourceLimit = 12,
+ CodeSet = 13,
+ ClientPort = 14,
+ ServerPort = 15,
};
enum {
- DEFAULT_STACK_SIZE = 0x4000,
+ DEFAULT_STACK_SIZE = 0x4000,
};
class Object : NonCopyable {
public:
- virtual ~Object() {}
+ virtual ~Object() {
+ }
/// Returns a unique identifier for the object. For debugging purposes only.
- unsigned int GetObjectId() const { return object_id; }
+ unsigned int GetObjectId() const {
+ return object_id;
+ }
- virtual std::string GetTypeName() const { return "[BAD KERNEL OBJECT TYPE]"; }
- virtual std::string GetName() const { return "[UNKNOWN KERNEL OBJECT]"; }
+ virtual std::string GetTypeName() const {
+ return "[BAD KERNEL OBJECT TYPE]";
+ }
+ virtual std::string GetName() const {
+ return "[UNKNOWN KERNEL OBJECT]";
+ }
virtual Kernel::HandleType GetHandleType() const = 0;
/**
@@ -122,7 +129,6 @@ using SharedPtr = boost::intrusive_ptr<T>;
/// Class that represents a Kernel object that a thread can be waiting on
class WaitObject : public Object {
public:
-
/**
* Check if the current thread should wait until the object is available
* @return True if the current thread should wait due to this object being unavailable
@@ -247,8 +253,12 @@ private:
*/
static const size_t MAX_COUNT = 4096;
- static u16 GetSlot(Handle handle) { return handle >> 15; }
- static u16 GetGeneration(Handle handle) { return handle & 0x7FFF; }
+ static u16 GetSlot(Handle handle) {
+ return handle >> 15;
+ }
+ static u16 GetGeneration(Handle handle) {
+ return handle & 0x7FFF;
+ }
/// Stores the Object referenced by the handle or null if the slot is empty.
std::array<SharedPtr<Object>, MAX_COUNT> objects;