Module Name:    src
Committed By:   ad
Date:           Mon Jan 13 12:03:42 UTC 2020

Modified Files:
        src/sys/arch/i386/i386: locore.S

Log Message:
It looks like Xen cpu_hatch() calls cpu_switchto() with prevlwp=NULL,
instead of calling idle_loop() directly.  I can't test a change to
cpu_hatch() right now so allow for prevlwp=NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/arch/i386/i386/locore.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.175 src/sys/arch/i386/i386/locore.S:1.176
--- src/sys/arch/i386/i386/locore.S:1.175	Wed Jan  8 17:38:41 2020
+++ src/sys/arch/i386/i386/locore.S	Mon Jan 13 12:03:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.175 2020/01/08 17:38:41 ad Exp $	*/
+/*	$NetBSD: locore.S,v 1.176 2020/01/13 12:03:41 ad Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.175 2020/01/08 17:38:41 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.176 2020/01/13 12:03:41 ad Exp $");
 
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
@@ -1316,10 +1316,14 @@ ENTRY(cpu_switchto)
 	movl	20(%esp),%edi		/* newlwp */
 	movl	24(%esp),%edx		/* returning */
 
+	testl	%esi,%esi		/* oldlwp = NULL ? */
+	jz	skip_save
+
 	/* Save old context. */
 	movl	L_PCB(%esi),%eax
 	movl	%esp,PCB_ESP(%eax)
 	movl	%ebp,PCB_EBP(%eax)
+skip_save:
 
 	/* Switch to newlwp's stack. */
 	movl	L_PCB(%edi),%ebx

Reply via email to