[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/19] libqos/ahci: Add ahci_guest_io
From: |
John Snow |
Subject: |
[Qemu-devel] [PATCH 14/19] libqos/ahci: Add ahci_guest_io |
Date: |
Fri, 30 Jan 2015 13:42:08 -0500 |
ahci_guest_io is a shorthand function that will, in one shot,
execute a data command on the guest to the specified guest buffer
location, in the requested amount.
Signed-off-by: John Snow <address@hidden>
---
tests/libqos/ahci.c | 15 +++++++++++++++
tests/libqos/ahci.h | 2 ++
2 files changed, 17 insertions(+)
diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index 3375d54..d55dab8 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -536,6 +536,21 @@ inline unsigned size_to_prdtl(unsigned bytes, unsigned
bytes_per_prd)
return (bytes + bytes_per_prd - 1) / bytes_per_prd;
}
+/* Given a guest buffer address, perform an IO operation */
+void ahci_guest_io(AHCIQState *ahci, uint8_t px, uint8_t ide_cmd,
+ uint64_t buffer, size_t bufsize)
+{
+ AHCICommand *cmd;
+
+ cmd = ahci_command_create(ide_cmd);
+ ahci_command_set_buffer(cmd, buffer);
+ ahci_command_set_size(cmd, bufsize);
+ ahci_command_commit(ahci, cmd, px);
+ ahci_command_issue(ahci, cmd);
+ ahci_command_verify(ahci, cmd);
+ ahci_command_free(cmd);
+}
+
typedef struct AHCICommand {
/* Test Management Data */
uint8_t name;
diff --git a/tests/libqos/ahci.h b/tests/libqos/ahci.h
index 1300967..cbde141 100644
--- a/tests/libqos/ahci.h
+++ b/tests/libqos/ahci.h
@@ -520,6 +520,8 @@ void ahci_set_command_header(AHCIQState *ahci, uint8_t px,
void ahci_destroy_command(AHCIQState *ahci, uint8_t px, uint8_t cx);
unsigned ahci_pick_cmd(AHCIQState *ahci, uint8_t px);
unsigned size_to_prdtl(unsigned bytes, unsigned bytes_per_prd);
+void ahci_guest_io(AHCIQState *ahci, uint8_t px, uint8_t ide_cmd,
+ uint64_t gbuffer, size_t size);
/* Command Lifecycle */
AHCICommand *ahci_command_create(uint8_t command_name);
--
1.9.3
- [Qemu-devel] [PATCH 06/19] libqos/ahci: Add ahci_port_check_interrupts helper, (continued)
- [Qemu-devel] [PATCH 06/19] libqos/ahci: Add ahci_port_check_interrupts helper, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 07/19] libqos/ahci: Add port_check_nonbusy helper, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 03/19] qtest/ahci: rename 'Command' to 'CommandHeader', John Snow, 2015/01/30
- [Qemu-devel] [PATCH 02/19] libqos/ahci: Add ahci_port_clear helper, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 05/19] libqos/ahci: Add ahci_port_check_error helper, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 04/19] libqos/ahci: Add command header helpers, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 09/19] qtest/ahci: Demagic ahci tests., John Snow, 2015/01/30
- [Qemu-devel] [PATCH 13/19] libqos/ahci: add ahci command size setters, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 08/19] libqos/ahci: Add cmd response sanity check helpers, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 10/19] libqos/ahci: Add ide cmd properties, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 14/19] libqos/ahci: Add ahci_guest_io,
John Snow <=
- [Qemu-devel] [PATCH 11/19] libqos/ahci: add ahci command functions, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 17/19] qtest/ahci: Add a macro bootup routine, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 12/19] libqos/ahci: add ahci command verify, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 18/19] qtest/ahci: Assert sector size in identify test, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 19/19] qtest/ahci: Adding simple dma read-write test, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 15/19] libqos/ahci: add ahci_io, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 16/19] libqos/ahci: Add ahci_clean_mem, John Snow, 2015/01/30