]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/bootstrap_custom/server/src/ARCH-arm/head.cc
fiasco: bootstrap: copy bootstrap into bootstrap_custom for to port this into Jailhouse.
[l4.git] / l4 / pkg / bootstrap_custom / server / src / ARCH-arm / head.cc
1 #include "support.h"
2 #include "startup.h"
3
4 extern "C" int __aeabi_unwind_cpp_pr0(void);
5 extern "C" int __aeabi_unwind_cpp_pr1(void);
6
7 enum { _URC_FAILURE  = 9 };
8 int __aeabi_unwind_cpp_pr0(void) { return _URC_FAILURE; }
9 int __aeabi_unwind_cpp_pr1(void) { return _URC_FAILURE; }
10
11 extern "C" void __main();
12 void __main()
13 {
14   unsigned long r;
15
16   asm volatile("mrc p15, 0, %0, c1, c0, 0" : "=r" (r) : : "memory");
17   r &= ~1UL;
18   r |= 2; // alignment check on
19   asm volatile("mcr p15, 0, %0, c1, c0, 0" : : "r" (r) : "memory");
20
21   clear_bss();
22   ctor_init();
23   Platform_base::iterate_platforms();
24
25   startup(_mbi_cmdline);
26   while(1)
27     ;
28 }