Go to the documentation of this file.
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 resume(Process *proc)
Resume scheduling of the given Process.
Process information structure, used for Info.
Represents a process which may run on the host.
Result
Enumeration of generic kernel API result codes.
State getState() const
Retrieves the current state.
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 * create(const Address entry, const MemoryMap &map, const bool readyToRun=false, const bool privileged=false)
Create a new Process.
ProcessID parent
Parent process id.
ProcessID id
Process Identity number.
ProcessID getID() const
Retrieve our ID number.
Result sleep(const Timer::Info *timer=0, const bool ignoreWakeups=false)
Let current Process sleep until a timer expires or wakeup occurs.
ProcessID getParent() const
Retrieve our parent ID.
API::Result ProcessCtlHandler(const ProcessID procID, const ProcessOperation action, const Address addr, const Address output)
Kernel handler prototype.
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.
Represents a configurable timer device.
virtual Result sendIRQ(const uint coreId, const uint irq)
Send a inter-processor-interrupt (IPI) to another core.
ProcessManager * getProcessManager()
Get process manager.
Memory mapping for the kernel and user processes on the ARM architecture.
void append(const char *str)
Append to buffered output.
#define DEBUG(msg)
Output a debug message to standard output.
Result stop(Process *proc)
Remove given Process from the Scheduler.
Process::State state
Defines the current state of the Process.
virtual void enableIRQ(u32 irq, bool enabled)
Enable or disable an hardware interrupt (IRQ).
static Kernel * instance()
Retrieve the instance.
Result schedule()
Schedule next process to run.
Process * get(const ProcessID id)
Retrieve a Process by it's ID.
ProcessOperation
Available operation to perform using ProcessCtl.
#define ERROR(msg)
Output an error message.
void remove(Process *proc, const uint exitStatus=0)
Remove a Process.
uint getWaitResult() const
Get wait result.
Log & operator<<(Log &log, ProcessOperation op)
Operator to print a ProcessOperation to a Log.
Process * current()
Current process running.
Timer * getTimer()
Get Timer.
virtual Result getCurrent(Info *info, const Size msecOffset=0)
Get current timer info.
Result registerInterruptNotify(Process *proc, const u32 vector)
Register an interrupt notification for a Process.