]> rtime.felk.cvut.cz Git - jailhouse.git/blob - inmates/lib/arm/header.S
inmates: arm: Initialize bss programmatically
[jailhouse.git] / inmates / lib / arm / header.S
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) ARM Limited, 2014
5  * Copyright (c) Siemens AG, 2016
6  *
7  * Authors:
8  *  Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
9  *  Jan Kiszka <jan.kiszka@siemens.com>
10  *
11  * This work is licensed under the terms of the GNU GPL, version 2.  See
12  * the COPYING file in the top-level directory.
13  */
14         .arm
15
16         .section ".boot", "ax"
17         .align 5
18 vectors:
19         b       __reset_entry
20         b       vector_undef
21         b       vector_svc
22         b       vector_pabt
23         b       vector_dabt
24         b       vector_unused
25         b       vector_irq
26         b       vector_fiq
27
28 .macro vector, name
29         .weak vector_\name
30         vector_\name:
31         b       .
32 .endm
33         vector undef
34         vector svc
35         vector pabt
36         vector dabt
37         vector unused
38         vector irq
39         vector fiq
40
41         .globl __reset_entry
42 __reset_entry:
43         ldr     r0, =vectors
44         mcr     p15, 0, r0, c12, c0, 0  @ VBAR
45
46         mov     r0, #0
47         ldr     r1, =bss_start
48         ldr     r2, =bss_dwords
49 1:      str     r0, [r1]
50         add     r1, #4
51         subs    r2, #1
52         bne     1b
53
54         ldr     sp, =stack_top
55
56         b       inmate_main
57
58         .ltorg