tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: power management and pseudo-devices



On Sun, Jul 18, 2010 at 04:52:58PM -0700, Paul Goyette wrote:
[...]
> >>+
> >>+extern struct cfdriver swwdog_cd;
> >
> >Include "ioconf.h" I think.
> 
> Tried that.  It works for compiling the kernel.  Unfortunately,
> swwdog is included in rump, and there doesn't seem to be an ioconf.h
> available for the librump build.

Well, whatever.  I don't think I want to look at that.

[...]
> >Ok, so you should be aware here that you're changing the logic of that
> >function, and you're only allowing for the creation of one swwdog(4).
> 
> The limitation of only one swwdog(4) was deliberate, especially
> since the original code had a "#define NSWWDOG 1" anyway!

I missed that in the initial code.

[...]
> >While you're there, I guess you could make swwdog_reboot a sysctl node.
> 
> Good point.  Would this belong in the kern or machdep sysctl tree?

I would set hw.swwdog.reboot.  And I don't understand why you bother
setting that up in swwdog_attach(), when we've just discussed there
could only be one anyway (and assuming that there could be more than
one, it seems to me that it would be plain overdesign to allow the
setting to be set per-device, but that's just me).

> -int swwdog_reboot = 0;               /* set for panic instead of reboot */
> +bool swwdog_reboot = 0;              /* set for panic instead of reboot */

If you change its type to bool, you might as well change the value to
false.

> Index: src/sys/dev/sysmon/files.sysmon
> ===================================================================
> RCS file: /cvsroot/src/sys/dev/sysmon/files.sysmon,v
> retrieving revision 1.11
> diff -u -p -r1.11 files.sysmon
> --- src/sys/dev/sysmon/files.sysmon   30 Jan 2010 21:55:28 -0000      1.11
> +++ src/sys/dev/sysmon/files.sysmon   18 Jul 2010 23:21:06 -0000
> @@ -18,5 +18,5 @@ file        dev/sysmon/sysmon_wdog.c        sysmon_wdo
>  file dev/sysmon/sysmon.c             sysmon_envsys | sysmon_wdog |
>                                       sysmon_power
>  
> -defpseudo swwdog: sysmon_wdog
> +defpseudodev swwdog: sysmon_wdog
>  file    dev/sysmon/swwdog.c            swwdog

You know, I was looking at -5 sources, which have the needs-count flag
there and therefore don't have the #define for NSWWDOG.  Must be pooka's
doing I guess;  it's certainly better that way.

-- 
Quentin Garnier - cube%cubidou.net@localhost - cube%NetBSD.org@localhost
"See the look on my face from staying too long in one place
[...] every time the morning breaks I know I'm closer to falling"
KT Tunstall, Saving My Face, Drastic Fantastic, 2007.

Attachment: pgpmkK1ork7vq.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index