Go to the documentation of this file.
18 #ifndef __KERNEL_PROCESS_MANAGER_H
19 #define __KERNEL_PROCESS_MANAGER_H
39 #define MAX_PROCS 1024
84 const bool readyToRun =
false,
85 const bool privileged =
false);
Responsible for deciding which Process may execute on the local Core.
Result resume(Process *proc)
Resume scheduling of the given Process.
Process * m_idle
Idle process.
Result raiseEvent(Process *proc, const struct ProcessEvent *event)
Raise kernel event for a Process.
virtual ~ProcessManager()
Destructor function.
Represents a process which may run on the host.
Represents a process which may run on the host.
Result reset(Process *proc, const Address entry)
Restart execution of a Process at the given entry point.
Process * m_current
Currently executing process.
Process * create(const Address entry, const MemoryMap &map, const bool readyToRun=false, const bool privileged=false)
Create a new Process.
Result unregisterInterruptNotify(Process *proc)
Remove all interrupt notifications for a Process.
Result dequeueProcess(Process *proc, const bool ignoreState=false) const
Remove the given process on the Schedule queue.
Result sleep(const Timer::Info *timer=0, const bool ignoreWakeups=false)
Let current Process sleep until a timer expires or wakeup occurs.
u32 ProcessID
Process Identification Number.
unsigned long Address
A memory address.
Result wakeup(Process *proc)
Take Process out of Sleep state and mark ready for execution.
Result wait(Process *proc)
Let current Process wait for another Process to terminate.
Timer information structure.
unsigned int uint
Unsigned integer number.
Result stop(Process *proc)
Remove given Process from the Scheduler.
Represents a process which may run on the host.
unsigned int u32
Unsigned 32-bit number.
ProcessManager()
Constructor function.
Describes virtual memory map layout.
Result schedule()
Schedule next process to run.
Process * get(const ProcessID id)
Retrieve a Process by it's ID.
Index< Process, MAX_PROCS > m_procs
All known Processes.
Result interruptNotify(const u32 vector)
Raise interrupt notifications for a interrupt vector.
void remove(Process *proc, const uint exitStatus=0)
Remove a Process.
Queue< Process *, MAX_PROCS > m_sleepTimerQueue
Queue with sleeping processes waiting for a Timer to expire.
Scheduler * m_scheduler
Object which selects processes to run.
Process * current()
Current process running.
Vectors are dynamically resizeable Arrays.
void setIdle(Process *proc)
Set the idle process.
Vector< List< Process * > * > m_interruptNotifyList
Interrupt notification list.
Result registerInterruptNotify(Process *proc, const u32 vector)
Register an interrupt notification for a Process.
Result enqueueProcess(Process *proc, const bool ignoreState=false)
Place the given process on the Schedule queue.