Mercurial > lcfOS
comparison kernel/arch/qemu_vexpress/startup_a9.asm @ 381:6df89163e114
Fix section and ldr pseudo instruction
author | Windel Bouwman |
---|---|
date | Sat, 26 Apr 2014 17:41:56 +0200 |
parents | kernel/startup_a9.asm@9667d78ba79e |
children | d056b552d3f4 |
comparison
equal
deleted
inserted
replaced
380:67a584582aee | 381:6df89163e114 |
---|---|
1 | |
2 section code | |
3 | |
4 interrupt_vector_table: | |
5 ivt_reset: B start ; 0x0 reset | |
6 ivt_undef: B undef_handler ; 0x4 undefined instruction | |
7 ivt_svc: B undef_handler ; 0x08 Supervisor call | |
8 ivt_prefetch: B undef_handler ; 0x0C prefetch abort | |
9 ivt_data: B undef_handler ; 0x10 data abort | |
10 ivt_hyptrap: B undef_handler ; 0x14 not used | |
11 ivt_irq: B undef_handler ; 0x18 IRQ | |
12 ivt_fiq: B undef_handler ; 0x18 FIQ | |
13 | |
14 | |
15 start: | |
16 | |
17 ; Setup TTBR1 (translation table base register) | |
18 | |
19 ldr r0, =kernel_table0 ; pseudo instruction which loads the value of the symbol | |
20 ; -KERNEL_BASE | |
21 mcr p15, 0, r0, c2, c0, 1 ; TTBR1 | |
22 mcr p15, 0, r0, c2, c0, 0 ; TTBR0 | |
23 | |
24 ; Prepare the TTBCR (translation table base control register) | |
25 mov r0, 0x1 ; TBD: why set this to 1? | |
26 mcr p15, 0, r0, c2, c0, 2 | |
27 | |
28 ; Enable the VMSA (Virtual memory system architecture): | |
29 mrc p15, 0, r0, c1, c0, 0 | |
30 ; TODO: | |
31 ; orr r0, r0, 0x1 | |
32 mcr p15, 0, r0, c1, c0, 0 | |
33 | |
34 ; Setup stack: | |
35 mov sp, 0x30000 | |
36 BL kernel_start ; Branch to main (this is actually in the interrupt vector) | |
37 local_loop: | |
38 B local_loop | |
39 | |
40 | |
41 ; Interrupt handlers: | |
42 | |
43 undef_handler: | |
44 B undef_handler | |
45 | |
46 | |
47 ; Assembly language helpers: | |
48 ; Called to identify the proc: | |
49 arch_pfr0: | |
50 mrc p15, 0, r0, c0, c1, 0 | |
51 mov pc, lr | |
52 | |
53 arch_pfr1: | |
54 mrc p15, 0, r0, c0, c1, 1 | |
55 mov pc, lr | |
56 | |
57 arch_mmfr0: | |
58 mrc p15, 0, r0, c0, c1, 4 | |
59 mov pc, lr | |
60 | |
61 | |
62 arch_mpuir: | |
63 mrc p15, 0, r0, c0, c0, 4 | |
64 mov pc, lr | |
65 | |
66 | |
67 ; Memory map tables: | |
68 | |
69 section mem_tables | |
70 | |
71 kernel_table0: | |
72 dcd 0x000402 | |
73 |