annotate libdha/libdha.h @ 7166:814ad5474529

ignore .libdeps
author rfelker
date Fri, 30 Aug 2002 13:53:32 +0000
parents 567de708ab3a
children f6d2772efca3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3973
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
1 /*
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
2 libgha.h - Library for direct hardware access
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
3 Copyrights:
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
4 1996/10/27 - Robin Cutshaw (robin@xfree86.org)
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
5 XFree86 3.3.3 implementation
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
6 1999 - Øyvind Aabling.
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
7 Modified for GATOS/win/gfxdump.
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
8 2002 - library implementation by Nick Kurshev
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
9
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
10 supported O/S's: SVR4, UnixWare, SCO, Solaris,
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
11 FreeBSD, NetBSD, 386BSD, BSDI BSD/386,
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
12 Linux, Mach/386, ISC
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
13 DOS (WATCOM 9.5 compiler), Win9x (with mapdev.vxd)
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
14 Licence: GPL
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
15 */
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
16 #ifndef LIBDHA_H
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
17 #define LIBDHA_H
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
18
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
19 #ifdef __cplusplus
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
20 extern "C" {
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
21 #endif
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
22
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
23 #define MAX_DEV_PER_VENDOR_CFG1 64
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
24 #define MAX_PCI_DEVICES_PER_BUS 32
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
25 #define MAX_PCI_DEVICES 64
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
26 #define PCI_MULTIFUNC_DEV 0x80
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
27
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
28 typedef struct pciinfo_s
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
29 {
4192
fb092b45c9cc en(dis)able app io should be exported too
nick
parents: 4174
diff changeset
30 int bus,card,func; /* PCI/AGP bus:card:func */
fb092b45c9cc en(dis)able app io should be exported too
nick
parents: 4174
diff changeset
31 unsigned short vendor,device; /* Card vendor+device ID */
fb092b45c9cc en(dis)able app io should be exported too
nick
parents: 4174
diff changeset
32 unsigned base0,base1,base2,baserom; /* Memory and I/O base addresses */
4277
5f74792b6d5e pci_config_read working
alex
parents: 4192
diff changeset
33 // unsigned base0_limit, base1_limit, base2_limit, baserom_limit;
3973
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
34 }pciinfo_t;
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
35
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
36 /* needed for mga_vid */
4277
5f74792b6d5e pci_config_read working
alex
parents: 4192
diff changeset
37 extern int pci_config_read(unsigned char bus, unsigned char dev, unsigned char func,
5f74792b6d5e pci_config_read working
alex
parents: 4192
diff changeset
38 unsigned char cmd, int len, unsigned long *val);
3973
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
39 /* Fill array pci_list which must have size MAX_PCI_DEVICES
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
40 and return 0 if sucessful */
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
41 extern int pci_scan(pciinfo_t *pci_list,unsigned *num_card);
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
42
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
43
4192
fb092b45c9cc en(dis)able app io should be exported too
nick
parents: 4174
diff changeset
44 /* Enables/disables accessing to IO space from application side.
fb092b45c9cc en(dis)able app io should be exported too
nick
parents: 4174
diff changeset
45 Should return 0 if o'k or errno on error. */
fb092b45c9cc en(dis)able app io should be exported too
nick
parents: 4174
diff changeset
46 extern int enable_app_io( void );
fb092b45c9cc en(dis)able app io should be exported too
nick
parents: 4174
diff changeset
47 extern int disable_app_io( void );
3973
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
48
3995
0d9de811e312 minor interface changing
nick
parents: 3973
diff changeset
49 extern unsigned char INPORT8(unsigned idx);
0d9de811e312 minor interface changing
nick
parents: 3973
diff changeset
50 extern unsigned short INPORT16(unsigned idx);
0d9de811e312 minor interface changing
nick
parents: 3973
diff changeset
51 extern unsigned INPORT32(unsigned idx);
0d9de811e312 minor interface changing
nick
parents: 3973
diff changeset
52 #define INPORT(idx) INPORT32(idx)
0d9de811e312 minor interface changing
nick
parents: 3973
diff changeset
53 extern void OUTPORT8(unsigned idx,unsigned char val);
0d9de811e312 minor interface changing
nick
parents: 3973
diff changeset
54 extern void OUTPORT16(unsigned idx,unsigned short val);
0d9de811e312 minor interface changing
nick
parents: 3973
diff changeset
55 extern void OUTPORT32(unsigned idx,unsigned val);
0d9de811e312 minor interface changing
nick
parents: 3973
diff changeset
56 #define OUTPORT(idx,val) OUTPORT32(idx,val)
3973
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
57
5702
567de708ab3a sync with mplayerxp
nick
parents: 4476
diff changeset
58 extern void * map_phys_mem(unsigned long base, unsigned long size);
567de708ab3a sync with mplayerxp
nick
parents: 4476
diff changeset
59 extern void unmap_phys_mem(void *ptr, unsigned long size);
3973
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
60
4476
0d9a096cfd46 MTRR configuring
nick
parents: 4277
diff changeset
61 /* These are the region types */
0d9a096cfd46 MTRR configuring
nick
parents: 4277
diff changeset
62 #define MTRR_TYPE_UNCACHABLE 0
0d9a096cfd46 MTRR configuring
nick
parents: 4277
diff changeset
63 #define MTRR_TYPE_WRCOMB 1
0d9a096cfd46 MTRR configuring
nick
parents: 4277
diff changeset
64 #define MTRR_TYPE_WRTHROUGH 4
0d9a096cfd46 MTRR configuring
nick
parents: 4277
diff changeset
65 #define MTRR_TYPE_WRPROT 5
0d9a096cfd46 MTRR configuring
nick
parents: 4277
diff changeset
66 #define MTRR_TYPE_WRBACK 6
0d9a096cfd46 MTRR configuring
nick
parents: 4277
diff changeset
67 extern int mtrr_set_type(unsigned base,unsigned size,int type);
0d9a096cfd46 MTRR configuring
nick
parents: 4277
diff changeset
68
3973
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
69 #ifdef __cplusplus
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
70 }
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
71 #endif
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
72
5702
567de708ab3a sync with mplayerxp
nick
parents: 4476
diff changeset
73 #endif