GNU Linux-libre 4.4.284-gnu1
[releases.git] / arch / powerpc / include / asm / setup.h
1 #ifndef _ASM_POWERPC_SETUP_H
2 #define _ASM_POWERPC_SETUP_H
3
4 #include <uapi/asm/setup.h>
5
6 #ifndef __ASSEMBLY__
7 extern void ppc_printk_progress(char *s, unsigned short hex);
8
9 extern unsigned int rtas_data;
10 extern unsigned long long memory_limit;
11 extern bool init_mem_is_free;
12 extern unsigned long klimit;
13 extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
14
15 struct device_node;
16 extern void note_scsi_host(struct device_node *, void *);
17
18 /* Used in very early kernel initialization. */
19 extern unsigned long reloc_offset(void);
20 extern unsigned long add_reloc_offset(unsigned long);
21 extern void reloc_got2(unsigned long);
22
23 #define PTRRELOC(x)     ((typeof(x)) add_reloc_offset((unsigned long)(x)))
24
25 void check_for_initrd(void);
26 void initmem_init(void);
27 void setup_panic(void);
28 #define ARCH_PANIC_TIMEOUT 180
29
30 void rfi_flush_enable(bool enable);
31
32 /* These are bit flags */
33 enum l1d_flush_type {
34         L1D_FLUSH_NONE          = 0x1,
35         L1D_FLUSH_FALLBACK      = 0x2,
36         L1D_FLUSH_ORI           = 0x4,
37         L1D_FLUSH_MTTRIG        = 0x8,
38 };
39
40 void setup_rfi_flush(enum l1d_flush_type, bool enable);
41 void setup_entry_flush(bool enable);
42 void setup_uaccess_flush(bool enable);
43 void do_rfi_flush_fixups(enum l1d_flush_type types);
44 #ifdef CONFIG_PPC_BARRIER_NOSPEC
45 void setup_barrier_nospec(void);
46 #else
47 static inline void setup_barrier_nospec(void) { };
48 #endif
49 void do_uaccess_flush_fixups(enum l1d_flush_type types);
50 void do_entry_flush_fixups(enum l1d_flush_type types);
51 void do_barrier_nospec_fixups(bool enable);
52 extern bool barrier_nospec_enabled;
53
54 #ifdef CONFIG_PPC_BARRIER_NOSPEC
55 void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
56 #else
57 static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { };
58 #endif
59
60 #ifdef CONFIG_PPC_FSL_BOOK3E
61 void setup_spectre_v2(void);
62 #else
63 static inline void setup_spectre_v2(void) {};
64 #endif
65 void do_btb_flush_fixups(void);
66
67 #endif /* !__ASSEMBLY__ */
68
69 #endif  /* _ASM_POWERPC_SETUP_H */
70