2022-05-31 18:04:11 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2020-2022 Loongson Technology Corporation Limited
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LOONGARCH_SETUP_H
|
|
|
|
#define _LOONGARCH_SETUP_H
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
2023-09-06 22:53:55 +08:00
|
|
|
#include <asm/sections.h>
|
2022-05-31 18:04:11 +08:00
|
|
|
#include <uapi/asm/setup.h>
|
|
|
|
|
|
|
|
#define VECSIZE 0x200
|
|
|
|
|
|
|
|
extern unsigned long eentry;
|
|
|
|
extern unsigned long tlbrentry;
|
2022-12-10 22:40:05 +08:00
|
|
|
extern char init_command_line[COMMAND_LINE_SIZE];
|
LoongArch: Refactor cache probe and flush methods
Current cache probe and flush methods have some drawbacks:
1, Assume there are 3 cache levels and only 3 levels;
2, Assume L1 = I + D, L2 = V, L3 = S, V is exclusive, S is inclusive.
However, the fact is I + D, I + D + V, I + D + S and I + D + V + S are
all valid. So, refactor the cache probe and flush methods to adapt more
types of cache hierarchy.
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2022-10-12 16:36:14 +08:00
|
|
|
extern void tlb_init(int cpu);
|
2022-05-31 18:04:11 +08:00
|
|
|
extern void cpu_cache_init(void);
|
LoongArch: Refactor cache probe and flush methods
Current cache probe and flush methods have some drawbacks:
1, Assume there are 3 cache levels and only 3 levels;
2, Assume L1 = I + D, L2 = V, L3 = S, V is exclusive, S is inclusive.
However, the fact is I + D, I + D + V, I + D + S and I + D + V + S are
all valid. So, refactor the cache probe and flush methods to adapt more
types of cache hierarchy.
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2022-10-12 16:36:14 +08:00
|
|
|
extern void cache_error_setup(void);
|
2022-05-31 18:04:11 +08:00
|
|
|
extern void per_cpu_trap_init(int cpu);
|
|
|
|
extern void set_handler(unsigned long offset, void *addr, unsigned long len);
|
|
|
|
extern void set_merr_handler(unsigned long offset, void *addr, unsigned long len);
|
|
|
|
|
2023-02-25 15:52:56 +08:00
|
|
|
#ifdef CONFIG_RELOCATABLE
|
|
|
|
|
|
|
|
struct rela_la_abs {
|
2023-11-21 15:03:25 +08:00
|
|
|
long pc;
|
2023-02-25 15:52:56 +08:00
|
|
|
long symvalue;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern long __la_abs_begin;
|
|
|
|
extern long __la_abs_end;
|
|
|
|
extern long __rela_dyn_begin;
|
|
|
|
extern long __rela_dyn_end;
|
|
|
|
|
2024-07-20 22:41:07 +08:00
|
|
|
#ifdef CONFIG_RELR
|
|
|
|
extern long __relr_dyn_begin;
|
|
|
|
extern long __relr_dyn_end;
|
|
|
|
#endif
|
|
|
|
|
2023-09-06 22:54:16 +08:00
|
|
|
extern unsigned long __init relocate_kernel(void);
|
2023-02-25 15:52:56 +08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2023-09-06 22:53:55 +08:00
|
|
|
static inline unsigned long kaslr_offset(void)
|
|
|
|
{
|
|
|
|
return (unsigned long)&_text - VMLINUX_LOAD_ADDRESS;
|
|
|
|
}
|
|
|
|
|
2022-05-31 18:04:11 +08:00
|
|
|
#endif /* __SETUP_H */
|