Go to the documentation of this file.
18 #include <FreeNOS/System.h>
42 ERROR(
"failed to create memory context");
50 ERROR(
"failed to initialize MemoryContext: result = " << (
int) memResult);
63 ERROR(
"failed to allocate user stack");
71 ERROR(
"failed to map user stack");
132 asm volatile (
"ldr sp, =(svcStack + (4096*4))\n"
134 "ldr r0, =loadCoreState0\n"
virtual Result initialize()=0
Initialize the MemoryContext.
MemoryContext * m_memoryContext
MMU memory context.
static Size copy(void *dest, const void *src, Size count)
Copy memory from one place to another.
Represents a process which may run on the host.
static void * set(void *dest, int ch, unsigned count)
Fill memory with a constant byte.
virtual ~ARMProcess()
Destructor function.
ARM virtual memory implementation.
#define PAGESIZE
ARM uses 4K pages.
MemoryMap m_map
Virtual memory layout.
CPUState m_cpuState
Contains all the CPU registers for this task.
u32 ProcessID
Process Identification Number.
unsigned long Address
A memory address.
Address address
Starting address of the memory range.
Size alignment
Alignment in bytes or ZERO for default alignment.
unsigned int uint
Unsigned integer number.
Size size
Amount of memory in bytes.
virtual void execute(Process *previous)
Allow the Process to run on the CPU.
virtual Result activate(bool initializeMMU=false)=0
Activate the MemoryContext.
Address phys
Physical address.
Memory::Range range(Region region) const
Get memory range for the given region.
Describes virtual memory map layout.
static Kernel * instance()
Retrieve the instance.
#define USR_MODE
ARM Program Status Register (CPSR)
Address m_entry
Entry point of the program.
virtual Result join(const uint result)
Complete waiting for another Process.
Contains all the CPU registers.
ARMProcess(ProcessID id, Address entry, bool privileged, const MemoryMap &map)
Constructor function.
virtual Result initialize()
Initialize the Process.
Describes a range of memory.
virtual Result join(const uint result)
Complete waiting for another Process.
virtual void reset(const Address entry)
Restart execution at the given entry point.
virtual Result initialize()
Initialize the Process.
#define ERROR(msg)
Output an error message.
unsigned char u8
Unsigned 8-bit number.
void setCpuState(const CPUState *cpuState)
Overwrite the saved CPU registers for this task.
Address virt
Virtual address.
const CPUState * cpuState() const
Retrieve saved CPU state.
Size size
Size in number of bytes.
Access access
Page access flags.
virtual Result mapRangeContiguous(Memory::Range *range)
Map a range of contiguous physical pages to virtual addresses.
bool m_privileged
Privilege level.