mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-27 21:24:11 -04:00
kern: Implement SecureMemory (system resource)
This commit is contained in:
parent
9231646f33
commit
fd9b986938
3 changed files with 189 additions and 20 deletions
|
@ -154,13 +154,11 @@ namespace ams::kern {
|
|||
constexpr KProcessAddress GetEntryPoint() const { return this->code_address; }
|
||||
|
||||
constexpr u64 GetRandomEntropy(size_t i) const { return this->entropy[i]; }
|
||||
constexpr bool IsSuspended() const {
|
||||
return this->is_suspended;
|
||||
}
|
||||
|
||||
constexpr void SetSuspended(bool suspended) {
|
||||
this->is_suspended = suspended;
|
||||
}
|
||||
constexpr bool IsApplication() const { return this->is_application; }
|
||||
|
||||
constexpr bool IsSuspended() const { return this->is_suspended; }
|
||||
constexpr void SetSuspended(bool suspended) { this->is_suspended = suspended; }
|
||||
|
||||
Result Terminate();
|
||||
|
||||
|
@ -246,6 +244,14 @@ namespace ams::kern {
|
|||
void IncrementThreadCount();
|
||||
void DecrementThreadCount();
|
||||
|
||||
size_t GetTotalSystemResourceSize() const { return this->system_resource_num_pages * PageSize; }
|
||||
size_t GetUsedSystemResourceSize() const {
|
||||
if (this->system_resource_num_pages == 0) {
|
||||
return 0;
|
||||
}
|
||||
return this->dynamic_page_manager.GetUsed() * PageSize;
|
||||
}
|
||||
|
||||
void ClearRunningThread(KThread *thread) {
|
||||
for (size_t i = 0; i < util::size(this->running_threads); ++i) {
|
||||
if (this->running_threads[i] == thread) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue