Re: [patch 1/2] pcspeaker driver update

Andrew Morton
2005-06-15T20:33:49Z

Stas Sergeev <stsp@aknet.ru> wrote:
>
> Andrew Morton wrote:
> >> Attached one is just a clean-up:
> >> it removes the extern definitions
> >> for the i8253_lock and i8259A_lock,
> >> making the use of the appropriate
> >> headers instead.
> > A nice cleanup to make, however we cannot include asm/timer.h from generic
> > code, because only a few architectures have such a file.
> OK, what a bugger...
> Does the attached one look any better?

Well not really - for example you now have drivers/input/joystick/analog.c
including asm/8253pit.h, which not all architectures implement.

The basic problem is that we have generic code referring to an x86-specific
lock inside `#ifdef __i386__'.

Perhaps what you could do is to declare those locks in
include/asm-i386/hardirq.h and then make sure that all the relevant files
include <linux/hardirq.h>. That's a bit of an abuse of hardirq.h, but we
don't have a generic "platform.h" place to put things like this.

If abusing hardirq.h offends you then you could make sure that all
architectures implement asm/rtc.h (most already do) (just copy
include/asm-alpha/rtc.h) and put the declarations in
include/asm-i386/rtc.h, which is more appropriate.

Whichever way you go, please check that x86_64 works OK too.