[PATCH] x86: i8253/i8259A lock cleanup
authorIngo Molnar <mingo@elte.hu>
Thu, 30 Jun 2005 09:58:55 +0000 (02:58 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 30 Jun 2005 15:45:10 +0000 (08:45 -0700)
Introduce proper declarations for i8253_lock and i8259A_lock.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 files changed:
arch/i386/kernel/apic.c
arch/i386/kernel/apm.c
arch/i386/kernel/io_apic.c
arch/i386/kernel/time.c
arch/i386/kernel/timers/timer_cyclone.c
arch/i386/kernel/timers/timer_pit.c
arch/i386/kernel/timers/timer_tsc.c
arch/i386/mach-voyager/voyager_basic.c
arch/x86_64/kernel/io_apic.c
drivers/ide/legacy/hd.c
drivers/input/gameport/gameport.c
drivers/input/joystick/analog.c
include/asm-i386/i8253.h [new file with mode: 0644]
include/asm-i386/mach-default/do_timer.h
include/asm-x86_64/io_apic.h

index 93df90bbb87e00e4f438d10d449f91b8faa4b801..bd1dbf3bd223cfd51021b7eec43d89b206a8bb95 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/desc.h>
 #include <asm/arch_hooks.h>
 #include <asm/hpet.h>
+#include <asm/i8253.h>
 
 #include <mach_apic.h>
 
@@ -879,7 +880,6 @@ fake_ioapic_page:
  */
 static unsigned int __devinit get_8254_timer_count(void)
 {
-       extern spinlock_t i8253_lock;
        unsigned long flags;
 
        unsigned int count;
index d48ce929096316bb433956ab4a278a159b12ff59..064211d5f41b62a9d4c593e94aaa2e37862434a6 100644 (file)
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/desc.h>
+#include <asm/i8253.h>
 
 #include "io_ports.h"
 
-extern spinlock_t i8253_lock;
 extern unsigned long get_cmos_time(void);
 extern void machine_real_restart(unsigned char *, int);
 
@@ -1168,8 +1168,7 @@ static void get_time_diff(void)
 static void reinit_timer(void)
 {
 #ifdef INIT_TIMER_AFTER_SUSPEND
-       unsigned long   flags;
-       extern spinlock_t i8253_lock;
+       unsigned long flags;
 
        spin_lock_irqsave(&i8253_lock, flags);
        /* set the clock to 100 Hz */
index 35eb8e29c485a05c6d5c6a17e8712f5ded763711..6578f40bd5012a0af9385d889f8a6cd37a6546a9 100644 (file)
@@ -37,6 +37,7 @@
 #include <asm/smp.h>
 #include <asm/desc.h>
 #include <asm/timer.h>
+#include <asm/i8259.h>
 
 #include <mach_apic.h>
 
@@ -1566,7 +1567,6 @@ void print_all_local_APICs (void)
 
 void /*__init*/ print_PIC(void)
 {
-       extern spinlock_t i8259A_lock;
        unsigned int v;
        unsigned long flags;
 
index e68d9fdb075962769a100f2eedce167187945463..2854c357377f18c8d98447e296dd63e3d877fb21 100644 (file)
@@ -68,7 +68,8 @@
 
 #include "io_ports.h"
 
-extern spinlock_t i8259A_lock;
+#include <asm/i8259.h>
+
 int pit_latch_buggy;              /* extern */
 
 #include "do_timer.h"
@@ -85,6 +86,8 @@ extern unsigned long wall_jiffies;
 DEFINE_SPINLOCK(rtc_lock);
 EXPORT_SYMBOL(rtc_lock);
 
+#include <asm/i8253.h>
+
 DEFINE_SPINLOCK(i8253_lock);
 EXPORT_SYMBOL(i8253_lock);
 
index f6f1206a11bb7ed9b2afc2c2714ef53b51157f57..13892a65c941b70ca77f51dcf88e607a018d821f 100644 (file)
@@ -17,9 +17,9 @@
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/fixmap.h>
-#include "io_ports.h"
+#include <asm/i8253.h>
 
-extern spinlock_t i8253_lock;
+#include "io_ports.h"
 
 /* Number of usecs that the last interrupt was delayed */
 static int delay_at_last_interrupt;
index 967d5453cd0ece3742ce5d50f24385f8e40590fc..06de036a820c23d63395e559ac9db1f5daedc2a3 100644 (file)
@@ -15,9 +15,8 @@
 #include <asm/smp.h>
 #include <asm/io.h>
 #include <asm/arch_hooks.h>
+#include <asm/i8253.h>
 
-extern spinlock_t i8259A_lock;
-extern spinlock_t i8253_lock;
 #include "do_timer.h"
 #include "io_ports.h"
 
@@ -166,7 +165,6 @@ struct init_timer_opts __initdata timer_pit_init = {
 
 void setup_pit_timer(void)
 {
-       extern spinlock_t i8253_lock;
        unsigned long flags;
 
        spin_lock_irqsave(&i8253_lock, flags);
index f46e625bab67f117a9ed046f1662515b434d389f..8f4e4d5bc560d58138f24ab514902f18a175bd57 100644 (file)
@@ -24,6 +24,7 @@
 #include "mach_timer.h"
 
 #include <asm/hpet.h>
+#include <asm/i8253.h>
 
 #ifdef CONFIG_HPET_TIMER
 static unsigned long hpet_usec_quotient;
@@ -35,8 +36,6 @@ static inline void cpufreq_delayed_get(void);
 
 int tsc_disable __devinitdata = 0;
 
-extern spinlock_t i8253_lock;
-
 static int use_tsc;
 /* Number of usecs that the last interrupt was delayed */
 static int delay_at_last_interrupt;
index 602aea240e9b55f67b5d1b4b7daf1f4a04b1e405..3e439ce5e1b22e47daa3f6285977d2958222299a 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/irq.h>
 #include <asm/tlbflush.h>
 #include <asm/arch_hooks.h>
+#include <asm/i8253.h>
 
 /*
  * Power off function, if any
@@ -182,7 +183,6 @@ voyager_timer_interrupt(struct pt_regs *regs)
                 * and swiftly introduce it to something sharp and
                 * pointy.  */
                __u16 val;
-               extern spinlock_t i8253_lock;
 
                spin_lock(&i8253_lock);
                
index 157190d986bbdb405d132a0b7230ea9a32792bfe..d206d7e49cf5a5381e0c72c96d202bb77c677020 100644 (file)
@@ -1064,7 +1064,6 @@ void print_all_local_APICs (void)
 
 void __apicdebuginit print_PIC(void)
 {
-       extern spinlock_t i8259A_lock;
        unsigned int v;
        unsigned long flags;
 
index e884cd4b22fdeaccab4310a801d1296ee3b73ff3..242029c9c0ca9a5e9e61b64011a3cd9dce7c31fd 100644 (file)
@@ -156,11 +156,13 @@ else \
 
 
 #if (HD_DELAY > 0)
+
+#include <asm/i8253.h>
+
 unsigned long last_req;
 
 unsigned long read_timer(void)
 {
-        extern spinlock_t i8253_lock;
        unsigned long t, flags;
        int i;
 
index 3e72c9b1461ee4c967c767d1004f11b3bbe70971..ab09cf4093e32595cbd84824db790e73f91d2881 100644 (file)
@@ -60,12 +60,13 @@ static void gameport_disconnect_port(struct gameport *gameport);
 
 #if defined(__i386__)
 
+#include <asm/i8253.h>
+
 #define DELTA(x,y)      ((y)-(x)+((y)<(x)?1193182/HZ:0))
 #define GET_TIME(x)     do { x = get_time_pit(); } while (0)
 
 static unsigned int get_time_pit(void)
 {
-       extern spinlock_t i8253_lock;
        unsigned long flags;
        unsigned int count;
 
index 504b7d5505671e066a3425c1037c87cec5252c3e..c3a5739030c3ba45d8dd1dda01cd79382faf3478 100644 (file)
@@ -140,12 +140,14 @@ struct analog_port {
  */
 
 #ifdef __i386__
+
+#include <asm/i8253.h>
+
 #define GET_TIME(x)    do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0)
 #define DELTA(x,y)     (cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0)))
 #define TIME_NAME      (cpu_has_tsc?"TSC":"PIT")
 static unsigned int get_time_pit(void)
 {
-        extern spinlock_t i8253_lock;
         unsigned long flags;
         unsigned int count;
 
diff --git a/include/asm-i386/i8253.h b/include/asm-i386/i8253.h
new file mode 100644 (file)
index 0000000..015d8df
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ASM_I8253_H__
+#define __ASM_I8253_H__
+
+extern spinlock_t i8253_lock;
+
+#endif /* __ASM_I8253_H__ */
index 03dd13a48a8cb4feee46e2b4559b8654ab22027f..56211414fc9595bc1aeb7a854e1133b6e5238036 100644 (file)
@@ -1,6 +1,7 @@
 /* defines for inline arch setup functions */
 
 #include <asm/apic.h>
+#include <asm/i8259.h>
 
 /**
  * do_timer_interrupt_hook - hook into timer tick
index 32573749004c7cbd2ea95ac37e78006d11ca9649..a8babd2bbe849c5197e96b908ffc7ded77e388e0 100644 (file)
@@ -217,4 +217,6 @@ extern int assign_irq_vector(int irq);
 
 void enable_NMI_through_LVT0 (void * dummy);
 
+extern spinlock_t i8259A_lock;
+
 #endif