- Timestamp:
- Feb 14, 2013 5:37:34 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 83791
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevLPC.cpp
r44528 r44693 2 2 /** @file 3 3 * 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. 4 7 */ 5 8 6 9 /* 7 * Copyright (C) 2006-201 1Oracle Corporation10 * Copyright (C) 2006-2013 Oracle Corporation 8 11 * 9 12 * This file is part of VirtualBox Open Source Edition (OSE), as … … 56 59 #include "VBoxDD2.h" 57 60 58 #define RCBA_BASE 0xFED1C00061 #define RCBA_BASE UINT32_C(0xFED1C000) 59 62 60 63 typedef struct … … 130 133 { 131 134 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); 148 137 return VINF_SUCCESS; 149 138 } … … 171 160 break; 172 161 case 4: 173 {174 /** @todo: locking? */175 162 rcba_ram_writel(s, GCPhysAddr, *(uint32_t *)pv); 176 163 break; 177 }178 164 179 165 default: … … 185 171 186 172 #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 }198 173 199 174 /** … … 255 230 PCIDevSetStatus (&pThis->dev, 0x0200); /* PCI_status_devsel_medium */ 256 231 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.) */ 258 237 /* See p. 427 of ICH9 specification for register description */ 259 238 … … 337 316 */ 338 317 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, 340 319 lpcMMIOWrite, lpcMMIORead, "LPC Memory"); 341 320 if (RT_FAILURE(rc)) … … 343 322 344 323 /* No state in the LPC right now */ 345 346 /*347 * Initialize the device state.348 */349 lpcReset(pDevIns);350 324 351 325 /** … … 392 366 NULL, 393 367 /* pfnReset */ 394 lpcReset,368 NULL, 395 369 /* pfnSuspend */ 396 370 NULL,
Note:
See TracChangeset
for help on using the changeset viewer.