.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * purgatory: setup code |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * Copyright (C) 2014 Red Hat Inc. |
---|
6 | 7 | * |
---|
7 | 8 | * 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. |
---|
11 | 9 | */ |
---|
| 10 | +#include <linux/linkage.h> |
---|
12 | 11 | #include <asm/purgatory.h> |
---|
13 | 12 | |
---|
14 | 13 | .text |
---|
15 | | - .globl purgatory_start |
---|
16 | 14 | .balign 16 |
---|
17 | | -purgatory_start: |
---|
18 | 15 | .code64 |
---|
19 | 16 | |
---|
| 17 | +SYM_CODE_START(purgatory_start) |
---|
20 | 18 | /* Load a gdt so I know what the segment registers are */ |
---|
21 | 19 | lgdt gdt(%rip) |
---|
22 | 20 | |
---|
.. | .. |
---|
34 | 32 | /* Call the C code */ |
---|
35 | 33 | call purgatory |
---|
36 | 34 | jmp entry64 |
---|
| 35 | +SYM_CODE_END(purgatory_start) |
---|
37 | 36 | |
---|
38 | 37 | .section ".rodata" |
---|
39 | 38 | .balign 16 |
---|
40 | | -gdt: /* 0x00 unusable segment |
---|
| 39 | +SYM_DATA_START_LOCAL(gdt) |
---|
| 40 | + /* 0x00 unusable segment |
---|
41 | 41 | * 0x08 unused |
---|
42 | 42 | * so use them as the gdt ptr |
---|
43 | 43 | */ |
---|
.. | .. |
---|
50 | 50 | |
---|
51 | 51 | /* 0x18 4GB flat data segment */ |
---|
52 | 52 | .word 0xFFFF, 0x0000, 0x9200, 0x00CF |
---|
53 | | -gdt_end: |
---|
| 53 | +SYM_DATA_END_LABEL(gdt, SYM_L_LOCAL, gdt_end) |
---|
54 | 54 | |
---|
55 | 55 | .bss |
---|
56 | 56 | .balign 4096 |
---|
57 | | -lstack: |
---|
| 57 | +SYM_DATA_START_LOCAL(lstack) |
---|
58 | 58 | .skip 4096 |
---|
59 | | -lstack_end: |
---|
| 59 | +SYM_DATA_END_LABEL(lstack, SYM_L_LOCAL, lstack_end) |
---|