1/*
2 * Copyright (C) 2017 Linaro, Ltd. <ard.biesheuvel@linaro.org>
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 version 2 as
6 * published by the Free Software Foundation.
7 *
8 */
9
10#include <linux/linkage.h>
11
12ENTRY(absolute_data64)
13	ldr	x0, 0f
14	ret
150:	.quad	sym64_abs
16ENDPROC(absolute_data64)
17
18ENTRY(absolute_data32)
19	ldr	w0, 0f
20	ret
210:	.long	sym32_abs
22ENDPROC(absolute_data32)
23
24ENTRY(absolute_data16)
25	adr	x0, 0f
26	ldrh	w0, [x0]
27	ret
280:	.short	sym16_abs, 0
29ENDPROC(absolute_data16)
30
31ENTRY(signed_movw)
32	movz	x0, #:abs_g2_s:sym64_abs
33	movk	x0, #:abs_g1_nc:sym64_abs
34	movk	x0, #:abs_g0_nc:sym64_abs
35	ret
36ENDPROC(signed_movw)
37
38ENTRY(unsigned_movw)
39	movz	x0, #:abs_g3:sym64_abs
40	movk	x0, #:abs_g2_nc:sym64_abs
41	movk	x0, #:abs_g1_nc:sym64_abs
42	movk	x0, #:abs_g0_nc:sym64_abs
43	ret
44ENDPROC(unsigned_movw)
45
46#ifndef CONFIG_ARM64_ERRATUM_843419
47
48ENTRY(relative_adrp)
49	adrp	x0, sym64_rel
50	add	x0, x0, #:lo12:sym64_rel
51	ret
52ENDPROC(relative_adrp)
53
54#endif
55
56ENTRY(relative_adr)
57	adr	x0, sym64_rel
58	ret
59ENDPROC(relative_adr)
60
61ENTRY(relative_data64)
62	adr	x1, 0f
63	ldr	x0, [x1]
64	add	x0, x0, x1
65	ret
660:	.quad	sym64_rel - .
67ENDPROC(relative_data64)
68
69ENTRY(relative_data32)
70	adr	x1, 0f
71	ldr	w0, [x1]
72	add	x0, x0, x1
73	ret
740:	.long	sym64_rel - .
75ENDPROC(relative_data32)
76
77ENTRY(relative_data16)
78	adr	x1, 0f
79	ldrsh	w0, [x1]
80	add	x0, x0, x1
81	ret
820:	.short	sym64_rel - ., 0
83ENDPROC(relative_data16)
84