Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Jun 2003 13:42:19 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 32320 for review
Message-ID:  <200306012042.h51KgJkS069320@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=32320

Change 32320 by peter@peter_hammer on 2003/06/01 13:42:17

	initial workaround for ERESTART causing suscall args to be trashed.
	I've got to do this better and make fast_syscall() do the register
	unwinding itself on the way to doreti since we shouldn't depend on
	having arrived via fast_syscall here.

Affected files ...

.. //depot/projects/hammer/sys/amd64/amd64/trap.c#22 edit

Differences ...

==== //depot/projects/hammer/sys/amd64/amd64/trap.c#22 (text+ko) ====

@@ -760,10 +760,14 @@
 
 	case ERESTART:
 		/*
-		 * Reconstruct pc, assuming lcall $X,y is 7 bytes,
-		 * int 0x80 is 2 bytes. We saved this in tf_err.
+		 * Reconstruct pc, we know that 'syscall' is 2 bytes.
+		 * We have to do a full context restore so that %r10
+		 * (which was holding the value of %rcx) is restored for
+		 * the next iteration.
 		 */
 		frame.tf_rip -= frame.tf_err;
+		frame.tf_r10 = frame.tf_rcx;
+		td->td_pcb->pcb_flags |= PCB_FULLCTX;
 		break;
 
 	case EJUSTRETURN:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306012042.h51KgJkS069320>