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>
24 lines
634 B
C
24 lines
634 B
C
/* 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>
|
|
#include <uapi/asm/setup.h>
|
|
|
|
#define VECSIZE 0x200
|
|
|
|
extern unsigned long eentry;
|
|
extern unsigned long tlbrentry;
|
|
extern void tlb_init(int cpu);
|
|
extern void cpu_cache_init(void);
|
|
extern void cache_error_setup(void);
|
|
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);
|
|
|
|
#endif /* __SETUP_H */
|