Re: [PATCH] arch-specific callout in panic()

From: viro
Date: Mon Feb 23 2004 - 00:58:02 EST


On Sun, Feb 22, 2004 at 11:13:34PM -0600, Mike Strosaker wrote:
> Hello, All:
>
> There are some ppc64-specific actions that should be taken upon a
> kernel panic. Rather than adding a new #ifdef in panic(), it seems to
> me that it would be worthwhile to add a single callout, and move the
> arch-specific code out to the arch subtrees. Does this seem reasonable,
> or should another #ifdef be added in panic() to perform the ppc64-
> specific actions?

Don't do it that way. Add a weak alias to empty function and override it
on ppc64 by defining a function with the same name.

See how cond_syscall() is done - similar trick will work here. There's
no need to mess with the architectures that do not use your hook.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/