powerpc/radix: Fix kernel crash with mremap()
[linux-2.6-block.git] / arch / powerpc / include / asm / setup.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
560285cd
AB
2#ifndef _ASM_POWERPC_SETUP_H
3#define _ASM_POWERPC_SETUP_H
4
5#include <uapi/asm/setup.h>
6
7#ifndef __ASSEMBLY__
8extern void ppc_printk_progress(char *s, unsigned short hex);
9
10extern unsigned int rtas_data;
560285cd 11extern unsigned long long memory_limit;
51c3c62b 12extern bool init_mem_is_free;
560285cd
AB
13extern unsigned long klimit;
14extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
15
560285cd
AB
16struct device_node;
17extern void note_scsi_host(struct device_node *, void *);
18
19/* Used in very early kernel initialization. */
20extern unsigned long reloc_offset(void);
21extern unsigned long add_reloc_offset(unsigned long);
22extern void reloc_got2(unsigned long);
23
24#define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x)))
25
b88c4767 26void check_for_initrd(void);
9bd9be00 27void mem_topology_setup(void);
10239733 28void initmem_init(void);
ab9dbf77 29void setup_panic(void);
b71d47c1 30#define ARCH_PANIC_TIMEOUT 180
b88c4767 31
d3cbff1b
BH
32#ifdef CONFIG_PPC_PSERIES
33extern void pseries_enable_reloc_on_exc(void);
34extern void pseries_disable_reloc_on_exc(void);
35extern void pseries_big_endian_exceptions(void);
36extern void pseries_little_endian_exceptions(void);
37#else
38static inline void pseries_enable_reloc_on_exc(void) {}
39static inline void pseries_disable_reloc_on_exc(void) {}
40static inline void pseries_big_endian_exceptions(void) {}
41static inline void pseries_little_endian_exceptions(void) {}
42#endif /* CONFIG_PPC_PSERIES */
43
aa8a5e00
ME
44void rfi_flush_enable(bool enable);
45
46/* These are bit flags */
47enum l1d_flush_type {
48 L1D_FLUSH_NONE = 0x1,
49 L1D_FLUSH_FALLBACK = 0x2,
50 L1D_FLUSH_ORI = 0x4,
51 L1D_FLUSH_MTTRIG = 0x8,
52};
53
abf110f3 54void setup_rfi_flush(enum l1d_flush_type, bool enable);
aa8a5e00 55void do_rfi_flush_fixups(enum l1d_flush_type types);
af375eef 56#ifdef CONFIG_PPC_BARRIER_NOSPEC
cb3d6759 57void setup_barrier_nospec(void);
af375eef
ME
58#else
59static inline void setup_barrier_nospec(void) { };
60#endif
2eea7f06 61void do_barrier_nospec_fixups(bool enable);
815069ca
MS
62extern bool barrier_nospec_enabled;
63
179ab1cb 64#ifdef CONFIG_PPC_BARRIER_NOSPEC
815069ca
MS
65void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
66#else
67static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { };
68#endif
aa8a5e00 69
f633a8ad
DC
70#ifdef CONFIG_PPC_FSL_BOOK3E
71void setup_spectre_v2(void);
72#else
73static inline void setup_spectre_v2(void) {};
74#endif
76a5eaa3
DC
75void do_btb_flush_fixups(void);
76
560285cd
AB
77#endif /* !__ASSEMBLY__ */
78
79#endif /* _ASM_POWERPC_SETUP_H */
80