]> rtime.felk.cvut.cz Git - l4.git/blobdiff - kernel/fiasco/src/kern/arm/bootstrap.cpp
update
[l4.git] / kernel / fiasco / src / kern / arm / bootstrap.cpp
index 7db0355c8e75e7e839a9dafe0ed2323a7923c883..504fcd26ec335bc20f710458170d09fc104da46c 100644 (file)
@@ -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"