From 427f1e3e3da5709e74bf4db674a019d9d79f2ed3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 28 Mar 2019 18:26:09 -0400 Subject: kernel/process: Make Run's stack size parameter a u64 This will make operating with the process-related SVC commands much nicer in the future (the parameter representing the stack size in svcStartProcess is a 64-bit value). --- src/core/hle/kernel/process.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/hle/kernel/process.h') diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index a0217d3d8..db14dd4b4 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -210,7 +210,7 @@ public: /** * Applies address space changes and launches the process main thread. */ - void Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size); + void Run(VAddr entry_point, s32 main_thread_priority, u64 stack_size); /** * Prepares a process for termination by stopping all of its threads -- cgit v1.2.3 From 5d4ab5ec2fe36fa06d3adccb66261a4a8077c74e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 28 Mar 2019 18:30:58 -0400 Subject: kernel/process: Store the main thread stack size to a data member This will be necessary in order to properly report memory usage within svcGetInfo. --- src/core/hle/kernel/process.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/hle/kernel/process.h') diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index db14dd4b4..ee559fe4c 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -247,6 +247,9 @@ private: /// Memory manager for this process. Kernel::VMManager vm_manager; + /// Size of the main thread's stack in bytes. + u64 main_thread_stack_size = 0; + /// Current status of the process ProcessStatus status; -- cgit v1.2.3 From 2289e895aa63cdb391795c573b96b1880c31f097 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 28 Mar 2019 18:52:45 -0400 Subject: kernel/process: Store the total size of the code memory loaded This will be necessary to properly report the used memory size in svcGetInfo. --- src/core/hle/kernel/process.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/hle/kernel/process.h') diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index ee559fe4c..16193ca56 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -250,6 +250,9 @@ private: /// Size of the main thread's stack in bytes. u64 main_thread_stack_size = 0; + /// Size of the loaded code memory in bytes. + u64 code_memory_size = 0; + /// Current status of the process ProcessStatus status; -- cgit v1.2.3 From 3a846aa80f5d533a5061fcbef2736aaef8c38a66 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 28 Mar 2019 22:59:17 -0400 Subject: kernel/process: Report total physical memory used to svcGetInfo Reports the (mostly) correct size through svcGetInfo now for queries to total used physical memory. This still doesn't correctly handle memory allocated via svcMapPhysicalMemory, however, we don't currently handle that case anyways. --- src/core/hle/kernel/process.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/hle/kernel/process.h') diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 16193ca56..732d12170 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -186,6 +186,9 @@ public: return random_entropy.at(index); } + /// Retrieves the total physical memory used by this process in bytes. + u64 GetTotalPhysicalMemoryUsed() const; + /// Clears the signaled state of the process if and only if it's signaled. /// /// @pre The process must not be already terminated. If this is called on a -- cgit v1.2.3