unsigned short ioaddr1,ioaddr2;
unsigned int memaddr1,memaddr2;
unsigned int iobase,ioa;
void getbaseaddr(char bus,char device);
{
iobase=0x80000000+bus*0x10000+(device*8)*0x100;
ioa=iobase+0x10;/*寻址基地址寄存器0*/
_outpd(0xcf8,ioa);
ioaddr1=(unsigned short)_inpd(0xcfc)&0xfffc;
/*屏蔽低两位和高16位*/
ioa=iobase+0x14; /*寻址基地址寄存器1*/
_outpd(0xcf8,ioa);
ioaddr2=(unsigned short)_inpd(0xcfc)&0xfffc;
ioa=iobase+0x18;/*寻址基地寄存器2*/
_outpd(0xcf8,ioa);
memaddr1=_inpd(0xcfc) & 0xfffffff0;
/*屏蔽低4位*/
ioa=iobase+0x1c; /*寻址基地址寄存器3*/
_outpd(0xcf8,ioa);
memaddr2=_inpd(0xcfc) & 0xfffffff0;
}