352
|
1 module arch;
|
367
|
2 import io;
|
352
|
3
|
362
|
4
|
352
|
5 function void init()
|
|
6 {
|
381
|
7 io.print2("PFR0 = ", pfr0());
|
|
8 io.print2("PFR1 = ", pfr1());
|
|
9 io.print2("MMFR0 = ", mmfr0());
|
|
10
|
|
11 // This below is not compatible with all qemu versions:
|
|
12 // io.print2("MPUIR = ", arch.mpuir());
|
353
|
13 }
|
|
14
|
|
15 function void putc(int c)
|
|
16 {
|
352
|
17 var int *UART0DR;
|
388
|
18 UART0DR = cast<int*>(0x109000); // UART0 DR register when remapped at 1MB
|
353
|
19 *UART0DR = c;
|
352
|
20 }
|
|
21
|
|
22 function void halt()
|
|
23 {
|
402
|
24 while(true)
|
|
25 {
|
|
26 }
|
352
|
27 }
|
|
28
|
381
|
29 function int pfr0();
|
|
30 function int pfr1();
|
|
31 function int mmfr0();
|
|
32 // function int mpuir();
|
|
33
|