From a4d6ea5ca98898c42c0eb533acbcb47c6edfb754 Mon Sep 17 00:00:00 2001 From: jkunz Date: Fri, 28 Jan 2005 17:38:49 +0000 Subject: [PATCH] Implement powerd(8) interface via sysmon(9) for power switch, controllable by sysctl(8). --- sys/arch/hp700/conf/files.hp700 | 6 ++++-- sys/arch/hp700/dev/lasi.c | 12 ++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/arch/hp700/conf/files.hp700 b/sys/arch/hp700/conf/files.hp700 index 31249ceb601b..ba2c18455d94 100644 --- a/sys/arch/hp700/conf/files.hp700 +++ b/sys/arch/hp700/conf/files.hp700 @@ -1,4 +1,4 @@ -# $NetBSD: files.hp700,v 1.12 2004/08/26 16:48:06 jkunz Exp $ +# $NetBSD: files.hp700,v 1.13 2005/01/28 17:38:50 jkunz Exp $ # # $OpenBSD: files.hp700,v 1.31 2001/06/26 02:41:25 mickey Exp $ # @@ -11,6 +11,7 @@ maxusers 2 8 64 # Status LEDs defflag USELEDS +defflag POWER_SWITCH # # "workstation console" routines @@ -70,7 +71,7 @@ define gscbus { } # Mainbus # -device mainbus {[irq = -1]} +device mainbus {[irq = -1]}: sysmon_power, sysmon_taskq attach mainbus at root file arch/hp700/hp700/mainbus.c mainbus @@ -228,6 +229,7 @@ file arch/hp700/hp700/intr.c file arch/hp700/hp700/machdep.c file arch/hp700/hp700/softintr.c file arch/hp700/hp700/sys_machdep.c +file arch/hp700/hp700/power.c power_switch file arch/hp700/dev/clock.c file dev/cons.c diff --git a/sys/arch/hp700/dev/lasi.c b/sys/arch/hp700/dev/lasi.c index 7d93760d2076..94a53de15d0f 100644 --- a/sys/arch/hp700/dev/lasi.c +++ b/sys/arch/hp700/dev/lasi.c @@ -1,4 +1,4 @@ -/* $NetBSD: lasi.c,v 1.8 2003/11/23 17:09:29 chs Exp $ */ +/* $NetBSD: lasi.c,v 1.9 2005/01/28 17:38:50 jkunz Exp $ */ /* $OpenBSD: lasi.c,v 1.4 2001/06/09 03:57:19 mickey Exp $ */ @@ -33,10 +33,12 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lasi.c,v 1.8 2003/11/23 17:09:29 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lasi.c,v 1.9 2005/01/28 17:38:50 jkunz Exp $"); #undef LASIDEBUG +#include "opt_power_switch.h" + #include #include #include @@ -49,6 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: lasi.c,v 1.8 2003/11/23 17:09:29 chs Exp $"); #include #include +#include struct lasi_hwr { u_int32_t lasi_power; @@ -193,6 +196,11 @@ lasiattach(struct device *parent, struct device *self, void *aux) sc->sc_int_reg.int_reg_mask = &sc->sc_trs->lasi_imr; sc->sc_int_reg.int_reg_req = &sc->sc_trs->lasi_irr; +#ifdef POWER_SWITCH + /* Tell power switch handling code about the Power Control Register */ + lasi_pwr_sw_reg = &sc->sc_hw->lasi_power; +#endif /* POWER_SWITCH */ + /* Attach the GSC bus. */ ga.ga_ca = *ca; /* clone from us */ ga.ga_name = "gsc";