VirtualBox

Changeset 39596 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
Dec 13, 2011 3:13:29 PM (13 years ago)
Author:
vboxsync
Message:

Minor cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS-new/ahci.c

    r39591 r39596  
    8888} ahci_t;
    8989
    90 #define AhciData ((ahci_t *) 0)
     90/* The AHCI specific data must fit into 1KB (statically allocated). */
     91ct_assert(sizeof(ahci_t) <= 1024);
    9192
    9293/** PCI configuration fields. */
     
    317318    /* Build variable part first of command dword (reuses 'cmd'). */
    318319    if (cmd == AHCI_CMD_WRITE_DMA_EXT)
    319         cmd = RT_BIT_32(6);     /* Indicate write to device. */
     320        cmd = RT_BIT_32(6);     /* Indicate a write to device. */
    320321    else if (cmd == ATA_CMD_PACKET) {
    321322        cmd |= RT_BIT_32(5);    /* Indicate ATAPI command. */
     
    406407
    407408    DBG_AHCI("AHCI: FIS receive area %lx from %x:%x\n",
    408              ahci_addr_to_phys(&ahci->abFisRecv), FP_SEG(ahci), &AhciData->abFisRecv);
     409             ahci_addr_to_phys(&ahci->abFisRecv), FP_SEG(ahci->abFisRecv), FP_OFF(ahci->abFisRecv));
    409410    VBOXAHCI_PORT_WRITE_REG(ahci->iobase, u8Port, AHCI_REG_PORT_FB, ahci_addr_to_phys(&ahci->abFisRecv));
    410411    VBOXAHCI_PORT_WRITE_REG(ahci->iobase, u8Port, AHCI_REG_PORT_FBU, 0);
     
    727728static int ahci_hba_init(uint16_t io_base)
    728729{
    729     uint8_t     i, cPorts;
    730     uint32_t    val;
    731     uint16_t    ebda_seg;
    732     uint16_t    ahci_seg;
     730    uint8_t             i, cPorts;
     731    uint32_t            val;
     732    uint16_t            ebda_seg;
     733    uint16_t            ahci_seg;
     734    bio_dsk_t __far     *bios_dsk;
     735    ahci_t __far        *ahci;
     736   
    733737
    734738    ebda_seg = read_word(0x0040, 0x000E);
     739    bios_dsk = ebda_seg :> &EbdaData->bdisk;
    735740
    736741    AHCI_READ_REG(io_base, AHCI_REG_VS, val);
     
    749754             ahci_seg, sizeof(ahci_t), (uint16_t)&EbdaData->bdisk.ahci_seg, sizeof(ebda_data_t));
    750755
    751     write_word(ebda_seg, (uint16_t)&EbdaData->bdisk.ahci_seg, ahci_seg);
    752     write_byte(ebda_seg, (uint16_t)&EbdaData->bdisk.ahci_devcnt, 0);
    753     write_byte(ahci_seg, (uint16_t)&AhciData->cur_port, 0xff);
    754     write_word(ahci_seg, (uint16_t)&AhciData->iobase, io_base);
     756    bios_dsk->ahci_seg    = ahci_seg;
     757    bios_dsk->ahci_devcnt = 0;
     758
     759    ahci = ahci_seg :> 0;
     760    ahci->cur_port = 0xff;
     761    ahci->iobase   = io_base;
    755762
    756763    /* Reset the controller. */
Note: See TracChangeset for help on using the changeset viewer.

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