Implement powerd(8) interface via sysmon(9) for power switch, controllable by sysctl(8).

This commit is contained in:
jkunz 2005-01-28 17:38:49 +00:00
parent 58332f0318
commit a4d6ea5ca9
2 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
@ -49,6 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: lasi.c,v 1.8 2003/11/23 17:09:29 chs Exp $");
#include <hp700/dev/cpudevs.h>
#include <hp700/gsc/gscbusvar.h>
#include <hp700/hp700/power.h>
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";