diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-01-15 15:59:53 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-01-15 15:59:53 +0000 |
commit | 340400036662ae41b230653e07a3aa4466010e3b (patch) | |
tree | 1088d724d0e60bc0dd2ccd637c585f43edacad0d /libdha/pci.c | |
parent | 2c7c5d325bcf50863f91a8c80aaa709d13ddb944 (diff) | |
download | mpv-340400036662ae41b230653e07a3aa4466010e3b.tar.bz2 mpv-340400036662ae41b230653e07a3aa4466010e3b.tar.xz |
api changed: enable/disable_os_io returns error-code (or zero if ok) and pciconfig_read exported for mga_vid
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4175 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libdha/pci.c')
-rw-r--r-- | libdha/pci.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/libdha/pci.c b/libdha/pci.c index e026ac5b87..bb40fe14e5 100644 --- a/libdha/pci.c +++ b/libdha/pci.c @@ -122,7 +122,7 @@ static swapl(unsigned long val) #define PCIBIOS_DEVICE_NOT_FOUND 0x86 #define PCIBIOS_SUCCESSFUL 0x00 -static int pciconfig_read( +int pciconfig_read( unsigned char bus, unsigned char dev, unsigned char offset, @@ -144,7 +144,7 @@ static int pciconfig_read( return PCIBIOS_SUCCESSFUL; } -static int pciconfig_write( +int pciconfig_write( unsigned char bus, unsigned char dev, unsigned char offset, @@ -528,10 +528,13 @@ int pci_scan(pciinfo_t *pci_list,unsigned *num_pci) struct pci_config_reg pcr; int do_mode1_scan = 0, do_mode2_scan = 0; int func, hostbridges=0; + int ret = -1; pci_lst = pci_list; - enable_os_io(); + ret = enable_os_io(); + if (ret != 0) + return(ret); if((pcr._configtype = pci_config_type()) == 0xFFFF) return ENODEV; @@ -695,3 +698,25 @@ int pci_scan(pciinfo_t *pci_list,unsigned *num_pci) return 0 ; } + +#if !defined(ENOTSUP) +#if defined(EOPNOTSUPP) +#define ENOTSUP EOPNOTSUPP +#else +#warning "ENOTSUP nor EOPNOTSUPP defined!" +#endif +#endif + +int pci_config_read(unsigned char bus, unsigned char dev, + unsigned char offset, int len, unsigned long *val) +{ + if (len != 4) + { + printf("pci_config_read: reading non-dword not supported!\n"); + return(ENOTSUP); + } + + *val = pci_config_read_long(bus, dev, offset, 0); + + return(0); +} |