blob: 3df30dd1c458bafe7f38385d516499baf027154e [file] [log] [blame]
Atish Patracb7d2dd2020-09-17 15:37:13 -07001/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2020 Western Digital Corporation or its affiliates.
4 * Linker script variables to be set after section resolution, as
5 * ld.lld does not like variables assigned before SECTIONS is processed.
tangchunyou5da9cbd2021-01-21 09:55:13 +08006 * Based on arch/arm64/kernel/image-vars.h
Atish Patracb7d2dd2020-09-17 15:37:13 -07007 */
8#ifndef __RISCV_KERNEL_IMAGE_VARS_H
9#define __RISCV_KERNEL_IMAGE_VARS_H
10
11#ifndef LINKER_SCRIPT
12#error This file should only be included in vmlinux.lds.S
13#endif
14
15#ifdef CONFIG_EFI
16
17/*
18 * The EFI stub has its own symbol namespace prefixed by __efistub_, to
19 * isolate it from the kernel proper. The following symbols are legally
20 * accessed by the stub, so provide some aliases to make them accessible.
21 * Only include data symbols here, or text symbols of functions that are
22 * guaranteed to be safe when executed at another offset than they were
23 * linked at. The routines below are all implemented in assembler in a
24 * position independent manner
25 */
Atish Patracb7d2dd2020-09-17 15:37:13 -070026__efistub__start = _start;
27__efistub__start_kernel = _start_kernel;
28__efistub__end = _end;
29__efistub__edata = _edata;
Alexandre Ghitib7ac4b82023-07-22 14:38:50 +020030__efistub___init_text_end = __init_text_end;
Arnd Bergmannb8466fe2023-10-17 11:39:46 +020031#if defined(CONFIG_EFI_EARLYCON) || defined(CONFIG_SYSFB)
Atish Patracb7d2dd2020-09-17 15:37:13 -070032__efistub_screen_info = screen_info;
Arnd Bergmannb8466fe2023-10-17 11:39:46 +020033#endif
Atish Patracb7d2dd2020-09-17 15:37:13 -070034
35#endif
36
37#endif /* __RISCV_KERNEL_IMAGE_VARS_H */