mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
40b0b3f8fb
Based on 2 normalized pattern(s): this source code is licensed under the gnu general public license version 2 see the file copying for more details this source code is licensed under general public license version 2 see extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 52 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190602204653.449021192@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
58 lines
1.0 KiB
ArmAsm
58 lines
1.0 KiB
ArmAsm
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* purgatory: setup code
|
|
*
|
|
* Copyright (C) 2003,2004 Eric Biederman (ebiederm@xmission.com)
|
|
* Copyright (C) 2014 Red Hat Inc.
|
|
*
|
|
* This code has been taken from kexec-tools.
|
|
*/
|
|
#include <asm/purgatory.h>
|
|
|
|
.text
|
|
.globl purgatory_start
|
|
.balign 16
|
|
purgatory_start:
|
|
.code64
|
|
|
|
/* Load a gdt so I know what the segment registers are */
|
|
lgdt gdt(%rip)
|
|
|
|
/* load the data segments */
|
|
movl $0x18, %eax /* data segment */
|
|
movl %eax, %ds
|
|
movl %eax, %es
|
|
movl %eax, %ss
|
|
movl %eax, %fs
|
|
movl %eax, %gs
|
|
|
|
/* Setup a stack */
|
|
leaq lstack_end(%rip), %rsp
|
|
|
|
/* Call the C code */
|
|
call purgatory
|
|
jmp entry64
|
|
|
|
.section ".rodata"
|
|
.balign 16
|
|
gdt: /* 0x00 unusable segment
|
|
* 0x08 unused
|
|
* so use them as the gdt ptr
|
|
*/
|
|
.word gdt_end - gdt - 1
|
|
.quad gdt
|
|
.word 0, 0, 0
|
|
|
|
/* 0x10 4GB flat code segment */
|
|
.word 0xFFFF, 0x0000, 0x9A00, 0x00AF
|
|
|
|
/* 0x18 4GB flat data segment */
|
|
.word 0xFFFF, 0x0000, 0x9200, 0x00CF
|
|
gdt_end:
|
|
|
|
.bss
|
|
.balign 4096
|
|
lstack:
|
|
.skip 4096
|
|
lstack_end:
|