comparison kernel/arch/qemu_vexpress/start.asm @ 389:2ec730e45ea1

Added check for recursive struct
author Windel Bouwman
date Fri, 16 May 2014 12:29:31 +0200
parents kernel/arch/qemu_vexpress/startup_a9.asm@e07c2a9abac1
children a284749c5729
comparison
equal deleted inserted replaced
388:e07c2a9abac1 389:2ec730e45ea1
1
2 section reset
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
29 ; Set domain 0 to manager:
30 mov r0, 3
31 mcr p15, 0, r0, c3, c0, 0
32
33
34 ; Enable the VMSA (Virtual memory system architecture):
35 mrc p15, 0, r0, c1, c0, 0
36 ; TODO:
37 mov r1, 0x1
38 orr r0, r0, r1 ; TODO: implement orr r0, r0, 1
39 mcr p15, 0, r0, c1, c0, 0
40
41 ; Setup stack:
42 mov sp, 0x30000
43 BL kernel_start ; Branch to main (this is actually in the interrupt vector)
44 local_loop:
45 B local_loop
46
47
48 ; Interrupt handlers:
49
50 undef_handler:
51 B undef_handler
52
53
54 ; Assembly language helpers:
55 ; Called to identify the proc:
56 arch_pfr0:
57 mrc p15, 0, r0, c0, c1, 0
58 mov pc, lr
59
60 arch_pfr1:
61 mrc p15, 0, r0, c0, c1, 1
62 mov pc, lr
63
64 arch_mmfr0:
65 mrc p15, 0, r0, c0, c1, 4
66 mov pc, lr
67
68 arch_mpuir:
69 mrc p15, 0, r0, c0, c0, 4
70 mov pc, lr
71
72
73 ; Memory map tables:
74
75 section mem_tables
76
77 kernel_table0:
78 dcd 0x00000402 ; Identity map first 1 MB
79 dcd 0x10000402 ; Map to peripheral space 1 MB
80 repeat 0x5FE
81 dcd 0
82 endrepeat
83
84 dcd 0x00000402 ; Alias to 0x0
85
86 repeat 0x9FF
87 dcd 0
88 endrepeat
89