diff --git a/sys/arch/powerpc/include/cpu.h b/sys/arch/powerpc/include/cpu.h index 7c64f6266ae1..17a40fa2ba3f 100644 --- a/sys/arch/powerpc/include/cpu.h +++ b/sys/arch/powerpc/include/cpu.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.16 2002/07/05 18:45:21 matt Exp $ */ +/* $NetBSD: cpu.h,v 1.17 2002/07/16 23:04:20 matt Exp $ */ /* * Copyright (C) 1999 Wolfgang Solfrank. @@ -214,7 +214,8 @@ void __syncicache(void *, size_t); #define CPU_CACHEINFO 5 #define CPU_ALTIVEC 6 #define CPU_MODEL 7 -#define CPU_MAXID 8 +#define CPU_POWERSAVE 8 +#define CPU_MAXID 9 #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ @@ -225,6 +226,7 @@ void __syncicache(void *, size_t); { "cacheinfo", CTLTYPE_STRUCT }, \ { "altivec", CTLTYPE_INT }, \ { "model", CTLTYPE_STRING }, \ + { "powersave", CTLTYPE_INT }, \ } #endif /* _POWERPC_CPU_H_ */ diff --git a/sys/arch/powerpc/mpc6xx/cpu_subr.c b/sys/arch/powerpc/mpc6xx/cpu_subr.c index 4058a7965a1e..f412a0807b6f 100644 --- a/sys/arch/powerpc/mpc6xx/cpu_subr.c +++ b/sys/arch/powerpc/mpc6xx/cpu_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_subr.c,v 1.23 2002/07/05 18:45:22 matt Exp $ */ +/* $NetBSD: cpu_subr.c,v 1.24 2002/07/16 23:04:21 matt Exp $ */ /*- * Copyright (c) 2001 Matt Thomas. @@ -217,7 +217,7 @@ cpu_attach_common(struct device *self, int id) /* Select NAP mode. */ hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP); hid0 |= HID0_NAP | HID0_DPM; - powersave = 1; + powersave = 0; /* but don't use it */ break; default: diff --git a/sys/arch/powerpc/powerpc/locore_subr.S b/sys/arch/powerpc/powerpc/locore_subr.S index 57622883924a..29905c37cd69 100644 --- a/sys/arch/powerpc/powerpc/locore_subr.S +++ b/sys/arch/powerpc/powerpc/locore_subr.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore_subr.S,v 1.3 2002/06/21 00:46:18 matt Exp $ */ +/* $NetBSD: locore_subr.S,v 1.4 2002/07/16 23:04:21 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -40,7 +40,7 @@ .data GLOBAL(powersave) - .long 0 + .long -1 .text /* @@ -68,8 +68,8 @@ ASENTRY(Idle) lis 8,_C_LABEL(powersave)@ha lwz 9,_C_LABEL(powersave)@l(8) - or. 9,9,9 - beq 1f + add. 9,9,9 + ble 1f sync oris 3,3,PSL_POW@h /* enter power saving mode */ diff --git a/sys/arch/powerpc/powerpc/powerpc_machdep.c b/sys/arch/powerpc/powerpc/powerpc_machdep.c index 2be43e781a59..35b478080776 100644 --- a/sys/arch/powerpc/powerpc/powerpc_machdep.c +++ b/sys/arch/powerpc/powerpc/powerpc_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: powerpc_machdep.c,v 1.12 2002/07/05 18:45:22 matt Exp $ */ +/* $NetBSD: powerpc_machdep.c,v 1.13 2002/07/16 23:04:21 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -42,6 +42,9 @@ int cpu_timebase; int cpu_printfataltraps; +#ifdef PPC_MPC6XX +extern int powersave; +#endif /* * Set set up registers on exec. @@ -127,6 +130,10 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) &curcpu()->ci_ci, sizeof(curcpu()->ci_ci)); #ifdef PPC_MPC6XX + case CPU_POWERSAVE: + if (powersave < 0) + return sysctl_rdint(oldp, oldlenp, newp, powersave); + return sysctl_int(oldp, oldlenp, newp, newlen, &powersave); case CPU_ALTIVEC: return sysctl_rdint(oldp, oldlenp, newp, cpu_altivec); #else