Subject: Re: CVS commit: src/sys/dev/ata
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Cherry G. Mathew <cherry@sdf.lonestar.org>
List: tech-kern
Date: 04/05/2006 18:24:12
>>>>> "Manuel" == Manuel Bouyer <bouyer@antioche.eu.org> writes:

    Manuel> On Wed, Apr 05, 2006 at 09:10:53AM +0530, Cherry G. Mathew
    Manuel> wrote:
    >> Moving thread to tech-kern, tech-macppc:
    >> 

[...]

    >> 
    >> Since it looks like this is a macppc specific thing, maybe a
    >> better way to do this would be to spin-down the disk in:
    >> machdep.c:cpu_reboot()

    Manuel> No, it's not a macppc specific thing, I think all systems
    Manuel> with IDE disks could benefit from this (it's possible that
    Manuel> PC systems with ACPI also don't sleep the drive before
    Manuel> power off). This has to be done in the shutdown hook, but
    Manuel> the shutdown hook needs more informations to work
    Manuel> properly.  I suspect this could benefit others drivers
    Manuel> using shutdown hooks too.


I'm trying to imagine what that would look like.
Would it be overkill if we introduced a 'payload' or 'in' variable in
struct hook_desk;

/*
 * A generic linear hook.
 */
struct hook_desc {
	LIST_ENTRY(hook_desc) hk_list;
	void	(*hk_fn)(void *);
	void	*hk_arg;
+       hookflag_t flag;
};


or would it be best for the flag to be global ?


-- 
~Cherry