Mercurial > mplayer.hg
annotate libdha/libdha.h @ 4211:2c1ca684ff04
zr en/disable, libjpeg detection - patch by Rik Snel <rsnel@cube.dyndns.org>
author | arpi |
---|---|
date | Thu, 17 Jan 2002 01:27:20 +0000 |
parents | fb092b45c9cc |
children | 5f74792b6d5e |
rev | line source |
---|---|
3973 | 1 /* |
2 libgha.h - Library for direct hardware access | |
3 Copyrights: | |
4 1996/10/27 - Robin Cutshaw (robin@xfree86.org) | |
5 XFree86 3.3.3 implementation | |
6 1999 - Øyvind Aabling. | |
7 Modified for GATOS/win/gfxdump. | |
8 2002 - library implementation by Nick Kurshev | |
9 | |
10 supported O/S's: SVR4, UnixWare, SCO, Solaris, | |
11 FreeBSD, NetBSD, 386BSD, BSDI BSD/386, | |
12 Linux, Mach/386, ISC | |
13 DOS (WATCOM 9.5 compiler), Win9x (with mapdev.vxd) | |
14 Licence: GPL | |
15 */ | |
16 #ifndef LIBDHA_H | |
17 #define LIBDHA_H | |
18 | |
19 #ifdef __cplusplus | |
20 extern "C" { | |
21 #endif | |
22 | |
23 #define MAX_DEV_PER_VENDOR_CFG1 64 | |
24 #define MAX_PCI_DEVICES_PER_BUS 32 | |
25 #define MAX_PCI_DEVICES 64 | |
26 #define PCI_MULTIFUNC_DEV 0x80 | |
27 | |
28 typedef struct pciinfo_s | |
29 { | |
4192 | 30 int bus,card,func; /* PCI/AGP bus:card:func */ |
31 unsigned short vendor,device; /* Card vendor+device ID */ | |
32 unsigned base0,base1,base2,baserom; /* Memory and I/O base addresses */ | |
3973 | 33 }pciinfo_t; |
34 | |
4174
4cfb6b9a6da3
api changed: enable/disable_os_io returns error-code (or zero if ok) and pciconfig_read exported for mga_vid
alex
parents:
3995
diff
changeset
|
35 /* needed for mga_vid */ |
4cfb6b9a6da3
api changed: enable/disable_os_io returns error-code (or zero if ok) and pciconfig_read exported for mga_vid
alex
parents:
3995
diff
changeset
|
36 extern int pci_config_read(unsigned char bus, unsigned char dev, unsigned char offset, |
4cfb6b9a6da3
api changed: enable/disable_os_io returns error-code (or zero if ok) and pciconfig_read exported for mga_vid
alex
parents:
3995
diff
changeset
|
37 int len, unsigned long *val); |
3973 | 38 /* Fill array pci_list which must have size MAX_PCI_DEVICES |
39 and return 0 if sucessful */ | |
40 extern int pci_scan(pciinfo_t *pci_list,unsigned *num_card); | |
41 | |
42 | |
4192 | 43 /* Enables/disables accessing to IO space from application side. |
44 Should return 0 if o'k or errno on error. */ | |
45 extern int enable_app_io( void ); | |
46 extern int disable_app_io( void ); | |
3973 | 47 |
3995 | 48 extern unsigned char INPORT8(unsigned idx); |
49 extern unsigned short INPORT16(unsigned idx); | |
50 extern unsigned INPORT32(unsigned idx); | |
51 #define INPORT(idx) INPORT32(idx) | |
52 extern void OUTPORT8(unsigned idx,unsigned char val); | |
53 extern void OUTPORT16(unsigned idx,unsigned short val); | |
54 extern void OUTPORT32(unsigned idx,unsigned val); | |
55 #define OUTPORT(idx,val) OUTPORT32(idx,val) | |
3973 | 56 |
57 extern void * map_phys_mem(unsigned base, unsigned size); | |
58 extern void unmap_phys_mem(void *ptr, unsigned size); | |
59 | |
60 #ifdef __cplusplus | |
61 } | |
62 #endif | |
63 | |
64 #endif |