Go to the documentation of this file.
18 #include <FreeNOS/System.h>
19 #include <FreeNOS/ProcessManager.h>
38 else if (!(proc = procs->
get(procID)))
54 ERROR(
"failed to lookup virtual address " << (
void *) range->
virt <<
55 ": " << (
int) memResult);
71 ERROR(
"failed to find free virtual address in UserPrivate: " <<
84 ERROR(
"failed to map memory range " << (
void *)range->
virt <<
"->" <<
85 (
void *) range->
phys <<
": " << (
int) memResult);
94 ERROR(
"failed to unmap range at virtual address " << (
void *)range->
virt <<
95 ": " << (
int) memResult);
104 ERROR(
"failed to release range at virtual address " << (
void *)range->
virt <<
105 ": " << (
int) memResult);
114 ERROR(
"failed to release sections at virtual address " << (
void *)range->
virt <<
115 ": " << (
int) memResult);
131 ERROR(
"failed to invalidate cache at address " << (
void *) range->
virt <<
132 ": result = " << (
int) r);
164 ERROR(
"address " << (
void *)addr <<
" is already allocated");
169 ERROR(
"failed to allocate " << (
void *)addr <<
", result = " << (
int)allocResult);
virtual Result cleanInvalidate(Type type)
Clean and invalidate entire cache.
virtual Result allocate(Range &args)
Allocate physical memory.
Represents a process which may run on the host.
Virtual memory abstract interface.
Result
Enumeration of generic kernel API result codes.
virtual Result unmapRange(Memory::Range *range)
Unmaps a range of virtual memory.
virtual Result access(Address virt, Memory::Access *access) const =0
Get Access flags for a virtual address.
virtual Result releaseRange(Memory::Range *range)=0
Release a range of physical memory by its virtual memory pages.
Represents a process which may run on the host.
#define PAGEMASK
Mask to find the page.
#define PAGESIZE
ARM uses 4K pages.
u32 ProcessID
Process Identification Number.
unsigned long Address
A memory address.
SplitAllocator * getAllocator()
Get physical memory allocator.
ProcessManager * getProcessManager()
Get process manager.
Allocator which separates kernel mapped memory at virtual and physical addresses.
virtual Result lookup(Address virt, Address *phys) const =0
Translate virtual address to physical address.
#define DEBUG(msg)
Output a debug message to standard output.
MemoryContext * getMemoryContext()
Get MMU memory context.
Address phys
Physical address.
ARMv6 cache management implementation.
virtual Result findFree(Size size, MemoryMap::Region region, Address *virt) const
Find unused memory.
unsigned int Size
Any sane size indicator cannot go negative.
static Kernel * instance()
Retrieve the instance.
virtual Result cleanData(Address addr)
Clean one data page.
@ UserPrivate
< User private dynamic memory mappings
Process * get(const ProcessID id)
Retrieve a Process by it's ID.
virtual Result invalidateAddress(Type type, Address addr)
Invalidate one memory page.
MemoryOperation
Memory operations which may be used as an argument to VMCtl().
API::Result VMCtlHandler(const ProcessID procID, const MemoryOperation op, Memory::Range *range)
Kernel handler prototype.
#define assert(exp)
Insert program diagnostics.
#define ERROR(msg)
Output an error message.
Address virt
Virtual address.
Size size
Size in number of bytes.
Process * current()
Current process running.
virtual Result releaseSection(const Memory::Range &range, const bool tablesOnly=false)=0
Release memory sections.
Access access
Page access flags.
bool isAllocated(const Address page) const
Check if a physical page is allocated.
virtual Result mapRangeContiguous(Memory::Range *range)
Map a range of contiguous physical pages to virtual addresses.
virtual Result mapRangeSparse(Memory::Range *range)
Map and allocate a range of sparse (non-contiguous) physical pages to virtual addresses.
Result
Allocation results.