diff options
| author | 2019-03-06 15:55:56 -0500 | |
|---|---|---|
| committer | 2019-03-06 15:55:56 -0500 | |
| commit | 75b417489ad3e23f62060933b0fe0f29646bbd04 (patch) | |
| tree | 1b5944f3d09d3383a9c94c3fdaf2cb14c9a9a8cf /src/core/hle/kernel/kernel.h | |
| parent | Merge pull request #2201 from lioncash/audio-retval (diff) | |
| parent | kernel/address_arbiter: Pass in system instance to constructor (diff) | |
| download | yuzu-75b417489ad3e23f62060933b0fe0f29646bbd04.tar.gz yuzu-75b417489ad3e23f62060933b0fe0f29646bbd04.tar.xz yuzu-75b417489ad3e23f62060933b0fe0f29646bbd04.zip | |
Merge pull request #2199 from lioncash/arbiter
kernel/address_arbiter: Convert the address arbiter into a class
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 154bced42..4d292aca9 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -11,6 +11,10 @@ | |||
| 11 | template <typename T> | 11 | template <typename T> |
| 12 | class ResultVal; | 12 | class ResultVal; |
| 13 | 13 | ||
| 14 | namespace Core { | ||
| 15 | class System; | ||
| 16 | } | ||
| 17 | |||
| 14 | namespace Core::Timing { | 18 | namespace Core::Timing { |
| 15 | class CoreTiming; | 19 | class CoreTiming; |
| 16 | struct EventType; | 20 | struct EventType; |
| @@ -18,6 +22,7 @@ struct EventType; | |||
| 18 | 22 | ||
| 19 | namespace Kernel { | 23 | namespace Kernel { |
| 20 | 24 | ||
| 25 | class AddressArbiter; | ||
| 21 | class ClientPort; | 26 | class ClientPort; |
| 22 | class HandleTable; | 27 | class HandleTable; |
| 23 | class Process; | 28 | class Process; |
| @@ -30,7 +35,14 @@ private: | |||
| 30 | using NamedPortTable = std::unordered_map<std::string, SharedPtr<ClientPort>>; | 35 | using NamedPortTable = std::unordered_map<std::string, SharedPtr<ClientPort>>; |
| 31 | 36 | ||
| 32 | public: | 37 | public: |
| 33 | KernelCore(); | 38 | /// Constructs an instance of the kernel using the given System |
| 39 | /// instance as a context for any necessary system-related state, | ||
| 40 | /// such as threads, CPU core state, etc. | ||
| 41 | /// | ||
| 42 | /// @post After execution of the constructor, the provided System | ||
| 43 | /// object *must* outlive the kernel instance itself. | ||
| 44 | /// | ||
| 45 | explicit KernelCore(Core::System& system); | ||
| 34 | ~KernelCore(); | 46 | ~KernelCore(); |
| 35 | 47 | ||
| 36 | KernelCore(const KernelCore&) = delete; | 48 | KernelCore(const KernelCore&) = delete; |
| @@ -40,11 +52,7 @@ public: | |||
| 40 | KernelCore& operator=(KernelCore&&) = delete; | 52 | KernelCore& operator=(KernelCore&&) = delete; |
| 41 | 53 | ||
| 42 | /// Resets the kernel to a clean slate for use. | 54 | /// Resets the kernel to a clean slate for use. |
| 43 | /// | 55 | void Initialize(); |
| 44 | /// @param core_timing CoreTiming instance used to create any necessary | ||
| 45 | /// kernel-specific callback events. | ||
| 46 | /// | ||
| 47 | void Initialize(Core::Timing::CoreTiming& core_timing); | ||
| 48 | 56 | ||
| 49 | /// Clears all resources in use by the kernel instance. | 57 | /// Clears all resources in use by the kernel instance. |
| 50 | void Shutdown(); | 58 | void Shutdown(); |
| @@ -67,6 +75,12 @@ public: | |||
| 67 | /// Retrieves a const pointer to the current process. | 75 | /// Retrieves a const pointer to the current process. |
| 68 | const Process* CurrentProcess() const; | 76 | const Process* CurrentProcess() const; |
| 69 | 77 | ||
| 78 | /// Provides a reference to the kernel's address arbiter. | ||
| 79 | Kernel::AddressArbiter& AddressArbiter(); | ||
| 80 | |||
| 81 | /// Provides a const reference to the kernel's address arbiter. | ||
| 82 | const Kernel::AddressArbiter& AddressArbiter() const; | ||
| 83 | |||
| 70 | /// Adds a port to the named port table | 84 | /// Adds a port to the named port table |
| 71 | void AddNamedPort(std::string name, SharedPtr<ClientPort> port); | 85 | void AddNamedPort(std::string name, SharedPtr<ClientPort> port); |
| 72 | 86 | ||