1628c3bb4SHuacai Chen /* SPDX-License-Identifier: GPL-2.0 */ 2628c3bb4SHuacai Chen /* 3628c3bb4SHuacai Chen * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 4628c3bb4SHuacai Chen */ 5628c3bb4SHuacai Chen 6628c3bb4SHuacai Chen #ifndef _LOONGARCH_SETUP_H 7628c3bb4SHuacai Chen #define _LOONGARCH_SETUP_H 8628c3bb4SHuacai Chen 9628c3bb4SHuacai Chen #include <linux/types.h> 10b72961f8SFeiyang Chen #include <asm/sections.h> 11628c3bb4SHuacai Chen #include <uapi/asm/setup.h> 12628c3bb4SHuacai Chen 13628c3bb4SHuacai Chen #define VECSIZE 0x200 14628c3bb4SHuacai Chen 15628c3bb4SHuacai Chen extern unsigned long eentry; 16628c3bb4SHuacai Chen extern unsigned long tlbrentry; 1788d4d957SBinbin Zhou extern char init_command_line[COMMAND_LINE_SIZE]; 18b61a40afSHuacai Chen extern void tlb_init(int cpu); 19628c3bb4SHuacai Chen extern void cpu_cache_init(void); 20b61a40afSHuacai Chen extern void cache_error_setup(void); 21628c3bb4SHuacai Chen extern void per_cpu_trap_init(int cpu); 22628c3bb4SHuacai Chen extern void set_handler(unsigned long offset, void *addr, unsigned long len); 23628c3bb4SHuacai Chen extern void set_merr_handler(unsigned long offset, void *addr, unsigned long len); 24628c3bb4SHuacai Chen 25d8da19fbSYouling Tang #ifdef CONFIG_RELOCATABLE 26d8da19fbSYouling Tang 27d8da19fbSYouling Tang struct rela_la_abs { 28aa0cbc1bSWANG Rui long pc; 29d8da19fbSYouling Tang long symvalue; 30d8da19fbSYouling Tang }; 31d8da19fbSYouling Tang 32d8da19fbSYouling Tang extern long __la_abs_begin; 33d8da19fbSYouling Tang extern long __la_abs_end; 34d8da19fbSYouling Tang extern long __rela_dyn_begin; 35d8da19fbSYouling Tang extern long __rela_dyn_end; 36d8da19fbSYouling Tang 37*e05d4cd9SXi Ruoyao #ifdef CONFIG_RELR 38*e05d4cd9SXi Ruoyao extern long __relr_dyn_begin; 39*e05d4cd9SXi Ruoyao extern long __relr_dyn_end; 40*e05d4cd9SXi Ruoyao #endif 41*e05d4cd9SXi Ruoyao 429fbcc076SQing Zhang extern unsigned long __init relocate_kernel(void); 43d8da19fbSYouling Tang 44d8da19fbSYouling Tang #endif 45d8da19fbSYouling Tang kaslr_offset(void)46b72961f8SFeiyang Chenstatic inline unsigned long kaslr_offset(void) 47b72961f8SFeiyang Chen { 48b72961f8SFeiyang Chen return (unsigned long)&_text - VMLINUX_LOAD_ADDRESS; 49b72961f8SFeiyang Chen } 50b72961f8SFeiyang Chen 51628c3bb4SHuacai Chen #endif /* __SETUP_H */ 52