Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / hidds / nouveau / pci-device-mock / pcimockhardware_intern.h
blobd1b1c82f626c5c2a0bfd1a3a6c6bc9416414fab3
1 #ifndef PCIMOCKHARDWARE_INTERN_H
2 #define PCIMOCKHARDWARE_INTERN_H
4 /*
5 Copyright 2011, The AROS Development Team. All rights reserved.
6 $Id$
7 */
9 #include <exec/types.h>
11 #define PCI_BAR0 0
12 #define PCI_BAR1 1
13 #define PCI_BAR2 2
14 #define PCI_BAR3 3
15 #define PCI_BAR4 4
16 #define PCI_BAR5 5
17 #define PCI_CONFIG_SPACE 6
18 #define PCI_ROM 7
19 #define PCI_REGIONS_COUNT 8
21 struct AddressSpaceRegion
23 ULONG Size;
24 IPTR Address;
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) \
37 { \
38 hwdata->Regions[n].Size = size; \
39 hwdata->Regions[n].Address = (IPTR)AllocVec(size, MEMF_ANY | MEMF_CLEAR); \
40 } \
42 #define ALLOC_ASR_NULL(hwdata, n) \
43 { \
44 hwdata->Regions[n].Size = 0; \
45 hwdata->Regions[n].Address = (IPTR)NULL; \
46 } \
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) \
58 { \
59 ULONG val = ((nextcapaddr + 4) << 8) | pcicap; \
60 SET_ASR_DWORD(hwdata, PCI_CONFIG_SPACE, nextcapaddr, val); \
61 nextcapaddr += 4; \
62 } \
65 struct RegionAndOffset
67 LONG Region;
68 IPTR Offset;
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 */