Mercurial > mplayer.hg
annotate vidix/sysdep/pci_x86.c @ 34234:4ec96d5d2e4c
build: drop releaseclean target
The target is supposed to remove files that are created during the XML build
process without removing the generated documentation. Unfortunately, it does
not work as expected and is not worth the extra complication.
author | diego |
---|---|
date | Mon, 07 Nov 2011 19:54:38 +0000 |
parents | 0f1b5b68af32 |
children |
rev | line source |
---|---|
4164 | 1 /* |
2 This file is based on: | |
3 $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.c,v 3.34.2.17 1998/11/10 11:55:40 dawes Exp $ | |
4 Modified for readability by Nick Kurshev | |
5 */ | |
6 | |
7 static int pci_config_type( void ) | |
8 { | |
9 unsigned long tmplong1, tmplong2; | |
10 unsigned char tmp1, tmp2; | |
11 int retval; | |
12 retval = 0; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
22900
diff
changeset
|
13 |
4164 | 14 outb(PCI_MODE2_ENABLE_REG, 0x00); |
15 outb(PCI_MODE2_FORWARD_REG, 0x00); | |
16 tmp1 = inb(PCI_MODE2_ENABLE_REG); | |
17 tmp2 = inb(PCI_MODE2_FORWARD_REG); | |
18 if ((tmp1 == 0x00) && (tmp2 == 0x00)) { | |
19 retval = 2; | |
20 /*printf("PCI says configuration type 2\n");*/ | |
21 } else { | |
22 tmplong1 = inl(PCI_MODE1_ADDRESS_REG); | |
23 outl(PCI_MODE1_ADDRESS_REG, PCI_EN); | |
24 tmplong2 = inl(PCI_MODE1_ADDRESS_REG); | |
25 outl(PCI_MODE1_ADDRESS_REG, tmplong1); | |
26 if (tmplong2 == PCI_EN) { | |
27 retval = 1; | |
28 /*printf("PCI says configuration type 1\n");*/ | |
29 } else { | |
30 /*printf("No PCI !\n");*/ | |
31 disable_os_io(); | |
32 /*exit(1);*/ | |
33 retval = 0xFFFF; | |
34 } | |
35 } | |
36 return retval; | |
37 } | |
38 | |
39 static int pci_get_vendor( | |
40 unsigned char bus, | |
41 unsigned char dev, | |
42 int func) | |
43 { | |
44 unsigned long config_cmd; | |
45 config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8); | |
46 outl(PCI_MODE1_ADDRESS_REG, config_cmd); | |
47 return inl(PCI_MODE1_DATA_REG); | |
48 } | |
49 | |
50 static long pci_config_read_long( | |
51 unsigned char bus, | |
52 unsigned char dev, | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
22900
diff
changeset
|
53 int func, |
4164 | 54 unsigned cmd) |
55 { | |
56 unsigned long config_cmd; | |
57 config_cmd = PCI_EN | (bus<<16) | (dev<<11) | (func<<8); | |
58 outl(PCI_MODE1_ADDRESS_REG, config_cmd | cmd); | |
59 return inl(PCI_MODE1_DATA_REG); | |
60 } |