Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4220 → Rev 4221

/branches/dd/uspace/srv/pci/libpci/i386-ports.c
14,9 → 14,12
 
#include "internal.h"
 
#define PCI_CONF1 0xcf8
#define PCI_CONF1_SIZE 8
 
 
static void conf12_init(struct pci_access *a)
{
{
}
 
static void conf12_cleanup(struct pci_access *a UNUSED)
70,6 → 73,14
{
unsigned int tmp;
int res = 0;
/*
* Gain control over PCI configuration ports.
*/
void * addr;
if (pio_enable((void *)PCI_CONF1, PCI_CONF1_SIZE, &addr)) {
return 0;
}
 
pio_write_8(0xCFB, 0x01);
tmp = pio_read_32(0xCF8);
142,6 → 153,17
 
static int conf2_detect(struct pci_access *a)
{
/*
* Gain control over PCI configuration ports.
*/
void * addr;
if (pio_enable((void *)PCI_CONF1, PCI_CONF1_SIZE, &addr)) {
return 0;
}
if (pio_enable((void *)0xC000, 0x1000, &addr)) {
return 0;
}
/* This is ugly and tends to produce false positives. Beware. */
pio_write_8(0xCFB, 0x00);
pio_write_8(0xCF8, 0x00);
178,7 → 200,7
pio_write_8(0xcf8, 0);
return pci_generic_block_read(d, pos, buf, len);
}
pio_write_8((void *)0xcf8, 0);
pio_write_8(0xcf8, 0);
return 1;
}