| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2003,2004 Eric Biederman (ebiederm@xmission.com) |
|---|
| 3 | 4 | * Copyright (C) 2014 Red Hat Inc. |
|---|
| .. | .. |
|---|
| 5 | 6 | * Author(s): Vivek Goyal <vgoyal@redhat.com> |
|---|
| 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 | + |
|---|
| 11 | +#include <linux/linkage.h> |
|---|
| 12 | 12 | |
|---|
| 13 | 13 | .text |
|---|
| 14 | 14 | .balign 16 |
|---|
| 15 | 15 | .code64 |
|---|
| 16 | | - .globl entry64, entry64_regs |
|---|
| 17 | 16 | |
|---|
| 18 | | - |
|---|
| 19 | | -entry64: |
|---|
| 17 | +SYM_CODE_START(entry64) |
|---|
| 20 | 18 | /* Setup a gdt that should be preserved */ |
|---|
| 21 | 19 | lgdt gdt(%rip) |
|---|
| 22 | 20 | |
|---|
| .. | .. |
|---|
| 56 | 54 | |
|---|
| 57 | 55 | /* Jump to the new code... */ |
|---|
| 58 | 56 | jmpq *rip(%rip) |
|---|
| 57 | +SYM_CODE_END(entry64) |
|---|
| 59 | 58 | |
|---|
| 60 | 59 | .section ".rodata" |
|---|
| 61 | 60 | .balign 4 |
|---|
| 62 | | -entry64_regs: |
|---|
| 61 | +SYM_DATA_START(entry64_regs) |
|---|
| 63 | 62 | rax: .quad 0x0 |
|---|
| 64 | 63 | rcx: .quad 0x0 |
|---|
| 65 | 64 | rdx: .quad 0x0 |
|---|
| .. | .. |
|---|
| 77 | 76 | r14: .quad 0x0 |
|---|
| 78 | 77 | r15: .quad 0x0 |
|---|
| 79 | 78 | rip: .quad 0x0 |
|---|
| 80 | | - .size entry64_regs, . - entry64_regs |
|---|
| 79 | +SYM_DATA_END(entry64_regs) |
|---|
| 81 | 80 | |
|---|
| 82 | 81 | /* GDT */ |
|---|
| 83 | 82 | .section ".rodata" |
|---|
| 84 | 83 | .balign 16 |
|---|
| 85 | | -gdt: |
|---|
| 86 | | - /* 0x00 unusable segment |
|---|
| 84 | +SYM_DATA_START_LOCAL(gdt) |
|---|
| 85 | + /* |
|---|
| 86 | + * 0x00 unusable segment |
|---|
| 87 | 87 | * 0x08 unused |
|---|
| 88 | 88 | * so use them as gdt ptr |
|---|
| 89 | 89 | */ |
|---|
| .. | .. |
|---|
| 96 | 96 | |
|---|
| 97 | 97 | /* 0x18 4GB flat data segment */ |
|---|
| 98 | 98 | .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) |
|---|