Kernel - Added a (slightly hacky) virtual PCI interface
[tpg/acess2.git] / KernelLand / Kernel / include / virtual_pci.h
1 /*
2  * Acess2 Kernel
3  * - By John Hodge (thePowersGang)
4  * 
5  * virtual_pci.h
6  * - Virtual PCI bus definitions
7  */
8 #ifndef _VIRTUAL_PCI_H_
9 #define _VIRTUAL_PCI_H_
10 #include <acess.h>
11
12 typedef struct sVPCI_Device     tVPCI_Device;
13
14 struct sVPCI_Device
15 {
16         void    *Ptr;
17
18         // Vendor/Device is defined at runtime as 0x0ACE:0x[ARCH][ARCH][IDX][IDX]
19         Uint16  Vendor;
20         Uint16  Device;
21         // Class code (Class, Subclass, Programming Interface, Revision)
22         Uint32  Class;
23         
24         Uint32  BARs[6];
25         Uint8   IRQ;
26         
27         /**
28          * \param Ptr   Value in sVPCI_Device.Ptr
29          * \param Data  Data to write to the specified address
30          */
31         void    (*Write)(void *Ptr, Uint8 DWord, Uint32 Data);
32         Uint32  (*Read)(void *Ptr, Uint8 DWord);
33 };
34
35 extern int      giVPCI_DeviceCount;
36 extern tVPCI_Device     gaVPCI_Devices[];
37
38 extern Uint32   VPCI_Read(tVPCI_Device *Dev, Uint8 Offset, Uint8 Size);
39 extern void     VPCI_Write(tVPCI_Device *Dev, Uint8 Offset, Uint8 Size, Uint32 Data);
40 #endif
41

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