setup.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 bool init_mem_is_free;
  10. extern unsigned long klimit;
  11. extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
  12. struct device_node;
  13. extern void note_scsi_host(struct device_node *, void *);
  14. /* Used in very early kernel initialization. */
  15. extern unsigned long reloc_offset(void);
  16. extern unsigned long add_reloc_offset(unsigned long);
  17. extern void reloc_got2(unsigned long);
  18. #define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x)))
  19. void check_for_initrd(void);
  20. void mem_topology_setup(void);
  21. void initmem_init(void);
  22. void setup_panic(void);
  23. #define ARCH_PANIC_TIMEOUT 180
  24. #ifdef CONFIG_PPC_PSERIES
  25. extern void pseries_enable_reloc_on_exc(void);
  26. extern void pseries_disable_reloc_on_exc(void);
  27. extern void pseries_big_endian_exceptions(void);
  28. extern void pseries_little_endian_exceptions(void);
  29. #else
  30. static inline void pseries_enable_reloc_on_exc(void) {}
  31. static inline void pseries_disable_reloc_on_exc(void) {}
  32. static inline void pseries_big_endian_exceptions(void) {}
  33. static inline void pseries_little_endian_exceptions(void) {}
  34. #endif /* CONFIG_PPC_PSERIES */
  35. void rfi_flush_enable(bool enable);
  36. /* These are bit flags */
  37. enum l1d_flush_type {
  38. L1D_FLUSH_NONE = 0x1,
  39. L1D_FLUSH_FALLBACK = 0x2,
  40. L1D_FLUSH_ORI = 0x4,
  41. L1D_FLUSH_MTTRIG = 0x8,
  42. };
  43. void setup_rfi_flush(enum l1d_flush_type, bool enable);
  44. void do_rfi_flush_fixups(enum l1d_flush_type types);
  45. #ifdef CONFIG_PPC_BARRIER_NOSPEC
  46. void setup_barrier_nospec(void);
  47. #else
  48. static inline void setup_barrier_nospec(void) { };
  49. #endif
  50. void do_barrier_nospec_fixups(bool enable);
  51. extern bool barrier_nospec_enabled;
  52. #ifdef CONFIG_PPC_BARRIER_NOSPEC
  53. void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
  54. #else
  55. static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { };
  56. #endif
  57. #endif /* !__ASSEMBLY__ */
  58. #endif /* _ASM_POWERPC_SETUP_H */