diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2000-09-07 19:21:31 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2000-09-07 19:21:31 +0000 |
commit | 90cd044330ba0fa276fd8b7ed15f9479e8fbd64d (patch) | |
tree | 583470e70d93723b5aaec932cbf4fe3439a3dedc /sys/kern | |
parent | 7ce06972c458e872f1399dbb47aa1412aa8497f2 (diff) |
On resume run the powerhook in installation order.
(the powerhooks were always run in reverse order).
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_subr.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index a26346a3ef2..59550ac7940 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_subr.c,v 1.15 2000/09/07 19:07:00 art Exp $ */ +/* $OpenBSD: kern_subr.c,v 1.16 2000/09/07 19:21:30 art Exp $ */ /* $NetBSD: kern_subr.c,v 1.15 1996/04/09 17:21:56 ragge Exp $ */ /* @@ -319,8 +319,14 @@ dopowerhooks(why) int s; s = splhigh(); - CIRCLEQ_FOREACH(dp, &powerhook_list, sfd_list) { - (*dp->sfd_fn)(why, dp->sfd_arg); + if (why == PWR_RESUME) { + CIRCLEQ_FOREACH_REVERSE(dp, &powerhook_list, sfd_list) { + (*dp->sfd_fn)(why, dp->sfd_arg); + } + } else { + CIRCLEQ_FOREACH(dp, &powerhook_list, sfd_list) { + (*dp->sfd_fn)(why, dp->sfd_arg); + } } splx(s); } |