minimal alpha pt_regs fixes
PATCH 1/1 minimal alpha pt_regs fixes
----6a50792270fe3fdcc835484ccf3de569b1d8162d
arch/alpha/kernel/irq.c +4 -1
@@ -129,6 +129,7 @@ #define MAX_ILLEGAL_IRQS 16void handle_irq (int irq,struct pt_regs * regs) { +struct pt_regs *old_regs;/* * We ack quickly, we don't want the irq controller * thinking we're snobs just because some other CPU has
@@ -149,6 +150,7 @@ handle_irq(int irq, struct pt_regs * regreturn ; } + old_regs =set_irq_regs (regs);irq_enter ();/* * __do_IRQ() must be called with IPL_MAX. Note that we do not
@@ -157,6 +159,7 @@ handle_irq(int irq, struct pt_regs * reg* at IPL 0. */ local_irq_disable (); -__do_IRQ (irq, regs); +__do_IRQ (irq);irq_exit (); +set_irq_regs (old_regs); }
arch/alpha/kernel/proto.h +1 -1
@@ -133,7 +133,7 @@ extern void smp_percpu_timer_interrupt(s/* extern void reset_for_srm(void); */ /* time.c */ -extern irqreturn_t timer_interrupt (int irq,void *dev,struct pt_regs * regs); +extern irqreturn_t timer_interrupt (int irq,void *dev);extern void common_init_rtc (void );extern unsigned long est_cycle_freq;
arch/alpha/kernel/smp.c +5 -1
@@ -515,12 +515,15 @@ smp_cpus_done(unsigned int max_cpus)void smp_percpu_timer_interrupt (struct pt_regs *regs) { +struct pt_regs *old_regs;int cpu =smp_processor_id ();unsigned long user =user_mode (regs);struct cpuinfo_alpha *data = &cpu_data[cpu]; + old_regs =set_irq_regs (regs); +/* Record kernel PC. */ -profile_tick (CPU_PROFILING , regs); +profile_tick (CPU_PROFILING );if (!--data->prof_counter) {/* We need to make like a normal interrupt -- otherwise
@@ -534,6 +537,7 @@ smp_percpu_timer_interrupt(struct pt_regirq_exit (); } +set_irq_regs (old_regs); }int __init
arch/alpha/kernel/time.c +3 -3
@@ -104,7 +104,7 @@ unsigned long long sched_clock(void)* timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -irqreturn_t timer_interrupt (int irq,void *dev,struct pt_regs * regs) +irqreturn_t timer_interrupt (int irq,void *dev) {unsigned long delta;__u32 now;
@@ -112,7 +112,7 @@ irqreturn_t timer_interrupt(int irq, voi#ifndef CONFIG_SMP /* Not SMP, do kernel PC profiling here. */ -profile_tick (CPU_PROFILING , regs); +profile_tick (CPU_PROFILING );#endif write_seqlock (&xtime_lock);
@@ -132,7 +132,7 @@ #endifwhile (nticks >0 ) {do_timer (1 );#ifndef CONFIG_SMP -update_process_times (user_mode (regs)); +update_process_times (user_mode (get_irq_regs ()));#endif nticks--; }
include/asm-alpha/irq_regs.h new file +1 -0
@@ -0,0 +1 @@ +#include <asm-generic/irq_regs.h>
include/asm-alpha/irq_regs.h line 1
Quoted 7 lines · Al Viro
include/asm-alpha/irq_regs.h new file +1
-0@@ -0,0 +1 @@ +#include <asm-generic/irq_regs.h>
ACK, of course, but I wonder if we can do something about these 1-line header files.
Would it be reasonable to encourage developers to do something like
#ifdef ARCH_HAVE_FEATURE_FOO #include <asm/foo.h> #else #include <asm-generic/foo.h> #endif
to avoid these 1-line headers?
Jeff
Quoted 13 lines · Jeff Garzik
include/asm-alpha/irq_regs.h line 1
Quoted 7 lines · Al Viro
include/asm-alpha/irq_regs.h new file +1
-0@@ -0,0 +1 @@ +#include <asm-generic/irq_regs.h> ACK, of course, but I wonder if we can do something about these 1-line header files.
Quoted 7 lines
Would it be reasonable to encourage developers to do something like
#ifdef ARCH_HAVE_FEATURE_FOO #include <asm/foo.h> #else #include <asm-generic/foo.h> #endif
In something like linux/irq_regs.h? Might make sense...
Quoted 6 lines · Jeff Garzik
ACK, of course, but I wonder if we can do something about these 1-line header files.
Would it be reasonable to encourage developers to do something like
Quoted 7 lines
#ifdef ARCH_HAVE_FEATURE_FOO #include <asm/foo.h> #else #include <asm-generic/foo.h> #endifto avoid these 1-line headers?
I actually think that _unconditional_ simple code is much nicer than conditional one.
With the current setup, we have a number of one-line trivial headers (which actually could be symlinks - the only downside of that is that regular "patch" doesn't really know about them, even if git does, and can handle them, including the "extended git patch" format). They are unconditional, so following them never implies having to grep for different architectures doing different things.
I personally absolutely detest the "ARCH_HAVE_FEATURE_FOO" kind of thing that makes different architectures behave differently. I'd much rather have a few small and simple files that all look the same and are totally obvious, except for the odd architecture that actually caused the arch-split in the first place.
(Also, if the files really _are_ entirely identical, at least it won't add any overhead at all to git - they'll all use the same backing store)
Linus
Quoted 12 lines · Jeff Garzik
include/asm-alpha/irq_regs.h line 1
Quoted 7 lines · Al Viro
include/asm-alpha/irq_regs.h new file +1
-0@@ -0,0 +1 @@ +#include <asm-generic/irq_regs.h> ACK, of course, but I wonder if we can do something about these 1-line header files.
It would be even more simple and future proof if we could in some way do it so "#include <foo/bar.h>" would pick up bar.h from asm-$(ARCH) if it exists and otherwise pick up asm-generic/bar.h.
Then we could include the generic one in asm-generic and
all architectures would include it except those that provide their own variant. The asm-$(ARCH) specific files would need a way to include the asm-generic version.
I have no idea handy for how to actually implment this but wanted just to share the idea.
The trade-off is that if it gets too iplicit then suddenly users will loose overview of how it works.
Sam
Quoted 5 lines · Sam Ravnborg
It would be even more simple and future proof if we could in some way do it so "#include <
foo/bar.h>" would pick upbar.hfrom asm-$(ARCH) if it exists and otherwise pick upasm-generic/bar.h.Then we could include the generic one in asm-generic and all architectures would include it except those that provide their own variant. The asm-$(ARCH) specific files would need a way to include the asm-generic version.
I have no idea handy for how to actually implement this but wanted just to share the idea. The trade-off is that if it gets too implicit then suddenly users will loose overview of how it works.
Well if we changed the include dir to look like this:
include/linux/bar.h
include/asm/foo.h
include/asm-powerpc/asm/foo.h
include/asm-frv/asm/foo.h doesn't exist, defaults to generic version.
Then I suppose you could carefully order the -I directives like this:
gcc [...] -Iinclude/asm-$(ARCH) -Iinclude [...]
The problem with that is if you only want to partially override asm/foo.h, and include it from your arch-specific version. I guess to solve that you could also do this:
include/linux/bar.h
include/asm-generic/asm/foo.h include/asm-powerpc/asm/foo.h
include/asm-frv/asm/foo.h doesn't exist, defaults to generic version.
And:
gcc [...] -Iinclude/asm-$(ARCH) -Iinclude/asm-generic -Iinclude [...]
Then you it would be possible to selectively override any headers you wanted too. It also gets rid of that nasty symlink problem. The only remaining trick would be teaching "headers_check" and "headers_install" about it.
Cheers,
Kyle Moffett