diff options
author | marha <marha@users.sourceforge.net> | 2012-06-08 09:33:13 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-06-08 09:33:13 +0200 |
commit | 990bc3f015a4f8fce2eb918375defcd44980a845 (patch) | |
tree | 8e8301f19482b52cc00bd95b4593522cc93267af /xorg-server/hw/xfree86/int10 | |
parent | 1af6fc1b5d93e54d6674de8b5870448b29f139a7 (diff) | |
download | vcxsrv-990bc3f015a4f8fce2eb918375defcd44980a845.tar.gz vcxsrv-990bc3f015a4f8fce2eb918375defcd44980a845.tar.bz2 vcxsrv-990bc3f015a4f8fce2eb918375defcd44980a845.zip |
Used synchronise script to update files
Diffstat (limited to 'xorg-server/hw/xfree86/int10')
-rw-r--r-- | xorg-server/hw/xfree86/int10/INT10.HOWTO | 688 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/int10/generic.c | 13 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/int10/helper_exec.c | 18 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/int10/helper_mem.c | 8 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/int10/x86emu.c | 24 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/int10/xf86int10.c | 42 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/int10/xf86int10.h | 4 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/int10/xf86x86emu.h | 108 |
8 files changed, 452 insertions, 453 deletions
diff --git a/xorg-server/hw/xfree86/int10/INT10.HOWTO b/xorg-server/hw/xfree86/int10/INT10.HOWTO index e2154c1c3..f2f08ceec 100644 --- a/xorg-server/hw/xfree86/int10/INT10.HOWTO +++ b/xorg-server/hw/xfree86/int10/INT10.HOWTO @@ -1,344 +1,344 @@ - - INT10 X86 Real Mode executor - ============================= - - PRELIMINARY - -INT10 is a XFree86 module for soft-booting and executing real mode -int10 BIOS calls. The BIOS call code is largely untested, yet. - -1. Usage -======== - -To use the int10 module in a driver the header file -xfree86/os-support/int10/xf86int10.h must be included. - - a. Initialization - ----------------- - -The int10-executer gets initialized by calling: - - xf86Int10InfoPtr xf86InitInt10(int entityIndex); - -The function will soft-boot any non-primary device and return a -pointer to a xf86Int10InfoRec on success. If anything fails or if -int10 execution is disabled by an option in the device section NULL -will be returned. The driver should store this pointer for later -calls to other int10 module functions. - - b. Memory allocation - -------------------- - -To allocate memory in the real mode execution environment - - void * xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off); - -can be called. It allocates num consecutive pagesize chunks. It -returns the address of the allocated area. off is set to its offset in -the real mode memory space. - - void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num); - -Is used to free num pages beginning at pbase. - - c. Doing int10 BIOS calls - ------------------------- - -The BIOS call is executed by calling: - - void xf86ExecX86int10(xf86Int10InfoPtr pInt); - -The number of the interrupt (normally 10) and the initial values of -the ax, bx, cx, dx, si, di and es x86-CPU registers can be set in the -xf86Int10InfoRec passed to the function. On return this structure -contains the exit values of the registers listed above and the CPU -flag register. - - d. De-initializing - ----------------- - -If no further int10 calls are required for a certain chipset -the driver should call: - - void xf86FreeInt10(xf86Int10InfoPtr pInt); - -to free the memory allocated for real mode int10 calls. - - -2. Porting issues -================= - -The int10 real mode executor is designed to run on top of various x86 -CPU emulators as well as in vm86 mode of a real x86 CPU. If used with -a CPU emulator the emulator and CPU specific interfaces can be held -separate thus requiring minimal efforts to port the int10 module to -new platforms. Currently an interface to the x86emu real mode -emulator is provided. Since details of setting up and running the -vm86 mode is platform dependent both the platform dependent -environment and the emulation layer have to be ported. Several helper -functions are provided for that. - -A CPU emulator should meet certain requirements to be usable -for the INT10 executor: - -1. It must trap calls to intXX instructions and pass execution to an - external function which is allowed to modify CPU registers - including the instruction pointer (IP) before returning to the - emulator for continuing execution. When the external function is - called the IP must point to the instruction past the intXX call. - -2. The emulator should use externally provided functions to handle - PIO. - -3. The emulator should be able to use externally provided functions - to access memory from the real mode memory environment. Note, that - the vm86 mode usually requires one hunk of consecutive memory - starting at address 0 in the process virtual memory space. Thus if - this mode is to be used, the OS environment has to be able to provide - that, ie. it must be able to remap the processes virtual memory space - onto itself. If the emulator is able to handle memory access thru - externally provided functions the real mode process memory can be - located anywhere in the processes virtual memory. It does not even - have to be consecutive. - -4. The executor should terminate on encountering a 'hlt' instruction. - - -Functions to implement: - -To simplify development the code has been split into a general setup -part and an emulator specific one. A generic setup code is provided in -generic.c. It should be usable with any emulator satisfying the -conditions mentioned above. Therefore the following section on int10 -setup may be skipped when porting int10 to new emulator. - -If the vm86() is to be used no memory access functions can be used. -Therefore the layout of the real mode memory image has to meet certain -requirements. Therefore when porting to other platforms a new setup -code may have to be designed, too. The following section will give -guidelines how this may be done. A sample implementation using SysV -IPC to map the appropriate real mode memory image to address 0 in -virtual address space just prior to execution may be found in -xfree86/os-support/linux/int10/linux.c. - -On non-PC like platforms emulation of certain PC features such as -initialization of BIOS int vectors, sys_BIOS constants or PCI config -method 1 can be turned on by defining _PC. - -I. Setup Code -------------- - -This sets up the real mode memory image, calls the emulator to POST -the chipset if required and maintains memory allocations in real mode -address space. - -1. xf86Int10InfoPtr xf86InitInt10(int entityIndex); - -This function should first find the screen assigned to the entity -carrying entitiyIndex and then call - - Bool int10skip(ScrnInfoPtr pScrn) - -to find out if the user has requested not to initialize int10. If so -xf86InitInt10() should return NULL. Otherwise an xf86Int10InfoRec -should be allocated. This structure contains the following fields: - - a. int entityIndex - index of the entity whose BIOS is to be - executed. - b. int scrnIndex - index of the screen assigned the entity. - c. pointer cpuRegs - pointer to a emulator/vm86-mode private - structure. May hold cpu register values - for the emulator. - d. CARD16 BIOSseg - Video BIOS segment address. - e. pointer private - pointer to a os specific data structure. - f. struct _int10Mem* - pointer to a structure to hold the memory - access functions for use by an emulator. - g. int num - number of the int to be called. - h. int ax..es,flags - CPU register values to pass to int-call. - -The Init function should initialize a-f. To initialize the emulator -specific execute environment the function - - Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt) - -should be called. If this function returns FALSE any already allocated -memory should be freed and xf86Int10Init(0 should exit returning NULL. - -If the platform has a PC like system BIOS it may be copied to or -mapped into memory locations SYS_BIOS to SYS_SIZE-1 of the real mode -memory environment of this process. Otherwise the helper function: - -int setup_system_bios(CARD32 base_addr); - -may be called to set up a rudimentary system BIOS sufficient to be -used to boot video BIOSes. base_addr specifies the virtual address -corresponding to SYS_BIOS in the real mode environment. If a PC-like -int vector and BIOS data area is available it should be copied to 0 to -LOW_PAGE_SIZE of the entities real mode environment. In this case the -video interrupt related entries should be reset for all non-primary -cards by calling: - -void reset_int_vect(xf86Int10InfoPtr pInt); To initialize the - -correct video BIOS entry points the BIOS must be warm-booted. If no -PC-like int vector is available one can be set up by calling - -void setup_int_vect(xf86Int10InfoPtr pInt); - -In this case the video BIOS has to be warm-booted always. If the -video BIOS for this entity has been installed during boot it may be -mapped (or copied) directly to the correct address in the real mode -memory environment. Otherwise - -int mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address); - -should be called to copy the BIOS image from PCI ROM. 'address' -specifies the address this image should be copied to. Sufficient space -to hold an entire BIOS image should be allocated prior to calling -mapPciRom(). This function will return the size of the BIOS image in -bytes if it was able to successfully copy the image and 0 -otherwise. To create a well defined point to exit the softbooter - -void set_return_trap(xf86Int10Ptr pInt); - -may be called. It sets up a 'hlt' instruction in the emulator memory -just above the BIOS variable area. Before entering real mode execution -this address will be pushed onto the return stack. If the BIOS needs -to be warm-booted this should be done before leaving xf86InitInt10() -by setting num in the xf86Int10InfoRec to 0xe6 and calling - -void xf86ExecX86int10(xf86Int10IfoPtr pInt); - -The implementation of this function will be discussed below. This -function should be wrapped by calls to void LockLegacyVGA(screen, -legacyVGAPtr vga); and void UnlockLegacyVGA(screen, legacyVGAPtr vga); -The struct vga is used to hold the state of the legacy VGA access -registers if a legacy VGA device exists. xf86InitInt10() should -return a pointer to the xf86Int10InfoRec allocated. - -2. Bool MapCurrentInt10(xf86Int10InfoPtr pInt); - -In case a platform specific mapping has to be performed to map the -memory allocated for the real mode memory environment into a specific -location prior to executing the x86 real mode code a function - - Bool MapCurrentInt10(xf86Int10InfoPtr pInt); - -has to be provided. It will be called by a helper function whenever -the active entity changes. If the vm86 mode is used it is most likely -that the 1MB real mode memory space located somewhere in the processes -virtual memory will have to be remapped to address 0 of the virtual -memory space. - -3. void xf86FreeInt10(xf86Int10InfoPtr pInt); - -To free all memory allocated for video BIOS calls of a specific entity -the function - - void xf86FreeInt10(xf86Int10InfoPtr pInt); - -should be provided. If the entity to be freed was mapped by -MapCurrentInt10() this mapping needs to be undone also. - -4. - void * xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off) - void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num) - -xf86Int10AllocPages() should allocate 'num' consecutive page-size -chunks of memory. In real mode memory space this range needs to occupy -consecutive addresses, too. The function must return the address of -this memory. The offset in real mode memory needs to be returned in -'off'. If no block of 'num' pages are available the function should -return NULL. - -xf86Int10FreePages() will free the 'num' pages starting at 'pbase'. -'num' is equal to the number of pages allocated by a single -xf86Int10AllocatePages() call. 'pbase' is the address of the range -previously returned by xf86Int10AllocatePages(). - -II. Emulator specific functions -------------------------------- - -1. Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt); - -This function will be called from xf86InitInt10(). It may be used to -set up the static emulator specific part of the real mode -environment. On success it should return TRUE. - -2. xf86ExecX86int10(xf86Int10InfoPtr pInt); - -This function gets called to execute an int call. It may call the -helper function: - - void setup_int(xf86Int10InfoPrt pInt); - -to copy the register values to the emulator specific locations and to -set up the non-static real mode execution environment. On return from -setup_int() 'Int10Current' holds a pointer to the current -xf86Int10InfoRec. - -It should start execution by calling - - Bool int_handler(xf86Int10InfoPtr pInt); - -and if this function returns TRUE it should call whatever necessary to -continue execution until a 'hlt' instruction is encountered. To copy -the resulting register values back to the xf86Int10InfoRec structure - - void finish_int(xf86Int10InfoPtr pInt); - -should be called. - -Helper functions are provided to aid the implementation of a vm86 -call: - - Bool vm86_GP_fault(xf86Int10InfoPtr pInt); - -This function handles instructions which cause a vm86 call to -trap. PIO access is handled by the in/out calls as defined in -compiler.h. Optionally the PIO instructions can be logged by defining -PRINT_PORT in xf86int10.h. This is meant for debugging purposes. - -Unknown instructions and 'hlt' cause vm86_GP_fault() to return -FALSE. Otherwise TRUE is returned. - -Note: This function is currently based on the Linux vm86 call. It -might have to be modified or even rewritten for other OS. So your -milage may vary. - -Functions to dump memory, code, xf86 CPU register values and stack are -also provided. Take a look at helper.c To view a memory range the -function - - void dprint(unsigned long start, unsigned long size) - -is provided. The use should be self explanatory. - -Register and memory access functions are provided in helper_mem.c. -The PIO register access functions can trap access to PCI config space -access register (config method 1) if _PC is not defined. - -A header file 'defines.h' is required to define OS/emulator specific -ways to access memory and xf86 CPU registers: Defines need to be -provided for memory byte/work/long read/write access -(MEM_RB(name,addr),MEM_RW(name,addr),MEM_RL(name,addr), -MEM_WB(name,addr,val),MEM_WL(name,addr,val),MEM_WL(name,addr,val)) of -the real mode memory environment. 'name' will contain a pointer to the -current xf86Int10InfoRec. Currently defines are available for -vm86-mode under Linux and x86emu. They may be activated by defining -_X86EMU or _VM86_LINUX respectively. - -Note: Emulators usually are not able to pass this pointer when calling -memory access functions. In this case a global variable should be -defined which can hold this pointer. This variable can be set in -MapCurrentInt10(). It also must be set in xf86InitInt10() if this -function calls the memory access functions either directly or by -calling xf86ExecX86int10(pInt). Defines to access the emulator -specific xf86 CPU register locations are also required: -X86_EAX,...,X86_EFLAGS for access of the full 32 bit registers, -X86_AX...X86_FLAGS for access of the 16 bit registers and -XF86_AL,XF86_BL,XF86_CL,XF86_DL to access the lower byte of the -AX,BX,CX and DX register. - - -$XFree86: xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO,v 1.2 2000/02/08 13:13:22 eich Exp $ +
+ INT10 X86 Real Mode executor
+ =============================
+
+ PRELIMINARY
+
+INT10 is a XFree86 module for soft-booting and executing real mode
+int10 BIOS calls. The BIOS call code is largely untested, yet.
+
+1. Usage
+========
+
+To use the int10 module in a driver the header file
+xfree86/os-support/int10/xf86int10.h must be included.
+
+ a. Initialization
+ -----------------
+
+The int10-executer gets initialized by calling:
+
+ xf86Int10InfoPtr xf86InitInt10(int entityIndex);
+
+The function will soft-boot any non-primary device and return a
+pointer to a xf86Int10InfoRec on success. If anything fails or if
+int10 execution is disabled by an option in the device section NULL
+will be returned. The driver should store this pointer for later
+calls to other int10 module functions.
+
+ b. Memory allocation
+ --------------------
+
+To allocate memory in the real mode execution environment
+
+ void * xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off);
+
+can be called. It allocates num consecutive pagesize chunks. It
+returns the address of the allocated area. off is set to its offset in
+the real mode memory space.
+
+ void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num);
+
+Is used to free num pages beginning at pbase.
+
+ c. Doing int10 BIOS calls
+ -------------------------
+
+The BIOS call is executed by calling:
+
+ void xf86ExecX86int10(xf86Int10InfoPtr pInt);
+
+The number of the interrupt (normally 10) and the initial values of
+the ax, bx, cx, dx, si, di and es x86-CPU registers can be set in the
+xf86Int10InfoRec passed to the function. On return this structure
+contains the exit values of the registers listed above and the CPU
+flag register.
+
+ d. De-initializing
+ -----------------
+
+If no further int10 calls are required for a certain chipset
+the driver should call:
+
+ void xf86FreeInt10(xf86Int10InfoPtr pInt);
+
+to free the memory allocated for real mode int10 calls.
+
+
+2. Porting issues
+=================
+
+The int10 real mode executor is designed to run on top of various x86
+CPU emulators as well as in vm86 mode of a real x86 CPU. If used with
+a CPU emulator the emulator and CPU specific interfaces can be held
+separate thus requiring minimal efforts to port the int10 module to
+new platforms. Currently an interface to the x86emu real mode
+emulator is provided. Since details of setting up and running the
+vm86 mode is platform dependent both the platform dependent
+environment and the emulation layer have to be ported. Several helper
+functions are provided for that.
+
+A CPU emulator should meet certain requirements to be usable
+for the INT10 executor:
+
+1. It must trap calls to intXX instructions and pass execution to an
+ external function which is allowed to modify CPU registers
+ including the instruction pointer (IP) before returning to the
+ emulator for continuing execution. When the external function is
+ called the IP must point to the instruction past the intXX call.
+
+2. The emulator should use externally provided functions to handle
+ PIO.
+
+3. The emulator should be able to use externally provided functions
+ to access memory from the real mode memory environment. Note, that
+ the vm86 mode usually requires one hunk of consecutive memory
+ starting at address 0 in the process virtual memory space. Thus if
+ this mode is to be used, the OS environment has to be able to provide
+ that, ie. it must be able to remap the processes virtual memory space
+ onto itself. If the emulator is able to handle memory access thru
+ externally provided functions the real mode process memory can be
+ located anywhere in the processes virtual memory. It does not even
+ have to be consecutive.
+
+4. The executor should terminate on encountering a 'hlt' instruction.
+
+
+Functions to implement:
+
+To simplify development the code has been split into a general setup
+part and an emulator specific one. A generic setup code is provided in
+generic.c. It should be usable with any emulator satisfying the
+conditions mentioned above. Therefore the following section on int10
+setup may be skipped when porting int10 to new emulator.
+
+If the vm86() is to be used no memory access functions can be used.
+Therefore the layout of the real mode memory image has to meet certain
+requirements. Therefore when porting to other platforms a new setup
+code may have to be designed, too. The following section will give
+guidelines how this may be done. A sample implementation using SysV
+IPC to map the appropriate real mode memory image to address 0 in
+virtual address space just prior to execution may be found in
+xfree86/os-support/linux/int10/linux.c.
+
+On non-PC like platforms emulation of certain PC features such as
+initialization of BIOS int vectors, sys_BIOS constants or PCI config
+method 1 can be turned on by defining _PC.
+
+I. Setup Code
+-------------
+
+This sets up the real mode memory image, calls the emulator to POST
+the chipset if required and maintains memory allocations in real mode
+address space.
+
+1. xf86Int10InfoPtr xf86InitInt10(int entityIndex);
+
+This function should first find the screen assigned to the entity
+carrying entitiyIndex and then call
+
+ Bool int10skip(ScrnInfoPtr pScrn)
+
+to find out if the user has requested not to initialize int10. If so
+xf86InitInt10() should return NULL. Otherwise an xf86Int10InfoRec
+should be allocated. This structure contains the following fields:
+
+ a. int entityIndex - index of the entity whose BIOS is to be
+ executed.
+ b. int scrnIndex - index of the screen assigned the entity.
+ c. pointer cpuRegs - pointer to a emulator/vm86-mode private
+ structure. May hold cpu register values
+ for the emulator.
+ d. CARD16 BIOSseg - Video BIOS segment address.
+ e. pointer private - pointer to a os specific data structure.
+ f. struct _int10Mem* - pointer to a structure to hold the memory
+ access functions for use by an emulator.
+ g. int num - number of the int to be called.
+ h. int ax..es,flags - CPU register values to pass to int-call.
+
+The Init function should initialize a-f. To initialize the emulator
+specific execute environment the function
+
+ Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
+
+should be called. If this function returns FALSE any already allocated
+memory should be freed and xf86Int10Init(0 should exit returning NULL.
+
+If the platform has a PC like system BIOS it may be copied to or
+mapped into memory locations SYS_BIOS to SYS_SIZE-1 of the real mode
+memory environment of this process. Otherwise the helper function:
+
+int setup_system_bios(CARD32 base_addr);
+
+may be called to set up a rudimentary system BIOS sufficient to be
+used to boot video BIOSes. base_addr specifies the virtual address
+corresponding to SYS_BIOS in the real mode environment. If a PC-like
+int vector and BIOS data area is available it should be copied to 0 to
+LOW_PAGE_SIZE of the entities real mode environment. In this case the
+video interrupt related entries should be reset for all non-primary
+cards by calling:
+
+void reset_int_vect(xf86Int10InfoPtr pInt); To initialize the
+
+correct video BIOS entry points the BIOS must be warm-booted. If no
+PC-like int vector is available one can be set up by calling
+
+void setup_int_vect(xf86Int10InfoPtr pInt);
+
+In this case the video BIOS has to be warm-booted always. If the
+video BIOS for this entity has been installed during boot it may be
+mapped (or copied) directly to the correct address in the real mode
+memory environment. Otherwise
+
+int mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address);
+
+should be called to copy the BIOS image from PCI ROM. 'address'
+specifies the address this image should be copied to. Sufficient space
+to hold an entire BIOS image should be allocated prior to calling
+mapPciRom(). This function will return the size of the BIOS image in
+bytes if it was able to successfully copy the image and 0
+otherwise. To create a well defined point to exit the softbooter
+
+void set_return_trap(xf86Int10Ptr pInt);
+
+may be called. It sets up a 'hlt' instruction in the emulator memory
+just above the BIOS variable area. Before entering real mode execution
+this address will be pushed onto the return stack. If the BIOS needs
+to be warm-booted this should be done before leaving xf86InitInt10()
+by setting num in the xf86Int10InfoRec to 0xe6 and calling
+
+void xf86ExecX86int10(xf86Int10IfoPtr pInt);
+
+The implementation of this function will be discussed below. This
+function should be wrapped by calls to void LockLegacyVGA(screen,
+legacyVGAPtr vga); and void UnlockLegacyVGA(screen, legacyVGAPtr vga);
+The struct vga is used to hold the state of the legacy VGA access
+registers if a legacy VGA device exists. xf86InitInt10() should
+return a pointer to the xf86Int10InfoRec allocated.
+
+2. Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
+
+In case a platform specific mapping has to be performed to map the
+memory allocated for the real mode memory environment into a specific
+location prior to executing the x86 real mode code a function
+
+ Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
+
+has to be provided. It will be called by a helper function whenever
+the active entity changes. If the vm86 mode is used it is most likely
+that the 1MB real mode memory space located somewhere in the processes
+virtual memory will have to be remapped to address 0 of the virtual
+memory space.
+
+3. void xf86FreeInt10(xf86Int10InfoPtr pInt);
+
+To free all memory allocated for video BIOS calls of a specific entity
+the function
+
+ void xf86FreeInt10(xf86Int10InfoPtr pInt);
+
+should be provided. If the entity to be freed was mapped by
+MapCurrentInt10() this mapping needs to be undone also.
+
+4.
+ void * xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off)
+ void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
+
+xf86Int10AllocPages() should allocate 'num' consecutive page-size
+chunks of memory. In real mode memory space this range needs to occupy
+consecutive addresses, too. The function must return the address of
+this memory. The offset in real mode memory needs to be returned in
+'off'. If no block of 'num' pages are available the function should
+return NULL.
+
+xf86Int10FreePages() will free the 'num' pages starting at 'pbase'.
+'num' is equal to the number of pages allocated by a single
+xf86Int10AllocatePages() call. 'pbase' is the address of the range
+previously returned by xf86Int10AllocatePages().
+
+II. Emulator specific functions
+-------------------------------
+
+1. Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
+
+This function will be called from xf86InitInt10(). It may be used to
+set up the static emulator specific part of the real mode
+environment. On success it should return TRUE.
+
+2. xf86ExecX86int10(xf86Int10InfoPtr pInt);
+
+This function gets called to execute an int call. It may call the
+helper function:
+
+ void setup_int(xf86Int10InfoPrt pInt);
+
+to copy the register values to the emulator specific locations and to
+set up the non-static real mode execution environment. On return from
+setup_int() 'Int10Current' holds a pointer to the current
+xf86Int10InfoRec.
+
+It should start execution by calling
+
+ Bool int_handler(xf86Int10InfoPtr pInt);
+
+and if this function returns TRUE it should call whatever necessary to
+continue execution until a 'hlt' instruction is encountered. To copy
+the resulting register values back to the xf86Int10InfoRec structure
+
+ void finish_int(xf86Int10InfoPtr pInt);
+
+should be called.
+
+Helper functions are provided to aid the implementation of a vm86
+call:
+
+ Bool vm86_GP_fault(xf86Int10InfoPtr pInt);
+
+This function handles instructions which cause a vm86 call to
+trap. PIO access is handled by the in/out calls as defined in
+compiler.h. Optionally the PIO instructions can be logged by defining
+PRINT_PORT in xf86int10.h. This is meant for debugging purposes.
+
+Unknown instructions and 'hlt' cause vm86_GP_fault() to return
+FALSE. Otherwise TRUE is returned.
+
+Note: This function is currently based on the Linux vm86 call. It
+might have to be modified or even rewritten for other OS. So your
+milage may vary.
+
+Functions to dump memory, code, xf86 CPU register values and stack are
+also provided. Take a look at helper.c To view a memory range the
+function
+
+ void dprint(unsigned long start, unsigned long size)
+
+is provided. The use should be self explanatory.
+
+Register and memory access functions are provided in helper_mem.c.
+The PIO register access functions can trap access to PCI config space
+access register (config method 1) if _PC is not defined.
+
+A header file 'defines.h' is required to define OS/emulator specific
+ways to access memory and xf86 CPU registers: Defines need to be
+provided for memory byte/work/long read/write access
+(MEM_RB(name,addr),MEM_RW(name,addr),MEM_RL(name,addr),
+MEM_WB(name,addr,val),MEM_WL(name,addr,val),MEM_WL(name,addr,val)) of
+the real mode memory environment. 'name' will contain a pointer to the
+current xf86Int10InfoRec. Currently defines are available for
+vm86-mode under Linux and x86emu. They may be activated by defining
+_X86EMU or _VM86_LINUX respectively.
+
+Note: Emulators usually are not able to pass this pointer when calling
+memory access functions. In this case a global variable should be
+defined which can hold this pointer. This variable can be set in
+MapCurrentInt10(). It also must be set in xf86InitInt10() if this
+function calls the memory access functions either directly or by
+calling xf86ExecX86int10(pInt). Defines to access the emulator
+specific xf86 CPU register locations are also required:
+X86_EAX,...,X86_EFLAGS for access of the full 32 bit registers,
+X86_AX...X86_FLAGS for access of the 16 bit registers and
+XF86_AL,XF86_BL,XF86_CL,XF86_DL to access the lower byte of the
+AX,BX,CX and DX register.
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO,v 1.2 2000/02/08 13:13:22 eich Exp $
diff --git a/xorg-server/hw/xfree86/int10/generic.c b/xorg-server/hw/xfree86/int10/generic.c index 8614e0b9b..5343e47e3 100644 --- a/xorg-server/hw/xfree86/int10/generic.c +++ b/xorg-server/hw/xfree86/int10/generic.c @@ -70,12 +70,12 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) void *base = 0; void *vbiosMem = 0; void *options = NULL; - int screen; legacyVGARec vga; + ScrnInfoPtr pScrn; - screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex; + pScrn = xf86FindScreenForEntity(entityIndex); - options = xf86HandleInt10Options(xf86Screens[screen], entityIndex); + options = xf86HandleInt10Options(pScrn, entityIndex); if (int10skip(options)) { free(options); @@ -89,7 +89,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) pInt->mem = &genericMem; pInt->private = (pointer) xnfcalloc(1, sizeof(genericInt10Priv)); INTPriv(pInt)->alloc = (pointer) xnfcalloc(1, ALLOC_ENTRIES(getpagesize())); - pInt->scrnIndex = screen; + pInt->pScrn = pScrn; base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS); /* FIXME: Shouldn't this be a failure case? Leaving dev as NULL seems like @@ -109,7 +109,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) INTPriv(pInt)->sysMem = sysMem; if (xf86ReadBIOS(0, 0, base, LOW_PAGE_SIZE) < 0) { - xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read int vect\n"); goto error1; } @@ -148,7 +148,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) vbiosMem = (unsigned char *) base + bios_location; err = pci_device_read_rom(rom_device, vbiosMem); if (err) { - xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (3) %s\n", + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read V_BIOS (3) %s\n", strerror(err)); goto error1; } @@ -249,7 +249,6 @@ MapVRam(xf86Int10InfoPtr pInt) static void UnmapVRam(xf86Int10InfoPtr pInt) { - int screen = pInt->scrnIndex; int pagesize = getpagesize(); int size = ((VRAM_SIZE + pagesize - 1) / pagesize) * pagesize; diff --git a/xorg-server/hw/xfree86/int10/helper_exec.c b/xorg-server/hw/xfree86/int10/helper_exec.c index 1e908778f..1c58cf7ae 100644 --- a/xorg-server/hw/xfree86/int10/helper_exec.c +++ b/xorg-server/hw/xfree86/int10/helper_exec.c @@ -125,7 +125,7 @@ run_bios_int(int num, xf86Int10InfoPtr pInt) if (MEM_RW(pInt, (num << 2) + 2) == (SYS_BIOS >> 4)) { /* SYS_BIOS_SEG ? */ if (num == 21 && X86_AH == 0x4e) { - xf86DrvMsg(pInt->scrnIndex, X_NOTICE, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_NOTICE, "Failing Find-Matching-File on non-PC" " (int 21, func 4e)\n"); X86_AX = 2; @@ -133,7 +133,7 @@ run_bios_int(int num, xf86Int10InfoPtr pInt) return 1; } else { - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "Ignoring int 0x%02x call\n", num); if (xf86GetVerbosity() > 3) { dump_registers(pInt); @@ -169,7 +169,7 @@ dump_code(xf86Int10InfoPtr pInt) int i; CARD32 lina = SEG_ADR((CARD32), X86_CS, IP); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n", + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n", lina); for (i = 0; i < 0x10; i++) xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i)); @@ -182,19 +182,19 @@ dump_code(xf86Int10InfoPtr pInt) void dump_registers(xf86Int10InfoPtr pInt) { - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "EAX=0x%8.8lx, EBX=0x%8.8lx, ECX=0x%8.8lx, EDX=0x%8.8lx\n", (unsigned long) X86_EAX, (unsigned long) X86_EBX, (unsigned long) X86_ECX, (unsigned long) X86_EDX); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "ESP=0x%8.8lx, EBP=0x%8.8lx, ESI=0x%8.8lx, EDI=0x%8.8lx\n", (unsigned long) X86_ESP, (unsigned long) X86_EBP, (unsigned long) X86_ESI, (unsigned long) X86_EDI); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "CS=0x%4.4x, SS=0x%4.4x," " DS=0x%4.4x, ES=0x%4.4x, FS=0x%4.4x, GS=0x%4.4x\n", X86_CS, X86_SS, X86_DS, X86_ES, X86_FS, X86_GS); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "EIP=0x%8.8lx, EFLAGS=0x%8.8lx\n", (unsigned long) X86_EIP, (unsigned long) X86_EFLAGS); } @@ -337,7 +337,7 @@ x_inb(CARD16 port) } else if (port < 0x0100) { /* Don't interfere with mainboard */ val = 0; - xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(Int10Current->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "inb 0x%4.4x\n", port); if (xf86GetVerbosity() > 3) { dump_registers(Int10Current); @@ -395,7 +395,7 @@ x_outb(CARD16 port, CARD8 val) #ifdef __NOT_YET__ } else if (port < 0x0100) { /* Don't interfere with mainboard */ - xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(Int10Current->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "outb 0x%4.4x,0x%2.2x\n", port, val); if (xf86GetVerbosity() > 3) { dump_registers(Int10Current); diff --git a/xorg-server/hw/xfree86/int10/helper_mem.c b/xorg-server/hw/xfree86/int10/helper_mem.c index 96c598a53..160c5aedf 100644 --- a/xorg-server/hw/xfree86/int10/helper_mem.c +++ b/xorg-server/hw/xfree86/int10/helper_mem.c @@ -281,7 +281,7 @@ xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt) #define CHECK_V_SEGMENT_RANGE(x) \ if (((x) << 4) < V_BIOS) { \ - xf86DrvMsg(pInt->scrnIndex, X_ERROR, \ + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, \ "V_BIOS address 0x%lx out of range\n", \ (unsigned long)(x) << 4); \ return FALSE; \ @@ -306,17 +306,17 @@ xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base) CHECK_V_SEGMENT_RANGE(cs); vbiosMem = (unsigned char *) base + (cs << 4); - if (int10_check_bios(pInt->scrnIndex, cs, vbiosMem)) { + if (int10_check_bios(pInt->pScrn->scrnIndex, cs, vbiosMem)) { break; } } if (segments[i] == ~0) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "No V_BIOS found\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "No V_BIOS found\n"); return FALSE; } - xf86DrvMsg(pInt->scrnIndex, X_INFO, "Primary V_BIOS segment is: 0x%lx\n", + xf86DrvMsg(pInt->pScrn->scrnIndex, X_INFO, "Primary V_BIOS segment is: 0x%lx\n", (unsigned long) cs); pInt->BIOSseg = cs; diff --git a/xorg-server/hw/xfree86/int10/x86emu.c b/xorg-server/hw/xfree86/int10/x86emu.c index b3320e5b9..087059131 100644 --- a/xorg-server/hw/xfree86/int10/x86emu.c +++ b/xorg-server/hw/xfree86/int10/x86emu.c @@ -1,12 +1,12 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include "debug.c" -#include "decode.c" -#include "fpu.c" -#include "ops.c" -#include "ops2.c" -#include "prim_ops.c" -#include "sys.c" +
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "debug.c"
+#include "decode.c"
+#include "fpu.c"
+#include "ops.c"
+#include "ops2.c"
+#include "prim_ops.c"
+#include "sys.c"
diff --git a/xorg-server/hw/xfree86/int10/xf86int10.c b/xorg-server/hw/xfree86/int10/xf86int10.c index df347d4dd..5ead44f23 100644 --- a/xorg-server/hw/xfree86/int10/xf86int10.c +++ b/xorg-server/hw/xfree86/int10/xf86int10.c @@ -57,7 +57,7 @@ int_handler(xf86Int10InfoPtr pInt) ret = run_bios_int(num, pInt); if (!ret) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Halting on int 0x%2.2x!\n", num); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Halting on int 0x%2.2x!\n", num); dump_registers(pInt); stack_trace(pInt); } @@ -257,7 +257,7 @@ int42_handler(xf86Int10InfoPtr pInt) /* DL = character column */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x04) -- Get Light Pen Position\n", pInt->num); if (xf86GetVerbosity() > 3) { @@ -314,10 +314,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x06) -- Initialise or Scroll Window Up\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, " AL=0x%2.2x, BH=0x%2.2x," " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n", X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL); @@ -339,10 +339,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x07) -- Initialise or Scroll Window Down\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, " AL=0x%2.2x, BH=0x%2.2x," " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n", X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL); @@ -360,10 +360,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* AL = character */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x08) -- Read Character and Attribute at" " Cursor\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "BH=0x%2.2x\n", X86_BH); if (xf86GetVerbosity() > 3) { dump_registers(pInt); @@ -382,10 +382,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x09) -- Write Character and Attribute at" " Cursor\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n", X86_AL, X86_BH, X86_BL, X86_CX); if (xf86GetVerbosity() > 3) { @@ -404,10 +404,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0A) -- Write Character at Cursor\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n", X86_AL, X86_BH, X86_BL, X86_CX); if (xf86GetVerbosity() > 3) { @@ -450,10 +450,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0C) -- Write Graphics Pixel\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n", X86_AL, X86_BH, X86_CX, X86_DX); if (xf86GetVerbosity() > 3) { @@ -471,10 +471,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: AL = pixel value */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0D) -- Read Graphics Pixel\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n", X86_BH, X86_CX, X86_DX); if (xf86GetVerbosity() > 3) { @@ -498,10 +498,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* which might or might not have been */ /* installed yet. */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0E) -- Write Character in Teletype Mode\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x\n", X86_AL, X86_BH, X86_BL); if (xf86GetVerbosity() > 3) { @@ -564,10 +564,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* which might or might not have been */ /* installed yet. */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x13) -- Write String in Teletype Mode\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x," " DH=0x%2.2x, DL=0x%2.2x, ES:BP=0x%4.4x:0x%4.4x\n", X86_AL, X86_BL, X86_CX, X86_DH, X86_DL, X86_ES, X86_BP); @@ -840,7 +840,7 @@ int1A_handler(xf86Int10InfoPtr pInt) #endif return 1; default: - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x1a subfunction\n"); dump_registers(pInt); if (xf86GetVerbosity() > 3) diff --git a/xorg-server/hw/xfree86/int10/xf86int10.h b/xorg-server/hw/xfree86/int10/xf86int10.h index 36b659fd7..6d564fc1a 100644 --- a/xorg-server/hw/xfree86/int10/xf86int10.h +++ b/xorg-server/hw/xfree86/int10/xf86int10.h @@ -21,10 +21,10 @@ /* int10 info structure */ typedef struct { int entityIndex; - int scrnIndex; - pointer cpuRegs; CARD16 BIOSseg; CARD16 inb40time; + ScrnInfoPtr pScrn; + pointer cpuRegs; char *BIOSScratch; int Flags; pointer private; diff --git a/xorg-server/hw/xfree86/int10/xf86x86emu.h b/xorg-server/hw/xfree86/int10/xf86x86emu.h index 4af2dafb7..320ad6fa8 100644 --- a/xorg-server/hw/xfree86/int10/xf86x86emu.h +++ b/xorg-server/hw/xfree86/int10/xf86x86emu.h @@ -1,54 +1,54 @@ -/* - * XFree86 int10 module - * execute BIOS int 10h calls in x86 real mode environment - * Copyright 1999 Egbert Eich - */ -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#ifndef XF86X86EMU_H_ -#define XF86X86EMU_H_ -#include <x86emu.h> - -#define M _X86EMU_env - -#define X86_EAX M.x86.R_EAX -#define X86_EBX M.x86.R_EBX -#define X86_ECX M.x86.R_ECX -#define X86_EDX M.x86.R_EDX -#define X86_ESI M.x86.R_ESI -#define X86_EDI M.x86.R_EDI -#define X86_EBP M.x86.R_EBP -#define X86_EIP M.x86.R_EIP -#define X86_ESP M.x86.R_ESP -#define X86_EFLAGS M.x86.R_EFLG - -#define X86_FLAGS M.x86.R_FLG -#define X86_AX M.x86.R_AX -#define X86_BX M.x86.R_BX -#define X86_CX M.x86.R_CX -#define X86_DX M.x86.R_DX -#define X86_SI M.x86.R_SI -#define X86_DI M.x86.R_DI -#define X86_BP M.x86.R_BP -#define X86_IP M.x86.R_IP -#define X86_SP M.x86.R_SP -#define X86_CS M.x86.R_CS -#define X86_DS M.x86.R_DS -#define X86_ES M.x86.R_ES -#define X86_SS M.x86.R_SS -#define X86_FS M.x86.R_FS -#define X86_GS M.x86.R_GS - -#define X86_AL M.x86.R_AL -#define X86_BL M.x86.R_BL -#define X86_CL M.x86.R_CL -#define X86_DL M.x86.R_DL - -#define X86_AH M.x86.R_AH -#define X86_BH M.x86.R_BH -#define X86_CH M.x86.R_CH -#define X86_DH M.x86.R_DH - -#endif +/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#ifndef XF86X86EMU_H_
+#define XF86X86EMU_H_
+#include <x86emu.h>
+
+#define M _X86EMU_env
+
+#define X86_EAX M.x86.R_EAX
+#define X86_EBX M.x86.R_EBX
+#define X86_ECX M.x86.R_ECX
+#define X86_EDX M.x86.R_EDX
+#define X86_ESI M.x86.R_ESI
+#define X86_EDI M.x86.R_EDI
+#define X86_EBP M.x86.R_EBP
+#define X86_EIP M.x86.R_EIP
+#define X86_ESP M.x86.R_ESP
+#define X86_EFLAGS M.x86.R_EFLG
+
+#define X86_FLAGS M.x86.R_FLG
+#define X86_AX M.x86.R_AX
+#define X86_BX M.x86.R_BX
+#define X86_CX M.x86.R_CX
+#define X86_DX M.x86.R_DX
+#define X86_SI M.x86.R_SI
+#define X86_DI M.x86.R_DI
+#define X86_BP M.x86.R_BP
+#define X86_IP M.x86.R_IP
+#define X86_SP M.x86.R_SP
+#define X86_CS M.x86.R_CS
+#define X86_DS M.x86.R_DS
+#define X86_ES M.x86.R_ES
+#define X86_SS M.x86.R_SS
+#define X86_FS M.x86.R_FS
+#define X86_GS M.x86.R_GS
+
+#define X86_AL M.x86.R_AL
+#define X86_BL M.x86.R_BL
+#define X86_CL M.x86.R_CL
+#define X86_DL M.x86.R_DL
+
+#define X86_AH M.x86.R_AH
+#define X86_BH M.x86.R_BH
+#define X86_CH M.x86.R_CH
+#define X86_DH M.x86.R_DH
+
+#endif
|