setup.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_POWERPC_SETUP_H
  3. #define _ASM_POWERPC_SETUP_H
  4. #include <uapi/asm/setup.h>
  5. #ifndef __ASSEMBLY__
  6. extern void ppc_printk_progress(char *s, unsigned short hex);
  7. extern unsigned int rtas_data;
  8. extern unsigned long long memory_limit;
  9. extern unsigned long klimit;
  10. extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
  11. struct device_node;
  12. extern void note_scsi_host(struct device_node *, void *);
  13. /* Used in very early kernel initialization. */
  14. extern unsigned long reloc_offset(void);
  15. extern unsigned long add_reloc_offset(unsigned long);
  16. extern void reloc_got2(unsigned long);
  17. #define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x)))
  18. void check_for_initrd(void);
  19. void mem_topology_setup(void);
  20. void initmem_init(void);
  21. void setup_panic(void);
  22. #define ARCH_PANIC_TIMEOUT 180
  23. #ifdef CONFIG_PPC_PSERIES
  24. extern void pseries_enable_reloc_on_exc(void);
  25. extern void pseries_disable_reloc_on_exc(void);
  26. extern void pseries_big_endian_exceptions(void);
  27. extern void pseries_little_endian_exceptions(void);
  28. #else
  29. static inline void pseries_enable_reloc_on_exc(void) {}
  30. static inline void pseries_disable_reloc_on_exc(void) {}
  31. static inline void pseries_big_endian_exceptions(void) {}
  32. static inline void pseries_little_endian_exceptions(void) {}
  33. #endif /* CONFIG_PPC_PSERIES */
  34. void rfi_flush_enable(bool enable);
  35. /* These are bit flags */
  36. enum l1d_flush_type {
  37. L1D_FLUSH_NONE = 0x1,
  38. L1D_FLUSH_FALLBACK = 0x2,
  39. L1D_FLUSH_ORI = 0x4,
  40. L1D_FLUSH_MTTRIG = 0x8,
  41. };
  42. void setup_rfi_flush(enum l1d_flush_type, bool enable);
  43. void do_rfi_flush_fixups(enum l1d_flush_type types);
  44. void setup_barrier_nospec(void);
  45. void do_barrier_nospec_fixups(bool enable);
  46. extern bool barrier_nospec_enabled;
  47. #ifdef CONFIG_PPC_BOOK3S_64
  48. void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
  49. #else
  50. static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { };
  51. #endif
  52. #endif /* !__ASSEMBLY__ */
  53. #endif /* _ASM_POWERPC_SETUP_H */