summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/KernelKit
diff options
context:
space:
mode:
Diffstat (limited to 'dev/Kernel/KernelKit')
-rw-r--r--dev/Kernel/KernelKit/Defines.h2
-rw-r--r--dev/Kernel/KernelKit/IPEFDLLObject.h4
-rw-r--r--dev/Kernel/KernelKit/Semaphore.h10
-rw-r--r--dev/Kernel/KernelKit/UserProcessScheduler.h30
-rw-r--r--dev/Kernel/KernelKit/UserProcessScheduler.inl2
5 files changed, 24 insertions, 24 deletions
diff --git a/dev/Kernel/KernelKit/Defines.h b/dev/Kernel/KernelKit/Defines.h
index 26618c93..abebdfdb 100644
--- a/dev/Kernel/KernelKit/Defines.h
+++ b/dev/Kernel/KernelKit/Defines.h
@@ -12,4 +12,4 @@
#define KERNELKIT_VERSION_BCD 0x01020
class UserProcessScheduler;
-class UserProcess;
+class UserThread;
diff --git a/dev/Kernel/KernelKit/IPEFDLLObject.h b/dev/Kernel/KernelKit/IPEFDLLObject.h
index 579587ee..1781c589 100644
--- a/dev/Kernel/KernelKit/IPEFDLLObject.h
+++ b/dev/Kernel/KernelKit/IPEFDLLObject.h
@@ -99,8 +99,8 @@ namespace Kernel
typedef IPEFDLLObject* IDLL;
- EXTERN_C IDLL rtl_init_dylib(UserProcess* header);
- EXTERN_C Void rtl_fini_dylib(UserProcess* header, IDLL lib, Bool* successful);
+ EXTERN_C IDLL rtl_init_dylib(UserThread& header);
+ EXTERN_C Void rtl_fini_dylib(UserThread& header, IDLL lib, Bool* successful);
} // namespace Kernel
#endif /* ifndef __KERNELKIT_SHARED_OBJECT_H__ */
diff --git a/dev/Kernel/KernelKit/Semaphore.h b/dev/Kernel/KernelKit/Semaphore.h
index 9ae3f617..41e02645 100644
--- a/dev/Kernel/KernelKit/Semaphore.h
+++ b/dev/Kernel/KernelKit/Semaphore.h
@@ -12,9 +12,9 @@
namespace Kernel
{
- class UserProcess;
+ class UserThread;
- typedef UserProcess* UserProcessPtr;
+ typedef UserThread& UserProcessRef;
/// @brief Access control class, which locks a task until one is done.
class Semaphore final
@@ -31,13 +31,13 @@ namespace Kernel
void WaitForProcess() noexcept;
public:
- bool Lock(UserProcess* process);
- bool LockOrWait(UserProcess* process, TimerInterface* timer);
+ bool Lock(UserThread& process);
+ bool LockOrWait(UserThread& process, TimerInterface* timer);
public:
ZKA_COPY_DEFAULT(Semaphore);
private:
- UserProcessPtr fLockingProcess{nullptr};
+ UserProcessRef fLockingProcess;
};
} // namespace Kernel
diff --git a/dev/Kernel/KernelKit/UserProcessScheduler.h b/dev/Kernel/KernelKit/UserProcessScheduler.h
index 744ad45a..452a55a3 100644
--- a/dev/Kernel/KernelKit/UserProcessScheduler.h
+++ b/dev/Kernel/KernelKit/UserProcessScheduler.h
@@ -31,7 +31,7 @@ namespace Kernel
//! @note Forward class declarations.
class IDLLObject;
- class UserProcess;
+ class UserThread;
class UserProcessTeam;
class UserProcessScheduler;
class UserProcessHelper;
@@ -142,16 +142,16 @@ namespace Kernel
}
};
- /// @name UserProcess
+ /// @name UserThread
/// @brief User process class, holds information about the running process/thread.
- class UserProcess final
+ class UserThread final
{
public:
- explicit UserProcess();
- ~UserProcess();
+ explicit UserThread();
+ ~UserThread();
public:
- ZKA_COPY_DEFAULT(UserProcess);
+ ZKA_COPY_DEFAULT(UserThread);
public:
Char Name[kProcessNameLen] = {"Process"};
@@ -261,18 +261,18 @@ namespace Kernel
ZKA_COPY_DEFAULT(UserProcessTeam);
- Array<UserProcess*, kSchedProcessLimitPerTeam>& AsArray();
- Ref<UserProcess>& AsRef();
+ Array<UserThread, kSchedProcessLimitPerTeam>& AsArray();
+ Ref<UserThread>& AsRef();
ProcessID& Id() noexcept;
public:
- Array<UserProcess*, kSchedProcessLimitPerTeam> mProcessList;
- Ref<UserProcess> mCurrentProcess;
+ Array<UserThread, kSchedProcessLimitPerTeam> mProcessList;
+ Ref<UserThread> mCurrentProcess;
ProcessID mTeamId{0};
ProcessID mProcessCount{0};
};
- using UserProcessPtr = UserProcess*;
+ using UserProcessRef = UserThread&;
/// @brief Process scheduler class.
/// The main class which you call to schedule user processes.
@@ -293,7 +293,7 @@ namespace Kernel
UserProcessTeam& CurrentTeam();
public:
- ProcessID Spawn(UserProcess* process);
+ ProcessID Spawn(const Char* name, VoidPtr code, VoidPtr image);
const Bool Remove(ProcessID process_id);
const Bool IsUser() override;
@@ -301,7 +301,7 @@ namespace Kernel
const Bool HasMP() override;
public:
- Ref<UserProcess>& GetCurrentProcess();
+ Ref<UserThread>& GetCurrentProcess();
const SizeT Run() noexcept;
public:
@@ -312,14 +312,14 @@ namespace Kernel
};
/*
- * \brief UserProcess helper class, which contains needed utilities for the scheduler.
+ * \brief UserThread helper class, which contains needed utilities for the scheduler.
*/
class UserProcessHelper final
{
public:
STATIC Bool Switch(VoidPtr image_ptr, UInt8* stack_ptr, HAL::StackFramePtr frame_ptr, const PID& new_pid);
- STATIC Bool CanBeScheduled(const UserProcess* process);
+ STATIC Bool CanBeScheduled(const UserThread& process);
STATIC ErrorOr<PID> TheCurrentPID();
STATIC SizeT StartScheduling();
};
diff --git a/dev/Kernel/KernelKit/UserProcessScheduler.inl b/dev/Kernel/KernelKit/UserProcessScheduler.inl
index 70f9f0a8..83ced960 100644
--- a/dev/Kernel/KernelKit/UserProcessScheduler.inl
+++ b/dev/Kernel/KernelKit/UserProcessScheduler.inl
@@ -14,7 +14,7 @@ namespace Kernel
/***********************************************************************************/
template <typename T>
- Boolean UserProcess::Delete(ErrorOr<T*> ptr, const SizeT& sz)
+ Boolean UserThread::Delete(ErrorOr<T*> ptr, const SizeT& sz)
{
if (!ptr ||
sz == 0)