Implement process and thread object type getters
This commit is contained in:
@@ -100,6 +100,7 @@ list(APPEND XTOSKRNL_SOURCE
|
|||||||
${XTOSKRNL_SOURCE_DIR}/po/idle.cc
|
${XTOSKRNL_SOURCE_DIR}/po/idle.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/ps/data.cc
|
${XTOSKRNL_SOURCE_DIR}/ps/data.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/ps/process.cc
|
${XTOSKRNL_SOURCE_DIR}/ps/process.cc
|
||||||
|
${XTOSKRNL_SOURCE_DIR}/ps/psmgr.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/ps/quota.cc
|
${XTOSKRNL_SOURCE_DIR}/ps/quota.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/ps/thread.cc
|
${XTOSKRNL_SOURCE_DIR}/ps/thread.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/rtl/${ARCH}/atomic.cc
|
${XTOSKRNL_SOURCE_DIR}/rtl/${ARCH}/atomic.cc
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include <xtos.hh>
|
#include <xtos.hh>
|
||||||
|
|
||||||
#include <ps/process.hh>
|
#include <ps/process.hh>
|
||||||
|
#include <ps/psmgr.hh>
|
||||||
#include <ps/quota.hh>
|
#include <ps/quota.hh>
|
||||||
#include <ps/thread.hh>
|
#include <ps/thread.hh>
|
||||||
|
|
||||||
|
|||||||
30
xtoskrnl/includes/ps/psmgr.hh
Normal file
30
xtoskrnl/includes/ps/psmgr.hh
Normal file
@@ -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 <harraiken91@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __XTOSKRNL_PS_PSMGR_HH
|
||||||
|
#define __XTOSKRNL_PS_PSMGR_HH
|
||||||
|
|
||||||
|
#include <xtos.hh>
|
||||||
|
|
||||||
|
|
||||||
|
/* 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 */
|
||||||
@@ -12,5 +12,11 @@
|
|||||||
/* Pointer to the system process object */
|
/* Pointer to the system process object */
|
||||||
PEPROCESS PS::Process::SystemProcess;
|
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 */
|
/* Default system-wide quota block assigned to processes */
|
||||||
EPROCESS_QUOTA_BLOCK PS::Quota::DefaultQuotaBlock;
|
EPROCESS_QUOTA_BLOCK PS::Quota::DefaultQuotaBlock;
|
||||||
|
|||||||
40
xtoskrnl/ps/psmgr.cc
Normal file
40
xtoskrnl/ps/psmgr.cc
Normal file
@@ -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 <harraiken91@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <xtos.hh>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user