xref: /linux/arch/loongarch/include/asm/setup.h (revision aa0cbc1b506b090c3a775b547c693ada108cc0d7)
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 {
28*aa0cbc1bSWANG 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 
379fbcc076SQing Zhang extern unsigned long __init relocate_kernel(void);
38d8da19fbSYouling Tang 
39d8da19fbSYouling Tang #endif
40d8da19fbSYouling Tang 
41b72961f8SFeiyang Chen static inline unsigned long kaslr_offset(void)
42b72961f8SFeiyang Chen {
43b72961f8SFeiyang Chen 	return (unsigned long)&_text - VMLINUX_LOAD_ADDRESS;
44b72961f8SFeiyang Chen }
45b72961f8SFeiyang Chen 
46628c3bb4SHuacai Chen #endif /* __SETUP_H */
47