summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/process.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-12-05 01:08:56 +0100
committerLioncash <mathew1800@gmail.com>2018-12-05 02:14:59 +0100
commitc7462ce71241fe6c8dfee48a859c63a6b1fd84fb (patch)
tree0350cdf3dcb0cae57573b7b2d869875c16f9b840 /src/core/hle/kernel/process.h
parentkernel/readable_event: Add member function for enforcing a strict reset contract (diff)
downloadyuzu-c7462ce71241fe6c8dfee48a859c63a6b1fd84fb.tar
yuzu-c7462ce71241fe6c8dfee48a859c63a6b1fd84fb.tar.gz
yuzu-c7462ce71241fe6c8dfee48a859c63a6b1fd84fb.tar.bz2
yuzu-c7462ce71241fe6c8dfee48a859c63a6b1fd84fb.tar.lz
yuzu-c7462ce71241fe6c8dfee48a859c63a6b1fd84fb.tar.xz
yuzu-c7462ce71241fe6c8dfee48a859c63a6b1fd84fb.tar.zst
yuzu-c7462ce71241fe6c8dfee48a859c63a6b1fd84fb.zip
Diffstat (limited to 'src/core/hle/kernel/process.h')
-rw-r--r--src/core/hle/kernel/process.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h
index 49345aa66..bcb9ac4b8 100644
--- a/src/core/hle/kernel/process.h
+++ b/src/core/hle/kernel/process.h
@@ -14,9 +14,10 @@
#include "common/bit_field.h"
#include "common/common_types.h"
#include "core/hle/kernel/handle_table.h"
-#include "core/hle/kernel/object.h"
#include "core/hle/kernel/thread.h"
#include "core/hle/kernel/vm_manager.h"
+#include "core/hle/kernel/wait_object.h"
+#include "core/hle/result.h"
namespace FileSys {
class ProgramMetadata;
@@ -117,7 +118,7 @@ struct CodeSet final {
VAddr entrypoint = 0;
};
-class Process final : public Object {
+class Process final : public WaitObject {
public:
static constexpr std::size_t RANDOM_ENTROPY_SIZE = 4;
@@ -212,6 +213,16 @@ public:
return random_entropy.at(index);
}
+ /// 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
+ /// terminated process, then ERR_INVALID_STATE will be returned.
+ ///
+ /// @pre The process must be in a signaled state. If this is called on a
+ /// process instance that is not signaled, ERR_INVALID_STATE will be
+ /// returned.
+ ResultCode ClearSignalState();
+
/**
* Loads process-specifics configuration info with metadata provided
* by an executable.
@@ -260,6 +271,17 @@ private:
explicit Process(KernelCore& kernel);
~Process() override;
+ /// Checks if the specified thread should wait until this process is available.
+ bool ShouldWait(Thread* thread) const override;
+
+ /// Acquires/locks this process for the specified thread if it's available.
+ void Acquire(Thread* thread) override;
+
+ /// Changes the process status. If the status is different
+ /// from the current process status, then this will trigger
+ /// a process signal.
+ void ChangeStatus(ProcessStatus new_status);
+
/// Memory manager for this process.
Kernel::VMManager vm_manager;
@@ -305,6 +327,10 @@ private:
/// specified by metadata provided to the process during loading.
bool is_64bit_process = true;
+ /// Whether or not this process is signaled. This occurs
+ /// upon the process changing to a different state.
+ bool is_signaled = false;
+
/// Total running time for the process in ticks.
u64 total_process_running_time_ticks = 0;