• J
    libqos/ahci: Add command header helpers · 6cae27a6
    John Snow 提交于
    Adds command header helper functions:
    -ahci_command_header_set
    -ahci_command_header_get,
    -ahci_command_destroy, and
    -ahci_cmd_pick
    
    These helpers help to quickly manage the command header information in
    the AHCI device.
    
    ahci_command_header_set and get will store or retrieve an AHCI command
    header, respectively.
    
    ahci_cmd_pick chooses the first available but least recently used
    command slot to allow us to cycle through the available command slots.
    
    ahci_command_destroy obliterates all information contained within a
    given slot's command header, and frees its associated command table,
    but not its DMA buffer!
    
    Lastly, the command table pointer fields (dba and dbau) are merged into
    a single 64bit value to make managing 64bit tests simpler.
    Signed-off-by: NJohn Snow <jsnow@redhat.com>
    Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
    Message-id: 1423158090-25580-5-git-send-email-jsnow@redhat.com
    Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
    6cae27a6
ahci.h 15.0 KB