diff options
| author | 2015-05-04 00:01:16 -0300 | |
|---|---|---|
| committer | 2015-05-08 22:11:02 -0300 | |
| commit | 6d60acf0f1afcae873988da5218f2f1c7bc9d151 (patch) | |
| tree | cec75198ab74759002dd1da78f6ac2af5e61949f /src/core/hle/kernel/process.h | |
| parent | Common: Add StringFromFixedZeroTerminatedBuffer (diff) | |
| download | yuzu-6d60acf0f1afcae873988da5218f2f1c7bc9d151.tar.gz yuzu-6d60acf0f1afcae873988da5218f2f1c7bc9d151.tar.xz yuzu-6d60acf0f1afcae873988da5218f2f1c7bc9d151.zip | |
Kernel: Introduce skeleton Process class to hold process data
Diffstat (limited to 'src/core/hle/kernel/process.h')
| -rw-r--r-- | src/core/hle/kernel/process.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h new file mode 100644 index 000000000..8abd881e3 --- /dev/null +++ b/src/core/hle/kernel/process.h | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <bitset> | ||
| 8 | |||
| 9 | #include <boost/container/static_vector.hpp> | ||
| 10 | |||
| 11 | #include "core/hle/kernel/kernel.h" | ||
| 12 | #include "core/hle/result.h" | ||
| 13 | |||
| 14 | namespace Kernel { | ||
| 15 | |||
| 16 | struct StaticAddressMapping { | ||
| 17 | // Address and size must be 4K-aligned | ||
| 18 | VAddr address; | ||
| 19 | u32 size; | ||
| 20 | bool writable; | ||
| 21 | }; | ||
| 22 | |||
| 23 | enum class MemoryRegion { | ||
| 24 | APPLICATION = 1, | ||
| 25 | SYSTEM = 2, | ||
| 26 | BASE = 3, | ||
| 27 | }; | ||
| 28 | |||
| 29 | class Process final : public Object { | ||
| 30 | public: | ||
| 31 | static SharedPtr<Process> Create(std::string name, u64 program_id); | ||
| 32 | |||
| 33 | std::string GetTypeName() const override { return "Process"; } | ||
| 34 | std::string GetName() const override { return name; } | ||
| 35 | |||
| 36 | static const HandleType HANDLE_TYPE = HandleType::Process; | ||
| 37 | HandleType GetHandleType() const override { return HANDLE_TYPE; } | ||
| 38 | |||
| 39 | std::string name; ///< Name of the process | ||
| 40 | u64 program_id; | ||
| 41 | |||
| 42 | std::bitset<0x80> svc_access_mask; | ||
| 43 | unsigned int handle_table_size = 0x200; | ||
| 44 | boost::container::static_vector<StaticAddressMapping, 8> static_address_mappings; // TODO: Determine a good upper limit | ||
| 45 | |||
| 46 | bool loaded_high = false; // Application loaded high (not at 0x00100000) | ||
| 47 | bool shared_page_writable = false; | ||
| 48 | bool privileged_priority = false; // Can use priority levels higher than 24 | ||
| 49 | MemoryRegion memory_region = MemoryRegion::APPLICATION; | ||
| 50 | |||
| 51 | void ParseKernelCaps(const u32* kernel_caps, size_t len); | ||
| 52 | void Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size); | ||
| 53 | |||
| 54 | private: | ||
| 55 | Process(); | ||
| 56 | ~Process() override; | ||
| 57 | }; | ||
| 58 | |||
| 59 | extern SharedPtr<Process> g_current_process; | ||
| 60 | |||
| 61 | } | ||