儲存庫 vbox 的更動 55206
- 時間撮記:
- 2015-4-13 上午11:05:11 (10 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/PC/BIOS/ahci.c
r52812 r55206 44 44 uint32_t len; 45 45 } ahci_prdt; 46 47 /** 48 * SATA D2H FIS (Device to Host Frame Information Structure). 49 */ 50 typedef struct { 51 uint8_t fis_type; /* 34h */ 52 uint8_t intr; /* Bit 6 indicates interrupt status. */ 53 uint8_t status; /* Status register. */ 54 uint8_t error; /* Error register. */ 55 uint8_t sec_no; /* Sector number register. */ 56 uint8_t cyl_lo; /* Cylinder low register. */ 57 uint8_t cyl_hi; /* Cylinder high register. */ 58 uint8_t dev_hd; /* Device/head register. */ 59 uint8_t sec_no_exp; /* Expanded sector number register. */ 60 uint8_t cyl_lo_exp; /* Expanded cylinder low register. */ 61 uint8_t cyl_hi_exp; /* Expanded cylinder high register. */ 62 uint8_t resvd0; 63 uint8_t sec_cn; /* Sector count register. */ 64 uint8_t sec_cn_exp; /* Expanded sector count register. */ 65 uint16_t resvd1; 66 uint32_t resvd2; 67 } fis_d2h; 68 69 ct_assert(sizeof(fis_d2h) == 20); 46 70 47 71 /** … … 305 329 ahci_ctrl_clear_bits(io_base, AHCI_PORT_REG(port, AHCI_REG_PORT_CMD), 306 330 AHCI_REG_PORT_CMD_ST); 307 308 /** @todo: Examine status. */ 331 /* Caller must examine status. */ 309 332 } 310 333 else … … 315 338 * Issue command to device. 316 339 */ 317 static voidahci_cmd_data(bio_dsk_t __far *bios_dsk, uint8_t cmd)340 static uint16_t ahci_cmd_data(bio_dsk_t __far *bios_dsk, uint8_t cmd) 318 341 { 319 342 ahci_t __far *ahci = bios_dsk->ahci_seg :> 0; … … 321 344 uint16_t sectsz = bios_dsk->drqp.sect_sz; 322 345 uint16_t prdt_idx; 346 fis_d2h __far *d2h; 323 347 324 348 _fmemset(&ahci->abCmd[0], 0, sizeof(ahci->abCmd)); … … 384 408 ahci_port_cmd_sync(ahci, cmd); 385 409 410 /* Examine operation status. */ 411 d2h = (void __far *)&ahci->abFisRecv[0x40]; 412 DBG_AHCI("AHCI: ERR=%02x, STAT=%02x, SCNT=%02x\n", d2h->error, d2h->status, d2h->sec_cn); 413 386 414 /* Unlock the buffer again. */ 387 415 vds_free_sg_list(&ahci->edds); 416 return d2h->error ? 4 : 0; 388 417 } 389 418 … … 490 519 { 491 520 uint16_t device_id; 521 uint16_t rc; 492 522 493 523 device_id = VBOX_GET_AHCI_DEVICE(bios_dsk->drqp.dev_id); … … 501 531 high_bits_save(bios_dsk->ahci_seg :> 0); 502 532 ahci_port_init(bios_dsk->ahci_seg :> 0, bios_dsk->ahcidev[device_id].port); 503 ahci_cmd_data(bios_dsk, AHCI_CMD_READ_DMA_EXT);533 rc = ahci_cmd_data(bios_dsk, AHCI_CMD_READ_DMA_EXT); 504 534 DBG_AHCI("%s: transferred %lu bytes\n", __func__, ((ahci_t __far *)(bios_dsk->ahci_seg :> 0))->aCmdHdr[1]); 505 535 bios_dsk->drqp.trsfsectors = bios_dsk->drqp.nsect; … … 508 538 #endif 509 539 high_bits_restore(bios_dsk->ahci_seg :> 0); 510 return 0; //@todo!!540 return rc; 511 541 } 512 542 … … 521 551 { 522 552 uint16_t device_id; 553 uint16_t rc; 523 554 524 555 device_id = VBOX_GET_AHCI_DEVICE(bios_dsk->drqp.dev_id); … … 532 563 high_bits_save(bios_dsk->ahci_seg :> 0); 533 564 ahci_port_init(bios_dsk->ahci_seg :> 0, bios_dsk->ahcidev[device_id].port); 534 ahci_cmd_data(bios_dsk, AHCI_CMD_WRITE_DMA_EXT);565 rc = ahci_cmd_data(bios_dsk, AHCI_CMD_WRITE_DMA_EXT); 535 566 DBG_AHCI("%s: transferred %lu bytes\n", __func__, ((ahci_t __far *)(bios_dsk->ahci_seg :> 0))->aCmdHdr[1]); 536 567 bios_dsk->drqp.trsfsectors = bios_dsk->drqp.nsect; 537 568 high_bits_restore(bios_dsk->ahci_seg :> 0); 538 return 0; //@todo!!569 return rc; 539 570 } 540 571 … … 605 636 606 637 return ahci->aCmdHdr[1] == 0 ? 4 : 0; 607 // return 0; //@todo!!608 638 } 609 639
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器