18#include <FreeNOS/System.h>
19#include <FreeNOS/Kernel.h>
20#include <FreeNOS/Config.h>
21#include <FreeNOS/Process.h>
22#include <FreeNOS/ProcessEvent.h>
23#include <FreeNOS/ProcessManager.h>
38 DEBUG(
"#" << procs->
current()->
getID() <<
" " << action <<
" -> " << procID <<
" (" << addr <<
")");
45 else if (!(proc = procs->
get(procID)))
52 proc = procs->
create(addr, map);
55 ERROR(
"failed to create process");
92 ERROR(
"failed to resume PID " << proc->
getID());
100 ERROR(
"failed to reset PID " << proc->
getID());
109 ERROR(
"failed to wakeup process ID " << proc->
getID());
117 ERROR(
"failed to register IRQ #" << addr <<
" to process ID " << proc->
getID());
143 ERROR(
"failed to wait for Process ID " << proc->
getID());
202 default: log.
append(
"???");
break;
Result
Enumeration of generic kernel API result codes.
Memory mapping for the kernel and user processes on the ARM architecture.
virtual Result sendIRQ(const uint coreId, const uint irq)
Send a inter-processor-interrupt (IPI) to another core.
Timer * getTimer()
Get Timer.
virtual void enableIRQ(u32 irq, bool enabled)
Enable or disable an hardware interrupt (IRQ).
ProcessManager * getProcessManager()
Get process manager.
void append(const char *str)
Append to buffered output.
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.
Result registerInterruptNotify(Process *proc, const u32 vector)
Register an interrupt notification for a Process.
Result resume(Process *proc)
Resume scheduling of the given Process.
Result sleep(const Timer::Info *timer=0, const bool ignoreWakeups=false)
Let current Process sleep until a timer expires or wakeup occurs.
Result wait(Process *proc)
Let current Process wait for another Process to terminate.
Process * create(const Address entry, const MemoryMap &map, const bool readyToRun=false, const bool privileged=false)
Create a new Process.
Result wakeup(Process *proc)
Take Process out of Sleep state and mark ready for execution.
void remove(Process *proc, const uint exitStatus=0)
Remove a Process.
Result stop(Process *proc)
Remove given Process from the Scheduler.
Result schedule()
Schedule next process to run.
Process * get(const ProcessID id)
Retrieve a Process by it's ID.
Process * current()
Current process running.
Represents a process which may run on the host.
uint getWaitResult() const
Get wait result.
State getState() const
Retrieves the current state.
ProcessID getID() const
Retrieve our ID number.
ProcessID getParent() const
Retrieve our parent ID.
Represents a configurable timer device.
virtual Result getCurrent(Info *info, const Size msecOffset=0)
Get current timer info.
static Kernel * instance()
Retrieve the instance.
API::Result ProcessCtlHandler(const ProcessID procID, const ProcessOperation action, const Address addr, const Address output)
Kernel handler prototype.
ProcessOperation
Available operation to perform using ProcessCtl.
Log & operator<<(Log &log, ProcessOperation op)
Operator to print a ProcessOperation to a Log.
u32 ProcessID
Process Identification Number.
unsigned long Address
A memory address.
#define ERROR(msg)
Output an error message.
#define DEBUG(msg)
Output a debug message to standard output.
Process information structure, used for Info.
Process::State state
Defines the current state of the Process.
ProcessID id
Process Identity number.
ProcessID parent
Parent process id.
Timer information structure.