bios_emul.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. struct udevice *pcidev;
  29. void *BIOSImage;
  30. u32 BIOSImageLen;
  31. u8 LowMem[1536];
  32. } BE_VGAInfo;
  33. struct vesa_state;
  34. int BootVideoCardBIOS(struct udevice *pcidev, BE_VGAInfo **pVGAInfo,
  35. int clean_up);
  36. /* Run a BIOS ROM natively (only supported on x86 machines) */
  37. void bios_run_on_x86(struct udevice *dev, unsigned long addr, int vesa_mode,
  38. struct vesa_state *mode_info);
  39. /**
  40. * bios_set_interrupt_handler() - Install an interrupt handler for the BIOS
  41. *
  42. * This installs an interrupt handler that the BIOS will call when needed.
  43. *
  44. * @intnum: Interrupt number to install a handler for
  45. * @int_handler_func: Function to call to handle interrupt
  46. */
  47. void bios_set_interrupt_handler(int intnum, int (*int_handler_func)(void));
  48. void biosemu_set_interrupt_handler(int intnum, int (*int_func)(void));
  49. int biosemu_setup(struct udevice *pcidev, BE_VGAInfo **pVGAInfo);
  50. int biosemu_run(struct udevice *dev, uchar *bios_rom, int bios_len,
  51. BE_VGAInfo *vga_info, int clean_up, int vesa_mode,
  52. struct vesa_state *mode_info);
  53. #endif