mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
xfree86: int10: move public SDK headers to include/
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
3bd7f343c1
commit
4764eb9a8a
@@ -559,4 +559,7 @@ if build_xorg
|
||||
install_data('xf86Sbus.h', install_dir: xorgsdkdir)
|
||||
endif
|
||||
|
||||
if int10 != 'false'
|
||||
install_data(['xf86int10.h', 'vbe.h', 'vbeModes.h'], install_dir: xorgsdkdir)
|
||||
endif
|
||||
endif
|
||||
|
||||
350
include/vbe.h
Normal file
350
include/vbe.h
Normal file
@@ -0,0 +1,350 @@
|
||||
|
||||
/*
|
||||
* XFree86 vbe module
|
||||
* Copyright 2000 Egbert Eich
|
||||
*
|
||||
* The mode query/save/set/restore functions from the vesa driver
|
||||
* have been moved here.
|
||||
* Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
|
||||
* Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
|
||||
*/
|
||||
|
||||
#ifndef _VBE_H
|
||||
#define _VBE_H
|
||||
#include "xf86int10.h"
|
||||
#include "xf86DDC.h"
|
||||
|
||||
typedef enum {
|
||||
DDC_UNCHECKED,
|
||||
DDC_NONE,
|
||||
DDC_1,
|
||||
DDC_2,
|
||||
DDC_1_2
|
||||
} ddc_lvl;
|
||||
|
||||
typedef struct {
|
||||
xf86Int10InfoPtr pInt10;
|
||||
int version;
|
||||
void *memory;
|
||||
int real_mode_base;
|
||||
int num_pages;
|
||||
Bool init_int10;
|
||||
ddc_lvl ddc;
|
||||
Bool ddc_blank;
|
||||
} vbeInfoRec, *vbeInfoPtr;
|
||||
|
||||
#define VBE_VERSION_MAJOR(x) *((CARD8*)(&x) + 1)
|
||||
#define VBE_VERSION_MINOR(x) (CARD8)(x)
|
||||
|
||||
extern _X_EXPORT vbeInfoPtr VBEInit(xf86Int10InfoPtr pInt, int entityIndex);
|
||||
extern _X_EXPORT vbeInfoPtr VBEExtendedInit(xf86Int10InfoPtr pInt,
|
||||
int entityIndex, int Flags);
|
||||
extern _X_EXPORT void vbeFree(vbeInfoPtr pVbe);
|
||||
extern _X_EXPORT xf86MonPtr vbeDoEDID(vbeInfoPtr pVbe, void *pDDCModule);
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct vbeControllerInfoBlock {
|
||||
CARD8 VbeSignature[4];
|
||||
CARD16 VbeVersion;
|
||||
CARD32 OemStringPtr;
|
||||
CARD8 Capabilities[4];
|
||||
CARD32 VideoModePtr;
|
||||
CARD16 TotalMem;
|
||||
CARD16 OemSoftwareRev;
|
||||
CARD32 OemVendorNamePtr;
|
||||
CARD32 OemProductNamePtr;
|
||||
CARD32 OemProductRevPtr;
|
||||
CARD8 Scratch[222];
|
||||
CARD8 OemData[256];
|
||||
} vbeControllerInfoRec, *vbeControllerInfoPtr;
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack() /* All GCC versions recognise this syntax */
|
||||
#else
|
||||
#pragma pack(0)
|
||||
#define __attribute__(a)
|
||||
#endif
|
||||
|
||||
typedef struct _VbeInfoBlock VbeInfoBlock;
|
||||
typedef struct _VbeModeInfoBlock VbeModeInfoBlock;
|
||||
typedef struct _VbeCRTCInfoBlock VbeCRTCInfoBlock;
|
||||
|
||||
/*
|
||||
* INT 0
|
||||
*/
|
||||
|
||||
struct _VbeInfoBlock {
|
||||
/* VESA 1.2 fields */
|
||||
CARD8 VESASignature[4]; /* VESA */
|
||||
CARD16 VESAVersion; /* Higher byte major, lower byte minor */
|
||||
/*CARD32 */ char *OEMStringPtr;
|
||||
/* Pointer to OEM string */
|
||||
CARD8 Capabilities[4]; /* Capabilities of the video environment */
|
||||
|
||||
/*CARD32 */ CARD16 *VideoModePtr;
|
||||
/* pointer to supported Super VGA modes */
|
||||
|
||||
CARD16 TotalMemory; /* Number of 64kb memory blocks on board */
|
||||
/* if not VESA 2, 236 scratch bytes follow (256 bytes total size) */
|
||||
|
||||
/* VESA 2 fields */
|
||||
CARD16 OemSoftwareRev; /* VBE implementation Software revision */
|
||||
/*CARD32 */ char *OemVendorNamePtr;
|
||||
/* Pointer to Vendor Name String */
|
||||
/*CARD32 */ char *OemProductNamePtr;
|
||||
/* Pointer to Product Name String */
|
||||
/*CARD32 */ char *OemProductRevPtr;
|
||||
/* Pointer to Product Revision String */
|
||||
CARD8 Reserved[222]; /* Reserved for VBE implementation */
|
||||
CARD8 OemData[256]; /* Data Area for OEM Strings */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Return Super VGA Information */
|
||||
extern _X_EXPORT VbeInfoBlock *VBEGetVBEInfo(vbeInfoPtr pVbe);
|
||||
extern _X_EXPORT void VBEFreeVBEInfo(VbeInfoBlock * block);
|
||||
|
||||
/*
|
||||
* INT 1
|
||||
*/
|
||||
|
||||
struct _VbeModeInfoBlock {
|
||||
CARD16 ModeAttributes; /* mode attributes */
|
||||
CARD8 WinAAttributes; /* window A attributes */
|
||||
CARD8 WinBAttributes; /* window B attributes */
|
||||
CARD16 WinGranularity; /* window granularity */
|
||||
CARD16 WinSize; /* window size */
|
||||
CARD16 WinASegment; /* window A start segment */
|
||||
CARD16 WinBSegment; /* window B start segment */
|
||||
CARD32 WinFuncPtr; /* real mode pointer to window function */
|
||||
CARD16 BytesPerScanline; /* bytes per scanline */
|
||||
|
||||
/* Mandatory information for VBE 1.2 and above */
|
||||
CARD16 XResolution; /* horizontal resolution in pixels or characters */
|
||||
CARD16 YResolution; /* vertical resolution in pixels or characters */
|
||||
CARD8 XCharSize; /* character cell width in pixels */
|
||||
CARD8 YCharSize; /* character cell height in pixels */
|
||||
CARD8 NumberOfPlanes; /* number of memory planes */
|
||||
CARD8 BitsPerPixel; /* bits per pixel */
|
||||
CARD8 NumberOfBanks; /* number of banks */
|
||||
CARD8 MemoryModel; /* memory model type */
|
||||
CARD8 BankSize; /* bank size in KB */
|
||||
CARD8 NumberOfImages; /* number of images */
|
||||
CARD8 Reserved; /* 1 *//* reserved for page function */
|
||||
|
||||
/* Direct color fields (required for direct/6 and YUV/7 memory models) */
|
||||
CARD8 RedMaskSize; /* size of direct color red mask in bits */
|
||||
CARD8 RedFieldPosition; /* bit position of lsb of red mask */
|
||||
CARD8 GreenMaskSize; /* size of direct color green mask in bits */
|
||||
CARD8 GreenFieldPosition; /* bit position of lsb of green mask */
|
||||
CARD8 BlueMaskSize; /* size of direct color blue mask in bits */
|
||||
CARD8 BlueFieldPosition; /* bit position of lsb of blue mask */
|
||||
CARD8 RsvdMaskSize; /* size of direct color reserved mask in bits */
|
||||
CARD8 RsvdFieldPosition; /* bit position of lsb of reserved mask */
|
||||
CARD8 DirectColorModeInfo; /* direct color mode attributes */
|
||||
|
||||
/* Mandatory information for VBE 2.0 and above */
|
||||
CARD32 PhysBasePtr; /* physical address for flat memory frame buffer */
|
||||
CARD32 Reserved32; /* 0 *//* Reserved - always set to 0 */
|
||||
CARD16 Reserved16; /* 0 *//* Reserved - always set to 0 */
|
||||
|
||||
/* Mandatory information for VBE 3.0 and above */
|
||||
CARD16 LinBytesPerScanLine; /* bytes per scan line for linear modes */
|
||||
CARD8 BnkNumberOfImagePages; /* number of images for banked modes */
|
||||
CARD8 LinNumberOfImagePages; /* number of images for linear modes */
|
||||
CARD8 LinRedMaskSize; /* size of direct color red mask (linear modes) */
|
||||
CARD8 LinRedFieldPosition; /* bit position of lsb of red mask (linear modes) */
|
||||
CARD8 LinGreenMaskSize; /* size of direct color green mask (linear modes) */
|
||||
CARD8 LinGreenFieldPosition; /* bit position of lsb of green mask (linear modes) */
|
||||
CARD8 LinBlueMaskSize; /* size of direct color blue mask (linear modes) */
|
||||
CARD8 LinBlueFieldPosition; /* bit position of lsb of blue mask (linear modes) */
|
||||
CARD8 LinRsvdMaskSize; /* size of direct color reserved mask (linear modes) */
|
||||
CARD8 LinRsvdFieldPosition; /* bit position of lsb of reserved mask (linear modes) */
|
||||
CARD32 MaxPixelClock; /* maximum pixel clock (in Hz) for graphics mode */
|
||||
CARD8 Reserved2[189]; /* remainder of VbeModeInfoBlock */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Return VBE Mode Information */
|
||||
extern _X_EXPORT VbeModeInfoBlock *VBEGetModeInfo(vbeInfoPtr pVbe, int mode);
|
||||
extern _X_EXPORT void VBEFreeModeInfo(VbeModeInfoBlock * block);
|
||||
|
||||
/*
|
||||
* INT2
|
||||
*/
|
||||
|
||||
#define CRTC_DBLSCAN (1<<0)
|
||||
#define CRTC_INTERLACE (1<<1)
|
||||
#define CRTC_NHSYNC (1<<2)
|
||||
#define CRTC_NVSYNC (1<<3)
|
||||
|
||||
struct _VbeCRTCInfoBlock {
|
||||
CARD16 HorizontalTotal; /* Horizontal total in pixels */
|
||||
CARD16 HorizontalSyncStart; /* Horizontal sync start in pixels */
|
||||
CARD16 HorizontalSyncEnd; /* Horizontal sync end in pixels */
|
||||
CARD16 VerticalTotal; /* Vertical total in lines */
|
||||
CARD16 VerticalSyncStart; /* Vertical sync start in lines */
|
||||
CARD16 VerticalSyncEnd; /* Vertical sync end in lines */
|
||||
CARD8 Flags; /* Flags (Interlaced, Double Scan etc) */
|
||||
CARD32 PixelClock; /* Pixel clock in units of Hz */
|
||||
CARD16 RefreshRate; /* Refresh rate in units of 0.01 Hz */
|
||||
CARD8 Reserved[40]; /* remainder of ModeInfoBlock */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* VbeCRTCInfoBlock is in the VESA 3.0 specs */
|
||||
|
||||
extern _X_EXPORT Bool VBESetVBEMode(vbeInfoPtr pVbe, int mode,
|
||||
VbeCRTCInfoBlock * crtc);
|
||||
|
||||
/*
|
||||
* INT 3
|
||||
*/
|
||||
|
||||
extern _X_EXPORT Bool VBEGetVBEMode(vbeInfoPtr pVbe, int *mode);
|
||||
|
||||
/*
|
||||
* INT 4
|
||||
*/
|
||||
|
||||
/* Save/Restore Super VGA video state */
|
||||
/* function values are (values stored in VESAPtr):
|
||||
* 0 := query & allocate amount of memory to save state
|
||||
* 1 := save state
|
||||
* 2 := restore state
|
||||
*
|
||||
* function 0 called automatically if function 1 called without
|
||||
* a previous call to function 0.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
MODE_QUERY,
|
||||
MODE_SAVE,
|
||||
MODE_RESTORE
|
||||
} vbeSaveRestoreFunction;
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction function,
|
||||
void **memory, int *size, int *real_mode_pages);
|
||||
|
||||
/*
|
||||
* INT 5
|
||||
*/
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
VBEBankSwitch(vbeInfoPtr pVbe, unsigned int iBank, int window);
|
||||
|
||||
/*
|
||||
* INT 6
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
SCANWID_SET,
|
||||
SCANWID_GET,
|
||||
SCANWID_SET_BYTES,
|
||||
SCANWID_GET_MAX
|
||||
} vbeScanwidthCommand;
|
||||
|
||||
#define VBESetLogicalScanline(pVbe, width) \
|
||||
VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET, width, \
|
||||
NULL, NULL, NULL)
|
||||
#define VBESetLogicalScanlineBytes(pVbe, width) \
|
||||
VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET_BYTES, width, \
|
||||
NULL, NULL, NULL)
|
||||
#define VBEGetLogicalScanline(pVbe, pixels, bytes, max) \
|
||||
VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET, 0, \
|
||||
pixels, bytes, max)
|
||||
#define VBEGetMaxLogicalScanline(pVbe, pixels, bytes, max) \
|
||||
VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET_MAX, 0, \
|
||||
pixels, bytes, max)
|
||||
extern _X_EXPORT Bool VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe,
|
||||
vbeScanwidthCommand
|
||||
command, int width,
|
||||
int *pixels, int *bytes,
|
||||
int *max);
|
||||
|
||||
/*
|
||||
* INT 7
|
||||
*/
|
||||
|
||||
/* 16 bit code */
|
||||
extern _X_EXPORT Bool VBESetDisplayStart(vbeInfoPtr pVbe, int x, int y,
|
||||
Bool wait_retrace);
|
||||
|
||||
/*
|
||||
* INT 8
|
||||
*/
|
||||
|
||||
/* if bits is 0, then it is a GET */
|
||||
extern _X_EXPORT int VBESetGetDACPaletteFormat(vbeInfoPtr pVbe, int bits);
|
||||
|
||||
/*
|
||||
* INT 9
|
||||
*/
|
||||
|
||||
/*
|
||||
* If getting a palette, the data argument is not used. It will return
|
||||
* the data.
|
||||
* If setting a palette, it will return the pointer received on success,
|
||||
* NULL on failure.
|
||||
*/
|
||||
extern _X_EXPORT CARD32 *VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set,
|
||||
int first, int num, CARD32 *data,
|
||||
Bool secondary,
|
||||
Bool wait_retrace);
|
||||
#define VBEFreePaletteData(data) free(data)
|
||||
|
||||
/*
|
||||
* INT A
|
||||
*/
|
||||
|
||||
typedef struct _VBEpmi {
|
||||
int seg_tbl;
|
||||
int tbl_off;
|
||||
int tbl_len;
|
||||
} VBEpmi;
|
||||
|
||||
#define VESAFreeVBEpmi(pmi) free(pmi)
|
||||
|
||||
/* high level helper functions */
|
||||
|
||||
typedef struct _vbeModeInfoRec {
|
||||
int width;
|
||||
int height;
|
||||
int bpp;
|
||||
int n;
|
||||
struct _vbeModeInfoRec *next;
|
||||
} vbeModeInfoRec, *vbeModeInfoPtr;
|
||||
|
||||
typedef struct {
|
||||
CARD8 *state;
|
||||
CARD8 *pstate;
|
||||
int statePage;
|
||||
int stateSize;
|
||||
int stateMode;
|
||||
} vbeSaveRestoreRec, *vbeSaveRestorePtr;
|
||||
|
||||
extern _X_EXPORT void
|
||||
|
||||
VBEVesaSaveRestore(vbeInfoPtr pVbe, vbeSaveRestorePtr vbe_sr,
|
||||
vbeSaveRestoreFunction function);
|
||||
|
||||
extern _X_EXPORT int VBEGetPixelClock(vbeInfoPtr pVbe, int mode, int Clock);
|
||||
extern _X_EXPORT Bool VBEDPMSSet(vbeInfoPtr pVbe, int mode);
|
||||
|
||||
struct vbePanelID {
|
||||
short hsize;
|
||||
short vsize;
|
||||
short fptype;
|
||||
char redbpp;
|
||||
char greenbpp;
|
||||
char bluebpp;
|
||||
char reservedbpp;
|
||||
int reserved_offscreen_mem_size;
|
||||
int reserved_offscreen_mem_pointer;
|
||||
char reserved[14];
|
||||
};
|
||||
|
||||
extern _X_EXPORT void VBEInterpretPanelID(ScrnInfoPtr pScrn,
|
||||
struct vbePanelID *data);
|
||||
extern _X_EXPORT struct vbePanelID *VBEReadPanelID(vbeInfoPtr pVbe);
|
||||
|
||||
#endif
|
||||
95
include/vbeModes.h
Normal file
95
include/vbeModes.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright © 2002 David Dawes
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* Except as contained in this notice, the name of the author(s) shall
|
||||
* not be used in advertising or otherwise to promote the sale, use or other
|
||||
* dealings in this Software without prior written authorization from
|
||||
* the author(s).
|
||||
*
|
||||
* Authors: David Dawes <dawes@xfree86.org>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _VBE_MODES_H
|
||||
#define _VBE_MODES_H
|
||||
|
||||
/*
|
||||
* This is intended to be stored in the DisplayModeRec's private area.
|
||||
* It includes all the information necessary to VBE information.
|
||||
*/
|
||||
typedef struct _VbeModeInfoData {
|
||||
int mode;
|
||||
VbeModeInfoBlock *data;
|
||||
VbeCRTCInfoBlock *block;
|
||||
} VbeModeInfoData;
|
||||
|
||||
#define V_DEPTH_1 0x001
|
||||
#define V_DEPTH_4 0x002
|
||||
#define V_DEPTH_8 0x004
|
||||
#define V_DEPTH_15 0x008
|
||||
#define V_DEPTH_16 0x010
|
||||
#define V_DEPTH_24_24 0x020
|
||||
#define V_DEPTH_24_32 0x040
|
||||
#define V_DEPTH_24 (V_DEPTH_24_24 | V_DEPTH_24_32)
|
||||
#define V_DEPTH_30 0x080
|
||||
#define V_DEPTH_32 0x100
|
||||
|
||||
#define VBE_MODE_SUPPORTED(m) (((m)->ModeAttributes & 0x01) != 0)
|
||||
#define VBE_MODE_COLOR(m) (((m)->ModeAttributes & 0x08) != 0)
|
||||
#define VBE_MODE_GRAPHICS(m) (((m)->ModeAttributes & 0x10) != 0)
|
||||
#define VBE_MODE_VGA(m) (((m)->ModeAttributes & 0x40) == 0)
|
||||
#define VBE_MODE_LINEAR(m) (((m)->ModeAttributes & 0x80) != 0 && \
|
||||
((m)->PhysBasePtr != 0))
|
||||
|
||||
#define VBE_MODE_USABLE(m, f) (VBE_MODE_SUPPORTED(m) || \
|
||||
(f & V_MODETYPE_BAD)) && \
|
||||
VBE_MODE_GRAPHICS(m) && \
|
||||
(VBE_MODE_VGA(m) || VBE_MODE_LINEAR(m))
|
||||
|
||||
#define V_MODETYPE_VBE 0x01
|
||||
#define V_MODETYPE_VGA 0x02
|
||||
#define V_MODETYPE_BAD 0x04
|
||||
|
||||
extern _X_EXPORT int VBEFindSupportedDepths(vbeInfoPtr pVbe, VbeInfoBlock * vbe,
|
||||
int *flags24, int modeTypes);
|
||||
extern _X_EXPORT DisplayModePtr VBEGetModePool(ScrnInfoPtr pScrn,
|
||||
vbeInfoPtr pVbe,
|
||||
VbeInfoBlock * vbe,
|
||||
int modeTypes);
|
||||
extern _X_EXPORT void VBESetModeNames(DisplayModePtr pMode);
|
||||
extern _X_EXPORT void VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe);
|
||||
|
||||
/*
|
||||
* Note: These are alternatives to the standard helpers. They should
|
||||
* usually just wrap the standard helpers.
|
||||
*/
|
||||
extern _X_EXPORT int VBEValidateModes(ScrnInfoPtr scrp,
|
||||
DisplayModePtr availModes,
|
||||
const char **modeNames,
|
||||
ClockRangePtr clockRanges,
|
||||
int *linePitches, int minPitch,
|
||||
int maxPitch, int pitchInc, int minHeight,
|
||||
int maxHeight, int virtualX, int virtualY,
|
||||
int apertureSize,
|
||||
LookupModeFlags strategy);
|
||||
extern _X_EXPORT void VBEPrintModes(ScrnInfoPtr scrp);
|
||||
|
||||
#endif /* VBE_MODES_H */
|
||||
139
include/xf86int10.h
Normal file
139
include/xf86int10.h
Normal file
@@ -0,0 +1,139 @@
|
||||
|
||||
/*
|
||||
* XFree86 int10 module
|
||||
* execute BIOS int 10h calls in x86 real mode environment
|
||||
* Copyright 1999 Egbert Eich
|
||||
*/
|
||||
|
||||
#ifndef _XF86INT10_H
|
||||
#define _XF86INT10_H
|
||||
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/Xdefs.h>
|
||||
#include "xf86Pci.h"
|
||||
|
||||
#define SEG_ADDR(x) (((x) >> 4) & 0x00F000)
|
||||
#define SEG_OFF(x) ((x) & 0x0FFFF)
|
||||
|
||||
#define SET_BIOS_SCRATCH 0x1
|
||||
#define RESTORE_BIOS_SCRATCH 0x2
|
||||
|
||||
/* int10 info structure */
|
||||
typedef struct {
|
||||
int entityIndex;
|
||||
uint16_t BIOSseg;
|
||||
uint16_t inb40time;
|
||||
ScrnInfoPtr pScrn;
|
||||
void *cpuRegs;
|
||||
char *BIOSScratch;
|
||||
int Flags;
|
||||
void *private;
|
||||
struct _int10Mem *mem;
|
||||
int num;
|
||||
int ax;
|
||||
int bx;
|
||||
int cx;
|
||||
int dx;
|
||||
int si;
|
||||
int di;
|
||||
int es;
|
||||
int bp;
|
||||
int flags;
|
||||
int stackseg;
|
||||
struct pci_device *dev;
|
||||
struct pci_io_handle *io;
|
||||
} xf86Int10InfoRec, *xf86Int10InfoPtr;
|
||||
|
||||
typedef struct _int10Mem {
|
||||
uint8_t (*rb) (xf86Int10InfoPtr, int);
|
||||
uint16_t (*rw) (xf86Int10InfoPtr, int);
|
||||
uint32_t (*rl) (xf86Int10InfoPtr, int);
|
||||
void (*wb) (xf86Int10InfoPtr, int, uint8_t);
|
||||
void (*ww) (xf86Int10InfoPtr, int, uint16_t);
|
||||
void (*wl) (xf86Int10InfoPtr, int, uint32_t);
|
||||
} int10MemRec, *int10MemPtr;
|
||||
|
||||
typedef struct {
|
||||
uint8_t save_msr;
|
||||
uint8_t save_pos102;
|
||||
uint8_t save_vse;
|
||||
uint8_t save_46e8;
|
||||
} legacyVGARec, *legacyVGAPtr;
|
||||
|
||||
/* OS dependent functions */
|
||||
extern _X_EXPORT xf86Int10InfoPtr xf86InitInt10(int entityIndex);
|
||||
extern _X_EXPORT xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex,
|
||||
int Flags);
|
||||
extern _X_EXPORT void xf86FreeInt10(xf86Int10InfoPtr pInt);
|
||||
extern _X_EXPORT void *xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num,
|
||||
int *off);
|
||||
extern _X_EXPORT void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase,
|
||||
int num);
|
||||
extern _X_EXPORT void *xf86int10Addr(xf86Int10InfoPtr pInt, uint32_t addr);
|
||||
|
||||
/* x86 executor related functions */
|
||||
extern _X_EXPORT void xf86ExecX86int10(xf86Int10InfoPtr pInt);
|
||||
|
||||
#ifdef _INT10_PRIVATE
|
||||
|
||||
#define I_S_DEFAULT_INT_VECT 0xFF065
|
||||
#define SYS_SIZE 0x100000
|
||||
#define SYS_BIOS 0xF0000
|
||||
#if 1
|
||||
#define BIOS_SIZE 0x10000
|
||||
#else /* a bug in DGUX requires this - let's try it */
|
||||
#define BIOS_SIZE (0x10000 - 1)
|
||||
#endif
|
||||
#define LOW_PAGE_SIZE 0x600
|
||||
#define V_RAM 0xA0000
|
||||
#define VRAM_SIZE 0x20000
|
||||
#define V_BIOS_SIZE 0x10000
|
||||
#define V_BIOS 0xC0000
|
||||
#define BIOS_SCRATCH_OFF 0x449
|
||||
#define BIOS_SCRATCH_END 0x466
|
||||
#define BIOS_SCRATCH_LEN (BIOS_SCRATCH_END - BIOS_SCRATCH_OFF + 1)
|
||||
#define HIGH_MEM V_BIOS
|
||||
#define HIGH_MEM_SIZE (SYS_BIOS - HIGH_MEM)
|
||||
#define SEG_ADR(type, seg, reg) type((seg << 4) + (X86_##reg))
|
||||
#define SEG_EADR(type, seg, reg) type((seg << 4) + (X86_E##reg))
|
||||
|
||||
#define X86_TF_MASK 0x00000100
|
||||
#define X86_IF_MASK 0x00000200
|
||||
#define X86_IOPL_MASK 0x00003000
|
||||
#define X86_NT_MASK 0x00004000
|
||||
#define X86_VM_MASK 0x00020000
|
||||
#define X86_AC_MASK 0x00040000
|
||||
#define X86_VIF_MASK 0x00080000 /* virtual interrupt flag */
|
||||
#define X86_VIP_MASK 0x00100000 /* virtual interrupt pending */
|
||||
#define X86_ID_MASK 0x00200000
|
||||
|
||||
#define MEM_RB(name, addr) (*name->mem->rb)(name, addr)
|
||||
#define MEM_RW(name, addr) (*name->mem->rw)(name, addr)
|
||||
#define MEM_RL(name, addr) (*name->mem->rl)(name, addr)
|
||||
#define MEM_WB(name, addr, val) (*name->mem->wb)(name, addr, val)
|
||||
#define MEM_WW(name, addr, val) (*name->mem->ww)(name, addr, val)
|
||||
#define MEM_WL(name, addr, val) (*name->mem->wl)(name, addr, val)
|
||||
|
||||
/* OS dependent functions */
|
||||
extern _X_EXPORT Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
|
||||
|
||||
/* x86 executor related functions */
|
||||
extern _X_EXPORT Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
|
||||
|
||||
/* int.c */
|
||||
extern _X_EXPORT xf86Int10InfoPtr Int10Current;
|
||||
|
||||
#if defined (_PC)
|
||||
extern _X_EXPORT void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt,
|
||||
Bool save);
|
||||
#endif
|
||||
|
||||
extern _X_EXPORT void *xf86HandleInt10Options(ScrnInfoPtr pScrn,
|
||||
int entityIndex);
|
||||
extern _X_EXPORT BusType xf86int10GetBiosLocationType(const xf86Int10InfoPtr
|
||||
pInt);
|
||||
extern _X_EXPORT Bool xf86int10GetBiosSegment(xf86Int10InfoPtr pInt,
|
||||
void *base);
|
||||
|
||||
#endif /* _INT10_PRIVATE */
|
||||
#endif /* _XF86INT10_H */
|
||||
Reference in New Issue
Block a user