diff options
Diffstat (limited to 'src/core/hle/kernel/process.h')
| -rw-r--r-- | src/core/hle/kernel/process.h | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index d781ef32c..070b2b558 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -36,15 +36,18 @@ enum class MemoryRegion : u16 { | |||
| 36 | union ProcessFlags { | 36 | union ProcessFlags { |
| 37 | u16 raw; | 37 | u16 raw; |
| 38 | 38 | ||
| 39 | BitField< 0, 1, u16> allow_debug; ///< Allows other processes to attach to and debug this process. | 39 | BitField<0, 1, u16> |
| 40 | BitField< 1, 1, u16> force_debug; ///< Allows this process to attach to processes even if they don't have allow_debug set. | 40 | allow_debug; ///< Allows other processes to attach to and debug this process. |
| 41 | BitField< 2, 1, u16> allow_nonalphanum; | 41 | BitField<1, 1, u16> force_debug; ///< Allows this process to attach to processes even if they |
| 42 | BitField< 3, 1, u16> shared_page_writable; ///< Shared page is mapped with write permissions. | 42 | /// don't have allow_debug set. |
| 43 | BitField< 4, 1, u16> privileged_priority; ///< Can use priority levels higher than 24. | 43 | BitField<2, 1, u16> allow_nonalphanum; |
| 44 | BitField< 5, 1, u16> allow_main_args; | 44 | BitField<3, 1, u16> shared_page_writable; ///< Shared page is mapped with write permissions. |
| 45 | BitField< 6, 1, u16> shared_device_mem; | 45 | BitField<4, 1, u16> privileged_priority; ///< Can use priority levels higher than 24. |
| 46 | BitField< 7, 1, u16> runnable_on_sleep; | 46 | BitField<5, 1, u16> allow_main_args; |
| 47 | BitField< 8, 4, MemoryRegion> memory_region; ///< Default region for memory allocations for this process | 47 | BitField<6, 1, u16> shared_device_mem; |
| 48 | BitField<7, 1, u16> runnable_on_sleep; | ||
| 49 | BitField<8, 4, MemoryRegion> | ||
| 50 | memory_region; ///< Default region for memory allocations for this process | ||
| 48 | BitField<12, 1, u16> loaded_high; ///< Application loaded high (not at 0x00100000). | 51 | BitField<12, 1, u16> loaded_high; ///< Application loaded high (not at 0x00100000). |
| 49 | }; | 52 | }; |
| 50 | 53 | ||
| @@ -54,11 +57,17 @@ struct MemoryRegionInfo; | |||
| 54 | struct CodeSet final : public Object { | 57 | struct CodeSet final : public Object { |
| 55 | static SharedPtr<CodeSet> Create(std::string name, u64 program_id); | 58 | static SharedPtr<CodeSet> Create(std::string name, u64 program_id); |
| 56 | 59 | ||
| 57 | std::string GetTypeName() const override { return "CodeSet"; } | 60 | std::string GetTypeName() const override { |
| 58 | std::string GetName() const override { return name; } | 61 | return "CodeSet"; |
| 62 | } | ||
| 63 | std::string GetName() const override { | ||
| 64 | return name; | ||
| 65 | } | ||
| 59 | 66 | ||
| 60 | static const HandleType HANDLE_TYPE = HandleType::CodeSet; | 67 | static const HandleType HANDLE_TYPE = HandleType::CodeSet; |
| 61 | HandleType GetHandleType() const override { return HANDLE_TYPE; } | 68 | HandleType GetHandleType() const override { |
| 69 | return HANDLE_TYPE; | ||
| 70 | } | ||
| 62 | 71 | ||
| 63 | /// Name of the process | 72 | /// Name of the process |
| 64 | std::string name; | 73 | std::string name; |
| @@ -85,11 +94,17 @@ class Process final : public Object { | |||
| 85 | public: | 94 | public: |
| 86 | static SharedPtr<Process> Create(SharedPtr<CodeSet> code_set); | 95 | static SharedPtr<Process> Create(SharedPtr<CodeSet> code_set); |
| 87 | 96 | ||
| 88 | std::string GetTypeName() const override { return "Process"; } | 97 | std::string GetTypeName() const override { |
| 89 | std::string GetName() const override { return codeset->name; } | 98 | return "Process"; |
| 99 | } | ||
| 100 | std::string GetName() const override { | ||
| 101 | return codeset->name; | ||
| 102 | } | ||
| 90 | 103 | ||
| 91 | static const HandleType HANDLE_TYPE = HandleType::Process; | 104 | static const HandleType HANDLE_TYPE = HandleType::Process; |
| 92 | HandleType GetHandleType() const override { return HANDLE_TYPE; } | 105 | HandleType GetHandleType() const override { |
| 106 | return HANDLE_TYPE; | ||
| 107 | } | ||
| 93 | 108 | ||
| 94 | static u32 next_process_id; | 109 | static u32 next_process_id; |
| 95 | 110 | ||
| @@ -124,7 +139,6 @@ public: | |||
| 124 | */ | 139 | */ |
| 125 | void Run(s32 main_thread_priority, u32 stack_size); | 140 | void Run(s32 main_thread_priority, u32 stack_size); |
| 126 | 141 | ||
| 127 | |||
| 128 | /////////////////////////////////////////////////////////////////////////////////////////////// | 142 | /////////////////////////////////////////////////////////////////////////////////////////////// |
| 129 | // Memory Management | 143 | // Memory Management |
| 130 | 144 | ||
| @@ -144,7 +158,8 @@ public: | |||
| 144 | 158 | ||
| 145 | /// The Thread Local Storage area is allocated as processes create threads, | 159 | /// The Thread Local Storage area is allocated as processes create threads, |
| 146 | /// each TLS area is 0x200 bytes, so one page (0x1000) is split up in 8 parts, and each part | 160 | /// each TLS area is 0x200 bytes, so one page (0x1000) is split up in 8 parts, and each part |
| 147 | /// holds the TLS for a specific thread. This vector contains which parts are in use for each page as a bitmask. | 161 | /// holds the TLS for a specific thread. This vector contains which parts are in use for each |
| 162 | /// page as a bitmask. | ||
| 148 | /// This vector will grow as more pages are allocated for new threads. | 163 | /// This vector will grow as more pages are allocated for new threads. |
| 149 | std::vector<std::bitset<8>> tls_slots; | 164 | std::vector<std::bitset<8>> tls_slots; |
| 150 | 165 | ||
| @@ -164,5 +179,4 @@ private: | |||
| 164 | }; | 179 | }; |
| 165 | 180 | ||
| 166 | extern SharedPtr<Process> g_current_process; | 181 | extern SharedPtr<Process> g_current_process; |
| 167 | |||
| 168 | } | 182 | } |