Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc Add machdep.powerpc sysctl. Change the def...
details: https://anonhg.NetBSD.org/src/rev/b51d1354016b
branches: trunk
changeset: 534105:b51d1354016b
user: matt <matt%NetBSD.org@localhost>
date: Tue Jul 16 23:04:20 2002 +0000
description:
Add machdep.powerpc sysctl. Change the default value of powersave to -1
(< 0 mean no powersave available). Enable powersave by default for
750/7400/7410 but leave if off for 7450/7455.
diffstat:
sys/arch/powerpc/include/cpu.h | 6 ++++--
sys/arch/powerpc/mpc6xx/cpu_subr.c | 4 ++--
sys/arch/powerpc/powerpc/locore_subr.S | 8 ++++----
sys/arch/powerpc/powerpc/powerpc_machdep.c | 9 ++++++++-
4 files changed, 18 insertions(+), 9 deletions(-)
diffs (104 lines):
diff -r d1a0254327e8 -r b51d1354016b sys/arch/powerpc/include/cpu.h
--- a/sys/arch/powerpc/include/cpu.h Tue Jul 16 22:00:31 2002 +0000
+++ b/sys/arch/powerpc/include/cpu.h Tue Jul 16 23:04:20 2002 +0000
@@ -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 @@
#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 @@
{ "cacheinfo", CTLTYPE_STRUCT }, \
{ "altivec", CTLTYPE_INT }, \
{ "model", CTLTYPE_STRING }, \
+ { "powersave", CTLTYPE_INT }, \
}
#endif /* _POWERPC_CPU_H_ */
diff -r d1a0254327e8 -r b51d1354016b sys/arch/powerpc/mpc6xx/cpu_subr.c
--- a/sys/arch/powerpc/mpc6xx/cpu_subr.c Tue Jul 16 22:00:31 2002 +0000
+++ b/sys/arch/powerpc/mpc6xx/cpu_subr.c Tue Jul 16 23:04:20 2002 +0000
@@ -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 @@
/* 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 -r d1a0254327e8 -r b51d1354016b sys/arch/powerpc/powerpc/locore_subr.S
--- a/sys/arch/powerpc/powerpc/locore_subr.S Tue Jul 16 22:00:31 2002 +0000
+++ b/sys/arch/powerpc/powerpc/locore_subr.S Tue Jul 16 23:04:20 2002 +0000
@@ -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 @@
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 -r d1a0254327e8 -r b51d1354016b sys/arch/powerpc/powerpc/powerpc_machdep.c
--- a/sys/arch/powerpc/powerpc/powerpc_machdep.c Tue Jul 16 22:00:31 2002 +0000
+++ b/sys/arch/powerpc/powerpc/powerpc_machdep.c Tue Jul 16 23:04:20 2002 +0000
@@ -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 @@
&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
Home |
Main Index |
Thread Index |
Old Index