Kernel - More work on ARM port
[tpg/acess2.git] / Kernel / arch / arm7 / pci.c
1 /*
2  *
3  */
4 #include <acess.h>
5
6 // === PROTOTYPES ===
7 #if 1
8 void    PCI_CfgWriteDWord(Uint16 bus, Uint16 dev, Uint16 func, Uint16 offset, Uint32 data);
9 Uint32  PCI_CfgReadDWord(Uint16 bus, Uint16 dev, Uint16 func, Uint16 offset);
10 Uint16  PCI_CfgReadWord(Uint16 bus, Uint16 dev, Uint16 func, Uint16 offset);
11 Uint8   PCI_CfgReadByte(Uint16 bus, Uint16 dev, Uint16 func, Uint16 offset);
12 #endif
13
14 // === CODE ===
15 void PCI_CfgWriteDWord(Uint16 bus, Uint16 dev, Uint16 func, Uint16 offset, Uint32 data)
16 {
17         // TODO: Use PCI_ADDRESS constant
18 }
19
20 Uint32 PCI_CfgReadDWord(Uint16 bus, Uint16 dev, Uint16 func, Uint16 offset)
21 {
22         // TODO: Locate PCI base and read/write data
23         return 0;
24 }
25
26 Uint16 PCI_CfgReadWord(Uint16 bus, Uint16 dev, Uint16 func, Uint16 offset)
27 {
28         return PCI_CfgReadDWord(bus, dev, func, offset & ~3) >> (8*(offset&2));
29 }
30
31 Uint8 PCI_CfgReadByte(Uint16 bus, Uint16 dev, Uint16 func, Uint16 offset)
32 {
33         return PCI_CfgReadDWord(bus, dev, func, offset & ~3) >> (8*(offset&3));
34 }

UCC git Repository :: git.ucc.asn.au