shithub: riscv

Download patch

ref: 1cfa405d0a272cbd7df22d4b9767eb57e21cc21f
parent: 48c5da7a64804bf649ff815c778064dfe8c59711
author: aiju <devnull@localhost>
date: Mon Jun 12 13:09:11 EDT 2017

pc64: set error code and trap fields in Ureg* on syscalls

--- a/sys/src/9/pc64/l.s
+++ b/sys/src/9/pc64/l.s
@@ -722,8 +722,10 @@
 	PUSHQ	R11				/* old flags */
 	PUSHQ	$UESEL				/* old code segment */
 	PUSHQ	CX				/* old ip */
+	PUSHQ	$0				/* error code */
+	PUSHQ	$64				/* trap number (VectorSYSCALL) */
 
-	SUBQ	$(8 + 23*8-5*8), SP		/* arg + sizeof(Ureg)-pushed */
+	SUBQ	$(8 + 23*8-7*8), SP		/* arg + sizeof(Ureg)-pushed */
 
 	MOVQ	RMACH, (15*8)(SP)		/* old r15 */
 	MOVQ	RUSER, (14*8)(SP)		/* old r14 */