diff options
Diffstat (limited to 'include/asm-alpha')
-rw-r--r-- | include/asm-alpha/core_mcpcia.h | 2 | ||||
-rw-r--r-- | include/asm-alpha/core_t2.h | 14 | ||||
-rw-r--r-- | include/asm-alpha/io.h | 6 | ||||
-rw-r--r-- | include/asm-alpha/mmu_context.h | 6 | ||||
-rw-r--r-- | include/asm-alpha/percpu.h | 74 | ||||
-rw-r--r-- | include/asm-alpha/system.h | 10 | ||||
-rw-r--r-- | include/asm-alpha/vga.h | 6 |
7 files changed, 95 insertions, 23 deletions
diff --git a/include/asm-alpha/core_mcpcia.h b/include/asm-alpha/core_mcpcia.h index 525b4f6a7ace..acf55b483472 100644 --- a/include/asm-alpha/core_mcpcia.h +++ b/include/asm-alpha/core_mcpcia.h | |||
@@ -261,7 +261,7 @@ struct el_MCPCIA_uncorrected_frame_mcheck { | |||
261 | } | 261 | } |
262 | #endif | 262 | #endif |
263 | 263 | ||
264 | static inline int __mcpcia_is_mmio(unsigned long addr) | 264 | extern inline int __mcpcia_is_mmio(unsigned long addr) |
265 | { | 265 | { |
266 | return (addr & 0x80000000UL) == 0; | 266 | return (addr & 0x80000000UL) == 0; |
267 | } | 267 | } |
diff --git a/include/asm-alpha/core_t2.h b/include/asm-alpha/core_t2.h index 90e6b5d6c214..46bfff58f670 100644 --- a/include/asm-alpha/core_t2.h +++ b/include/asm-alpha/core_t2.h | |||
@@ -356,13 +356,13 @@ struct el_t2_frame_corrected { | |||
356 | #define vip volatile int * | 356 | #define vip volatile int * |
357 | #define vuip volatile unsigned int * | 357 | #define vuip volatile unsigned int * |
358 | 358 | ||
359 | static inline u8 t2_inb(unsigned long addr) | 359 | extern inline u8 t2_inb(unsigned long addr) |
360 | { | 360 | { |
361 | long result = *(vip) ((addr << 5) + T2_IO + 0x00); | 361 | long result = *(vip) ((addr << 5) + T2_IO + 0x00); |
362 | return __kernel_extbl(result, addr & 3); | 362 | return __kernel_extbl(result, addr & 3); |
363 | } | 363 | } |
364 | 364 | ||
365 | static inline void t2_outb(u8 b, unsigned long addr) | 365 | extern inline void t2_outb(u8 b, unsigned long addr) |
366 | { | 366 | { |
367 | unsigned long w; | 367 | unsigned long w; |
368 | 368 | ||
@@ -371,13 +371,13 @@ static inline void t2_outb(u8 b, unsigned long addr) | |||
371 | mb(); | 371 | mb(); |
372 | } | 372 | } |
373 | 373 | ||
374 | static inline u16 t2_inw(unsigned long addr) | 374 | extern inline u16 t2_inw(unsigned long addr) |
375 | { | 375 | { |
376 | long result = *(vip) ((addr << 5) + T2_IO + 0x08); | 376 | long result = *(vip) ((addr << 5) + T2_IO + 0x08); |
377 | return __kernel_extwl(result, addr & 3); | 377 | return __kernel_extwl(result, addr & 3); |
378 | } | 378 | } |
379 | 379 | ||
380 | static inline void t2_outw(u16 b, unsigned long addr) | 380 | extern inline void t2_outw(u16 b, unsigned long addr) |
381 | { | 381 | { |
382 | unsigned long w; | 382 | unsigned long w; |
383 | 383 | ||
@@ -386,12 +386,12 @@ static inline void t2_outw(u16 b, unsigned long addr) | |||
386 | mb(); | 386 | mb(); |
387 | } | 387 | } |
388 | 388 | ||
389 | static inline u32 t2_inl(unsigned long addr) | 389 | extern inline u32 t2_inl(unsigned long addr) |
390 | { | 390 | { |
391 | return *(vuip) ((addr << 5) + T2_IO + 0x18); | 391 | return *(vuip) ((addr << 5) + T2_IO + 0x18); |
392 | } | 392 | } |
393 | 393 | ||
394 | static inline void t2_outl(u32 b, unsigned long addr) | 394 | extern inline void t2_outl(u32 b, unsigned long addr) |
395 | { | 395 | { |
396 | *(vuip) ((addr << 5) + T2_IO + 0x18) = b; | 396 | *(vuip) ((addr << 5) + T2_IO + 0x18) = b; |
397 | mb(); | 397 | mb(); |
@@ -435,7 +435,7 @@ static inline void t2_outl(u32 b, unsigned long addr) | |||
435 | set_hae(msb); \ | 435 | set_hae(msb); \ |
436 | } | 436 | } |
437 | 437 | ||
438 | static DEFINE_SPINLOCK(t2_hae_lock); | 438 | extern spinlock_t t2_hae_lock; |
439 | 439 | ||
440 | /* | 440 | /* |
441 | * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since | 441 | * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since |
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h index 38f18cf18c9d..e971ab000f95 100644 --- a/include/asm-alpha/io.h +++ b/include/asm-alpha/io.h | |||
@@ -35,7 +35,7 @@ | |||
35 | * register not being up-to-date with respect to the hardware | 35 | * register not being up-to-date with respect to the hardware |
36 | * value. | 36 | * value. |
37 | */ | 37 | */ |
38 | static inline void __set_hae(unsigned long new_hae) | 38 | extern inline void __set_hae(unsigned long new_hae) |
39 | { | 39 | { |
40 | unsigned long flags; | 40 | unsigned long flags; |
41 | local_irq_save(flags); | 41 | local_irq_save(flags); |
@@ -49,7 +49,7 @@ static inline void __set_hae(unsigned long new_hae) | |||
49 | local_irq_restore(flags); | 49 | local_irq_restore(flags); |
50 | } | 50 | } |
51 | 51 | ||
52 | static inline void set_hae(unsigned long new_hae) | 52 | extern inline void set_hae(unsigned long new_hae) |
53 | { | 53 | { |
54 | if (new_hae != alpha_mv.hae_cache) | 54 | if (new_hae != alpha_mv.hae_cache) |
55 | __set_hae(new_hae); | 55 | __set_hae(new_hae); |
@@ -176,7 +176,7 @@ REMAP2(u64, writeq, volatile) | |||
176 | #undef REMAP1 | 176 | #undef REMAP1 |
177 | #undef REMAP2 | 177 | #undef REMAP2 |
178 | 178 | ||
179 | static inline void __iomem *generic_ioportmap(unsigned long a) | 179 | extern inline void __iomem *generic_ioportmap(unsigned long a) |
180 | { | 180 | { |
181 | return alpha_mv.mv_ioportmap(a); | 181 | return alpha_mv.mv_ioportmap(a); |
182 | } | 182 | } |
diff --git a/include/asm-alpha/mmu_context.h b/include/asm-alpha/mmu_context.h index 6a5be1f7debf..86c08a02d239 100644 --- a/include/asm-alpha/mmu_context.h +++ b/include/asm-alpha/mmu_context.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | 25 | ||
26 | extern inline unsigned long | 26 | static inline unsigned long |
27 | __reload_thread(struct pcb_struct *pcb) | 27 | __reload_thread(struct pcb_struct *pcb) |
28 | { | 28 | { |
29 | register unsigned long a0 __asm__("$16"); | 29 | register unsigned long a0 __asm__("$16"); |
@@ -114,7 +114,7 @@ extern unsigned long last_asn; | |||
114 | #define __MMU_EXTERN_INLINE | 114 | #define __MMU_EXTERN_INLINE |
115 | #endif | 115 | #endif |
116 | 116 | ||
117 | static inline unsigned long | 117 | extern inline unsigned long |
118 | __get_new_mm_context(struct mm_struct *mm, long cpu) | 118 | __get_new_mm_context(struct mm_struct *mm, long cpu) |
119 | { | 119 | { |
120 | unsigned long asn = cpu_last_asn(cpu); | 120 | unsigned long asn = cpu_last_asn(cpu); |
@@ -226,7 +226,7 @@ ev4_activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm) | |||
226 | # endif | 226 | # endif |
227 | #endif | 227 | #endif |
228 | 228 | ||
229 | extern inline int | 229 | static inline int |
230 | init_new_context(struct task_struct *tsk, struct mm_struct *mm) | 230 | init_new_context(struct task_struct *tsk, struct mm_struct *mm) |
231 | { | 231 | { |
232 | int i; | 232 | int i; |
diff --git a/include/asm-alpha/percpu.h b/include/asm-alpha/percpu.h index 48348fe34c19..3495e8e00d70 100644 --- a/include/asm-alpha/percpu.h +++ b/include/asm-alpha/percpu.h | |||
@@ -1,6 +1,78 @@ | |||
1 | #ifndef __ALPHA_PERCPU_H | 1 | #ifndef __ALPHA_PERCPU_H |
2 | #define __ALPHA_PERCPU_H | 2 | #define __ALPHA_PERCPU_H |
3 | #include <linux/compiler.h> | ||
4 | #include <linux/threads.h> | ||
3 | 5 | ||
4 | #include <asm-generic/percpu.h> | 6 | /* |
7 | * Determine the real variable name from the name visible in the | ||
8 | * kernel sources. | ||
9 | */ | ||
10 | #define per_cpu_var(var) per_cpu__##var | ||
11 | |||
12 | #ifdef CONFIG_SMP | ||
13 | |||
14 | /* | ||
15 | * per_cpu_offset() is the offset that has to be added to a | ||
16 | * percpu variable to get to the instance for a certain processor. | ||
17 | */ | ||
18 | extern unsigned long __per_cpu_offset[NR_CPUS]; | ||
19 | |||
20 | #define per_cpu_offset(x) (__per_cpu_offset[x]) | ||
21 | |||
22 | #define __my_cpu_offset per_cpu_offset(raw_smp_processor_id()) | ||
23 | #ifdef CONFIG_DEBUG_PREEMPT | ||
24 | #define my_cpu_offset per_cpu_offset(smp_processor_id()) | ||
25 | #else | ||
26 | #define my_cpu_offset __my_cpu_offset | ||
27 | #endif | ||
28 | |||
29 | #ifndef MODULE | ||
30 | #define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset)) | ||
31 | #define PER_CPU_ATTRIBUTES | ||
32 | #else | ||
33 | /* | ||
34 | * To calculate addresses of locally defined variables, GCC uses 32-bit | ||
35 | * displacement from the GP. Which doesn't work for per cpu variables in | ||
36 | * modules, as an offset to the kernel per cpu area is way above 4G. | ||
37 | * | ||
38 | * This forces allocation of a GOT entry for per cpu variable using | ||
39 | * ldq instruction with a 'literal' relocation. | ||
40 | */ | ||
41 | #define SHIFT_PERCPU_PTR(var, offset) ({ \ | ||
42 | extern int simple_identifier_##var(void); \ | ||
43 | unsigned long __ptr, tmp_gp; \ | ||
44 | asm ( "br %1, 1f \n\ | ||
45 | 1: ldgp %1, 0(%1) \n\ | ||
46 | ldq %0, per_cpu__" #var"(%1)\t!literal" \ | ||
47 | : "=&r"(__ptr), "=&r"(tmp_gp)); \ | ||
48 | (typeof(&per_cpu_var(var)))(__ptr + (offset)); }) | ||
49 | |||
50 | #define PER_CPU_ATTRIBUTES __used | ||
51 | |||
52 | #endif /* MODULE */ | ||
53 | |||
54 | /* | ||
55 | * A percpu variable may point to a discarded regions. The following are | ||
56 | * established ways to produce a usable pointer from the percpu variable | ||
57 | * offset. | ||
58 | */ | ||
59 | #define per_cpu(var, cpu) \ | ||
60 | (*SHIFT_PERCPU_PTR(var, per_cpu_offset(cpu))) | ||
61 | #define __get_cpu_var(var) \ | ||
62 | (*SHIFT_PERCPU_PTR(var, my_cpu_offset)) | ||
63 | #define __raw_get_cpu_var(var) \ | ||
64 | (*SHIFT_PERCPU_PTR(var, __my_cpu_offset)) | ||
65 | |||
66 | #else /* ! SMP */ | ||
67 | |||
68 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu_var(var))) | ||
69 | #define __get_cpu_var(var) per_cpu_var(var) | ||
70 | #define __raw_get_cpu_var(var) per_cpu_var(var) | ||
71 | |||
72 | #define PER_CPU_ATTRIBUTES | ||
73 | |||
74 | #endif /* SMP */ | ||
75 | |||
76 | #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu_var(name) | ||
5 | 77 | ||
6 | #endif /* __ALPHA_PERCPU_H */ | 78 | #endif /* __ALPHA_PERCPU_H */ |
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index ed221d6408fc..afe20fa58c99 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h | |||
@@ -184,7 +184,7 @@ enum amask_enum { | |||
184 | __amask; }) | 184 | __amask; }) |
185 | 185 | ||
186 | #define __CALL_PAL_R0(NAME, TYPE) \ | 186 | #define __CALL_PAL_R0(NAME, TYPE) \ |
187 | static inline TYPE NAME(void) \ | 187 | extern inline TYPE NAME(void) \ |
188 | { \ | 188 | { \ |
189 | register TYPE __r0 __asm__("$0"); \ | 189 | register TYPE __r0 __asm__("$0"); \ |
190 | __asm__ __volatile__( \ | 190 | __asm__ __volatile__( \ |
@@ -196,7 +196,7 @@ static inline TYPE NAME(void) \ | |||
196 | } | 196 | } |
197 | 197 | ||
198 | #define __CALL_PAL_W1(NAME, TYPE0) \ | 198 | #define __CALL_PAL_W1(NAME, TYPE0) \ |
199 | static inline void NAME(TYPE0 arg0) \ | 199 | extern inline void NAME(TYPE0 arg0) \ |
200 | { \ | 200 | { \ |
201 | register TYPE0 __r16 __asm__("$16") = arg0; \ | 201 | register TYPE0 __r16 __asm__("$16") = arg0; \ |
202 | __asm__ __volatile__( \ | 202 | __asm__ __volatile__( \ |
@@ -207,7 +207,7 @@ static inline void NAME(TYPE0 arg0) \ | |||
207 | } | 207 | } |
208 | 208 | ||
209 | #define __CALL_PAL_W2(NAME, TYPE0, TYPE1) \ | 209 | #define __CALL_PAL_W2(NAME, TYPE0, TYPE1) \ |
210 | static inline void NAME(TYPE0 arg0, TYPE1 arg1) \ | 210 | extern inline void NAME(TYPE0 arg0, TYPE1 arg1) \ |
211 | { \ | 211 | { \ |
212 | register TYPE0 __r16 __asm__("$16") = arg0; \ | 212 | register TYPE0 __r16 __asm__("$16") = arg0; \ |
213 | register TYPE1 __r17 __asm__("$17") = arg1; \ | 213 | register TYPE1 __r17 __asm__("$17") = arg1; \ |
@@ -219,7 +219,7 @@ static inline void NAME(TYPE0 arg0, TYPE1 arg1) \ | |||
219 | } | 219 | } |
220 | 220 | ||
221 | #define __CALL_PAL_RW1(NAME, RTYPE, TYPE0) \ | 221 | #define __CALL_PAL_RW1(NAME, RTYPE, TYPE0) \ |
222 | static inline RTYPE NAME(TYPE0 arg0) \ | 222 | extern inline RTYPE NAME(TYPE0 arg0) \ |
223 | { \ | 223 | { \ |
224 | register RTYPE __r0 __asm__("$0"); \ | 224 | register RTYPE __r0 __asm__("$0"); \ |
225 | register TYPE0 __r16 __asm__("$16") = arg0; \ | 225 | register TYPE0 __r16 __asm__("$16") = arg0; \ |
@@ -232,7 +232,7 @@ static inline RTYPE NAME(TYPE0 arg0) \ | |||
232 | } | 232 | } |
233 | 233 | ||
234 | #define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1) \ | 234 | #define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1) \ |
235 | static inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1) \ | 235 | extern inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1) \ |
236 | { \ | 236 | { \ |
237 | register RTYPE __r0 __asm__("$0"); \ | 237 | register RTYPE __r0 __asm__("$0"); \ |
238 | register TYPE0 __r16 __asm__("$16") = arg0; \ | 238 | register TYPE0 __r16 __asm__("$16") = arg0; \ |
diff --git a/include/asm-alpha/vga.h b/include/asm-alpha/vga.h index e8df1e7aae6b..c00106bac521 100644 --- a/include/asm-alpha/vga.h +++ b/include/asm-alpha/vga.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #define VT_BUF_HAVE_MEMSETW | 13 | #define VT_BUF_HAVE_MEMSETW |
14 | #define VT_BUF_HAVE_MEMCPYW | 14 | #define VT_BUF_HAVE_MEMCPYW |
15 | 15 | ||
16 | extern inline void scr_writew(u16 val, volatile u16 *addr) | 16 | static inline void scr_writew(u16 val, volatile u16 *addr) |
17 | { | 17 | { |
18 | if (__is_ioaddr(addr)) | 18 | if (__is_ioaddr(addr)) |
19 | __raw_writew(val, (volatile u16 __iomem *) addr); | 19 | __raw_writew(val, (volatile u16 __iomem *) addr); |
@@ -21,7 +21,7 @@ extern inline void scr_writew(u16 val, volatile u16 *addr) | |||
21 | *addr = val; | 21 | *addr = val; |
22 | } | 22 | } |
23 | 23 | ||
24 | extern inline u16 scr_readw(volatile const u16 *addr) | 24 | static inline u16 scr_readw(volatile const u16 *addr) |
25 | { | 25 | { |
26 | if (__is_ioaddr(addr)) | 26 | if (__is_ioaddr(addr)) |
27 | return __raw_readw((volatile const u16 __iomem *) addr); | 27 | return __raw_readw((volatile const u16 __iomem *) addr); |
@@ -29,7 +29,7 @@ extern inline u16 scr_readw(volatile const u16 *addr) | |||
29 | return *addr; | 29 | return *addr; |
30 | } | 30 | } |
31 | 31 | ||
32 | extern inline void scr_memsetw(u16 *s, u16 c, unsigned int count) | 32 | static inline void scr_memsetw(u16 *s, u16 c, unsigned int count) |
33 | { | 33 | { |
34 | if (__is_ioaddr(s)) | 34 | if (__is_ioaddr(s)) |
35 | memsetw_io((u16 __iomem *) s, c, count); | 35 | memsetw_io((u16 __iomem *) s, c, count); |