Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Mar 1998 16:30:01 -0500 (EST)
From:      "Bruce M. Walter" <walter@fortean.com>
To:        Andrew Maltsev <am@amsoft.ru>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: APM power off (patch)
Message-ID:  <Pine.BSF.3.96.980309162230.17781A-100000@aries.fortean.com>
In-Reply-To: <199803092107.AAA05671@amsoft.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
> What can be more standart, than ioctl(/dev/apm) for userland and
> apm_power_off for kernel stuff?
> 
> Or should we call it machine_power_off() and place a hook in
> i386/machdep.c?

The idea is to have a kernel callout hook using the at_shutdown interface.
A driver like /dev/apm could insert a callout onto a queue which would get
called from within reboot() in kern_shutdown.c...  Whatever code you need
to poweroff the system would go in your callout in the device driver.

As for my patches, they add two things:

1) A third at_shutdown queue called SHUTDOWN_POWEROFF.  This is required
because some drivers (the DPT in particular) do cache flushing in the
SHUTDOWN_POST_SYNC queue.  Since the queues are not currently ordered,
there is no way to insure shutdown code would get called before the
adapter has written all disk info.

2) Shutdown queues can now be ordered.  The above is still necessary as
ordering doesn't really provide MUCH help.  A driver could still put it's
callout after a poweroff driver by using the wrong priority on accident.

My personal feeling is that I don't want any APM code at all in my
kernels, especially my server boxes.  I do want UPS shutdown code.  With
the callout mechanism, I only get the shutdown code which is in the
drivers I use *AND* the kernel doesn't have to know diddly squat about
what ugly and convoluted things I need to do to turn off a UPS or
Motherbord from Vendor XYZ with APM version 99.34 :)

- Bruce

========================================================================
|| Bruce M. Walter                    || 107 Timber Hollow Court #335 ||
|| Senior Network Consultant          || Chapel Hill, NC  27514       ||
|| Fortean Technologies, Inc.         || Tel: 919-967-4766            ||
|| Information Technology Consultants || Fax: 919-967-4395            ||
========================================================================
||       BSD Unix -- It's not just a job, it's a way of life!         ||
========================================================================


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980309162230.17781A-100000>