From owner-freebsd-hackers Mon Mar 9 13:32:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA04320 for freebsd-hackers-outgoing; Mon, 9 Mar 1998 13:32:13 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from aries.fortean.com (aries.fortean.com [209.42.194.114]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA04250 for ; Mon, 9 Mar 1998 13:31:46 -0800 (PST) (envelope-from walter@fortean.com) Received: from localhost (walter@localhost) by aries.fortean.com (8.8.8/8.8.8) with SMTP id QAA17805; Mon, 9 Mar 1998 16:30:01 -0500 (EST) (envelope-from walter@fortean.com) X-Authentication-Warning: aries.fortean.com: walter owned process doing -bs Date: Mon, 9 Mar 1998 16:30:01 -0500 (EST) From: "Bruce M. Walter" To: Andrew Maltsev cc: freebsd-hackers@FreeBSD.ORG Subject: Re: APM power off (patch) In-Reply-To: <199803092107.AAA05671@amsoft.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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