summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-03-18 01:45:02 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2013-03-18 01:45:02 (GMT)
commit1658b7dcd16a2a9f75a984de14630082b4ea20e2 (patch)
tree42b3f17bf93310e605cbf39fc518ca2a35170314
parent5aae4c665e6f7541f5126c9de2b3971e6e129cf7 (diff)
downloadvirtio9p-1658b7dcd16a2a9f75a984de14630082b4ea20e2.zip
virtio9p-1658b7dcd16a2a9f75a984de14630082b4ea20e2.tar.gz
virtio9p-1658b7dcd16a2a9f75a984de14630082b4ea20e2.tar.bz2
virtio9p-1658b7dcd16a2a9f75a984de14630082b4ea20e2.tar.xz
message.asm: on exit, point %di to payload
-rw-r--r--message.asm20
1 files changed, 18 insertions, 2 deletions
diff --git a/message.asm b/message.asm
index dbd4119..3d2170c 100644
--- a/message.asm
+++ b/message.asm
@@ -42,7 +42,7 @@
* %cx -> data length if read or write
*
* On return:
- * reply in msgbuf, %di -> msgbuf
+ * reply in msgbuf, %di -> msgbuf+7 (= payload)
* carry set if error reply or protocol error, error code in %ax
* ------------------------------------------------------------------------- */
@@ -173,6 +173,21 @@ GPROC(do_message)
/* Now we have a response */
popw %dx /* Restore data/opcode */
+#ifdef DEBUG
+ /* Dump the response */
+ pushaw
+ debugmsg "< "
+ movw msgbuf,%si
+ movw (%si),%cx
+412:
+ lodsb
+ pushw %ax
+ call debug_printhex2
+ loopw 412b
+ call debug_crlf
+ popaw
+#endif
+
testb have_vds,%dh
jz 6f /* No VDS or no data */
@@ -187,7 +202,7 @@ GPROC(do_message)
movw $L_EIO,%ax /* Error code = EIO */
movw msgbuf,%di
- cmpl $7,(%di) /* Length + opcode + tag = 7 bytes*/
+ cmpl $7,(%di) /* Length + opcode + tag = 7 bytes */
jb error /* Reply impossibly small */
movw last_tag,%cx /* Tag must match! */
@@ -205,6 +220,7 @@ msg_error:
error:
stc
ok:
+ addw $7,%di /* CF <- 0, %di <- payload */
retw
END(do_message)