svc: Implement svcGetProcessInfo

A fairly basic service function, which only appears to currently support
retrieving the process state. This also alters the ProcessStatus enum to
contain all of the values that a kernel process seems to be able of
reporting with regards to state.
This commit is contained in:
Lioncash 2018-10-13 14:31:46 -04:00
parent 1584fb6b38
commit 1c7a7ed79b
3 changed files with 50 additions and 4 deletions

View file

@ -24,6 +24,7 @@ class ProgramMetadata;
namespace Kernel {
class KernelCore;
class ResourceLimit;
struct AddressMapping {
// Address and size must be page-aligned
@ -57,9 +58,23 @@ union ProcessFlags {
BitField<12, 1, u16> loaded_high; ///< Application loaded high (not at 0x00100000).
};
enum class ProcessStatus { Created, Running, Exited };
class ResourceLimit;
/**
* Indicates the status of a Process instance.
*
* @note These match the values as used by kernel,
* so new entries should only be added if RE
* shows that a new value has been introduced.
*/
enum class ProcessStatus {
Created,
CreatedWithDebuggerAttached,
Running,
WaitingForDebuggerToAttach,
DebuggerAttached,
Exiting,
Exited,
DebugBreak,
};
struct CodeSet final {
struct Segment {