Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0 */
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 long long memory_limit;
11extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
12
13struct device_node;
14
15/* Used in very early kernel initialization. */
16extern unsigned long reloc_offset(void);
17extern unsigned long add_reloc_offset(unsigned long);
18extern void reloc_got2(unsigned long);
19
20#define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x)))
21
22void check_for_initrd(void);
23void mem_topology_setup(void);
24void initmem_init(void);
25void setup_panic(void);
26#define ARCH_PANIC_TIMEOUT 180
27
28#ifdef CONFIG_PPC_PSERIES
29extern bool pseries_reloc_on_exception(void);
30extern bool pseries_enable_reloc_on_exc(void);
31extern void pseries_disable_reloc_on_exc(void);
32extern void pseries_big_endian_exceptions(void);
33void __init pseries_little_endian_exceptions(void);
34#else
35static inline bool pseries_reloc_on_exception(void) { return false; }
36static inline bool pseries_enable_reloc_on_exc(void) { return false; }
37static inline void pseries_disable_reloc_on_exc(void) {}
38static inline void pseries_big_endian_exceptions(void) {}
39static inline void pseries_little_endian_exceptions(void) {}
40#endif /* CONFIG_PPC_PSERIES */
41
42void rfi_flush_enable(bool enable);
43
44/* These are bit flags */
45enum l1d_flush_type {
46 L1D_FLUSH_NONE = 0x1,
47 L1D_FLUSH_FALLBACK = 0x2,
48 L1D_FLUSH_ORI = 0x4,
49 L1D_FLUSH_MTTRIG = 0x8,
50};
51
52void setup_rfi_flush(enum l1d_flush_type, bool enable);
53void setup_entry_flush(bool enable);
54void setup_uaccess_flush(bool enable);
55void do_rfi_flush_fixups(enum l1d_flush_type types);
56#ifdef CONFIG_PPC_BARRIER_NOSPEC
57void __init setup_barrier_nospec(void);
58#else
59static inline void setup_barrier_nospec(void) { }
60#endif
61void do_uaccess_flush_fixups(enum l1d_flush_type types);
62void do_entry_flush_fixups(enum l1d_flush_type types);
63void do_barrier_nospec_fixups(bool enable);
64extern bool barrier_nospec_enabled;
65
66#ifdef CONFIG_PPC_BARRIER_NOSPEC
67void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
68#else
69static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { }
70#endif
71
72#ifdef CONFIG_PPC_E500
73void __init setup_spectre_v2(void);
74#else
75static inline void setup_spectre_v2(void) {}
76#endif
77void __init do_btb_flush_fixups(void);
78
79#ifdef CONFIG_PPC32
80unsigned long __init early_init(unsigned long dt_ptr);
81void __init machine_init(u64 dt_ptr);
82#endif
83void __init early_setup(unsigned long dt_ptr);
84void early_setup_secondary(void);
85
86/* prom_init (OpenFirmware) */
87unsigned long __init prom_init(unsigned long r3, unsigned long r4,
88 unsigned long pp, unsigned long r6,
89 unsigned long r7, unsigned long kbase);
90
91extern struct seq_buf ppc_hw_desc;
92
93#endif /* !__ASSEMBLY__ */
94
95#endif /* _ASM_POWERPC_SETUP_H */
96