diff options
| author | 2019-03-12 17:54:48 -0400 | |
|---|---|---|
| committer | 2019-03-12 17:54:48 -0400 | |
| commit | 3bfd199497bd016e79ba27f338c0dd77923080d1 (patch) | |
| tree | a34b9dd33b3250026d9164037d2266593b5af568 /src/core/hle/kernel/process.h | |
| parent | Merge pull request #2222 from lioncash/cstr (diff) | |
| parent | kernel: Make the address arbiter instance per-process (diff) | |
| download | yuzu-3bfd199497bd016e79ba27f338c0dd77923080d1.tar.gz yuzu-3bfd199497bd016e79ba27f338c0dd77923080d1.tar.xz yuzu-3bfd199497bd016e79ba27f338c0dd77923080d1.zip | |
Merge pull request #2211 from lioncash/arbiter
kernel: Make the address arbiter instance per-process
Diffstat (limited to 'src/core/hle/kernel/process.h')
| -rw-r--r-- | src/core/hle/kernel/process.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index dcc57ae9f..2a132c894 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -12,12 +12,17 @@ | |||
| 12 | #include <vector> | 12 | #include <vector> |
| 13 | #include <boost/container/static_vector.hpp> | 13 | #include <boost/container/static_vector.hpp> |
| 14 | #include "common/common_types.h" | 14 | #include "common/common_types.h" |
| 15 | #include "core/hle/kernel/address_arbiter.h" | ||
| 15 | #include "core/hle/kernel/handle_table.h" | 16 | #include "core/hle/kernel/handle_table.h" |
| 16 | #include "core/hle/kernel/process_capability.h" | 17 | #include "core/hle/kernel/process_capability.h" |
| 17 | #include "core/hle/kernel/vm_manager.h" | 18 | #include "core/hle/kernel/vm_manager.h" |
| 18 | #include "core/hle/kernel/wait_object.h" | 19 | #include "core/hle/kernel/wait_object.h" |
| 19 | #include "core/hle/result.h" | 20 | #include "core/hle/result.h" |
| 20 | 21 | ||
| 22 | namespace Core { | ||
| 23 | class System; | ||
| 24 | } | ||
| 25 | |||
| 21 | namespace FileSys { | 26 | namespace FileSys { |
| 22 | class ProgramMetadata; | 27 | class ProgramMetadata; |
| 23 | } | 28 | } |
| @@ -116,7 +121,7 @@ public: | |||
| 116 | 121 | ||
| 117 | static constexpr std::size_t RANDOM_ENTROPY_SIZE = 4; | 122 | static constexpr std::size_t RANDOM_ENTROPY_SIZE = 4; |
| 118 | 123 | ||
| 119 | static SharedPtr<Process> Create(KernelCore& kernel, std::string&& name); | 124 | static SharedPtr<Process> Create(Core::System& system, std::string&& name); |
| 120 | 125 | ||
| 121 | std::string GetTypeName() const override { | 126 | std::string GetTypeName() const override { |
| 122 | return "Process"; | 127 | return "Process"; |
| @@ -150,6 +155,16 @@ public: | |||
| 150 | return handle_table; | 155 | return handle_table; |
| 151 | } | 156 | } |
| 152 | 157 | ||
| 158 | /// Gets a reference to the process' address arbiter. | ||
| 159 | AddressArbiter& GetAddressArbiter() { | ||
| 160 | return address_arbiter; | ||
| 161 | } | ||
| 162 | |||
| 163 | /// Gets a const reference to the process' address arbiter. | ||
| 164 | const AddressArbiter& GetAddressArbiter() const { | ||
| 165 | return address_arbiter; | ||
| 166 | } | ||
| 167 | |||
| 153 | /// Gets the current status of the process | 168 | /// Gets the current status of the process |
| 154 | ProcessStatus GetStatus() const { | 169 | ProcessStatus GetStatus() const { |
| 155 | return status; | 170 | return status; |
| @@ -251,7 +266,7 @@ public: | |||
| 251 | void FreeTLSSlot(VAddr tls_address); | 266 | void FreeTLSSlot(VAddr tls_address); |
| 252 | 267 | ||
| 253 | private: | 268 | private: |
| 254 | explicit Process(KernelCore& kernel); | 269 | explicit Process(Core::System& kernel); |
| 255 | ~Process() override; | 270 | ~Process() override; |
| 256 | 271 | ||
| 257 | /// Checks if the specified thread should wait until this process is available. | 272 | /// Checks if the specified thread should wait until this process is available. |
| @@ -309,6 +324,9 @@ private: | |||
| 309 | /// Per-process handle table for storing created object handles in. | 324 | /// Per-process handle table for storing created object handles in. |
| 310 | HandleTable handle_table; | 325 | HandleTable handle_table; |
| 311 | 326 | ||
| 327 | /// Per-process address arbiter. | ||
| 328 | AddressArbiter address_arbiter; | ||
| 329 | |||
| 312 | /// Random values for svcGetInfo RandomEntropy | 330 | /// Random values for svcGetInfo RandomEntropy |
| 313 | std::array<u64, RANDOM_ENTROPY_SIZE> random_entropy; | 331 | std::array<u64, RANDOM_ENTROPY_SIZE> random_entropy; |
| 314 | 332 | ||