VMMDevTesting.h revision c36d095531b5355dba93be3b9b862bac18148109
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/* $Id$ */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/** @file
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync * VMMDev - Testing Extensions.
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/*
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync * Copyright (C) 2010 Oracle Corporation
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync *
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync * available from http://www.virtualbox.org. This file is free software;
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync * you can redistribute it and/or modify it under the terms of the GNU
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync * General Public License (GPL) as published by the Free Software
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#ifndef ___VBox_VMMDevTesting_h
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#define ___VBox_VMMDevTesting_h
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#include <VBox/types.h>
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/** The base address of the MMIO range used for testing.
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync * This is intentionally put at the 2nd page above 1M so that it can be
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync * accessed from both real (!A20) and protected mode. */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#define VMMDEV_TESTING_MMIO_BASE UINT32_C(0x00101000)
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/** The size of the MMIO range used for testing. */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#define VMMDEV_TESTING_MMIO_SIZE UINT32_C(0x00001000)
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/** The NOP MMIO register - 124 RW. */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#define VMMDEV_TESTING_MMIO_NOP (VMMDEV_TESTING_MMIO_BASE + 0x000)
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/** The XXX MMIO register - 124 RW. */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#define VMMDEV_TESTING_MMIO_TODO (VMMDEV_TESTING_MMIO_BASE + 0x004)
c36d095531b5355dba93be3b9b862bac18148109vboxsync/** The real mode selector to use.
c36d095531b5355dba93be3b9b862bac18148109vboxsync * @remarks Requires that the A20 gate is enabled. */
c36d095531b5355dba93be3b9b862bac18148109vboxsync#define VMMDEV_TESTING_MMIO_RM_SEL 0xffff
c36d095531b5355dba93be3b9b862bac18148109vboxsync/** Calculate the real mode offset of a MMIO register. */
c36d095531b5355dba93be3b9b862bac18148109vboxsync#define VMMDEV_TESTING_MMIO_RM_OFF(val) ((val) - 0xffff0)
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/** The base port of the I/O range used for testing. */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#define VMMDEV_TESTING_IOPORT_BASE 0x0510
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/** The number of I/O ports reserved for testing. */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#define VMMDEV_TESTING_IOPORT_COUNT 0x0010
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/** The NOP I/O port - 124 RW. */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#define VMMDEV_TESTING_IOPORT_NOP (VMMDEV_TESTING_IOPORT_BASE + 0)
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/** The low nanosecond timestamp - 4 RO. */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#define VMMDEV_TESTING_IOPORT_TS_LOW (VMMDEV_TESTING_IOPORT_BASE + 1)
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/** The high nanosecond timestamp - 4 RO. Read this after the low one! */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#define VMMDEV_TESTING_IOPORT_TS_HIGH (VMMDEV_TESTING_IOPORT_BASE + 2)
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync/** What the NOP accesses returns. */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#define VMMDEV_TESTING_NOP_RET UINT32_C(0x64726962) /* bird */
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync#endif
afc71ee9d14313aac9881860b235a74d7c8a683evboxsync