VirtualBox

Changeset 44693 in vbox for trunk


Ignore:
Timestamp:
Feb 14, 2013 5:37:34 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83791
Message:

DevLPC.cpp: some small adjustment, not worth doing much here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevLPC.cpp

    r44528 r44693  
    22/** @file
    33 * DevLPC - LPC device emulation
     4 *
     5 * @todo This needs to be _replaced_ by a proper chipset device one day. There
     6 *       are less than 10 C/C++ statements in this file doing active emulation.
    47 */
    58
    69/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     10 * Copyright (C) 2006-2013 Oracle Corporation
    811 *
    912 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5659#include "VBoxDD2.h"
    5760
    58 #define RCBA_BASE                0xFED1C000
     61#define RCBA_BASE                UINT32_C(0xFED1C000)
    5962
    6063typedef struct
     
    130133{
    131134    LPCState *s = PDMINS_2_DATA(pDevIns, LPCState*);
    132     switch (cb)
    133     {
    134         case 1:
    135         case 2:
    136             break;
    137 
    138         case 4:
    139         {
    140             *(uint32_t*)pv = rcba_ram_readl(s, GCPhysAddr);
    141             break;
    142         }
    143 
    144         default:
    145             AssertReleaseMsgFailed(("cb=%d\n", cb)); /* for now we assume simple accesses. */
    146             return VERR_INTERNAL_ERROR;
    147     }
     135    Assert(cb == 4); Assert(!(GCPhysAddr & 3));
     136    *(uint32_t*)pv = rcba_ram_readl(s, GCPhysAddr);
    148137    return VINF_SUCCESS;
    149138}
     
    171160            break;
    172161        case 4:
    173         {
    174             /** @todo: locking? */
    175162            rcba_ram_writel(s, GCPhysAddr, *(uint32_t *)pv);
    176163            break;
    177         }
    178164
    179165        default:
     
    185171
    186172#ifdef IN_RING3
    187 /**
    188  * Reset notification.
    189  *
    190  * @returns VBox status.
    191  * @param   pDevIns     The device instance data.
    192  */
    193 static DECLCALLBACK(void) lpcReset(PPDMDEVINS pDevIns)
    194 {
    195     LPCState *pThis = PDMINS_2_DATA(pDevIns, LPCState *);
    196     LogFlow(("lpcReset: \n"));
    197 }
    198173
    199174/**
     
    255230    PCIDevSetStatus           (&pThis->dev, 0x0200); /* PCI_status_devsel_medium */
    256231
    257     /** @todo: rewrite using PCI accessors */
     232    /** @todo rewrite using PCI accessors; Update, rewrite this device from
     233     *        scratch! Possibly against ICH9 or something else matching our
     234     *        chipset of choice. (Note that the exteremely partial emulation here
     235     *        is supposed to be of ICH7 if what's on the top of the file is
     236     *        anything to go by.) */
    258237    /* See p. 427 of ICH9 specification for register description */
    259238
     
    337316     */
    338317    rc = PDMDevHlpMMIORegister(pDevIns, RCBA_BASE, 0x4000, pThis,
    339                                IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU,
     318                               IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_PASSTHRU,
    340319                               lpcMMIOWrite, lpcMMIORead, "LPC Memory");
    341320    if (RT_FAILURE(rc))
     
    343322
    344323    /* No state in the LPC right now */
    345 
    346     /*
    347      * Initialize the device state.
    348      */
    349     lpcReset(pDevIns);
    350324
    351325    /**
     
    392366    NULL,
    393367    /* pfnReset */
    394     lpcReset,
     368    NULL,
    395369    /* pfnSuspend */
    396370    NULL,
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette