Go to the documentation of this file.
18 #include <FreeNOS/System.h>
19 #include <FreeNOS/API.h>
27 : m_id(id), m_map(map), m_shares(id)
182 ERROR(
"failed to allocate kernel event channel object");
193 ERROR(
"failed to allocate kernel event channel pages");
ProcessID m_waitId
Waits for exit of this Process.
MemoryContext * m_memoryContext
MMU memory context.
static Size copy(void *dest, const void *src, Size count)
Copy memory from one place to another.
Virtual memory abstract interface.
State getState() const
Retrieves the current state.
Result setVirtual(const Address data, const Address feedback, const bool hardReset=true)
Set memory pages by virtual address.
Represents a process which may run on the host.
static void * set(void *dest, int ch, unsigned count)
Fill memory with a constant byte.
Result raiseEvent(const struct ProcessEvent *event)
Raise kernel event.
ProcessID getID() const
Retrieve our ID number.
#define PAGESIZE
ARM uses 4K pages.
virtual Result map(Address virt, Address phys, Memory::Access access)=0
Map a physical page to a virtual address.
virtual ~Process()
Destructor function.
bool isPrivileged() const
Get privilege.
MemoryMap m_map
Virtual memory layout.
ProcessID getParent() const
Retrieve our parent ID.
u32 ProcessID
Process Identification Number.
uint m_waitResult
Wait exit result of the other Process.
@ UserShare
< User shared dynamic memory mappings
unsigned long Address
A memory address.
Timer::Info m_sleepTimer
Sleep timer value.
Address address
Starting address of the memory range.
Process(ProcessID id, Address entry, bool privileged, const MemoryMap &map)
Constructor function.
virtual Result unmap(Address virt)=0
Unmap a virtual address.
@ UserData
< User program data from libexec, e.g.
Size alignment
Alignment in bytes or ZERO for default alignment.
Timer information structure.
Result wakeup()
Prevent process from sleeping.
unsigned int uint
Unsigned integer number.
State m_state
Current process status.
ProcessShares & getShares()
Get process shares.
Size size
Amount of memory in bytes.
Result stop()
Stop execution of this process.
MemoryContext * getMemoryContext()
Get MMU memory context.
Result resume()
Resume execution when this process is stopped.
Represents a process which may run on the host.
Address phys
Physical address.
ARMv6 cache management implementation.
Size m_wakeups
Number of wakeups received.
Memory::Range range(Region region) const
Get memory range for the given region.
ProcessShares m_shares
Contains virtual memory shares between this process and others.
virtual Result findFree(Size size, MemoryMap::Region region, Address *virt) const
Find unused memory.
Describes virtual memory map layout.
static Kernel * instance()
Retrieve the instance.
Address m_entry
Entry point of the program.
virtual Result write(const void *buffer)
Write a message.
virtual Result cleanData(Address addr)
Clean one data page.
Unidirectional point-to-point channel using shared memory.
@ UserPrivate
< User private dynamic memory mappings
const ProcessID m_id
Process Identifier.
void setParent(ProcessID id)
Set parent process ID.
virtual Result flush()
Flush message buffers.
Result createShare(ProcessShares &instance, MemoryShare *share)
Describes a range of memory.
virtual Result join(const uint result)
Complete waiting for another Process.
virtual Result initialize()
Initialize the Process.
State
Represents the execution state of the Process.
#define ERROR(msg)
Output an error message.
Result sleep(const Timer::Info *timer, bool ignoreWakeups)
Stops the process for executing until woken up.
Address virt
Virtual address.
@ UserArgs
< Used for copying program arguments and file descriptors
uint getWaitResult() const
Get wait result.
Size size
Size in number of bytes.
bool operator==(Process *proc)
Compare two processes.
virtual Result releaseSection(const Memory::Range &range, const bool tablesOnly=false)=0
Release memory sections.
const Timer::Info & getSleepTimer() const
Get sleep timer.
Access access
Page access flags.
MemoryChannel * m_kernelChannel
Channel for sending kernel events to the Process.
Result wait(ProcessID id)
Let Process wait for other Process to terminate.
virtual Result mapRangeContiguous(Memory::Range *range)
Map a range of contiguous physical pages to virtual addresses.
Result setMemoryContext(MemoryContext *context)
Set MemoryContext.
ProcessID getWait() const
Get Wait ID.
bool m_privileged
Privilege level.
Manages memory shares for a Process.
ProcessID m_parent
Parent process.