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