Re: [RFC] machine_reboot and friends

From: Dave Hansen (
Date: Sun Jun 08 2003 - 00:18:48 EST

On Fri, 2003-06-06 at 14:51, Anders Gustafsson wrote:
> What if machine_restart/machine_halt/machine_power_off were made
> functionpointers instead? And let the architectures assign to them
> instead of defining the functions? Some architectures are already
> doing this.

We don't usually abstract out architecture features with function
pointers. The more standard way is with definitions in
architecture-specific files. Also, the


stuff is fairly messy, and it would probably be preferable to do
something like this instead:

void machine_restart(void)

Then, let the architectures define arch_machine_restart(), and keep tons
of duplicate if()s from being scattered around.

> A bit orthogonal: Different architechtures do different things if the action
> fails (or is unimplemented), some panic, some return, some do "for(;;);",
> isn't it about time someone defined the semantics for these functions?

Not really. It's architecture specific :) Some machines simply don't
have a recourse when something that low-level fails. Is there a case
when something happens that you don't expect? The three architecures
that I compile for work happily, and as I expect.

Dave Hansen

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Jun 15 2003 - 22:00:18 EST