bios_ebda.h 914 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_BIOS_EBDA_H
  3. #define _ASM_X86_BIOS_EBDA_H
  4. #include <asm/io.h>
  5. /*
  6. * Returns physical address of EBDA. Returns 0 if there is no EBDA.
  7. */
  8. static inline unsigned int get_bios_ebda(void)
  9. {
  10. /*
  11. * There is a real-mode segmented pointer pointing to the
  12. * 4K EBDA area at 0x40E.
  13. */
  14. unsigned int address = *(unsigned short *)phys_to_virt(0x40E);
  15. address <<= 4;
  16. return address; /* 0 means none */
  17. }
  18. void reserve_bios_regions(void);
  19. #ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
  20. /*
  21. * This is obviously not a great place for this, but we want to be
  22. * able to scatter it around anywhere in the kernel.
  23. */
  24. void check_for_bios_corruption(void);
  25. void start_periodic_check_for_corruption(void);
  26. #else
  27. static inline void check_for_bios_corruption(void)
  28. {
  29. }
  30. static inline void start_periodic_check_for_corruption(void)
  31. {
  32. }
  33. #endif
  34. #endif /* _ASM_X86_BIOS_EBDA_H */