VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/xf86int10.h@ 78293

Last change on this file since 78293 was 69098, checked in by vboxsync, 7 years ago

Clean up XFree86 driver header files.
bugref:3810: X11 Guest Additions maintenance
Over the years we have cleaned up the layout in the tree of the X.Org
header files we use to build drivers. The XFree86 ones were still in their
original, rather sub-optimal layout. This change fixes that.

  • Property svn:eol-style set to native
File size: 5.9 KB
Line 
1/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.h,v 1.24 2002/07/23 14:22:46 tsi Exp $ */
2
3/*
4 * XFree86 int10 module
5 * execute BIOS int 10h calls in x86 real mode environment
6 * Copyright 1999 Egbert Eich
7 */
8
9#ifndef _XF86INT10_H
10#define _XF86INT10_H
11
12#include "Xmd.h"
13#include "Xdefs.h"
14#include "xf86Pci.h"
15
16#define SEG_ADDR(x) (((x) >> 4) & 0x00F000)
17#define SEG_OFF(x) ((x) & 0x0FFFF)
18
19#define SET_BIOS_SCRATCH 0x1
20#define RESTORE_BIOS_SCRATCH 0x2
21
22/* int10 info structure */
23typedef struct {
24 int entityIndex;
25 int scrnIndex;
26 pointer cpuRegs;
27 CARD16 BIOSseg;
28 CARD16 inb40time;
29 char * BIOSScratch;
30 int Flags;
31 pointer private;
32 struct _int10Mem* mem;
33 int num;
34 int ax;
35 int bx;
36 int cx;
37 int dx;
38 int si;
39 int di;
40 int es;
41 int bp;
42 int flags;
43 int stackseg;
44 PCITAG Tag;
45 IOADDRESS ioBase;
46} xf86Int10InfoRec, *xf86Int10InfoPtr;
47
48typedef struct _int10Mem {
49 CARD8(*rb)(xf86Int10InfoPtr, int);
50 CARD16(*rw)(xf86Int10InfoPtr, int);
51 CARD32(*rl)(xf86Int10InfoPtr, int);
52 void(*wb)(xf86Int10InfoPtr, int, CARD8);
53 void(*ww)(xf86Int10InfoPtr, int, CARD16);
54 void(*wl)(xf86Int10InfoPtr, int, CARD32);
55} int10MemRec, *int10MemPtr;
56
57typedef struct {
58 CARD8 save_msr;
59 CARD8 save_pos102;
60 CARD8 save_vse;
61 CARD8 save_46e8;
62} legacyVGARec, *legacyVGAPtr;
63
64typedef struct {
65 BusType bus;
66 union {
67 struct {
68 int bus;
69 int dev;
70 int func;
71 } pci;
72 int legacy;
73 } location;
74} xf86int10BiosLocation, *xf86int10BiosLocationPtr;
75
76/* OS dependent functions */
77xf86Int10InfoPtr xf86InitInt10(int entityIndex);
78xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex, int Flags);
79void xf86FreeInt10(xf86Int10InfoPtr pInt);
80void *xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off);
81void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num);
82pointer xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr);
83
84/* x86 executor related functions */
85void xf86ExecX86int10(xf86Int10InfoPtr pInt);
86
87#ifdef _INT10_PRIVATE
88
89#define I_S_DEFAULT_INT_VECT 0xFF065
90#define SYS_SIZE 0x100000
91#define SYS_BIOS 0xF0000
92#if 1
93#define BIOS_SIZE 0x10000
94#else /* a bug in DGUX requires this - let's try it */
95#define BIOS_SIZE (0x10000 - 1)
96#endif
97#define LOW_PAGE_SIZE 0x600
98#define V_RAM 0xA0000
99#define VRAM_SIZE 0x20000
100#define V_BIOS_SIZE 0x10000
101#define V_BIOS 0xC0000
102#define BIOS_SCRATCH_OFF 0x449
103#define BIOS_SCRATCH_END 0x466
104#define BIOS_SCRATCH_LEN (BIOS_SCRATCH_END - BIOS_SCRATCH_OFF + 1)
105#define HIGH_MEM V_BIOS
106#define HIGH_MEM_SIZE (SYS_BIOS - HIGH_MEM)
107#define SEG_ADR(type, seg, reg) type((seg << 4) + (X86_##reg))
108#define SEG_EADR(type, seg, reg) type((seg << 4) + (X86_E##reg))
109
110#define X86_TF_MASK 0x00000100
111#define X86_IF_MASK 0x00000200
112#define X86_IOPL_MASK 0x00003000
113#define X86_NT_MASK 0x00004000
114#define X86_VM_MASK 0x00020000
115#define X86_AC_MASK 0x00040000
116#define X86_VIF_MASK 0x00080000 /* virtual interrupt flag */
117#define X86_VIP_MASK 0x00100000 /* virtual interrupt pending */
118#define X86_ID_MASK 0x00200000
119
120#define MEM_RB(name, addr) (*name->mem->rb)(name, addr)
121#define MEM_RW(name, addr) (*name->mem->rw)(name, addr)
122#define MEM_RL(name, addr) (*name->mem->rl)(name, addr)
123#define MEM_WB(name, addr, val) (*name->mem->wb)(name, addr, val)
124#define MEM_WW(name, addr, val) (*name->mem->ww)(name, addr, val)
125#define MEM_WL(name, addr, val) (*name->mem->wl)(name, addr, val)
126
127/* OS dependent functions */
128Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
129/* x86 executor related functions */
130Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
131
132/* int.c */
133extern xf86Int10InfoPtr Int10Current;
134int int_handler(xf86Int10InfoPtr pInt);
135
136/* helper_exec.c */
137int setup_int(xf86Int10InfoPtr pInt);
138void finish_int(xf86Int10InfoPtr, int sig);
139CARD32 getIntVect(xf86Int10InfoPtr pInt, int num);
140void pushw(xf86Int10InfoPtr pInt, CARD16 val);
141int run_bios_int(int num, xf86Int10InfoPtr pInt);
142void dump_code(xf86Int10InfoPtr pInt);
143void dump_registers(xf86Int10InfoPtr pInt);
144void stack_trace(xf86Int10InfoPtr pInt);
145xf86Int10InfoPtr getInt10Rec(int entityIndex);
146CARD8 bios_checksum(CARD8 *start, int size);
147void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
148void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
149#if defined (_PC)
150void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save);
151#endif
152int port_rep_inb(xf86Int10InfoPtr pInt,
153 CARD16 port, CARD32 base, int d_f, CARD32 count);
154int port_rep_inw(xf86Int10InfoPtr pInt,
155 CARD16 port, CARD32 base, int d_f, CARD32 count);
156int port_rep_inl(xf86Int10InfoPtr pInt,
157 CARD16 port, CARD32 base, int d_f, CARD32 count);
158int port_rep_outb(xf86Int10InfoPtr pInt,
159 CARD16 port, CARD32 base, int d_f, CARD32 count);
160int port_rep_outw(xf86Int10InfoPtr pInt,
161 CARD16 port, CARD32 base, int d_f, CARD32 count);
162int port_rep_outl(xf86Int10InfoPtr pInt,
163 CARD16 port, CARD32 base, int d_f, CARD32 count);
164
165CARD8 x_inb(CARD16 port);
166CARD16 x_inw(CARD16 port);
167void x_outb(CARD16 port, CARD8 val);
168void x_outw(CARD16 port, CARD16 val);
169CARD32 x_inl(CARD16 port);
170void x_outl(CARD16 port, CARD32 val);
171
172CARD8 Mem_rb(CARD32 addr);
173CARD16 Mem_rw(CARD32 addr);
174CARD32 Mem_rl(CARD32 addr);
175void Mem_wb(CARD32 addr, CARD8 val);
176void Mem_ww(CARD32 addr, CARD16 val);
177void Mem_wl(CARD32 addr, CARD32 val);
178
179/* helper_mem.c */
180void setup_int_vect(xf86Int10InfoPtr pInt);
181int setup_system_bios(void *base_addr);
182void reset_int_vect(xf86Int10InfoPtr pInt);
183void set_return_trap(xf86Int10InfoPtr pInt);
184void * xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex);
185Bool int10skip(void* options);
186Bool int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem);
187Bool initPrimary(void* options);
188void xf86int10ParseBiosLocation(void* options,
189 xf86int10BiosLocationPtr bios);
190#ifdef DEBUG
191void dprint(unsigned long start, unsigned long size);
192#endif
193
194/* pci.c */
195int mapPciRom(int pciEntity, unsigned char *address);
196
197#endif /* _INT10_PRIVATE */
198#endif /* _XF86INT10_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette