diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c index 8b9ff07c5..4d8dfb4de 100644 --- a/hw/xfree86/int10/generic.c +++ b/hw/xfree86/int10/generic.c @@ -15,7 +15,7 @@ #include "xf86_OSproc.h" #include "compiler.h" #define _INT10_PRIVATE -#include "xf86int10_priv.h" +#include "xf86int10.h" #include "int10Defines.h" #include "Pci.h" diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c index fc4d83c16..ccfecf15d 100644 --- a/hw/xfree86/int10/helper_exec.c +++ b/hw/xfree86/int10/helper_exec.c @@ -30,7 +30,7 @@ #include "compiler.h" #define _INT10_PRIVATE #include "int10Defines.h" -#include "xf86int10_priv.h" +#include "xf86int10.h" #include "Pci.h" #ifdef _X86EMU #include "x86emu/x86emui.h" diff --git a/hw/xfree86/int10/helper_mem.c b/hw/xfree86/int10/helper_mem.c index 7bd27a3c1..1b5960e0c 100644 --- a/hw/xfree86/int10/helper_mem.c +++ b/hw/xfree86/int10/helper_mem.c @@ -18,7 +18,7 @@ #if 0 #include "int10Defines.h" #endif -#include "xf86int10_priv.h" +#include "xf86int10.h" #define REG pInt diff --git a/hw/xfree86/int10/xf86int10.c b/hw/xfree86/int10/xf86int10.c index 74966207e..578f461b7 100644 --- a/hw/xfree86/int10/xf86int10.c +++ b/hw/xfree86/int10/xf86int10.c @@ -11,7 +11,7 @@ #include "xf86.h" #include "compiler.h" #define _INT10_PRIVATE -#include "xf86int10_priv.h" +#include "xf86int10.h" #include "int10Defines.h" #include "Pci.h" diff --git a/hw/xfree86/int10/xf86int10.h b/hw/xfree86/int10/xf86int10.h index 9aacff925..83bab7e61 100644 --- a/hw/xfree86/int10/xf86int10.h +++ b/hw/xfree86/int10/xf86int10.h @@ -122,18 +122,70 @@ extern _X_EXPORT Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt); /* int.c */ extern _X_EXPORT xf86Int10InfoPtr Int10Current; +int int_handler(xf86Int10InfoPtr pInt); + +/* helper_exec.c */ +int setup_int(xf86Int10InfoPtr pInt); +void finish_int(xf86Int10InfoPtr, int sig); +uint32_t getIntVect(xf86Int10InfoPtr pInt, int num); +void pushw(xf86Int10InfoPtr pInt, uint16_t val); +int run_bios_int(int num, xf86Int10InfoPtr pInt); +void dump_code(xf86Int10InfoPtr pInt); +void dump_registers(xf86Int10InfoPtr pInt); +void stack_trace(xf86Int10InfoPtr pInt); +uint8_t bios_checksum(const uint8_t *start, int size); +void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga); +void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga); #if defined (_PC) extern _X_EXPORT void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save); #endif +int port_rep_inb(xf86Int10InfoPtr pInt, + uint16_t port, uint32_t base, int d_f, uint32_t count); +int port_rep_inw(xf86Int10InfoPtr pInt, + uint16_t port, uint32_t base, int d_f, uint32_t count); +int port_rep_inl(xf86Int10InfoPtr pInt, + uint16_t port, uint32_t base, int d_f, uint32_t count); +int port_rep_outb(xf86Int10InfoPtr pInt, + uint16_t port, uint32_t base, int d_f, uint32_t count); +int port_rep_outw(xf86Int10InfoPtr pInt, + uint16_t port, uint32_t base, int d_f, uint32_t count); +int port_rep_outl(xf86Int10InfoPtr pInt, + uint16_t port, uint32_t base, int d_f, uint32_t count); +uint8_t x_inb(uint16_t port); +uint16_t x_inw(uint16_t port); +void x_outb(uint16_t port, uint8_t val); +void x_outw(uint16_t port, uint16_t val); +uint32_t x_inl(uint16_t port); +void x_outl(uint16_t port, uint32_t val); + +uint8_t Mem_rb(uint32_t addr); +uint16_t Mem_rw(uint32_t addr); +uint32_t Mem_rl(uint32_t addr); +void Mem_wb(uint32_t addr, uint8_t val); +void Mem_ww(uint32_t addr, uint16_t val); +void Mem_wl(uint32_t addr, uint32_t val); + +/* helper_mem.c */ +void setup_int_vect(xf86Int10InfoPtr pInt); +int setup_system_bios(void *base_addr); +void reset_int_vect(xf86Int10InfoPtr pInt); +void set_return_trap(xf86Int10InfoPtr pInt); extern _X_EXPORT void *xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex); +Bool int10skip(const void *options); +Bool int10_check_bios(int scrnIndex, int codeSeg, + const unsigned char *vbiosMem); +Bool initPrimary(const void *options); extern _X_EXPORT BusType xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt); extern _X_EXPORT Bool xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base); +#ifdef DEBUG +void dprint(unsigned long start, unsigned long size); +#endif #endif /* _INT10_PRIVATE */ #endif /* _XF86INT10_H */ diff --git a/hw/xfree86/int10/xf86int10_priv.h b/hw/xfree86/int10/xf86int10_priv.h deleted file mode 100644 index c0b236ea5..000000000 --- a/hw/xfree86/int10/xf86int10_priv.h +++ /dev/null @@ -1,77 +0,0 @@ -/* SPDX-License-Identifier: MIT OR X11 - * - * Copyright © 2024 Enrico Weigelt, metux IT consult - * Copyright © 1999 Egbert Eich - * - * XFree86 int10 module - * execute BIOS int 10h calls in x86 real mode environment - */ -#ifndef _XSERVER_XF86INT10_H -#define _XSERVER_XF86INT10_H - -#include -#include -#include "xf86Pci.h" -#include "xf86int10.h" - -#ifdef _INT10_PRIVATE - -/* int.c */ -int int_handler(xf86Int10InfoPtr pInt); - -/* helper_exec.c */ -int setup_int(xf86Int10InfoPtr pInt); -void finish_int(xf86Int10InfoPtr, int sig); -uint32_t getIntVect(xf86Int10InfoPtr pInt, int num); -void pushw(xf86Int10InfoPtr pInt, uint16_t val); -int run_bios_int(int num, xf86Int10InfoPtr pInt); -void dump_code(xf86Int10InfoPtr pInt); -void dump_registers(xf86Int10InfoPtr pInt); -void stack_trace(xf86Int10InfoPtr pInt); -uint8_t bios_checksum(const uint8_t *start, int size); -void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga); -void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga); - -int port_rep_inb(xf86Int10InfoPtr pInt, - uint16_t port, uint32_t base, int d_f, uint32_t count); -int port_rep_inw(xf86Int10InfoPtr pInt, - uint16_t port, uint32_t base, int d_f, uint32_t count); -int port_rep_inl(xf86Int10InfoPtr pInt, - uint16_t port, uint32_t base, int d_f, uint32_t count); -int port_rep_outb(xf86Int10InfoPtr pInt, - uint16_t port, uint32_t base, int d_f, uint32_t count); -int port_rep_outw(xf86Int10InfoPtr pInt, - uint16_t port, uint32_t base, int d_f, uint32_t count); -int port_rep_outl(xf86Int10InfoPtr pInt, - uint16_t port, uint32_t base, int d_f, uint32_t count); - -uint8_t x_inb(uint16_t port); -uint16_t x_inw(uint16_t port); -void x_outb(uint16_t port, uint8_t val); -void x_outw(uint16_t port, uint16_t val); -uint32_t x_inl(uint16_t port); -void x_outl(uint16_t port, uint32_t val); - -uint8_t Mem_rb(uint32_t addr); -uint16_t Mem_rw(uint32_t addr); -uint32_t Mem_rl(uint32_t addr); -void Mem_wb(uint32_t addr, uint8_t val); -void Mem_ww(uint32_t addr, uint16_t val); -void Mem_wl(uint32_t addr, uint32_t val); - -/* helper_mem.c */ -void setup_int_vect(xf86Int10InfoPtr pInt); -int setup_system_bios(void *base_addr); -void reset_int_vect(xf86Int10InfoPtr pInt); -void set_return_trap(xf86Int10InfoPtr pInt); -Bool int10skip(const void *options); -Bool int10_check_bios(int scrnIndex, int codeSeg, - const unsigned char *vbiosMem); -Bool initPrimary(const void *options); -#ifdef DEBUG -void dprint(unsigned long start, unsigned long size); -#endif - -#endif /* _INT10_PRIVATE */ - -#endif /* _XSERVER_XF86INT10_H */ diff --git a/hw/xfree86/int10/xf86x86emu.c b/hw/xfree86/int10/xf86x86emu.c index 3c1dae7c5..5a3a5484f 100644 --- a/hw/xfree86/int10/xf86x86emu.c +++ b/hw/xfree86/int10/xf86x86emu.c @@ -11,7 +11,7 @@ #include "xf86_OSproc.h" #include "xf86Pci.h" #define _INT10_PRIVATE -#include "xf86int10_priv.h" +#include "xf86int10.h" #include "int10Defines.h" #include