diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-06-30 17:04:47 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-06-30 17:04:47 +0000 |
commit | e60453a1f9662ab70ca343120c93ba8c2eaa810d (patch) | |
tree | 68e5c6ce322265b1ab10a017dcb9fa7893ef15ce | |
parent | 277db345d097f9aea677703a189b52fe7150e46e (diff) |
Shortly run at ipl 1 in cpu_idle_cycle(), to let SIMH recognize the system
is idle; adapted from NetBSD
-rw-r--r-- | sys/arch/vax/include/cpu.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/arch/vax/include/cpu.h b/sys/arch/vax/include/cpu.h index 6284fd9e230..2f0d237bc1c 100644 --- a/sys/arch/vax/include/cpu.h +++ b/sys/arch/vax/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.45 2013/03/12 09:37:16 mpi Exp $ */ +/* $OpenBSD: cpu.h,v 1.46 2013/06/30 17:04:46 miod Exp $ */ /* $NetBSD: cpu.h,v 1.41 1999/10/21 20:01:36 ragge Exp $ */ /* @@ -134,9 +134,17 @@ extern int want_resched; /* resched() was called */ */ #define need_proftick(p) mtpr(AST_OK,PR_ASTLVL) +/* + * Temporarily switching to ipl 1 when the kernel is idle allows SIMH + * to recognize the system is idle, and relinquish CPU time as well. + */ #define cpu_idle_enter() do { /* nothing */ } while (0) -#define cpu_idle_cycle() do { /* nothing */ } while (0) #define cpu_idle_leave() do { /* nothing */ } while (0) +#define cpu_idle_cycle() \ +do { \ + mtpr(0x01, PR_IPL); \ + mtpr(0x00, PR_IPL); \ +} while (0) /* * This defines the I/O device register space size in pages. |