1 #ifndef PCIMOCKHARDWARE_INTERN_H
2 #define PCIMOCKHARDWARE_INTERN_H
5 Copyright 2011, The AROS Development Team. All rights reserved.
9 #include <exec/types.h>
17 #define PCI_CONFIG_SPACE 6
19 #define PCI_REGIONS_COUNT 8
21 struct AddressSpaceRegion
27 struct HIDDPCIMockHardwareData
29 struct AddressSpaceRegion Regions
[PCI_REGIONS_COUNT
];
33 #define GET_PCIMOCKHWDATA \
34 struct HIDDPCIMockHardwareData * hwdata = OOP_INST_DATA((SD(cl))->pciMockHardwareClass, o);
36 #define ALLOC_ASR(hwdata, n, size) \
38 hwdata->Regions[n].Size = size; \
39 hwdata->Regions[n].Address = (IPTR)AllocVec(size, MEMF_ANY | MEMF_CLEAR); \
42 #define ALLOC_ASR_NULL(hwdata, n) \
44 hwdata->Regions[n].Size = 0; \
45 hwdata->Regions[n].Address = (IPTR)NULL; \
48 #define SET_ASR_DWORD(hwdata, n, address, value) \
49 *((ULONG *)(hwdata->Regions[n].Address + address)) = value;
51 #define GET_ASR_DWORD(hwdata, n, address) \
52 *((ULONG *)(hwdata->Regions[n].Address + address))
54 #define DEF_NEXTCAPADDR \
55 ULONG nextcapaddr = 0x80; \
57 #define ADD_PCI_CAP(hwdata, pcicap) \
59 ULONG val = ((nextcapaddr + 4) << 8) | pcicap; \
60 SET_ASR_DWORD(hwdata, PCI_CONFIG_SPACE, nextcapaddr, val); \
65 struct RegionAndOffset
71 struct RegionAndOffset
HIDDPCIMockHardwareDetectRegionAndOffset(struct HIDDPCIMockHardwareData
* hwdata
, IPTR address
);
73 /* Emulated hardware */
75 #define CLID_Hidd_PCIMockHardware_NV44A "hidd.pcimockhardware.nv44a"
77 struct HIDDNV44AMockHardwareData
81 #define CLID_Hidd_PCIMockHardware_NVG86 "hidd.pcimockhardware.nvg86"
83 struct HIDDNVG86MockHardwareData
87 #define CLID_Hidd_PCIMockHardware_NVGTS250 "hidd.pcimockhardware.nvgts250"
89 struct HIDDNVGTS250MockHardwareData
93 #define CLID_Hidd_PCIMockHardware_NVGF100 "hidd.pcimockhardware.nvgf100"
95 struct HIDDNVGF100MockHardwareData
99 #define CLID_Hidd_PCIMockHardware_SIS661FX "hidd.pcimockhardware.sis661fx"
101 struct HIDDSIS661FXMockHardwareData
105 #endif /* PCIMOCKHARDWARE_INTERN_H */