|
|
|
|
|
|
|
|
|
|
xen-changelog
[Xen-changelog] [xen-unstable] [IA64] Add support for 4 & 8 byte buffere
# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1193934612 21600
# Node ID cbf8224779c6ab42519518fd15f623d1625d3990
# Parent 4255ca79f9d9944be4e3e0d4fdaf22aff77e7129
[IA64] Add support for 4 & 8 byte buffered io
The data structure handles it better now.
Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
xen/arch/ia64/vmx/mmio.c | 35 ++++++++++++++++++++++++-----------
1 files changed, 24 insertions(+), 11 deletions(-)
diff -r 4255ca79f9d9 -r cbf8224779c6 xen/arch/ia64/vmx/mmio.c
--- a/xen/arch/ia64/vmx/mmio.c Thu Nov 01 09:07:16 2007 -0600
+++ b/xen/arch/ia64/vmx/mmio.c Thu Nov 01 10:30:12 2007 -0600
@@ -58,13 +58,14 @@ static int hvm_buffered_io_intercept(ior
buffered_iopage_t *pg =
(buffered_iopage_t *)(v->domain->arch.hvm_domain.buffered_io_va);
buf_ioreq_t bp;
- int i;
+ int i, qw = 0;
/* Ensure buffered_iopage fits in a page */
BUILD_BUG_ON(sizeof(buffered_iopage_t) > PAGE_SIZE);
- /* ignore READ ioreq_t! */
- if (p->dir == IOREQ_READ)
+ /* ignore READ ioreq_t and anything buffered io can't deal with */
+ if (p->dir == IOREQ_READ || p->addr > 0xFFFFFUL ||
+ p->data_is_ptr || p->df || p->count != 1)
return 0;
for (i = 0; i < HVM_BUFFERED_IO_RANGE_NR; i++) {
@@ -86,17 +87,23 @@ static int hvm_buffered_io_intercept(ior
case 2:
bp.size = 1;
break;
+ case 4:
+ bp.size = 2;
+ break;
+ case 8:
+ bp.size = 3;
+ qw = 1;
+ break;
default:
- /* Could use quad word semantics, but it only appears
- * to be useful for timeoffset data. */
- return 0;
- }
- bp.data = (uint16_t)p->data;
- bp.addr = (uint32_t)p->addr;
+ gdprintk(XENLOG_WARNING, "unexpected ioreq size:%"PRId64"\n", p->size);
+ return 0;
+ }
+ bp.data = p->data;
+ bp.addr = p->addr;
spin_lock(&v->domain->arch.hvm_domain.buffered_io_lock);
- if (pg->write_pointer - pg->read_pointer == IOREQ_BUFFER_SLOT_NUM) {
+ if (pg->write_pointer - pg->read_pointer >= IOREQ_BUFFER_SLOT_NUM - qw) {
/* the queue is full.
* send the iopacket through the normal path.
* NOTE: The arithimetic operation could handle the situation for
@@ -109,9 +116,15 @@ static int hvm_buffered_io_intercept(ior
memcpy(&pg->buf_ioreq[pg->write_pointer % IOREQ_BUFFER_SLOT_NUM],
&bp, sizeof(bp));
+ if (qw) {
+ bp.data = p->data >> 32;
+ memcpy(&pg->buf_ioreq[(pg->write_pointer + 1) % IOREQ_BUFFER_SLOT_NUM],
+ &bp, sizeof(bp));
+ }
+
/* Make the ioreq_t visible before write_pointer */
wmb();
- pg->write_pointer++;
+ pg->write_pointer += qw ? 2 : 1;
spin_unlock(&v->domain->arch.hvm_domain.buffered_io_lock);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-changelog] [xen-unstable] [IA64] Add support for 4 & 8 byte buffered io,
Xen patchbot-unstable <=
|
|
|
|
|