libqos/ahci: Add command header helpers
commit6cae27a6af159ab44f7c265d7f22d9e95880db25
authorJohn Snow <jsnow@redhat.com>
Thu, 5 Feb 2015 17:41:15 +0000 (5 12:41 -0500)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 16 Feb 2015 15:07:16 +0000 (16 15:07 +0000)
tree3235ddb2967e6ebf936fcb05b9925c236f069aa1
parentc7f9c570b908a844aee393d93d01c332aea2a5a5
libqos/ahci: Add command header helpers

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: John Snow <jsnow@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1423158090-25580-5-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/ahci-test.c
tests/libqos/ahci.c
tests/libqos/ahci.h