hyp-stub.S (80c59dafb1a9a86fa996e6e34d06b60567c925ca) hyp-stub.S (424e5994e63326a42012f003f1174f3c363c7b62)
1/*
2 * Copyright (c) 2012 Linaro Limited.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 7 unchanged lines hidden (view full) ---

16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#include <linux/init.h>
20#include <linux/linkage.h>
21#include <asm/assembler.h>
22#include <asm/virt.h>
23
1/*
2 * Copyright (c) 2012 Linaro Limited.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 7 unchanged lines hidden (view full) ---

16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#include <linux/init.h>
20#include <linux/linkage.h>
21#include <asm/assembler.h>
22#include <asm/virt.h>
23
24#ifndef ZIMAGE
24/*
25 * For the kernel proper, we need to find out the CPU boot mode long after
26 * boot, so we need to store it in a writable variable.
27 *
28 * This is not in .bss, because we set it sufficiently early that the boot-time
29 * zeroing of .bss would clobber it.
30 */
31.data

--- 22 unchanged lines hidden (view full) ---

54 adr \reg2, .L__boot_cpu_mode_offset
55 ldr \reg3, [\reg2]
56 ldr \reg1, [\reg2, \reg3]
57 cmp \mode, \reg1 @ matches primary CPU boot mode?
58 orrne r7, r7, #BOOT_CPU_MODE_MISMATCH
59 strne r7, [r5, r6] @ record what happened and give up
60 .endm
61
25/*
26 * For the kernel proper, we need to find out the CPU boot mode long after
27 * boot, so we need to store it in a writable variable.
28 *
29 * This is not in .bss, because we set it sufficiently early that the boot-time
30 * zeroing of .bss would clobber it.
31 */
32.data

--- 22 unchanged lines hidden (view full) ---

55 adr \reg2, .L__boot_cpu_mode_offset
56 ldr \reg3, [\reg2]
57 ldr \reg1, [\reg2, \reg3]
58 cmp \mode, \reg1 @ matches primary CPU boot mode?
59 orrne r7, r7, #BOOT_CPU_MODE_MISMATCH
60 strne r7, [r5, r6] @ record what happened and give up
61 .endm
62
63#else /* ZIMAGE */
64
65 .macro store_primary_cpu_mode reg1:req, reg2:req, reg3:req
66 .endm
67
62/*
68/*
69 * The zImage loader only runs on one CPU, so we don't bother with mult-CPU
70 * consistency checking:
71 */
72 .macro compare_cpu_mode_with_primary mode, reg1, reg2, reg3
73 cmp \mode, \mode
74 .endm
75
76#endif /* ZIMAGE */
77
78/*
63 * Hypervisor stub installation functions.
64 *
65 * These must be called with the MMU and D-cache off.
66 * They are not ABI compliant and are only intended to be called from the kernel
67 * entry points in head.S.
68 */
69@ Call this from the primary CPU
70ENTRY(__hyp_stub_install)

--- 98 unchanged lines hidden (view full) ---

169 mov r0, #-1
170ENDPROC(__hyp_get_vectors)
171 @ fall through
172ENTRY(__hyp_set_vectors)
173 __HVC(0)
174 bx lr
175ENDPROC(__hyp_set_vectors)
176
79 * Hypervisor stub installation functions.
80 *
81 * These must be called with the MMU and D-cache off.
82 * They are not ABI compliant and are only intended to be called from the kernel
83 * entry points in head.S.
84 */
85@ Call this from the primary CPU
86ENTRY(__hyp_stub_install)

--- 98 unchanged lines hidden (view full) ---

185 mov r0, #-1
186ENDPROC(__hyp_get_vectors)
187 @ fall through
188ENTRY(__hyp_set_vectors)
189 __HVC(0)
190 bx lr
191ENDPROC(__hyp_set_vectors)
192
193#ifndef ZIMAGE
177.align 2
178.L__boot_cpu_mode_offset:
179 .long __boot_cpu_mode - .
194.align 2
195.L__boot_cpu_mode_offset:
196 .long __boot_cpu_mode - .
197#endif
180
181.align 5
182__hyp_stub_vectors:
183__hyp_stub_reset: W(b) .
184__hyp_stub_und: W(b) .
185__hyp_stub_svc: W(b) .
186__hyp_stub_pabort: W(b) .
187__hyp_stub_dabort: W(b) .
188__hyp_stub_trap: W(b) __hyp_stub_do_trap
189__hyp_stub_irq: W(b) .
190__hyp_stub_fiq: W(b) .
191ENDPROC(__hyp_stub_vectors)
192
198
199.align 5
200__hyp_stub_vectors:
201__hyp_stub_reset: W(b) .
202__hyp_stub_und: W(b) .
203__hyp_stub_svc: W(b) .
204__hyp_stub_pabort: W(b) .
205__hyp_stub_dabort: W(b) .
206__hyp_stub_trap: W(b) __hyp_stub_do_trap
207__hyp_stub_irq: W(b) .
208__hyp_stub_fiq: W(b) .
209ENDPROC(__hyp_stub_vectors)
210