diff options
Diffstat (limited to 'include/asm-ia64')
-rw-r--r-- | include/asm-ia64/io.h | 8 | ||||
-rw-r--r-- | include/asm-ia64/iosapic.h | 4 | ||||
-rw-r--r-- | include/asm-ia64/spinlock.h | 33 |
3 files changed, 26 insertions, 19 deletions
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h index 491e9d1fc538..54e7637a326c 100644 --- a/include/asm-ia64/io.h +++ b/include/asm-ia64/io.h | |||
@@ -120,14 +120,6 @@ static inline void ___ia64_mmiowb(void) | |||
120 | ia64_mfa(); | 120 | ia64_mfa(); |
121 | } | 121 | } |
122 | 122 | ||
123 | static inline const unsigned long | ||
124 | __ia64_get_io_port_base (void) | ||
125 | { | ||
126 | extern unsigned long ia64_iobase; | ||
127 | |||
128 | return ia64_iobase; | ||
129 | } | ||
130 | |||
131 | static inline void* | 123 | static inline void* |
132 | __ia64_mk_io_addr (unsigned long port) | 124 | __ia64_mk_io_addr (unsigned long port) |
133 | { | 125 | { |
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h index 1093f35b3b90..a429fe225b07 100644 --- a/include/asm-ia64/iosapic.h +++ b/include/asm-ia64/iosapic.h | |||
@@ -75,6 +75,8 @@ extern int __devinit iosapic_init (unsigned long address, | |||
75 | unsigned int gsi_base); | 75 | unsigned int gsi_base); |
76 | #ifdef CONFIG_HOTPLUG | 76 | #ifdef CONFIG_HOTPLUG |
77 | extern int iosapic_remove (unsigned int gsi_base); | 77 | extern int iosapic_remove (unsigned int gsi_base); |
78 | #else | ||
79 | #define iosapic_remove(gsi_base) (-EINVAL) | ||
78 | #endif /* CONFIG_HOTPLUG */ | 80 | #endif /* CONFIG_HOTPLUG */ |
79 | extern int gsi_to_vector (unsigned int gsi); | 81 | extern int gsi_to_vector (unsigned int gsi); |
80 | extern int gsi_to_irq (unsigned int gsi); | 82 | extern int gsi_to_irq (unsigned int gsi); |
@@ -102,9 +104,7 @@ extern void __devinit map_iosapic_to_node (unsigned int, int); | |||
102 | #else | 104 | #else |
103 | #define iosapic_system_init(pcat_compat) do { } while (0) | 105 | #define iosapic_system_init(pcat_compat) do { } while (0) |
104 | #define iosapic_init(address,gsi_base) (-EINVAL) | 106 | #define iosapic_init(address,gsi_base) (-EINVAL) |
105 | #ifdef CONFIG_HOTPLUG | ||
106 | #define iosapic_remove(gsi_base) (-ENODEV) | 107 | #define iosapic_remove(gsi_base) (-ENODEV) |
107 | #endif /* CONFIG_HOTPLUG */ | ||
108 | #define iosapic_register_intr(gsi,polarity,trigger) (gsi) | 108 | #define iosapic_register_intr(gsi,polarity,trigger) (gsi) |
109 | #define iosapic_unregister_intr(irq) do { } while (0) | 109 | #define iosapic_unregister_intr(irq) do { } while (0) |
110 | #define iosapic_override_isa_irq(isa_irq,gsi,polarity,trigger) do { } while (0) | 110 | #define iosapic_override_isa_irq(isa_irq,gsi,polarity,trigger) do { } while (0) |
diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h index 909936f25512..d2430aa0d49d 100644 --- a/include/asm-ia64/spinlock.h +++ b/include/asm-ia64/spinlock.h | |||
@@ -93,7 +93,15 @@ _raw_spin_lock_flags (spinlock_t *lock, unsigned long flags) | |||
93 | # endif /* CONFIG_MCKINLEY */ | 93 | # endif /* CONFIG_MCKINLEY */ |
94 | #endif | 94 | #endif |
95 | } | 95 | } |
96 | |||
96 | #define _raw_spin_lock(lock) _raw_spin_lock_flags(lock, 0) | 97 | #define _raw_spin_lock(lock) _raw_spin_lock_flags(lock, 0) |
98 | |||
99 | /* Unlock by doing an ordered store and releasing the cacheline with nta */ | ||
100 | static inline void _raw_spin_unlock(spinlock_t *x) { | ||
101 | barrier(); | ||
102 | asm volatile ("st4.rel.nta [%0] = r0\n\t" :: "r"(x)); | ||
103 | } | ||
104 | |||
97 | #else /* !ASM_SUPPORTED */ | 105 | #else /* !ASM_SUPPORTED */ |
98 | #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) | 106 | #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) |
99 | # define _raw_spin_lock(x) \ | 107 | # define _raw_spin_lock(x) \ |
@@ -109,16 +117,16 @@ do { \ | |||
109 | } while (ia64_spinlock_val); \ | 117 | } while (ia64_spinlock_val); \ |
110 | } \ | 118 | } \ |
111 | } while (0) | 119 | } while (0) |
120 | #define _raw_spin_unlock(x) do { barrier(); ((spinlock_t *) x)->lock = 0; } while (0) | ||
112 | #endif /* !ASM_SUPPORTED */ | 121 | #endif /* !ASM_SUPPORTED */ |
113 | 122 | ||
114 | #define spin_is_locked(x) ((x)->lock != 0) | 123 | #define spin_is_locked(x) ((x)->lock != 0) |
115 | #define _raw_spin_unlock(x) do { barrier(); ((spinlock_t *) x)->lock = 0; } while (0) | ||
116 | #define _raw_spin_trylock(x) (cmpxchg_acq(&(x)->lock, 0, 1) == 0) | 124 | #define _raw_spin_trylock(x) (cmpxchg_acq(&(x)->lock, 0, 1) == 0) |
117 | #define spin_unlock_wait(x) do { barrier(); } while ((x)->lock) | 125 | #define spin_unlock_wait(x) do { barrier(); } while ((x)->lock) |
118 | 126 | ||
119 | typedef struct { | 127 | typedef struct { |
120 | volatile unsigned int read_counter : 31; | 128 | volatile unsigned int read_counter : 24; |
121 | volatile unsigned int write_lock : 1; | 129 | volatile unsigned int write_lock : 8; |
122 | #ifdef CONFIG_PREEMPT | 130 | #ifdef CONFIG_PREEMPT |
123 | unsigned int break_lock; | 131 | unsigned int break_lock; |
124 | #endif | 132 | #endif |
@@ -174,6 +182,13 @@ do { \ | |||
174 | (result == 0); \ | 182 | (result == 0); \ |
175 | }) | 183 | }) |
176 | 184 | ||
185 | static inline void _raw_write_unlock(rwlock_t *x) | ||
186 | { | ||
187 | u8 *y = (u8 *)x; | ||
188 | barrier(); | ||
189 | asm volatile ("st1.rel.nta [%0] = r0\n\t" :: "r"(y+3) : "memory" ); | ||
190 | } | ||
191 | |||
177 | #else /* !ASM_SUPPORTED */ | 192 | #else /* !ASM_SUPPORTED */ |
178 | 193 | ||
179 | #define _raw_write_lock(l) \ | 194 | #define _raw_write_lock(l) \ |
@@ -195,14 +210,14 @@ do { \ | |||
195 | (ia64_val == 0); \ | 210 | (ia64_val == 0); \ |
196 | }) | 211 | }) |
197 | 212 | ||
213 | static inline void _raw_write_unlock(rwlock_t *x) | ||
214 | { | ||
215 | barrier(); | ||
216 | x->write_lock = 0; | ||
217 | } | ||
218 | |||
198 | #endif /* !ASM_SUPPORTED */ | 219 | #endif /* !ASM_SUPPORTED */ |
199 | 220 | ||
200 | #define _raw_read_trylock(lock) generic_raw_read_trylock(lock) | 221 | #define _raw_read_trylock(lock) generic_raw_read_trylock(lock) |
201 | 222 | ||
202 | #define _raw_write_unlock(x) \ | ||
203 | ({ \ | ||
204 | smp_mb__before_clear_bit(); /* need barrier before releasing lock... */ \ | ||
205 | clear_bit(31, (x)); \ | ||
206 | }) | ||
207 | |||
208 | #endif /* _ASM_IA64_SPINLOCK_H */ | 223 | #endif /* _ASM_IA64_SPINLOCK_H */ |