VirtualBox

Ignore:
Timestamp:
Dec 14, 2011 5:36:18 PM (13 years ago)
Author:
vboxsync
Message:

16 bits is plenty for the AHCI index register.

File:
1 edited

Legend:

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

    r39610 r39619  
    141141
    142142/** Returns the absolute register offset from a given port and port register. */
    143 #define AHCI_PORT_REG(port, reg)    ((uint32_t)(AHCI_HBA_SIZE + (port) * AHCI_PORT_SIZE + (reg)))
     143#define AHCI_PORT_REG(port, reg)    (AHCI_HBA_SIZE + (port) * AHCI_PORT_SIZE + (reg))
    144144
    145145#define AHCI_REG_IDX   0
     
    147147
    148148/** Writes the given value to a AHCI register. */
    149 #define AHCI_WRITE_REG(iobase, reg, val)                \
    150     outpd((iobase) + AHCI_REG_IDX, (uint32_t)(reg));    \
    151     outpd((iobase) + AHCI_REG_DATA, (uint32_t)(val))
     149#define AHCI_WRITE_REG(iobase, reg, val)    \
     150    outpd((iobase) + AHCI_REG_IDX, reg);    \
     151    outpd((iobase) + AHCI_REG_DATA, val)
    152152
    153153/** Reads from a AHCI register. */
    154 #define AHCI_READ_REG(iobase, reg, val)                 \
    155     outpd((iobase) + AHCI_REG_IDX, (uint32_t)(reg));    \
     154#define AHCI_READ_REG(iobase, reg, val)     \
     155    outpd((iobase) + AHCI_REG_IDX, reg);    \
    156156    (val) = inpd((iobase) + AHCI_REG_DATA)
    157157
     
    224224 * Sets a given set of bits in a register.
    225225 */
    226 static void ahci_ctrl_set_bits(uint16_t iobase, uint32_t reg, uint32_t mask)
     226static void ahci_ctrl_set_bits(uint16_t iobase, uint16_t reg, uint32_t mask)
    227227{
    228228    outpd(iobase + AHCI_REG_IDX, reg);
     
    233233 * Clears a given set of bits in a register.
    234234 */
    235 static void ahci_ctrl_clear_bits(uint16_t iobase, uint32_t reg, uint32_t mask)
     235static void ahci_ctrl_clear_bits(uint16_t iobase, uint16_t reg, uint32_t mask)
    236236{
    237237    outpd(iobase + AHCI_REG_IDX, reg);
     
    243243 * for a register.
    244244 */
    245 static uint8_t ahci_ctrl_is_bit_set(uint16_t iobase, uint32_t reg, uint32_t mask)
     245static uint8_t ahci_ctrl_is_bit_set(uint16_t iobase, uint16_t reg, uint32_t mask)
    246246{
    247247    outpd(iobase + AHCI_REG_IDX, reg);
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