27 #ifndef L4_SYS_KIP_H__ 28 #define L4_SYS_KIP_H__ 30 #include <l4/cxx/static_vector> 83 static unsigned long &memory_info(
void *kip)
throw()
84 {
return *((
unsigned long *)kip + 21); }
86 static unsigned long memory_info(
void const *kip)
throw()
87 {
return *((
unsigned long const *)kip + 21); }
100 + (memory_info(kip) >> ((
sizeof(
unsigned long) / 2) * 8)));
105 return (
Mem_desc const *)((
char const *)kip
106 + (memory_info(kip) >> ((
sizeof(
unsigned long) / 2) * 8)));
116 static unsigned long count(
void const *kip)
throw()
118 return memory_info(kip)
119 & ((1UL << ((
sizeof(
unsigned long) / 2) * 8)) - 1);
130 unsigned long &mi = memory_info(kip);
131 mi = (mi & ~((1UL << ((
sizeof(
unsigned long) / 2) * 8)) - 1)) |
count;
167 Mem_type t,
unsigned char st = 0,
bool virt =
false) throw()
168 : _l((start & ~0x3ffUL) | (t & 0x0f) | ((st << 4) & 0x0f0)
169 | (virt ? 0x0200 : 0x0)), _h(end | 0x3ffUL)
177 unsigned long start()
const throw() {
return _l & ~0x3ffUL; }
184 unsigned long end()
const throw() {
return _h | 0x3ffUL; }
205 unsigned char sub_type()
const throw() {
return (_l >> 4) & 0x0f; }
225 Mem_type t,
unsigned char st = 0,
bool virt =
false)
throw()
227 _l = (start & ~0x3ffUL) | (t & 0x0f) | ((st << 4) & 0x0f0)
Mem_desc(unsigned long start, unsigned long end, Mem_type t, unsigned char st=0, bool virt=false)
Initialize memory descriptor.
static cxx::static_vector< Mem_desc > all(void *kip)
Return enumerable list of memory descriptors.
Simple encapsulation for a dynamically allocated array.
Memory belongs to the boot loader.
unsigned long end() const
Return end address of memory descriptor.
Memory descriptors stored in the kernel interface page.
static void count(void *kip, unsigned count)
Set number of memory descriptors.
L4 low-level kernel interface.
unsigned long size() const
Return size of region described by the memory descriptor.
static unsigned long count(void const *kip)
Return number of memory descriptors stored in the kernel info page.
Mem_type type() const
Return type of the memory descriptor.
Physical address of the ACPI root pointer.
Architecture specific memory.
unsigned long start() const
Return start address of memory descriptor.
Reserved region, do not use this memory.
static cxx::static_vector< Mem_desc const > all(void const *kip)
Return enumerable list of memory descriptors.
static Mem_desc * first(void *kip)
Get first memory descriptor.
unsigned char sub_type() const
Return sub-type of the memory descriptor.
unsigned is_virtual() const
Return whether the memory descriptor describes a virtual or physical region.
Info_sub_type
Memory sub types for the Mem_type::Info type.