hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/x86/purgatory/entry64.S
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2003,2004 Eric Biederman (ebiederm@xmission.com)
34 * Copyright (C) 2014 Red Hat Inc.
....@@ -5,18 +6,15 @@
56 * Author(s): Vivek Goyal <vgoyal@redhat.com>
67 *
78 * This code has been taken from kexec-tools.
8
- *
9
- * This source code is licensed under the GNU General Public License,
10
- * Version 2. See the file COPYING for more details.
119 */
10
+
11
+#include <linux/linkage.h>
1212
1313 .text
1414 .balign 16
1515 .code64
16
- .globl entry64, entry64_regs
1716
18
-
19
-entry64:
17
+SYM_CODE_START(entry64)
2018 /* Setup a gdt that should be preserved */
2119 lgdt gdt(%rip)
2220
....@@ -56,10 +54,11 @@
5654
5755 /* Jump to the new code... */
5856 jmpq *rip(%rip)
57
+SYM_CODE_END(entry64)
5958
6059 .section ".rodata"
6160 .balign 4
62
-entry64_regs:
61
+SYM_DATA_START(entry64_regs)
6362 rax: .quad 0x0
6463 rcx: .quad 0x0
6564 rdx: .quad 0x0
....@@ -77,13 +76,14 @@
7776 r14: .quad 0x0
7877 r15: .quad 0x0
7978 rip: .quad 0x0
80
- .size entry64_regs, . - entry64_regs
79
+SYM_DATA_END(entry64_regs)
8180
8281 /* GDT */
8382 .section ".rodata"
8483 .balign 16
85
-gdt:
86
- /* 0x00 unusable segment
84
+SYM_DATA_START_LOCAL(gdt)
85
+ /*
86
+ * 0x00 unusable segment
8787 * 0x08 unused
8888 * so use them as gdt ptr
8989 */
....@@ -96,6 +96,8 @@
9696
9797 /* 0x18 4GB flat data segment */
9898 .word 0xFFFF, 0x0000, 0x9200, 0x00CF
99
-gdt_end:
100
-stack: .quad 0, 0
101
-stack_init:
99
+SYM_DATA_END_LABEL(gdt, SYM_L_LOCAL, gdt_end)
100
+
101
+SYM_DATA_START_LOCAL(stack)
102
+ .quad 0, 0
103
+SYM_DATA_END_LABEL(stack, SYM_L_LOCAL, stack_init)