X-Git-Url: https://rtime.felk.cvut.cz/gitweb/l4.git/blobdiff_plain/35719fdd2ff27177690edb32843d32e092a006e3..5658d2ec9c1081516a8868259fa867926e25ab3f:/kernel/fiasco/src/kern/arm/bootstrap.cpp diff --git a/kernel/fiasco/src/kern/arm/bootstrap.cpp b/kernel/fiasco/src/kern/arm/bootstrap.cpp index 7db0355c8..504fcd26e 100644 --- a/kernel/fiasco/src/kern/arm/bootstrap.cpp +++ b/kernel/fiasco/src/kern/arm/bootstrap.cpp @@ -95,6 +95,19 @@ map_1mb(void *pd, Address va, Address pa, bool cache, bool local) | (local ? Section_local : Section_global); } +// This is a template so that we can have the static_assertion, checking the +// right value at compile time. At runtime we probably won't see anything +// as this also affects the UART mapping. +template< Address PA > +static void inline +map_dev(void *pd, unsigned va_slotnr) +{ + static_assert(PA == Invalid_address || (PA & ~0xfff00000) == 0, "Physical address must be 2^20 aligned"); + if (PA != Invalid_address) + map_1mb(pd, Mem_layout::Registers_map_start + va_slotnr * 0x100000, PA, + false, false); +} + asm ( ".section .text.init,#alloc,#execinstr \n"