revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-pc / hidds / pcipc / pciconf1.c
blob959c03e2a73f32df614ab9ce64d4cef407262c9b
1 /*
2 Copyright © 2004-2017, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: PCI configuration mechanism 1 access functions
6 Lang: English
7 */
9 #include <asm/io.h>
10 #include <proto/exec.h>
12 #include "pci.h"
14 #define CFGADD(bus,dev,func,reg) \
15 ( 0x80000000 | ((bus)<<16) | \
16 ((dev)<<11) | ((func)<<8) | ((reg)&~3))
18 ULONG ReadConfig1Long(UBYTE bus, UBYTE dev, UBYTE sub, UWORD reg)
20 ULONG temp;
22 Disable();
23 outl(CFGADD(bus, dev, sub, reg),PCI_AddressPort);
24 temp=inl(PCI_DataPort);
25 Enable();
27 return temp;
30 void WriteConfig1Long(UBYTE bus, UBYTE dev, UBYTE sub, UWORD reg, ULONG val)
32 Disable();
34 outl(CFGADD(bus, dev, sub, reg),PCI_AddressPort);
35 outl(val,PCI_DataPort);
37 Enable();