diff --git a/xtoskrnl/CMakeLists.txt b/xtoskrnl/CMakeLists.txt index c7c929d..3d7767a 100644 --- a/xtoskrnl/CMakeLists.txt +++ b/xtoskrnl/CMakeLists.txt @@ -100,6 +100,7 @@ list(APPEND XTOSKRNL_SOURCE ${XTOSKRNL_SOURCE_DIR}/po/idle.cc ${XTOSKRNL_SOURCE_DIR}/ps/data.cc ${XTOSKRNL_SOURCE_DIR}/ps/process.cc + ${XTOSKRNL_SOURCE_DIR}/ps/psmgr.cc ${XTOSKRNL_SOURCE_DIR}/ps/quota.cc ${XTOSKRNL_SOURCE_DIR}/ps/thread.cc ${XTOSKRNL_SOURCE_DIR}/rtl/${ARCH}/atomic.cc diff --git a/xtoskrnl/includes/ps.hh b/xtoskrnl/includes/ps.hh index 9218771..f3aa725 100644 --- a/xtoskrnl/includes/ps.hh +++ b/xtoskrnl/includes/ps.hh @@ -12,6 +12,7 @@ #include #include +#include #include #include diff --git a/xtoskrnl/includes/ps/psmgr.hh b/xtoskrnl/includes/ps/psmgr.hh new file mode 100644 index 0000000..be4fc6b --- /dev/null +++ b/xtoskrnl/includes/ps/psmgr.hh @@ -0,0 +1,30 @@ +/** + * PROJECT: ExectOS + * COPYRIGHT: See COPYING.md in the top level directory + * FILE: xtoskrnl/includes/ps/process.hh + * DESCRIPTION: Process Management + * DEVELOPERS: Aiken Harris + */ + +#ifndef __XTOSKRNL_PS_PSMGR_HH +#define __XTOSKRNL_PS_PSMGR_HH + +#include + + +/* Process and thread management */ +namespace PS +{ + class ProcessManager + { + private: + STATIC POBJECT_TYPE ProcessType; + STATIC POBJECT_TYPE ThreadType; + + public: + STATIC XTFASTCALL POBJECT_TYPE GetProcessType(VOID); + STATIC XTFASTCALL POBJECT_TYPE GetThreadType(VOID); + }; +} + +#endif /* __XTOSKRNL_PS_PSMGR_HH */ diff --git a/xtoskrnl/ps/data.cc b/xtoskrnl/ps/data.cc index 6b2930a..b196cb7 100644 --- a/xtoskrnl/ps/data.cc +++ b/xtoskrnl/ps/data.cc @@ -12,5 +12,11 @@ /* Pointer to the system process object */ PEPROCESS PS::Process::SystemProcess; +/* Global object type descriptor for Process objects */ +POBJECT_TYPE PS::ProcessManager::ProcessType; + +/* Global object type descriptor for Thread objects */ +POBJECT_TYPE PS::ProcessManager::ThreadType; + /* Default system-wide quota block assigned to processes */ EPROCESS_QUOTA_BLOCK PS::Quota::DefaultQuotaBlock; diff --git a/xtoskrnl/ps/psmgr.cc b/xtoskrnl/ps/psmgr.cc new file mode 100644 index 0000000..0febeb1 --- /dev/null +++ b/xtoskrnl/ps/psmgr.cc @@ -0,0 +1,40 @@ +/** + * PROJECT: ExectOS + * COPYRIGHT: See COPYING.md in the top level directory + * FILE: xtoskrnl/po/psmgr.cc + * DESCRIPTION: Process Manager + * DEVELOPERS: Aiken Harris + */ + +#include + + +/** + * Retrieves the global object type descriptor for Process objects. + * + * @return This routine returns a pointer to the process object type structure. + * + * @since XT 1.0 + */ +XTFASTCALL +POBJECT_TYPE +PS::ProcessManager::GetProcessType(VOID) +{ + /* Return the process object type descriptor */ + return ProcessType; +} + +/** + * Retrieves the global object type descriptor for Thread objects. + * + * @return This routine returns a pointer to the thread object type structure. + * + * @since XT 1.0 + */ +XTFASTCALL +POBJECT_TYPE +PS::ProcessManager::GetThreadType(VOID) +{ + /* Return the thread object type descriptor */ + return ThreadType; +}