bios_emul.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 1996-1999 SciTech Software, Inc.
  4. */
  5. #ifndef _BIOS_EMUL_H
  6. #define _BIOS_EMUL_H
  7. /* Include the register header directly here */
  8. #include "../drivers/bios_emulator/include/x86emu/regs.h"
  9. #include <pci.h>
  10. /****************************************************************************
  11. REMARKS:
  12. Data structure used to describe the details for the BIOS emulator system
  13. environment as used by the X86 emulator library.
  14. HEADER:
  15. biosemu.h
  16. MEMBERS:
  17. vgaInfo - VGA BIOS information structure
  18. biosmem_base - Base of the BIOS image
  19. biosmem_limit - Limit of the BIOS image
  20. busmem_base - Base of the VGA bus memory
  21. ****************************************************************************/
  22. typedef struct {
  23. int function;
  24. int device;
  25. int bus;
  26. u32 VendorID;
  27. u32 DeviceID;
  28. #ifdef CONFIG_DM_PCI
  29. struct udevice *pcidev;
  30. #else
  31. pci_dev_t pcidev;
  32. #endif
  33. void *BIOSImage;
  34. u32 BIOSImageLen;
  35. u8 LowMem[1536];
  36. } BE_VGAInfo;
  37. struct vbe_mode_info;
  38. #ifdef CONFIG_DM_PCI
  39. int BootVideoCardBIOS(struct udevice *pcidev, BE_VGAInfo **pVGAInfo,
  40. int clean_up);
  41. #else
  42. int BootVideoCardBIOS(pci_dev_t pcidev, BE_VGAInfo **pVGAInfo, int clean_up);
  43. #endif
  44. /* Run a BIOS ROM natively (only supported on x86 machines) */
  45. void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
  46. struct vbe_mode_info *mode_info);
  47. /**
  48. * bios_set_interrupt_handler() - Install an interrupt handler for the BIOS
  49. *
  50. * This installs an interrupt handler that the BIOS will call when needed.
  51. *
  52. * @intnum: Interrupt number to install a handler for
  53. * @int_handler_func: Function to call to handle interrupt
  54. */
  55. void bios_set_interrupt_handler(int intnum, int (*int_handler_func)(void));
  56. void biosemu_set_interrupt_handler(int intnum, int (*int_func)(void));
  57. #ifdef CONFIG_DM_PCI
  58. int biosemu_setup(struct udevice *pcidev, BE_VGAInfo **pVGAInfo);
  59. int biosemu_run(struct udevice *dev, uchar *bios_rom, int bios_len,
  60. BE_VGAInfo *vga_info, int clean_up, int vesa_mode,
  61. struct vbe_mode_info *mode_info);
  62. #else
  63. int biosemu_setup(pci_dev_t pcidev, BE_VGAInfo **pVGAInfo);
  64. int biosemu_run(pci_dev_t pcidev, uchar *bios_rom, int bios_len,
  65. BE_VGAInfo *vga_info, int clean_up, int vesa_mode,
  66. struct vbe_mode_info *mode_info);
  67. #endif
  68. #endif