Changeset 15252 in vbox for trunk/src/VBox/Devices/Storage/ATAController.h
- Timestamp:
- Dec 10, 2008 3:37:23 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/ATAController.h
r13004 r15252 78 78 * Structures and Typedefs * 79 79 *******************************************************************************/ 80 typedef struct A TADevState {80 typedef struct AHCIATADevState { 81 81 /** Flag indicating whether the current command uses LBA48 mode. */ 82 82 bool fLBA48; … … 165 165 volatile uint32_t MediaEventStatus; 166 166 167 uint32_t Alignment0;168 169 167 /** The status LED state for this drive. */ 170 PDMLED Led; 168 R3PTRTYPE(PPDMLED) pLed; 169 #if HC_ARCH_BITS == 64 170 uint32_t uAlignment3; 171 #endif 171 172 172 173 /** Size of I/O buffer. */ … … 201 202 STAMPROFILEADV StatReads; 202 203 /** Statistics: number of bytes read. */ 203 STAMCOUNTER StatBytesRead; 204 R3PTRTYPE(PSTAMCOUNTER) pStatBytesRead; 205 #if HC_ARCH_BITS == 64 206 uint64_t uAlignment4; 207 #endif 204 208 /** Statistics: number of write operations and the time spent writing. */ 205 209 STAMPROFILEADV StatWrites; 206 210 /** Statistics: number of bytes written. */ 207 STAMCOUNTER StatBytesWritten; 211 R3PTRTYPE(PSTAMCOUNTER) pStatBytesWritten; 212 #if HC_ARCH_BITS == 64 213 uint64_t uAlignment5; 214 #endif 208 215 /** Statistics: number of flush operations and the time spend flushing. */ 209 216 STAMPROFILE StatFlushes; … … 242 249 PPDMDEVINSR3 pDevInsR3; 243 250 /** Pointer to controller instance. */ 244 R3PTRTYPE(struct A TACONTROLLER *) pControllerR3;251 R3PTRTYPE(struct AHCIATACONTROLLER *) pControllerR3; 245 252 /** Pointer to device instance. */ 246 253 PPDMDEVINSR0 pDevInsR0; 247 254 /** Pointer to controller instance. */ 248 R0PTRTYPE(struct A TACONTROLLER *) pControllerR0;255 R0PTRTYPE(struct AHCIATACONTROLLER *) pControllerR0; 249 256 /** Pointer to device instance. */ 250 257 PPDMDEVINSRC pDevInsRC; 251 258 /** Pointer to controller instance. */ 252 RCPTRTYPE(struct A TACONTROLLER *) pControllerRC;253 } A TADevState;254 255 256 typedef struct A TATransferRequest259 RCPTRTYPE(struct AHCIATACONTROLLER *) pControllerRC; 260 } AHCIATADevState; 261 262 263 typedef struct AHCIATATransferRequest 257 264 { 258 265 uint8_t iIf; … … 261 268 uint32_t cbTotalTransfer; 262 269 uint8_t uTxDir; 263 } A TATransferRequest;264 265 266 typedef struct A TAAbortRequest270 } AHCIATATransferRequest; 271 272 273 typedef struct AHCIATAAbortRequest 267 274 { 268 275 uint8_t iIf; 269 276 bool fResetDrive; 270 } A TAAbortRequest;277 } AHCIATAAbortRequest; 271 278 272 279 … … 274 281 { 275 282 /** Begin a new transfer. */ 276 A TA_AIO_NEW = 0,283 AHCIATA_AIO_NEW = 0, 277 284 /** Continue a DMA transfer. */ 278 A TA_AIO_DMA,285 AHCIATA_AIO_DMA, 279 286 /** Continue a PIO transfer. */ 280 A TA_AIO_PIO,287 AHCIATA_AIO_PIO, 281 288 /** Reset the drives on current controller, stop all transfer activity. */ 282 A TA_AIO_RESET_ASSERTED,289 AHCIATA_AIO_RESET_ASSERTED, 283 290 /** Reset the drives on current controller, resume operation. */ 284 A TA_AIO_RESET_CLEARED,291 AHCIATA_AIO_RESET_CLEARED, 285 292 /** Abort the current transfer of a particular drive. */ 286 A TA_AIO_ABORT287 } A TAAIO;288 289 290 typedef struct A TARequest293 AHCIATA_AIO_ABORT 294 } AHCIATAAIO; 295 296 297 typedef struct AHCIATARequest 291 298 { 292 A TAAIO ReqType;299 AHCIATAAIO ReqType; 293 300 union 294 301 { 295 A TATransferRequest t;296 A TAAbortRequest a;302 AHCIATATransferRequest t; 303 AHCIATAAbortRequest a; 297 304 } u; 298 } A TARequest;299 300 301 typedef struct A TACONTROLLER305 } AHCIATARequest; 306 307 308 typedef struct AHCIATACONTROLLER 302 309 { 303 310 /** The base of the first I/O Port range. */ … … 338 345 339 346 /** The ATA/ATAPI interfaces of this controller. */ 340 A TADevState aIfs[2];347 AHCIATADevState aIfs[2]; 341 348 342 349 /** Pointer to device instance. */ … … 354 361 RTSEMEVENT AsyncIOSem; 355 362 /** The request queue for the AIO thread. One element is always unused. */ 356 A TARequestaAsyncIORequests[4];363 AHCIATARequest aAsyncIORequests[4]; 357 364 /** The position at which to insert a new request for the AIO thread. */ 358 365 uint8_t AsyncIOReqHead; … … 377 384 STAMPROFILEADV StatAsyncTime; 378 385 STAMPROFILE StatLockWait; 379 } A TACONTROLLER, *PATACONTROLLER;386 } AHCIATACONTROLLER, *PAHCIATACONTROLLER; 380 387 381 388 #ifndef VBOX_DEVICE_STRUCT_TESTCASE … … 384 391 #define ATADEVSTATE_2_DEVINS(pIf) ( (pIf)->CTX_SUFF(pDevIns) ) 385 392 #define CONTROLLER_2_DEVINS(pController) ( (pController)->CTX_SUFF(pDevIns) ) 386 #define PDMIBASE_2_ATASTATE(pInterface) ( (A TADevState *)((uintptr_t)(pInterface) - RT_OFFSETOF(ATADevState, IBase)) )393 #define PDMIBASE_2_ATASTATE(pInterface) ( (AHCIATADevState *)((uintptr_t)(pInterface) - RT_OFFSETOF(AHCIATADevState, IBase)) ) 387 394 388 395 … … 391 398 ******************************************************************************/ 392 399 __BEGIN_DECLS 393 int ataControllerIOPortWrite1(PA TACONTROLLER pCtl, RTIOPORT Port, uint32_t u32, unsigned cb);394 int ataControllerIOPortRead1(PA TACONTROLLER pCtl, RTIOPORT Port, uint32_t *u32, unsigned cb);395 int ataControllerIOPortWriteStr1(PA TACONTROLLER pCtl, RTIOPORT Port, RTGCPTR *pGCPtrSrc, PRTGCUINTREG pcTransfer, unsigned cb);396 int ataControllerIOPortReadStr1(PA TACONTROLLER pCtl, RTIOPORT Port, RTGCPTR *pGCPtrDst, PRTGCUINTREG pcTransfer, unsigned cb);397 int ataControllerIOPortWrite2(PA TACONTROLLER pCtl, RTIOPORT Port, uint32_t u32, unsigned cb);398 int ataControllerIOPortRead2(PA TACONTROLLER pCtl, RTIOPORT Port, uint32_t *u32, unsigned cb);399 int ataControllerBMDMAIOPortRead(PA TACONTROLLER pCtl, RTIOPORT Port, uint32_t *pu32, unsigned cb);400 int ataControllerBMDMAIOPortWrite(PA TACONTROLLER pCtl, RTIOPORT Port, uint32_t u32, unsigned cb);400 int ataControllerIOPortWrite1(PAHCIATACONTROLLER pCtl, RTIOPORT Port, uint32_t u32, unsigned cb); 401 int ataControllerIOPortRead1(PAHCIATACONTROLLER pCtl, RTIOPORT Port, uint32_t *u32, unsigned cb); 402 int ataControllerIOPortWriteStr1(PAHCIATACONTROLLER pCtl, RTIOPORT Port, RTGCPTR *pGCPtrSrc, PRTGCUINTREG pcTransfer, unsigned cb); 403 int ataControllerIOPortReadStr1(PAHCIATACONTROLLER pCtl, RTIOPORT Port, RTGCPTR *pGCPtrDst, PRTGCUINTREG pcTransfer, unsigned cb); 404 int ataControllerIOPortWrite2(PAHCIATACONTROLLER pCtl, RTIOPORT Port, uint32_t u32, unsigned cb); 405 int ataControllerIOPortRead2(PAHCIATACONTROLLER pCtl, RTIOPORT Port, uint32_t *u32, unsigned cb); 406 int ataControllerBMDMAIOPortRead(PAHCIATACONTROLLER pCtl, RTIOPORT Port, uint32_t *pu32, unsigned cb); 407 int ataControllerBMDMAIOPortWrite(PAHCIATACONTROLLER pCtl, RTIOPORT Port, uint32_t u32, unsigned cb); 401 408 __END_DECLS 402 409 … … 413 420 * @param szName Name of the controller (Used to initialize the critical section). 414 421 */ 415 int ataControllerInit(PPDMDEVINS pDevIns, PA TACONTROLLER pCtl, PPDMIBASE pDrvBaseMaster, PPDMIBASE pDrvBaseSlave,416 uint32_t *pcbSSMState, const char *szName );422 int ataControllerInit(PPDMDEVINS pDevIns, PAHCIATACONTROLLER pCtl, PPDMIBASE pDrvBaseMaster, PPDMIBASE pDrvBaseSlave, 423 uint32_t *pcbSSMState, const char *szName, PPDMLED pLed, PSTAMCOUNTER pStatBytesRead, PSTAMCOUNTER pStatBytesWritten); 417 424 418 425 /** … … 422 429 * @param pCtl The controller instance. 423 430 */ 424 int ataControllerDestroy(PA TACONTROLLER pCtl);431 int ataControllerDestroy(PAHCIATACONTROLLER pCtl); 425 432 426 433 /** … … 430 437 * @param pCtl the controller instance. 431 438 */ 432 void ataControllerPowerOff(PA TACONTROLLER pCtl);439 void ataControllerPowerOff(PAHCIATACONTROLLER pCtl); 433 440 434 441 /** … … 438 445 * @param pCtl Pointer to the controller. 439 446 */ 440 void ataControllerReset(PA TACONTROLLER pCtl);447 void ataControllerReset(PAHCIATACONTROLLER pCtl); 441 448 442 449 /** … … 446 453 * @param pCtl The controller instance. 447 454 */ 448 void ataControllerSuspend(PA TACONTROLLER pCtl);455 void ataControllerSuspend(PAHCIATACONTROLLER pCtl); 449 456 450 457 /** … … 455 462 */ 456 463 457 void ataControllerResume(PA TACONTROLLER pCtl);464 void ataControllerResume(PAHCIATACONTROLLER pCtl); 458 465 459 466 /** … … 464 471 * @param offDelta The relocation delta relative to the old location. 465 472 */ 466 void ataControllerRelocate(PA TACONTROLLER pCtl, RTGCINTPTR offDelta);473 void ataControllerRelocate(PAHCIATACONTROLLER pCtl, RTGCINTPTR offDelta); 467 474 468 475 /** … … 473 480 * @param pSSM SSM operation handle. 474 481 */ 475 int ataControllerSaveExec(PA TACONTROLLER pCtl, PSSMHANDLE pSSM);482 int ataControllerSaveExec(PAHCIATACONTROLLER pCtl, PSSMHANDLE pSSM); 476 483 477 484 /** … … 482 489 * @param pSSM SSM operation handle. 483 490 */ 484 int ataControllerSavePrep(PA TACONTROLLER pCtl, PSSMHANDLE pSSM);491 int ataControllerSavePrep(PAHCIATACONTROLLER pCtl, PSSMHANDLE pSSM); 485 492 486 493 /** … … 491 498 * @param pSSM SSM operation handle. 492 499 */ 493 int ataControllerLoadExec(PA TACONTROLLER pCtl, PSSMHANDLE pSSM);500 int ataControllerLoadExec(PAHCIATACONTROLLER pCtl, PSSMHANDLE pSSM); 494 501 495 502 /** … … 500 507 * @param pSSM SSM operation handle. 501 508 */ 502 int ataControllerLoadPrep(PA TACONTROLLER pCtl, PSSMHANDLE pSSM);509 int ataControllerLoadPrep(PAHCIATACONTROLLER pCtl, PSSMHANDLE pSSM); 503 510 504 511 #endif /* IN_RING3 */
Note:
See TracChangeset
for help on using the changeset viewer.