tstDeviceStructSizeGC.cpp revision e840b5c2558687c721a6a08a7e7fee7eaf63c867
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * tstDeviceStructSizeGC - Generate structure member and size checks from the GC perspective.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This is built using the VBOXGC template but linked into a host
cce0c6096dee0c5353bb74431dc47b05f87a1c6dvboxsync * ring-3 executable, rather hacky.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Copyright (C) 2006-2008 Sun Microsystems, Inc.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * available from http://www.virtualbox.org. This file is free software;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * you can redistribute it and/or modify it under the terms of the GNU
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * General Public License (GPL) as published by the Free Software
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * additional information or have any questions.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Sanity checks.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/*******************************************************************************
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync* Header Files *
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync*******************************************************************************/
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#include "../PC/DevPIC.cpp"
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#include "../PC/DevRTC.cpp"
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# include "../USB/DevOHCI.cpp"
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# include "../USB/DevEHCI.cpp"
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/*#undef LOG_GROUP
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#include "../VMMDev/VBoxDev.cpp"*/
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/* we don't use iprt here because we're pretending to be in GC! */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define GEN_CHECK_SIZE(s) printf(" CHECK_SIZE(%s, %d);\n", #s, (int)sizeof(s))
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define GEN_CHECK_OFF(s, m) printf(" CHECK_OFF(%s, %d, %s);\n", #s, (int)RT_OFFSETOF(s, m), #m)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define GEN_CHECK_PADDING(s, m) printf(" CHECK_PADDING(%s, %s);\n", #s, #m)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(PCIDEVICE, Int.s.aIORegions[PCI_NUM_REGIONS - 1]);
968c867cc19737e4e1fd97c396fcf75a3d52dd27vboxsync GEN_CHECK_OFF(PCIDEVICE, Int.s.aIORegions[0].addr);
b84a3f2aac9529d5c5840512b12d81bc62d0e665vboxsync GEN_CHECK_OFF(PCIDEVICE, Int.s.aIORegions[0].size);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(PCIDEVICE, Int.s.aIORegions[0].type);
fb9af443dbf06990f4956d683286ddce29c4dca6vboxsync GEN_CHECK_OFF(PCIDEVICE, Int.s.aIORegions[0].padding);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(PCIDEVICE, Int.s.pfnBridgeConfigRead);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(PCIDEVICE, Int.s.pfnBridgeConfigWrite);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(VGASTATE, vbe_regs[VBE_DISPI_INDEX_NB - 1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(VGASTATE, invalidated_y_table[(VGA_MAX_HEIGHT / 32) - 1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(VGASTATE, last_ch_attr[CH_ATTR_SIZE - 1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(VGASTATE, au32DirtyBitmap[(VGA_VRAM_MAX / PAGE_SIZE / 32) - 1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(PCNetState, pfnEMInterpretInstructionGC
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(PCNetState, pfnEMInterpretInstructionR0
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(PCNetState, StatRingWriteOutsideRangeGC);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(PicState, special_fully_nested_mode);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(PITChannelState, next_transition_time);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync// GEN_CHECK_OFF(PITState, dummy_refresh_clock);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(IOAPICState, ioredtbl[IOAPIC_NUM_PINS - 1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(ATADevState, PCHSGeometry.cCylinders);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(ATADevState, aATAPICmd[ATAPI_PACKET_SIZE - 1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(ATADevState, abATAPISense[ATAPI_SENSE_SIZE - 1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(ATADevState, szSerialNumber[ATA_SERIAL_NUMBER_LENGTH]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(ATADevState, szFirmwareRevision[ATA_FIRMWARE_REVISION_LENGTH]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(ATADevState, szModelNumber[ATA_MODEL_NUMBER_LENGTH]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(ATATransferRequest, cbTotalTransfer);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync //GEN_CHECK_OFF(OHCI, dqic:3);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync //GEN_CHECK_OFF(OHCI, fno:1);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync //GEN_CHECK_OFF(OHCI, fsmps:15);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync //GEN_CHECK_OFF(OHCI, fit:1);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync //GEN_CHECK_OFF(OHCI, fi:14);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync //GEN_CHECK_OFF(OHCI, frt:1);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif /* VBOX_WITH_USB */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(ParallelState, pDrvHostParallelConnector);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(ParallelState, reg_ecp_base_plus_400h);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATADevState, PCHSGeometry.cCylinders);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATADevState, PCHSGeometry.cHeads);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATADevState, PCHSGeometry.cSectors);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATADevState, cbElementaryTransfer);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATADevState, iIOBufferPIODataStart);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATADevState, iIOBufferPIODataEnd);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATADevState, aATAPICmd[ATAPI_PACKET_SIZE - 1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATADevState, abATAPISense[ATAPI_SENSE_SIZE - 1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATADevState, cNotifiedMediaChange);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATATransferRequest, iBeginTransfer);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATATransferRequest, iSourceSink);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATATransferRequest, cbTotalTransfer);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATACONTROLLER, fChainedTransfer);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATACONTROLLER, fRedoDMALastDesc);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATACONTROLLER, aAsyncIORequests[4]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATACONTROLLER, AsyncIORequestMutex);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATACONTROLLER, StatAsyncMinWait);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIATACONTROLLER, StatAsyncMaxWait);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIPort, ahciIOTasks[2*AHCI_NR_COMMAND_SLOTS-1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIPort, StatProfileDestroyScatterGatherList);
1167f682bad8a5c086022e181da3bb4028a20ff8vboxsync GEN_CHECK_OFF(AHCIPort, szSerialNumber[AHCI_SERIAL_NUMBER_LENGTH]); /* One additional byte for the termination.*/
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIPort, szFirmwareRevision[AHCI_FIRMWARE_REVISION_LENGTH]); /* One additional byte for the termination.*/
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCIPort, szModelNumber[AHCI_MODEL_NUMBER_LENGTH]); /* One additional byte for the termination.*/
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCI, ahciPort[AHCI_MAX_NR_PORTS_IMPL-1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(AHCI, f8ByteMMIO4BytesWrittenSuccessfully);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif /* VBOX_WITH_AHCI */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(E1KSTATE, auRegs[E1K_NUM_OF_32BIT_REGS]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(E1KSTATE, aTxPacket[E1K_MAX_TX_PKT_SIZE]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif /* VBOX_WITH_E1000 */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(BUSLOGICDEVICE, cOutstandingRequests);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(BUSLOGIC, aCommandBuffer[BUSLOGIC_COMMAND_SIZE_MAX]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(BUSLOGIC, aReplyBuffer[BUSLOGIC_REPLY_SIZE_MAX]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(BUSLOGIC, GCPhysAddrMailboxOutgoingBase);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(BUSLOGIC, uMailboxOutgoingPositionCurrent);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(BUSLOGIC, GCPhysAddrMailboxIncomingBase);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(BUSLOGIC, uMailboxIncomingPositionCurrent);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(BUSLOGIC, aDeviceStates[BUSLOGIC_MAX_DEVICES-1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif /* VBOX_WITH_BUSLOGIC */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICDEVICE, cOutstandingRequests);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, fEventNotificationEnabled);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, aDeviceStates[LSILOGIC_DEVICES_MAX-1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, aMessage[sizeof(MptConfigurationRequest)-1]);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, u32SenseBufferHighAddr);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, ReplyPostQueueCritSect);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, ReplyFreeQueueCritSect);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, pReplyFreeQueueBaseR3);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, pReplyPostQueueBaseR3);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, pReplyFreeQueueBaseR0);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, pReplyPostQueueBaseR0);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, pReplyFreeQueueBaseRC);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, pReplyPostQueueBaseRC);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, uReplyFreeQueueNextEntryFreeWrite);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, uReplyFreeQueueNextAddressRead);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, uReplyPostQueueNextEntryFreeWrite);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, uReplyPostQueueNextAddressRead);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, uRequestQueueNextEntryFreeWrite);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync GEN_CHECK_OFF(LSILOGICSCSI, uRequestQueueNextAddressRead);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif /* VBOX_WITH_LSILOGIC */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync return (0);