diff options
| author | 2018-10-12 11:36:31 -0400 | |
|---|---|---|
| committer | 2018-10-12 12:07:32 -0400 | |
| commit | 1abed2f4c42c7a389cb0e019f183d3ec94971af1 (patch) | |
| tree | c8459ae8d497e7a148365f93e971b817a0adf0f6 /src/core/hle/kernel/process.h | |
| parent | Merge pull request #1474 from ogniK5377/hwopus-decodeinterleavedwithperformance (diff) | |
| download | yuzu-1abed2f4c42c7a389cb0e019f183d3ec94971af1.tar.gz yuzu-1abed2f4c42c7a389cb0e019f183d3ec94971af1.tar.xz yuzu-1abed2f4c42c7a389cb0e019f183d3ec94971af1.zip | |
kernel/process: Make CodeSet a regular non-inherited object
These only exist to ferry data into a Process instance and end up going
out of scope quite early. Because of this, we can just make it a plain
struct for holding things and just std::move it into the relevant
function. There's no need to make this inherit from the kernel's Object
type.
Diffstat (limited to 'src/core/hle/kernel/process.h')
| -rw-r--r-- | src/core/hle/kernel/process.h | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 590e0c73d..73ec01e11 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -61,26 +61,15 @@ enum class ProcessStatus { Created, Running, Exited }; | |||
| 61 | 61 | ||
| 62 | class ResourceLimit; | 62 | class ResourceLimit; |
| 63 | 63 | ||
| 64 | struct CodeSet final : public Object { | 64 | struct CodeSet final { |
| 65 | struct Segment { | 65 | struct Segment { |
| 66 | std::size_t offset = 0; | 66 | std::size_t offset = 0; |
| 67 | VAddr addr = 0; | 67 | VAddr addr = 0; |
| 68 | u32 size = 0; | 68 | u32 size = 0; |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | static SharedPtr<CodeSet> Create(KernelCore& kernel, std::string name); | 71 | explicit CodeSet(); |
| 72 | 72 | ~CodeSet(); | |
| 73 | std::string GetTypeName() const override { | ||
| 74 | return "CodeSet"; | ||
| 75 | } | ||
| 76 | std::string GetName() const override { | ||
| 77 | return name; | ||
| 78 | } | ||
| 79 | |||
| 80 | static const HandleType HANDLE_TYPE = HandleType::CodeSet; | ||
| 81 | HandleType GetHandleType() const override { | ||
| 82 | return HANDLE_TYPE; | ||
| 83 | } | ||
| 84 | 73 | ||
| 85 | Segment& CodeSegment() { | 74 | Segment& CodeSegment() { |
| 86 | return segments[0]; | 75 | return segments[0]; |
| @@ -109,14 +98,7 @@ struct CodeSet final : public Object { | |||
| 109 | std::shared_ptr<std::vector<u8>> memory; | 98 | std::shared_ptr<std::vector<u8>> memory; |
| 110 | 99 | ||
| 111 | std::array<Segment, 3> segments; | 100 | std::array<Segment, 3> segments; |
| 112 | VAddr entrypoint; | 101 | VAddr entrypoint = 0; |
| 113 | |||
| 114 | /// Name of the process | ||
| 115 | std::string name; | ||
| 116 | |||
| 117 | private: | ||
| 118 | explicit CodeSet(KernelCore& kernel); | ||
| 119 | ~CodeSet() override; | ||
| 120 | }; | 102 | }; |
| 121 | 103 | ||
| 122 | class Process final : public Object { | 104 | class Process final : public Object { |
| @@ -219,7 +201,7 @@ public: | |||
| 219 | */ | 201 | */ |
| 220 | void PrepareForTermination(); | 202 | void PrepareForTermination(); |
| 221 | 203 | ||
| 222 | void LoadModule(SharedPtr<CodeSet> module_, VAddr base_addr); | 204 | void LoadModule(CodeSet module_, VAddr base_addr); |
| 223 | 205 | ||
| 224 | /////////////////////////////////////////////////////////////////////////////////////////////// | 206 | /////////////////////////////////////////////////////////////////////////////////////////////// |
| 225 | // Memory Management | 207 | // Memory Management |