xref: /kvm-unit-tests/arm/cstart64.S (revision 39ac3f8494beb048a121f44bf626275b18c66da5)
1/*
2 * Boot entry point and assembler functions for aarch64 tests.
3 *
4 * Copyright (C) 2014, Red Hat Inc, Andrew Jones <drjones@redhat.com>
5 *
6 * This work is licensed under the terms of the GNU LGPL, version 2.
7 */
8#define __ASSEMBLY__
9#include <asm/asm-offsets.h>
10
11.section .init
12
13.globl start
14start:
15	/*
16	 * bootloader params are in x0-x3
17	 * The physical address of the dtb is in x0, x1-x3 are reserved
18	 * See the kernel doc Documentation/arm64/booting.txt
19	 */
20	adr     x4, stacktop
21	mov	sp, x4
22	stp	x0, x1, [sp, #-16]!
23
24	/* Enable FP/ASIMD */
25	mov	x0, #(3 << 20)
26	msr	cpacr_el1, x0
27
28	/* set up exception handling */
29//	bl	exceptions_init
30
31	/* complete setup */
32	ldp	x0, x1, [sp], #16
33	bl	setup
34
35	/* run the test */
36	adr	x0, __argc
37	ldr	x0, [x0]
38	adr	x1, __argv
39	bl	main
40	bl	exit
41	b	halt
42
43.text
44
45.globl halt
46halt:
471:	wfi
48	b	1b
49