tstDeviceStructSizeRC.cpp revision 9b5a120b694c2603a7a3dccbd6cc519164943b17
199767f8919635c4928607450d9e0abb932109ceToomas Soome * tstDeviceStructSizeGC - Generate structure member and size checks from the GC perspective.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * This is built using the VBOXGC template but linked into a host
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ring-3 executable, rather hacky.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright (C) 2006-2008 Sun Microsystems, Inc.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * This file is part of VirtualBox Open Source Edition (OSE), as
199767f8919635c4928607450d9e0abb932109ceToomas Soome * available from http://www.virtualbox.org. This file is free software;
199767f8919635c4928607450d9e0abb932109ceToomas Soome * you can redistribute it and/or modify it under the terms of the GNU
199767f8919635c4928607450d9e0abb932109ceToomas Soome * General Public License (GPL) as published by the Free Software
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Foundation, in version 2 as it comes in the "COPYING" file of the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Clara, CA 95054 USA or visit http://www.sun.com if you need
199767f8919635c4928607450d9e0abb932109ceToomas Soome * additional information or have any questions.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Sanity checks.
199767f8919635c4928607450d9e0abb932109ceToomas Soome/*******************************************************************************
199767f8919635c4928607450d9e0abb932109ceToomas Soome* Header Files *
199767f8919635c4928607450d9e0abb932109ceToomas Soome*******************************************************************************/
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include "../Bus/DevPCI.cpp" /* must be first! */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/*#undef LOG_GROUP
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* we don't use iprt here because we're pretending to be in GC! */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define GEN_CHECK_SIZE(s) printf(" CHECK_SIZE(%s, %d);\n", #s, (int)sizeof(s))
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define GEN_CHECK_OFF(s, m) printf(" CHECK_OFF(%s, %d, %s);\n", #s, (int)RT_OFFSETOF(s, m), #m)
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define GEN_CHECK_PADDING(s, m, a) printf(" CHECK_PADDING(%s, %s, %u);\n", #s, #m, (a))
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIDEVICE, Int.s.aIORegions[PCI_NUM_REGIONS - 1]);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIDEVICE, Int.s.aIORegions[0].addr);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIDEVICE, Int.s.aIORegions[0].size);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIDEVICE, Int.s.aIORegions[0].type);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIDEVICE, Int.s.aIORegions[0].padding);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIDEVICE, Int.s.pfnConfigWrite);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIDEVICE, Int.s.fRequestedDevFn);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIDEVICE, Int.s.fPciToPciBridge);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIDEVICE, Int.s.pfnBridgeConfigRead);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIDEVICE, Int.s.pfnBridgeConfigWrite);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIGLOBALS, pci_apic_irq_levels);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(PCIGLOBALS, pci_apic_irq_levels[1]);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(VGASTATE, vbe_regs[VBE_DISPI_INDEX_NB - 1]);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(VGASTATE, invalidated_y_table[1]);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(VGASTATE, invalidated_y_table[(VGA_MAX_HEIGHT / 32) - 1]);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(VGASTATE, last_ch_attr[CH_ATTR_SIZE - 1]);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(VGASTATE, cMilliesRefreshInterval);
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(VGASTATE, au32DirtyBitmap[(VGA_VRAM_MAX / PAGE_SIZE / 32) - 1]);
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(VBOX_WITH_HGSMI) && defined(VBOX_WITH_VIDEOHWACCEL)
199767f8919635c4928607450d9e0abb932109ceToomas Soome GEN_CHECK_OFF(VGASTATE, cbWriteVBEExtraAddress);
/* Network/DevPCNet.cpp */
#ifndef PCNET_NO_POLLING
#ifdef PCNET_NO_POLLING
#ifdef VBOX_WITH_STATISTICS
# ifdef PCNET_NO_POLLING
/* PC/DevACPI.cpp */
/* PC/DevPIC.cpp */
#ifdef VBOX_WITH_STATISTICS
/* PC/DevPit-i8254.cpp */
/* PC/DevRTC.cpp */
#ifdef VBOX_WITH_STATISTICS
#ifdef VBOX_WITH_STATISTICS
#ifdef VBOX_WITH_STATISTICS
/* Storage/DevATA.cpp */
#ifdef VBOX_WITH_USB
/* USB/DevOHCI.cpp */
# ifdef VBOX_WITH_STATISTICS
/* USB/DevEHCI.cpp */
# ifdef VBOX_WITH_STATISTICS
/* VMMDev/VBoxDev.cpp */
/* Parallel/DevParallel.cpp */
/* Serial/DevSerial.cpp */
#ifdef VBOX_WITH_AHCI
/* Storage/ATAController.h */
/* Storage/DevAHCI.cpp */
#ifdef VBOX_WITH_STATISTICS
GEN_CHECK_OFF(AHCIPort, szSerialNumber[AHCI_SERIAL_NUMBER_LENGTH]); /* One additional byte for the termination.*/
GEN_CHECK_OFF(AHCIPort, szFirmwareRevision[AHCI_FIRMWARE_REVISION_LENGTH]); /* One additional byte for the termination.*/
GEN_CHECK_OFF(AHCIPort, szModelNumber[AHCI_MODEL_NUMBER_LENGTH]); /* One additional byte for the termination.*/
#ifdef VBOX_WITH_E1000
#ifndef E1K_GLOBAL_MUTEX
#ifdef VBOX_WITH_VIRTIO
#ifdef VNET_TX_DELAY
#ifdef VBOX_WITH_SCSI
#ifdef VBOX_WITH_BUSLOGIC
#ifdef VBOX_WITH_LSILOGIC
#ifdef VBOX_WITH_HPET