DevPcArch.cpp revision 6b362bc00d2820ca57d348a77ddb1dc558dc94f8
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/* $Id$ */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/** @file
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * DevPcArch - PC Architecture Device.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/*
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync * Copyright (C) 2006-2012 Oracle Corporation
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * available from http://www.virtualbox.org. This file is free software;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * you can redistribute it and/or modify it under the terms of the GNU
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * General Public License (GPL) as published by the Free Software
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/*******************************************************************************
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync* Header Files *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync*******************************************************************************/
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#define LOG_GROUP LOG_GROUP_DEV_PC_ARCH
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#include <VBox/vmm/pdmdev.h>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#include <VBox/vmm/mm.h>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#include <VBox/log.h>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#include <VBox/err.h>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#include <iprt/assert.h>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#include <iprt/string.h>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#include "VBoxDD.h"
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/*******************************************************************************
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync* Structures and Typedefs *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync*******************************************************************************/
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * PC Bios instance data structure.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsynctypedef struct DEVPCARCH
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync{
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync /** Pointer back to the device instance. */
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync PPDMDEVINS pDevIns;
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync} DEVPCARCH, *PDEVPCARCH;
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync
5c127165d63f95b1763b4af2a2c6ae1025fc84fevboxsync
5c127165d63f95b1763b4af2a2c6ae1025fc84fevboxsync/**
5c127165d63f95b1763b4af2a2c6ae1025fc84fevboxsync * @callback_method_impl{FNIOMIOPORTIN, Math coprocessor.}
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncstatic DECLCALLBACK(int) pcarchIOPortFPURead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync{
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync int rc;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NOREF(pvUser); NOREF(pDevIns); NOREF(pu32);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync rc = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d\n", Port, cb);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if (rc == VINF_SUCCESS)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync rc = VERR_IOM_IOPORT_UNUSED;
82391de567696f10b21a762fde6a06fe3c266d28vboxsync return rc;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync}
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @callback_method_impl{FNIOMIOPORTOUT, Math coprocessor.}
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @todo Add IGNNE support.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncstatic DECLCALLBACK(int) pcarchIOPortFPUWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync{
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync int rc = VINF_SUCCESS;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NOREF(pvUser);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if (cb == 1)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync switch (Port)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /*
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Clear busy latch.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync case 0xf0:
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync Log2(("PCARCH: FPU Clear busy latch u32=%#x\n", u32));
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/* This is triggered when booting Knoppix (3.7) */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#if 0
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if (!u32)
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync rc = PDMDeviceDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", Port, cb, u32);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync#endif
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pDevIns->pHlp->pfnPICSetIrq(pDevIns, 13, 0); */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync break;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* Reset. */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync case 0xf1:
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync Log2(("PCARCH: FPU Reset cb=%d u32=%#x\n", Port, cb, u32));
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /** @todo figure out what the difference between FPU ports 0xf0 and 0xf1 are... */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pDevIns->pHlp->pfnPICSetIrq(pDevIns, 13, 0); */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync break;
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* opcode transfers */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync case 0xf8:
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync case 0xfa:
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync case 0xfc:
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync default:
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync rc = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", Port, cb, u32);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync break;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* this works better, but probably not entirely correct. */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync PDMDevHlpISASetIrq(pDevIns, 13, 0);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync else
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync rc = PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", Port, cb, u32);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return rc;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync}
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @callback_method_impl{FNIOMIOPORTIN, PS/2 system control port A.}
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @todo Check if the A20 enable/disable method implemented here in any way
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * should cooperate with the one implemented in the PS/2 keyboard device.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * This probably belongs together in the PS/2 keyboard device (since that
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * is where the "port B" mentioned by Ralph Brown is implemented).
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @remark Ralph Brown and friends have this to say about this port:
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @verbatim
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync0092 RW PS/2 system control port A (port B is at PORT 0061h) (see #P0415)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncBitfields for PS/2 system control port A:
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncBit(s) Description (Table P0415)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync 7-6 any bit set to 1 turns activity light on
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync 5 unused
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync 4 watchdog timout occurred
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync 3 =0 RTC/CMOS security lock (on password area) unlocked
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync =1 CMOS locked (done by POST)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync 2 unused
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync 1 A20 is active
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync 0 =0 system reset or write
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync =1 pulse alternate reset pin (high-speed alternate CPU reset)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncNotes: once set, bit 3 may only be cleared by a power-on reset
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync on at least the C&T 82C235, bit 0 remains set through a CPU reset to
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync allow the BIOS to determine the reset method
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync on the PS/2 30-286 & "Tortuga" the INT 15h/87h memory copy does
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync not use this port for A20 control, but instead uses the keyboard
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync controller (8042). Reportedly this may cause the system to crash
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync when access to the 8042 is disabled in password server mode
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync (see #P0398).
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsyncSeeAlso: #P0416,#P0417,MSR 00001000h
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @endverbatim
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncstatic DECLCALLBACK(int)
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsyncpcarchIOPortPS2SysControlPortARead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync{
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if (cb == 1)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync *pu32 = PDMDevHlpA20IsEnabled(pDevIns) << 1;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return VINF_SUCCESS;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d\n", Port, cb);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync}
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync/**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @callback_method_impl{FNIOMIOPORTOUT, PS/2 system control port A.}
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @see Remark and todo of pcarchIOPortPS2SysControlPortARead().
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsyncstatic DECLCALLBACK(int)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncpcarchIOPortPS2SysControlPortAWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync{
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NOREF(pvUser);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if (cb == 1)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync {
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /*
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Fast reset?
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if (u32 & 1)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync {
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync LogRel(("Reset initiated by system port A\n"));
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return PDMDevHlpVMReset(pDevIns);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync /*
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * A20 is the only thing we care about of the other stuff.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync PDMDevHlpA20Set(pDevIns, !!(u32 & 2));
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return VINF_SUCCESS;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync }
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "Port=%#x cb=%d u32=%#x\n", Port, cb, u32);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync}
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * @interface_method_impl{PDMDEVREG,pfnConstruct}
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncstatic DECLCALLBACK(int) pcarchConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg)
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync{
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync PDEVPCARCH pThis = PDMINS_2_DATA(pDevIns, PDEVPCARCH);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync int rc;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync Assert(iInstance == 0);
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /*
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync * Validate configuration.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync if (!CFGMR3AreValuesValid(pCfg, "\0"))
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES;
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /*
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * Init the data.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync pThis->pDevIns = pDevIns;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /*
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync * Register I/O Ports
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync */
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync rc = PDMDevHlpIOPortRegister(pDevIns, 0xF0, 0x10, NULL,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync pcarchIOPortFPUWrite, pcarchIOPortFPURead,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NULL, NULL, "Math Co-Processor (DOS/OS2 mode)");
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if (RT_FAILURE(rc))
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync return rc;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync rc = PDMDevHlpIOPortRegister(pDevIns, 0x92, 1, NULL,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync pcarchIOPortPS2SysControlPortAWrite, pcarchIOPortPS2SysControlPortARead,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NULL, NULL, "PS/2 system control port A (A20 and more)");
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync if (RT_FAILURE(rc))
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return rc;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync return VINF_SUCCESS;
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync}
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync/**
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync * The device registration structure.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsyncconst PDMDEVREG g_DevicePcArch =
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync{
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* u32Version */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync PDM_DEVREG_VERSION,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* szName */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync "pcarch",
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* szRCMod */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync "",
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* szR0Mod */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync "",
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pszDescription */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync "PC Architecture Device",
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync /* fFlags */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync PDM_DEVREG_FLAGS_HOST_BITS_DEFAULT | PDM_DEVREG_FLAGS_GUEST_BITS_DEFAULT,
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync /* fClass */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync PDM_DEVREG_CLASS_ARCH,
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync /* cMaxInstances */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync 1,
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync /* cbInstance */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync sizeof(DEVPCARCH),
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pfnConstruct */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync pcarchConstruct,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pfnDestruct */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NULL,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pfnRelocate */
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync NULL,
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync /* pfnIOCtl */
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync NULL,
7b4c4bb29760b28b5727231ad446462a5b0cc01avboxsync /* pfnPowerOn */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NULL,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pfnReset */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NULL,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pfnSuspend */
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync NULL,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pfnResume */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NULL,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pfnAttach */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NULL,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pfnDetach */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NULL,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pfnQueryInterface. */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NULL,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pfnInitComplete. */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NULL,
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync /* pfnPowerOff */
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync NULL,
822e11c896dd36c9dc3609dff676059576b7d3devboxsync /* pfnSoftReset */
822e11c896dd36c9dc3609dff676059576b7d3devboxsync NULL,
822e11c896dd36c9dc3609dff676059576b7d3devboxsync /* u32VersionEnd */
822e11c896dd36c9dc3609dff676059576b7d3devboxsync PDM_DEVREG_VERSION
82391de567696f10b21a762fde6a06fe3c266d28vboxsync};
82391de567696f10b21a762fde6a06fe3c266d28vboxsync
82391de567696f10b21a762fde6a06fe3c266d28vboxsync