Module Name:    src
Committed By:   matt
Date:           Mon Feb 27 15:50:49 UTC 2012

Modified Files:
        src/sys/arch/vax/include: cpu.h

Log Message:
Change cpu_idle to be an inline which sets IPL to 1 and then back to 0
so simh can recognize the kernel is idle.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/vax/include/cpu.h

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/vax/include/cpu.h
diff -u src/sys/arch/vax/include/cpu.h:1.93 src/sys/arch/vax/include/cpu.h:1.94
--- src/sys/arch/vax/include/cpu.h:1.93	Sun Jun  5 16:59:21 2011
+++ src/sys/arch/vax/include/cpu.h	Mon Feb 27 15:50:48 2012
@@ -1,4 +1,4 @@
-/*      $NetBSD: cpu.h,v 1.93 2011/06/05 16:59:21 matt Exp $      */
+/*      $NetBSD: cpu.h,v 1.94 2012/02/27 15:50:48 matt Exp $      */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden
@@ -162,7 +162,18 @@ extern int cpu_printfataltraps;
 		mtpr(AST_OK,PR_ASTLVL);		\
 	} while (/*CONSTCOND*/ 0)
 #define	cpu_proc_fork(x, y)	do { } while (/*CONSCOND*/0)
-#define	cpu_idle()		do { } while (/*CONSCOND*/0)
+
+/*
+ * This allows SIMH to recognize the kernel wants to sleep.
+ */
+static inline void
+cpu_idle(void)
+{
+	int ipl = mfpr(PR_IPL);
+	mtpr(1, PR_IPL);
+	mtpr(ipl, PR_IPL);
+}
+
 static inline bool
 cpu_intr_p(void)
 {

Reply via email to