summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/process.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-09-30 00:47:00 +0200
committerLioncash <mathew1800@gmail.com>2018-09-30 08:30:01 +0200
commitcf9d6c6f526fffb2bf414ff774c5d0281a73ecf4 (patch)
treea9e0bbc02013f0dbc6409af9c8685a8b8b9e9f32 /src/core/hle/kernel/process.h
parentarm_interface: Add missing fpsr/tpidr members to the ThreadContext struct (diff)
downloadyuzu-cf9d6c6f526fffb2bf414ff774c5d0281a73ecf4.tar
yuzu-cf9d6c6f526fffb2bf414ff774c5d0281a73ecf4.tar.gz
yuzu-cf9d6c6f526fffb2bf414ff774c5d0281a73ecf4.tar.bz2
yuzu-cf9d6c6f526fffb2bf414ff774c5d0281a73ecf4.tar.lz
yuzu-cf9d6c6f526fffb2bf414ff774c5d0281a73ecf4.tar.xz
yuzu-cf9d6c6f526fffb2bf414ff774c5d0281a73ecf4.tar.zst
yuzu-cf9d6c6f526fffb2bf414ff774c5d0281a73ecf4.zip
Diffstat (limited to 'src/core/hle/kernel/process.h')
-rw-r--r--src/core/hle/kernel/process.h97
1 files changed, 71 insertions, 26 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h
index adb03c228..2dfb88fa9 100644
--- a/src/core/hle/kernel/process.h
+++ b/src/core/hle/kernel/process.h
@@ -135,6 +135,16 @@ public:
return HANDLE_TYPE;
}
+ /// Gets a reference to the process' memory manager.
+ Kernel::VMManager& VMManager() {
+ return vm_manager;
+ }
+
+ /// Gets a const reference to the process' memory manager.
+ const Kernel::VMManager& VMManager() const {
+ return vm_manager;
+ }
+
/// Gets the current status of the process
ProcessStatus GetStatus() const {
return status;
@@ -145,6 +155,40 @@ public:
return process_id;
}
+ /// Gets the title ID corresponding to this process.
+ u64 GetTitleID() const {
+ return program_id;
+ }
+
+ /// Gets the resource limit descriptor for this process
+ ResourceLimit& GetResourceLimit() {
+ return *resource_limit;
+ }
+
+ /// Gets the resource limit descriptor for this process
+ const ResourceLimit& GetResourceLimit() const {
+ return *resource_limit;
+ }
+
+ /// Gets the default CPU ID for this process
+ u8 GetDefaultProcessorID() const {
+ return ideal_processor;
+ }
+
+ /// Gets the bitmask of allowed CPUs that this process' threads can run on.
+ u32 GetAllowedProcessorMask() const {
+ return allowed_processor_mask;
+ }
+
+ /// Gets the bitmask of allowed thread priorities.
+ u32 GetAllowedThreadPriorityMask() const {
+ return allowed_thread_priority_mask;
+ }
+
+ u32 IsVirtualMemoryEnabled() const {
+ return is_virtual_address_memory_enabled;
+ }
+
/**
* Loads process-specifics configuration info with metadata provided
* by an executable.
@@ -153,30 +197,6 @@ public:
*/
void LoadFromMetadata(const FileSys::ProgramMetadata& metadata);
- /// Title ID corresponding to the process
- u64 program_id;
-
- /// Resource limit descriptor for this process
- SharedPtr<ResourceLimit> resource_limit;
-
- /// The process may only call SVCs which have the corresponding bit set.
- std::bitset<0x80> svc_access_mask;
- /// Maximum size of the handle table for the process.
- unsigned int handle_table_size = 0x200;
- /// Special memory ranges mapped into this processes address space. This is used to give
- /// processes access to specific I/O regions and device memory.
- boost::container::static_vector<AddressMapping, 8> address_mappings;
- ProcessFlags flags;
- /// Kernel compatibility version for this process
- u16 kernel_version = 0;
- /// The default CPU for this process, threads are scheduled on this cpu by default.
- u8 ideal_processor = 0;
- /// Bitmask of allowed CPUs that this process' threads can run on. TODO(Subv): Actually parse
- /// this value from the process header.
- u32 allowed_processor_mask = THREADPROCESSORID_DEFAULT_MASK;
- u32 allowed_thread_priority_mask = 0xFFFFFFFF;
- u32 is_virtual_address_memory_enabled = 0;
-
/**
* Parses a list of kernel capability descriptors (as found in the ExHeader) and applies them
* to this process.
@@ -212,18 +232,43 @@ public:
ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size);
- VMManager vm_manager;
-
private:
explicit Process(KernelCore& kernel);
~Process() override;
+ /// Memory manager for this process.
+ Kernel::VMManager vm_manager;
+
/// Current status of the process
ProcessStatus status;
/// The ID of this process
u32 process_id = 0;
+ /// Title ID corresponding to the process
+ u64 program_id;
+
+ /// Resource limit descriptor for this process
+ SharedPtr<ResourceLimit> resource_limit;
+
+ /// The process may only call SVCs which have the corresponding bit set.
+ std::bitset<0x80> svc_access_mask;
+ /// Maximum size of the handle table for the process.
+ u32 handle_table_size = 0x200;
+ /// Special memory ranges mapped into this processes address space. This is used to give
+ /// processes access to specific I/O regions and device memory.
+ boost::container::static_vector<AddressMapping, 8> address_mappings;
+ ProcessFlags flags;
+ /// Kernel compatibility version for this process
+ u16 kernel_version = 0;
+ /// The default CPU for this process, threads are scheduled on this cpu by default.
+ u8 ideal_processor = 0;
+ /// Bitmask of allowed CPUs that this process' threads can run on. TODO(Subv): Actually parse
+ /// this value from the process header.
+ u32 allowed_processor_mask = THREADPROCESSORID_DEFAULT_MASK;
+ u32 allowed_thread_priority_mask = 0xFFFFFFFF;
+ u32 is_virtual_address_memory_enabled = 0;
+
// Memory used to back the allocations in the regular heap. A single vector is used to cover
// the entire virtual address space extents that bound the allocations, including any holes.
// This makes deallocation and reallocation of holes fast and keeps process memory contiguous