diff options
59 files changed, 350 insertions, 339 deletions
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c index 42629ff84f5a..ea569ba482b1 100644 --- a/arch/arm/kernel/sys_arm.c +++ b/arch/arm/kernel/sys_arm.c | |||
@@ -305,7 +305,7 @@ long execve(const char *filename, char **argv, char **envp) | |||
305 | "Ir" (THREAD_START_SP - sizeof(regs)), | 305 | "Ir" (THREAD_START_SP - sizeof(regs)), |
306 | "r" (®s), | 306 | "r" (®s), |
307 | "Ir" (sizeof(regs)) | 307 | "Ir" (sizeof(regs)) |
308 | : "r0", "r1", "r2", "r3", "ip", "memory"); | 308 | : "r0", "r1", "r2", "r3", "ip", "lr", "memory"); |
309 | 309 | ||
310 | out: | 310 | out: |
311 | return ret; | 311 | return ret; |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index e7d22dbcb691..f6de76e0a45d 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -504,7 +504,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) | |||
504 | 504 | ||
505 | bad_access: | 505 | bad_access: |
506 | spin_unlock(&mm->page_table_lock); | 506 | spin_unlock(&mm->page_table_lock); |
507 | /* simulate a read access fault */ | 507 | /* simulate a write access fault */ |
508 | do_DataAbort(addr, 15 + (1 << 11), regs); | 508 | do_DataAbort(addr, 15 + (1 << 11), regs); |
509 | return -1; | 509 | return -1; |
510 | } | 510 | } |
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c index 41e5849ae8da..f8a742bb2d5b 100644 --- a/arch/arm/mach-imx/generic.c +++ b/arch/arm/mach-imx/generic.c | |||
@@ -28,14 +28,15 @@ | |||
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <asm/arch/imxfb.h> | 29 | #include <asm/arch/imxfb.h> |
30 | #include <asm/hardware.h> | 30 | #include <asm/hardware.h> |
31 | #include <asm/arch/imx-regs.h> | ||
31 | 32 | ||
32 | #include <asm/mach/map.h> | 33 | #include <asm/mach/map.h> |
33 | 34 | ||
34 | void imx_gpio_mode(int gpio_mode) | 35 | void imx_gpio_mode(int gpio_mode) |
35 | { | 36 | { |
36 | unsigned int pin = gpio_mode & GPIO_PIN_MASK; | 37 | unsigned int pin = gpio_mode & GPIO_PIN_MASK; |
37 | unsigned int port = (gpio_mode & GPIO_PORT_MASK) >> 5; | 38 | unsigned int port = (gpio_mode & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT; |
38 | unsigned int ocr = (gpio_mode & GPIO_OCR_MASK) >> 10; | 39 | unsigned int ocr = (gpio_mode & GPIO_OCR_MASK) >> GPIO_OCR_SHIFT; |
39 | unsigned int tmp; | 40 | unsigned int tmp; |
40 | 41 | ||
41 | /* Pullup enable */ | 42 | /* Pullup enable */ |
@@ -57,7 +58,7 @@ void imx_gpio_mode(int gpio_mode) | |||
57 | GPR(port) &= ~(1<<pin); | 58 | GPR(port) &= ~(1<<pin); |
58 | 59 | ||
59 | /* use as gpio? */ | 60 | /* use as gpio? */ |
60 | if( ocr == 3 ) | 61 | if(gpio_mode & GPIO_GIUS) |
61 | GIUS(port) |= (1<<pin); | 62 | GIUS(port) |= (1<<pin); |
62 | else | 63 | else |
63 | GIUS(port) &= ~(1<<pin); | 64 | GIUS(port) &= ~(1<<pin); |
@@ -72,20 +73,20 @@ void imx_gpio_mode(int gpio_mode) | |||
72 | tmp |= (ocr << (pin*2)); | 73 | tmp |= (ocr << (pin*2)); |
73 | OCR1(port) = tmp; | 74 | OCR1(port) = tmp; |
74 | 75 | ||
75 | if( gpio_mode & GPIO_AOUT ) | 76 | ICONFA1(port) &= ~( 3<<(pin*2)); |
76 | ICONFA1(port) &= ~( 3<<(pin*2)); | 77 | ICONFA1(port) |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2); |
77 | if( gpio_mode & GPIO_BOUT ) | 78 | ICONFB1(port) &= ~( 3<<(pin*2)); |
78 | ICONFB1(port) &= ~( 3<<(pin*2)); | 79 | ICONFB1(port) |= ((gpio_mode >> GPIO_BOUT_SHIFT) & 3) << (pin * 2); |
79 | } else { | 80 | } else { |
80 | tmp = OCR2(port); | 81 | tmp = OCR2(port); |
81 | tmp &= ~( 3<<((pin-16)*2)); | 82 | tmp &= ~( 3<<((pin-16)*2)); |
82 | tmp |= (ocr << ((pin-16)*2)); | 83 | tmp |= (ocr << ((pin-16)*2)); |
83 | OCR2(port) = tmp; | 84 | OCR2(port) = tmp; |
84 | 85 | ||
85 | if( gpio_mode & GPIO_AOUT ) | 86 | ICONFA2(port) &= ~( 3<<((pin-16)*2)); |
86 | ICONFA2(port) &= ~( 3<<((pin-16)*2)); | 87 | ICONFA2(port) |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << ((pin-16) * 2); |
87 | if( gpio_mode & GPIO_BOUT ) | 88 | ICONFB2(port) &= ~( 3<<((pin-16)*2)); |
88 | ICONFB2(port) &= ~( 3<<((pin-16)*2)); | 89 | ICONFB2(port) |= ((gpio_mode >> GPIO_BOUT_SHIFT) & 3) << ((pin-16) * 2); |
89 | } | 90 | } |
90 | } | 91 | } |
91 | 92 | ||
diff --git a/arch/arm/mach-imx/mx1ads.c b/arch/arm/mach-imx/mx1ads.c index 5d25434d332c..a7511ddfe364 100644 --- a/arch/arm/mach-imx/mx1ads.c +++ b/arch/arm/mach-imx/mx1ads.c | |||
@@ -55,7 +55,7 @@ static void __init | |||
55 | mx1ads_init(void) | 55 | mx1ads_init(void) |
56 | { | 56 | { |
57 | #ifdef CONFIG_LEDS | 57 | #ifdef CONFIG_LEDS |
58 | imx_gpio_mode(GPIO_PORTA | GPIO_OUT | GPIO_GPIO | 2); | 58 | imx_gpio_mode(GPIO_PORTA | GPIO_OUT | 2); |
59 | #endif | 59 | #endif |
60 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 60 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
61 | } | 61 | } |
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c index bc015e980341..279a62627c10 100644 --- a/arch/sparc/kernel/time.c +++ b/arch/sparc/kernel/time.c | |||
@@ -457,7 +457,7 @@ void __init time_init(void) | |||
457 | sbus_time_init(); | 457 | sbus_time_init(); |
458 | } | 458 | } |
459 | 459 | ||
460 | extern __inline__ unsigned long do_gettimeoffset(void) | 460 | static inline unsigned long do_gettimeoffset(void) |
461 | { | 461 | { |
462 | return (*master_l10_counter >> 10) & 0x1fffff; | 462 | return (*master_l10_counter >> 10) & 0x1fffff; |
463 | } | 463 | } |
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index c89a803cbc20..c664b962987c 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
@@ -260,7 +260,7 @@ static inline pte_t srmmu_pte_modify(pte_t pte, pgprot_t newprot) | |||
260 | { return __pte((pte_val(pte) & SRMMU_CHG_MASK) | pgprot_val(newprot)); } | 260 | { return __pte((pte_val(pte) & SRMMU_CHG_MASK) | pgprot_val(newprot)); } |
261 | 261 | ||
262 | /* to find an entry in a top-level page table... */ | 262 | /* to find an entry in a top-level page table... */ |
263 | extern inline pgd_t *srmmu_pgd_offset(struct mm_struct * mm, unsigned long address) | 263 | static inline pgd_t *srmmu_pgd_offset(struct mm_struct * mm, unsigned long address) |
264 | { return mm->pgd + (address >> SRMMU_PGDIR_SHIFT); } | 264 | { return mm->pgd + (address >> SRMMU_PGDIR_SHIFT); } |
265 | 265 | ||
266 | /* Find an entry in the second-level page table.. */ | 266 | /* Find an entry in the second-level page table.. */ |
diff --git a/arch/um/include/registers.h b/arch/um/include/registers.h index 0a35e6d0baa0..4892e5fcef07 100644 --- a/arch/um/include/registers.h +++ b/arch/um/include/registers.h | |||
@@ -15,16 +15,6 @@ extern void save_registers(int pid, union uml_pt_regs *regs); | |||
15 | extern void restore_registers(int pid, union uml_pt_regs *regs); | 15 | extern void restore_registers(int pid, union uml_pt_regs *regs); |
16 | extern void init_registers(int pid); | 16 | extern void init_registers(int pid); |
17 | extern void get_safe_registers(unsigned long * regs); | 17 | extern void get_safe_registers(unsigned long * regs); |
18 | extern void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer); | ||
18 | 19 | ||
19 | #endif | 20 | #endif |
20 | |||
21 | /* | ||
22 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
23 | * Emacs will notice this stuff at the end of the file and automatically | ||
24 | * adjust the settings for this buffer only. This must remain at the end | ||
25 | * of the file. | ||
26 | * --------------------------------------------------------------------------- | ||
27 | * Local variables: | ||
28 | * c-file-style: "linux" | ||
29 | * End: | ||
30 | */ | ||
diff --git a/arch/um/include/sysdep-x86_64/ptrace.h b/arch/um/include/sysdep-x86_64/ptrace.h index 331aa2d1f3f5..8f0656766c21 100644 --- a/arch/um/include/sysdep-x86_64/ptrace.h +++ b/arch/um/include/sysdep-x86_64/ptrace.h | |||
@@ -218,10 +218,6 @@ struct syscall_args { | |||
218 | case RBP: UPT_RBP(regs) = __upt_val; break; \ | 218 | case RBP: UPT_RBP(regs) = __upt_val; break; \ |
219 | case ORIG_RAX: UPT_ORIG_RAX(regs) = __upt_val; break; \ | 219 | case ORIG_RAX: UPT_ORIG_RAX(regs) = __upt_val; break; \ |
220 | case CS: UPT_CS(regs) = __upt_val; break; \ | 220 | case CS: UPT_CS(regs) = __upt_val; break; \ |
221 | case DS: UPT_DS(regs) = __upt_val; break; \ | ||
222 | case ES: UPT_ES(regs) = __upt_val; break; \ | ||
223 | case FS: UPT_FS(regs) = __upt_val; break; \ | ||
224 | case GS: UPT_GS(regs) = __upt_val; break; \ | ||
225 | case EFLAGS: UPT_EFLAGS(regs) = __upt_val; break; \ | 221 | case EFLAGS: UPT_EFLAGS(regs) = __upt_val; break; \ |
226 | default : \ | 222 | default : \ |
227 | panic("Bad register in UPT_SET : %d\n", reg); \ | 223 | panic("Bad register in UPT_SET : %d\n", reg); \ |
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c index f80850091e79..b331e970002f 100644 --- a/arch/um/kernel/sysrq.c +++ b/arch/um/kernel/sysrq.c | |||
@@ -62,13 +62,7 @@ void show_stack(struct task_struct *task, unsigned long *esp) | |||
62 | 62 | ||
63 | if (esp == NULL) { | 63 | if (esp == NULL) { |
64 | if (task != current && task != NULL) { | 64 | if (task != current && task != NULL) { |
65 | /* XXX: Isn't this bogus? I.e. isn't this the | ||
66 | * *userspace* stack of this task? If not so, use this | ||
67 | * even when task == current (as in i386). | ||
68 | */ | ||
69 | esp = (unsigned long *) KSTK_ESP(task); | 65 | esp = (unsigned long *) KSTK_ESP(task); |
70 | /* Which one? No actual difference - just coding style.*/ | ||
71 | //esp = (unsigned long *) PT_REGS_IP(&task->thread.regs); | ||
72 | } else { | 66 | } else { |
73 | esp = (unsigned long *) &esp; | 67 | esp = (unsigned long *) &esp; |
74 | } | 68 | } |
@@ -84,5 +78,5 @@ void show_stack(struct task_struct *task, unsigned long *esp) | |||
84 | } | 78 | } |
85 | 79 | ||
86 | printk("Call Trace: \n"); | 80 | printk("Call Trace: \n"); |
87 | show_trace(current, esp); | 81 | show_trace(task, esp); |
88 | } | 82 | } |
diff --git a/arch/um/os-Linux/sys-i386/registers.c b/arch/um/os-Linux/sys-i386/registers.c index 3125d320722c..aee4812333c6 100644 --- a/arch/um/os-Linux/sys-i386/registers.c +++ b/arch/um/os-Linux/sys-i386/registers.c | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | #include <errno.h> | 6 | #include <errno.h> |
7 | #include <string.h> | 7 | #include <string.h> |
8 | #include <setjmp.h> | ||
8 | #include "sysdep/ptrace_user.h" | 9 | #include "sysdep/ptrace_user.h" |
9 | #include "sysdep/ptrace.h" | 10 | #include "sysdep/ptrace.h" |
10 | #include "uml-config.h" | 11 | #include "uml-config.h" |
@@ -126,13 +127,11 @@ void get_safe_registers(unsigned long *regs) | |||
126 | memcpy(regs, exec_regs, HOST_FRAME_SIZE * sizeof(unsigned long)); | 127 | memcpy(regs, exec_regs, HOST_FRAME_SIZE * sizeof(unsigned long)); |
127 | } | 128 | } |
128 | 129 | ||
129 | /* | 130 | void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer) |
130 | * Overrides for Emacs so that we follow Linus's tabbing style. | 131 | { |
131 | * Emacs will notice this stuff at the end of the file and automatically | 132 | struct __jmp_buf_tag *jmpbuf = buffer; |
132 | * adjust the settings for this buffer only. This must remain at the end | 133 | |
133 | * of the file. | 134 | UPT_SET(uml_regs, EIP, jmpbuf->__jmpbuf[JB_PC]); |
134 | * --------------------------------------------------------------------------- | 135 | UPT_SET(uml_regs, UESP, jmpbuf->__jmpbuf[JB_SP]); |
135 | * Local variables: | 136 | UPT_SET(uml_regs, EBP, jmpbuf->__jmpbuf[JB_BP]); |
136 | * c-file-style: "linux" | 137 | } |
137 | * End: | ||
138 | */ | ||
diff --git a/arch/um/os-Linux/sys-x86_64/registers.c b/arch/um/os-Linux/sys-x86_64/registers.c index 44438d15c3d6..4b638dfb52b0 100644 --- a/arch/um/os-Linux/sys-x86_64/registers.c +++ b/arch/um/os-Linux/sys-x86_64/registers.c | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | #include <errno.h> | 6 | #include <errno.h> |
7 | #include <string.h> | 7 | #include <string.h> |
8 | #include <setjmp.h> | ||
8 | #include "ptrace_user.h" | 9 | #include "ptrace_user.h" |
9 | #include "uml-config.h" | 10 | #include "uml-config.h" |
10 | #include "skas_ptregs.h" | 11 | #include "skas_ptregs.h" |
@@ -74,13 +75,11 @@ void get_safe_registers(unsigned long *regs) | |||
74 | memcpy(regs, exec_regs, HOST_FRAME_SIZE * sizeof(unsigned long)); | 75 | memcpy(regs, exec_regs, HOST_FRAME_SIZE * sizeof(unsigned long)); |
75 | } | 76 | } |
76 | 77 | ||
77 | /* | 78 | void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer) |
78 | * Overrides for Emacs so that we follow Linus's tabbing style. | 79 | { |
79 | * Emacs will notice this stuff at the end of the file and automatically | 80 | struct __jmp_buf_tag *jmpbuf = buffer; |
80 | * adjust the settings for this buffer only. This must remain at the end | 81 | |
81 | * of the file. | 82 | UPT_SET(uml_regs, RIP, jmpbuf->__jmpbuf[JB_PC]); |
82 | * --------------------------------------------------------------------------- | 83 | UPT_SET(uml_regs, RSP, jmpbuf->__jmpbuf[JB_RSP]); |
83 | * Local variables: | 84 | UPT_SET(uml_regs, RBP, jmpbuf->__jmpbuf[JB_RBP]); |
84 | * c-file-style: "linux" | 85 | } |
85 | * End: | ||
86 | */ | ||
diff --git a/arch/um/sys-i386/sysrq.c b/arch/um/sys-i386/sysrq.c index e3706d15c4f5..d5244f070539 100644 --- a/arch/um/sys-i386/sysrq.c +++ b/arch/um/sys-i386/sysrq.c | |||
@@ -88,9 +88,7 @@ void show_trace(struct task_struct* task, unsigned long * stack) | |||
88 | task = current; | 88 | task = current; |
89 | 89 | ||
90 | if (task != current) { | 90 | if (task != current) { |
91 | //ebp = (unsigned long) KSTK_EBP(task); | 91 | ebp = (unsigned long) KSTK_EBP(task); |
92 | /* Which one? No actual difference - just coding style.*/ | ||
93 | ebp = (unsigned long) PT_REGS_EBP(&task->thread.regs); | ||
94 | } else { | 92 | } else { |
95 | asm ("movl %%ebp, %0" : "=r" (ebp) : ); | 93 | asm ("movl %%ebp, %0" : "=r" (ebp) : ); |
96 | } | 94 | } |
@@ -99,15 +97,6 @@ void show_trace(struct task_struct* task, unsigned long * stack) | |||
99 | ((unsigned long)stack & (~(THREAD_SIZE - 1))); | 97 | ((unsigned long)stack & (~(THREAD_SIZE - 1))); |
100 | print_context_stack(context, stack, ebp); | 98 | print_context_stack(context, stack, ebp); |
101 | 99 | ||
102 | /*while (((long) stack & (THREAD_SIZE-1)) != 0) { | ||
103 | addr = *stack; | ||
104 | if (__kernel_text_address(addr)) { | ||
105 | printk("%08lx: [<%08lx>]", (unsigned long) stack, addr); | ||
106 | print_symbol(" %s", addr); | ||
107 | printk("\n"); | ||
108 | } | ||
109 | stack++; | ||
110 | }*/ | ||
111 | printk("\n"); | 100 | printk("\n"); |
112 | } | 101 | } |
113 | 102 | ||
diff --git a/arch/um/sys-i386/user-offsets.c b/arch/um/sys-i386/user-offsets.c index 677fc26a9bbe..26b68675053d 100644 --- a/arch/um/sys-i386/user-offsets.c +++ b/arch/um/sys-i386/user-offsets.c | |||
@@ -46,7 +46,7 @@ void foo(void) | |||
46 | OFFSET(HOST_SC_FP_ST, _fpstate, _st); | 46 | OFFSET(HOST_SC_FP_ST, _fpstate, _st); |
47 | OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env); | 47 | OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env); |
48 | 48 | ||
49 | DEFINE_LONGS(HOST_FRAME_SIZE, FRAME_SIZE); | 49 | DEFINE(HOST_FRAME_SIZE, FRAME_SIZE); |
50 | DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_i387_struct)); | 50 | DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_i387_struct)); |
51 | DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fxsr_struct)); | 51 | DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fxsr_struct)); |
52 | 52 | ||
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S index 4592bf21fcaf..b92e5f45ed46 100644 --- a/arch/x86_64/kernel/head.S +++ b/arch/x86_64/kernel/head.S | |||
@@ -270,26 +270,26 @@ ENTRY(level3_kernel_pgt) | |||
270 | .org 0x4000 | 270 | .org 0x4000 |
271 | ENTRY(level2_ident_pgt) | 271 | ENTRY(level2_ident_pgt) |
272 | /* 40MB for bootup. */ | 272 | /* 40MB for bootup. */ |
273 | .quad 0x0000000000000183 | 273 | .quad 0x0000000000000083 |
274 | .quad 0x0000000000200183 | 274 | .quad 0x0000000000200083 |
275 | .quad 0x0000000000400183 | 275 | .quad 0x0000000000400083 |
276 | .quad 0x0000000000600183 | 276 | .quad 0x0000000000600083 |
277 | .quad 0x0000000000800183 | 277 | .quad 0x0000000000800083 |
278 | .quad 0x0000000000A00183 | 278 | .quad 0x0000000000A00083 |
279 | .quad 0x0000000000C00183 | 279 | .quad 0x0000000000C00083 |
280 | .quad 0x0000000000E00183 | 280 | .quad 0x0000000000E00083 |
281 | .quad 0x0000000001000183 | 281 | .quad 0x0000000001000083 |
282 | .quad 0x0000000001200183 | 282 | .quad 0x0000000001200083 |
283 | .quad 0x0000000001400183 | 283 | .quad 0x0000000001400083 |
284 | .quad 0x0000000001600183 | 284 | .quad 0x0000000001600083 |
285 | .quad 0x0000000001800183 | 285 | .quad 0x0000000001800083 |
286 | .quad 0x0000000001A00183 | 286 | .quad 0x0000000001A00083 |
287 | .quad 0x0000000001C00183 | 287 | .quad 0x0000000001C00083 |
288 | .quad 0x0000000001E00183 | 288 | .quad 0x0000000001E00083 |
289 | .quad 0x0000000002000183 | 289 | .quad 0x0000000002000083 |
290 | .quad 0x0000000002200183 | 290 | .quad 0x0000000002200083 |
291 | .quad 0x0000000002400183 | 291 | .quad 0x0000000002400083 |
292 | .quad 0x0000000002600183 | 292 | .quad 0x0000000002600083 |
293 | /* Temporary mappings for the super early allocator in arch/x86_64/mm/init.c */ | 293 | /* Temporary mappings for the super early allocator in arch/x86_64/mm/init.c */ |
294 | .globl temp_boot_pmds | 294 | .globl temp_boot_pmds |
295 | temp_boot_pmds: | 295 | temp_boot_pmds: |
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c index ffbcd40418d5..23a3f56c7899 100644 --- a/drivers/infiniband/hw/mthca/mthca_main.c +++ b/drivers/infiniband/hw/mthca/mthca_main.c | |||
@@ -503,6 +503,25 @@ err_free_aux: | |||
503 | return err; | 503 | return err; |
504 | } | 504 | } |
505 | 505 | ||
506 | static void mthca_free_icms(struct mthca_dev *mdev) | ||
507 | { | ||
508 | u8 status; | ||
509 | |||
510 | mthca_free_icm_table(mdev, mdev->mcg_table.table); | ||
511 | if (mdev->mthca_flags & MTHCA_FLAG_SRQ) | ||
512 | mthca_free_icm_table(mdev, mdev->srq_table.table); | ||
513 | mthca_free_icm_table(mdev, mdev->cq_table.table); | ||
514 | mthca_free_icm_table(mdev, mdev->qp_table.rdb_table); | ||
515 | mthca_free_icm_table(mdev, mdev->qp_table.eqp_table); | ||
516 | mthca_free_icm_table(mdev, mdev->qp_table.qp_table); | ||
517 | mthca_free_icm_table(mdev, mdev->mr_table.mpt_table); | ||
518 | mthca_free_icm_table(mdev, mdev->mr_table.mtt_table); | ||
519 | mthca_unmap_eq_icm(mdev); | ||
520 | |||
521 | mthca_UNMAP_ICM_AUX(mdev, &status); | ||
522 | mthca_free_icm(mdev, mdev->fw.arbel.aux_icm); | ||
523 | } | ||
524 | |||
506 | static int __devinit mthca_init_arbel(struct mthca_dev *mdev) | 525 | static int __devinit mthca_init_arbel(struct mthca_dev *mdev) |
507 | { | 526 | { |
508 | struct mthca_dev_lim dev_lim; | 527 | struct mthca_dev_lim dev_lim; |
@@ -580,18 +599,7 @@ static int __devinit mthca_init_arbel(struct mthca_dev *mdev) | |||
580 | return 0; | 599 | return 0; |
581 | 600 | ||
582 | err_free_icm: | 601 | err_free_icm: |
583 | if (mdev->mthca_flags & MTHCA_FLAG_SRQ) | 602 | mthca_free_icms(mdev); |
584 | mthca_free_icm_table(mdev, mdev->srq_table.table); | ||
585 | mthca_free_icm_table(mdev, mdev->cq_table.table); | ||
586 | mthca_free_icm_table(mdev, mdev->qp_table.rdb_table); | ||
587 | mthca_free_icm_table(mdev, mdev->qp_table.eqp_table); | ||
588 | mthca_free_icm_table(mdev, mdev->qp_table.qp_table); | ||
589 | mthca_free_icm_table(mdev, mdev->mr_table.mpt_table); | ||
590 | mthca_free_icm_table(mdev, mdev->mr_table.mtt_table); | ||
591 | mthca_unmap_eq_icm(mdev); | ||
592 | |||
593 | mthca_UNMAP_ICM_AUX(mdev, &status); | ||
594 | mthca_free_icm(mdev, mdev->fw.arbel.aux_icm); | ||
595 | 603 | ||
596 | err_stop_fw: | 604 | err_stop_fw: |
597 | mthca_UNMAP_FA(mdev, &status); | 605 | mthca_UNMAP_FA(mdev, &status); |
@@ -611,18 +619,7 @@ static void mthca_close_hca(struct mthca_dev *mdev) | |||
611 | mthca_CLOSE_HCA(mdev, 0, &status); | 619 | mthca_CLOSE_HCA(mdev, 0, &status); |
612 | 620 | ||
613 | if (mthca_is_memfree(mdev)) { | 621 | if (mthca_is_memfree(mdev)) { |
614 | if (mdev->mthca_flags & MTHCA_FLAG_SRQ) | 622 | mthca_free_icms(mdev); |
615 | mthca_free_icm_table(mdev, mdev->srq_table.table); | ||
616 | mthca_free_icm_table(mdev, mdev->cq_table.table); | ||
617 | mthca_free_icm_table(mdev, mdev->qp_table.rdb_table); | ||
618 | mthca_free_icm_table(mdev, mdev->qp_table.eqp_table); | ||
619 | mthca_free_icm_table(mdev, mdev->qp_table.qp_table); | ||
620 | mthca_free_icm_table(mdev, mdev->mr_table.mpt_table); | ||
621 | mthca_free_icm_table(mdev, mdev->mr_table.mtt_table); | ||
622 | mthca_unmap_eq_icm(mdev); | ||
623 | |||
624 | mthca_UNMAP_ICM_AUX(mdev, &status); | ||
625 | mthca_free_icm(mdev, mdev->fw.arbel.aux_icm); | ||
626 | 623 | ||
627 | mthca_UNMAP_FA(mdev, &status); | 624 | mthca_UNMAP_FA(mdev, &status); |
628 | mthca_free_icm(mdev, mdev->fw.arbel.fw_icm); | 625 | mthca_free_icm(mdev, mdev->fw.arbel.fw_icm); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 704f48e0b6a7..6c5bf07489f4 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -474,7 +474,7 @@ err: | |||
474 | spin_unlock(&priv->lock); | 474 | spin_unlock(&priv->lock); |
475 | } | 475 | } |
476 | 476 | ||
477 | static void path_lookup(struct sk_buff *skb, struct net_device *dev) | 477 | static void ipoib_path_lookup(struct sk_buff *skb, struct net_device *dev) |
478 | { | 478 | { |
479 | struct ipoib_dev_priv *priv = netdev_priv(skb->dev); | 479 | struct ipoib_dev_priv *priv = netdev_priv(skb->dev); |
480 | 480 | ||
@@ -569,7 +569,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
569 | 569 | ||
570 | if (skb->dst && skb->dst->neighbour) { | 570 | if (skb->dst && skb->dst->neighbour) { |
571 | if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) { | 571 | if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) { |
572 | path_lookup(skb, dev); | 572 | ipoib_path_lookup(skb, dev); |
573 | goto out; | 573 | goto out; |
574 | } | 574 | } |
575 | 575 | ||
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c index 8154bbbb7792..9f491563944e 100644 --- a/drivers/net/tokenring/ibmtr.c +++ b/drivers/net/tokenring/ibmtr.c | |||
@@ -531,7 +531,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
531 | if (!time_after(jiffies, timeout)) continue; | 531 | if (!time_after(jiffies, timeout)) continue; |
532 | DPRINTK( "Hardware timeout during initialization.\n"); | 532 | DPRINTK( "Hardware timeout during initialization.\n"); |
533 | iounmap(t_mmio); | 533 | iounmap(t_mmio); |
534 | kfree(ti); | ||
535 | return -ENODEV; | 534 | return -ENODEV; |
536 | } | 535 | } |
537 | ti->sram_phys = | 536 | ti->sram_phys = |
@@ -645,7 +644,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
645 | DPRINTK("Unknown shared ram paging info %01X\n", | 644 | DPRINTK("Unknown shared ram paging info %01X\n", |
646 | ti->shared_ram_paging); | 645 | ti->shared_ram_paging); |
647 | iounmap(t_mmio); | 646 | iounmap(t_mmio); |
648 | kfree(ti); | ||
649 | return -ENODEV; | 647 | return -ENODEV; |
650 | break; | 648 | break; |
651 | } /*end switch shared_ram_paging */ | 649 | } /*end switch shared_ram_paging */ |
@@ -675,7 +673,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
675 | "driver limit (%05x), adapter not started.\n", | 673 | "driver limit (%05x), adapter not started.\n", |
676 | chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE); | 674 | chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE); |
677 | iounmap(t_mmio); | 675 | iounmap(t_mmio); |
678 | kfree(ti); | ||
679 | return -ENODEV; | 676 | return -ENODEV; |
680 | } else { /* seems cool, record what we have figured out */ | 677 | } else { /* seems cool, record what we have figured out */ |
681 | ti->sram_base = new_base >> 12; | 678 | ti->sram_base = new_base >> 12; |
@@ -690,7 +687,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
690 | DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n", | 687 | DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n", |
691 | irq); | 688 | irq); |
692 | iounmap(t_mmio); | 689 | iounmap(t_mmio); |
693 | kfree(ti); | ||
694 | return -ENODEV; | 690 | return -ENODEV; |
695 | } | 691 | } |
696 | /*?? Now, allocate some of the PIO PORTs for this driver.. */ | 692 | /*?? Now, allocate some of the PIO PORTs for this driver.. */ |
@@ -699,7 +695,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
699 | DPRINTK("Could not grab PIO range. Halting driver.\n"); | 695 | DPRINTK("Could not grab PIO range. Halting driver.\n"); |
700 | free_irq(dev->irq, dev); | 696 | free_irq(dev->irq, dev); |
701 | iounmap(t_mmio); | 697 | iounmap(t_mmio); |
702 | kfree(ti); | ||
703 | return -EBUSY; | 698 | return -EBUSY; |
704 | } | 699 | } |
705 | 700 | ||
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 78afbc7f08be..da4c5e94a959 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -490,9 +490,14 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
490 | return 0; | 490 | return 0; |
491 | } | 491 | } |
492 | 492 | ||
493 | /* Length of the packet body */ | 493 | /* Check packet length, pad short packets, round up odd length */ |
494 | /* FIXME: what if the skb is smaller than this? */ | 494 | len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN); |
495 | len = max_t(int,skb->len - ETH_HLEN, ETH_ZLEN - ETH_HLEN); | 495 | if (skb->len < len) { |
496 | skb = skb_padto(skb, len); | ||
497 | if (skb == NULL) | ||
498 | goto fail; | ||
499 | } | ||
500 | len -= ETH_HLEN; | ||
496 | 501 | ||
497 | eh = (struct ethhdr *)skb->data; | 502 | eh = (struct ethhdr *)skb->data; |
498 | 503 | ||
@@ -544,8 +549,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
544 | p = skb->data; | 549 | p = skb->data; |
545 | } | 550 | } |
546 | 551 | ||
547 | /* Round up for odd length packets */ | 552 | err = hermes_bap_pwrite(hw, USER_BAP, p, data_len, |
548 | err = hermes_bap_pwrite(hw, USER_BAP, p, ALIGN(data_len, 2), | ||
549 | txfid, data_off); | 553 | txfid, data_off); |
550 | if (err) { | 554 | if (err) { |
551 | printk(KERN_ERR "%s: Error %d writing packet to BAP\n", | 555 | printk(KERN_ERR "%s: Error %d writing packet to BAP\n", |
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 1b3148e842af..c3f637395734 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/delay.h> | 34 | #include <linux/delay.h> |
35 | #include <linux/uio.h> | 35 | #include <linux/uio.h> |
36 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
37 | #include <linux/fs.h> | ||
37 | #include <linux/compat.h> | 38 | #include <linux/compat.h> |
38 | 39 | ||
39 | #include <scsi/scsi.h> | 40 | #include <scsi/scsi.h> |
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 5959e6755a81..656c0e8d160e 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c | |||
@@ -518,11 +518,7 @@ static void sunsu_change_mouse_baud(struct uart_sunsu_port *up) | |||
518 | 518 | ||
519 | quot = up->port.uartclk / (16 * new_baud); | 519 | quot = up->port.uartclk / (16 * new_baud); |
520 | 520 | ||
521 | spin_unlock(&up->port.lock); | ||
522 | |||
523 | sunsu_change_speed(&up->port, up->cflag, 0, quot); | 521 | sunsu_change_speed(&up->port, up->cflag, 0, quot); |
524 | |||
525 | spin_lock(&up->port.lock); | ||
526 | } | 522 | } |
527 | 523 | ||
528 | static void receive_kbd_ms_chars(struct uart_sunsu_port *up, struct pt_regs *regs, int is_break) | 524 | static void receive_kbd_ms_chars(struct uart_sunsu_port *up, struct pt_regs *regs, int is_break) |
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index e240c335eb23..5af928fa0449 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c | |||
@@ -108,7 +108,7 @@ static int bfs_create(struct inode * dir, struct dentry * dentry, int mode, | |||
108 | inode->i_mapping->a_ops = &bfs_aops; | 108 | inode->i_mapping->a_ops = &bfs_aops; |
109 | inode->i_mode = mode; | 109 | inode->i_mode = mode; |
110 | inode->i_ino = ino; | 110 | inode->i_ino = ino; |
111 | BFS_I(inode)->i_dsk_ino = cpu_to_le16(ino); | 111 | BFS_I(inode)->i_dsk_ino = ino; |
112 | BFS_I(inode)->i_sblock = 0; | 112 | BFS_I(inode)->i_sblock = 0; |
113 | BFS_I(inode)->i_eblock = 0; | 113 | BFS_I(inode)->i_eblock = 0; |
114 | insert_inode_hash(inode); | 114 | insert_inode_hash(inode); |
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index c7b39aa279d7..3af6c73c5b5a 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c | |||
@@ -357,28 +357,46 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent) | |||
357 | } | 357 | } |
358 | 358 | ||
359 | info->si_blocks = (le32_to_cpu(bfs_sb->s_end) + 1)>>BFS_BSIZE_BITS; /* for statfs(2) */ | 359 | info->si_blocks = (le32_to_cpu(bfs_sb->s_end) + 1)>>BFS_BSIZE_BITS; /* for statfs(2) */ |
360 | info->si_freeb = (le32_to_cpu(bfs_sb->s_end) + 1 - cpu_to_le32(bfs_sb->s_start))>>BFS_BSIZE_BITS; | 360 | info->si_freeb = (le32_to_cpu(bfs_sb->s_end) + 1 - le32_to_cpu(bfs_sb->s_start))>>BFS_BSIZE_BITS; |
361 | info->si_freei = 0; | 361 | info->si_freei = 0; |
362 | info->si_lf_eblk = 0; | 362 | info->si_lf_eblk = 0; |
363 | info->si_lf_sblk = 0; | 363 | info->si_lf_sblk = 0; |
364 | info->si_lf_ioff = 0; | 364 | info->si_lf_ioff = 0; |
365 | bh = NULL; | ||
365 | for (i=BFS_ROOT_INO; i<=info->si_lasti; i++) { | 366 | for (i=BFS_ROOT_INO; i<=info->si_lasti; i++) { |
366 | inode = iget(s,i); | 367 | struct bfs_inode *di; |
367 | if (BFS_I(inode)->i_dsk_ino == 0) | 368 | int block = (i - BFS_ROOT_INO)/BFS_INODES_PER_BLOCK + 1; |
369 | int off = (i - BFS_ROOT_INO) % BFS_INODES_PER_BLOCK; | ||
370 | unsigned long sblock, eblock; | ||
371 | |||
372 | if (!off) { | ||
373 | brelse(bh); | ||
374 | bh = sb_bread(s, block); | ||
375 | } | ||
376 | |||
377 | if (!bh) | ||
378 | continue; | ||
379 | |||
380 | di = (struct bfs_inode *)bh->b_data + off; | ||
381 | |||
382 | if (!di->i_ino) { | ||
368 | info->si_freei++; | 383 | info->si_freei++; |
369 | else { | 384 | continue; |
370 | set_bit(i, info->si_imap); | 385 | } |
371 | info->si_freeb -= inode->i_blocks; | 386 | set_bit(i, info->si_imap); |
372 | if (BFS_I(inode)->i_eblock > info->si_lf_eblk) { | 387 | info->si_freeb -= BFS_FILEBLOCKS(di); |
373 | info->si_lf_eblk = BFS_I(inode)->i_eblock; | 388 | |
374 | info->si_lf_sblk = BFS_I(inode)->i_sblock; | 389 | sblock = le32_to_cpu(di->i_sblock); |
375 | info->si_lf_ioff = BFS_INO2OFF(i); | 390 | eblock = le32_to_cpu(di->i_eblock); |
376 | } | 391 | if (eblock > info->si_lf_eblk) { |
392 | info->si_lf_eblk = eblock; | ||
393 | info->si_lf_sblk = sblock; | ||
394 | info->si_lf_ioff = BFS_INO2OFF(i); | ||
377 | } | 395 | } |
378 | iput(inode); | ||
379 | } | 396 | } |
397 | brelse(bh); | ||
380 | if (!(s->s_flags & MS_RDONLY)) { | 398 | if (!(s->s_flags & MS_RDONLY)) { |
381 | mark_buffer_dirty(bh); | 399 | mark_buffer_dirty(info->si_sbh); |
382 | s->s_dirt = 1; | 400 | s->s_dirt = 1; |
383 | } | 401 | } |
384 | dump_imap("read_super", s); | 402 | dump_imap("read_super", s); |
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index 83f3322765cd..de58579a1d0e 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog | |||
@@ -102,6 +102,9 @@ ToDo/Notes: | |||
102 | inode instead of a vfs inode as parameter. | 102 | inode instead of a vfs inode as parameter. |
103 | - Fix the definition of the CHKD ntfs record magic. It had an off by | 103 | - Fix the definition of the CHKD ntfs record magic. It had an off by |
104 | two error causing it to be CHKB instead of CHKD. | 104 | two error causing it to be CHKB instead of CHKD. |
105 | - Fix a stupid bug in __ntfs_bitmap_set_bits_in_run() which caused the | ||
106 | count to become negative and hence we had a wild memset() scribbling | ||
107 | all over the system's ram. | ||
105 | 108 | ||
106 | 2.1.23 - Implement extension of resident files and make writing safe as well as | 109 | 2.1.23 - Implement extension of resident files and make writing safe as well as |
107 | many bug fixes, cleanups, and enhancements... | 110 | many bug fixes, cleanups, and enhancements... |
diff --git a/fs/ntfs/bitmap.c b/fs/ntfs/bitmap.c index 12cf2e30c7dd..7a190cdc60e2 100644 --- a/fs/ntfs/bitmap.c +++ b/fs/ntfs/bitmap.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * bitmap.c - NTFS kernel bitmap handling. Part of the Linux-NTFS project. | 2 | * bitmap.c - NTFS kernel bitmap handling. Part of the Linux-NTFS project. |
3 | * | 3 | * |
4 | * Copyright (c) 2004 Anton Altaparmakov | 4 | * Copyright (c) 2004-2005 Anton Altaparmakov |
5 | * | 5 | * |
6 | * This program/include file is free software; you can redistribute it and/or | 6 | * This program/include file is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License as published | 7 | * modify it under the terms of the GNU General Public License as published |
@@ -90,7 +90,8 @@ int __ntfs_bitmap_set_bits_in_run(struct inode *vi, const s64 start_bit, | |||
90 | /* If the first byte is partial, modify the appropriate bits in it. */ | 90 | /* If the first byte is partial, modify the appropriate bits in it. */ |
91 | if (bit) { | 91 | if (bit) { |
92 | u8 *byte = kaddr + pos; | 92 | u8 *byte = kaddr + pos; |
93 | while ((bit & 7) && cnt--) { | 93 | while ((bit & 7) && cnt) { |
94 | cnt--; | ||
94 | if (value) | 95 | if (value) |
95 | *byte |= 1 << bit++; | 96 | *byte |= 1 << bit++; |
96 | else | 97 | else |
diff --git a/fs/ntfs/layout.h b/fs/ntfs/layout.h index 01f2dfa39cec..5c248d404f05 100644 --- a/fs/ntfs/layout.h +++ b/fs/ntfs/layout.h | |||
@@ -309,7 +309,7 @@ typedef le16 MFT_RECORD_FLAGS; | |||
309 | * Note: The _LE versions will return a CPU endian formatted value! | 309 | * Note: The _LE versions will return a CPU endian formatted value! |
310 | */ | 310 | */ |
311 | #define MFT_REF_MASK_CPU 0x0000ffffffffffffULL | 311 | #define MFT_REF_MASK_CPU 0x0000ffffffffffffULL |
312 | #define MFT_REF_MASK_LE const_cpu_to_le64(0x0000ffffffffffffULL) | 312 | #define MFT_REF_MASK_LE const_cpu_to_le64(MFT_REF_MASK_CPU) |
313 | 313 | ||
314 | typedef u64 MFT_REF; | 314 | typedef u64 MFT_REF; |
315 | typedef le64 leMFT_REF; | 315 | typedef le64 leMFT_REF; |
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 247586d1d5dc..b011369b5956 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c | |||
@@ -58,7 +58,8 @@ static inline MFT_RECORD *map_mft_record_page(ntfs_inode *ni) | |||
58 | * overflowing the unsigned long, but I don't think we would ever get | 58 | * overflowing the unsigned long, but I don't think we would ever get |
59 | * here if the volume was that big... | 59 | * here if the volume was that big... |
60 | */ | 60 | */ |
61 | index = ni->mft_no << vol->mft_record_size_bits >> PAGE_CACHE_SHIFT; | 61 | index = (u64)ni->mft_no << vol->mft_record_size_bits >> |
62 | PAGE_CACHE_SHIFT; | ||
62 | ofs = (ni->mft_no << vol->mft_record_size_bits) & ~PAGE_CACHE_MASK; | 63 | ofs = (ni->mft_no << vol->mft_record_size_bits) & ~PAGE_CACHE_MASK; |
63 | 64 | ||
64 | i_size = i_size_read(mft_vi); | 65 | i_size = i_size_read(mft_vi); |
diff --git a/fs/ntfs/unistr.c b/fs/ntfs/unistr.c index a389a5a16c84..0ea887fc859c 100644 --- a/fs/ntfs/unistr.c +++ b/fs/ntfs/unistr.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * unistr.c - NTFS Unicode string handling. Part of the Linux-NTFS project. | 2 | * unistr.c - NTFS Unicode string handling. Part of the Linux-NTFS project. |
3 | * | 3 | * |
4 | * Copyright (c) 2001-2004 Anton Altaparmakov | 4 | * Copyright (c) 2001-2005 Anton Altaparmakov |
5 | * | 5 | * |
6 | * This program/include file is free software; you can redistribute it and/or | 6 | * This program/include file is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License as published | 7 | * modify it under the terms of the GNU General Public License as published |
diff --git a/include/asm-arm/arch-h720x/system.h b/include/asm-arm/arch-h720x/system.h index 0b025e227ec2..09eda84592ff 100644 --- a/include/asm-arm/arch-h720x/system.h +++ b/include/asm-arm/arch-h720x/system.h | |||
@@ -17,9 +17,11 @@ | |||
17 | static void arch_idle(void) | 17 | static void arch_idle(void) |
18 | { | 18 | { |
19 | CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_IDLE; | 19 | CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_IDLE; |
20 | __asm__ __volatile__( | 20 | nop(); |
21 | "mov r0, r0\n\t" | 21 | nop(); |
22 | "mov r0, r0"); | 22 | CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_RUN; |
23 | nop(); | ||
24 | nop(); | ||
23 | } | 25 | } |
24 | 26 | ||
25 | 27 | ||
diff --git a/include/asm-arm/arch-imx/imx-regs.h b/include/asm-arm/arch-imx/imx-regs.h index 93b840e8fa60..229f7008d74f 100644 --- a/include/asm-arm/arch-imx/imx-regs.h +++ b/include/asm-arm/arch-imx/imx-regs.h | |||
@@ -76,6 +76,7 @@ | |||
76 | #define GPIO_PIN_MASK 0x1f | 76 | #define GPIO_PIN_MASK 0x1f |
77 | #define GPIO_PORT_MASK (0x3 << 5) | 77 | #define GPIO_PORT_MASK (0x3 << 5) |
78 | 78 | ||
79 | #define GPIO_PORT_SHIFT 5 | ||
79 | #define GPIO_PORTA (0<<5) | 80 | #define GPIO_PORTA (0<<5) |
80 | #define GPIO_PORTB (1<<5) | 81 | #define GPIO_PORTB (1<<5) |
81 | #define GPIO_PORTC (2<<5) | 82 | #define GPIO_PORTC (2<<5) |
@@ -88,24 +89,37 @@ | |||
88 | #define GPIO_PF (0<<9) | 89 | #define GPIO_PF (0<<9) |
89 | #define GPIO_AF (1<<9) | 90 | #define GPIO_AF (1<<9) |
90 | 91 | ||
92 | #define GPIO_OCR_SHIFT 10 | ||
91 | #define GPIO_OCR_MASK (3<<10) | 93 | #define GPIO_OCR_MASK (3<<10) |
92 | #define GPIO_AIN (0<<10) | 94 | #define GPIO_AIN (0<<10) |
93 | #define GPIO_BIN (1<<10) | 95 | #define GPIO_BIN (1<<10) |
94 | #define GPIO_CIN (2<<10) | 96 | #define GPIO_CIN (2<<10) |
95 | #define GPIO_GPIO (3<<10) | 97 | #define GPIO_DR (3<<10) |
96 | 98 | ||
97 | #define GPIO_AOUT (1<<12) | 99 | #define GPIO_AOUT_SHIFT 12 |
98 | #define GPIO_BOUT (1<<13) | 100 | #define GPIO_AOUT_MASK (3<<12) |
101 | #define GPIO_AOUT (0<<12) | ||
102 | #define GPIO_AOUT_ISR (1<<12) | ||
103 | #define GPIO_AOUT_0 (2<<12) | ||
104 | #define GPIO_AOUT_1 (3<<12) | ||
105 | |||
106 | #define GPIO_BOUT_SHIFT 14 | ||
107 | #define GPIO_BOUT_MASK (3<<14) | ||
108 | #define GPIO_BOUT (0<<14) | ||
109 | #define GPIO_BOUT_ISR (1<<14) | ||
110 | #define GPIO_BOUT_0 (2<<14) | ||
111 | #define GPIO_BOUT_1 (3<<14) | ||
112 | |||
113 | #define GPIO_GIUS (1<<16) | ||
99 | 114 | ||
100 | /* assignements for GPIO alternate/primary functions */ | 115 | /* assignements for GPIO alternate/primary functions */ |
101 | 116 | ||
102 | /* FIXME: This list is not completed. The correct directions are | 117 | /* FIXME: This list is not completed. The correct directions are |
103 | * missing on some (many) pins | 118 | * missing on some (many) pins |
104 | */ | 119 | */ |
105 | #define PA0_PF_A24 ( GPIO_PORTA | GPIO_PF | 0 ) | 120 | #define PA0_AIN_SPI2_CLK ( GPIO_GIUS | GPIO_PORTA | GPIO_OUT | 0 ) |
106 | #define PA0_AIN_SPI2_CLK ( GPIO_PORTA | GPIO_OUT | GPIO_AIN | 0 ) | ||
107 | #define PA0_AF_ETMTRACESYNC ( GPIO_PORTA | GPIO_AF | 0 ) | 121 | #define PA0_AF_ETMTRACESYNC ( GPIO_PORTA | GPIO_AF | 0 ) |
108 | #define PA1_AOUT_SPI2_RXD ( GPIO_PORTA | GPIO_IN | GPIO_AOUT | 1 ) | 122 | #define PA1_AOUT_SPI2_RXD ( GPIO_GIUS | GPIO_PORTA | GPIO_IN | 1 ) |
109 | #define PA1_PF_TIN ( GPIO_PORTA | GPIO_PF | 1 ) | 123 | #define PA1_PF_TIN ( GPIO_PORTA | GPIO_PF | 1 ) |
110 | #define PA2_PF_PWM0 ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 2 ) | 124 | #define PA2_PF_PWM0 ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 2 ) |
111 | #define PA3_PF_CSI_MCLK ( GPIO_PORTA | GPIO_PF | 3 ) | 125 | #define PA3_PF_CSI_MCLK ( GPIO_PORTA | GPIO_PF | 3 ) |
@@ -123,7 +137,7 @@ | |||
123 | #define PA15_PF_I2C_SDA ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 15 ) | 137 | #define PA15_PF_I2C_SDA ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 15 ) |
124 | #define PA16_PF_I2C_SCL ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 16 ) | 138 | #define PA16_PF_I2C_SCL ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 16 ) |
125 | #define PA17_AF_ETMTRACEPKT4 ( GPIO_PORTA | GPIO_AF | 17 ) | 139 | #define PA17_AF_ETMTRACEPKT4 ( GPIO_PORTA | GPIO_AF | 17 ) |
126 | #define PA17_AIN_SPI2_SS ( GPIO_PORTA | GPIO_AIN | 17 ) | 140 | #define PA17_AIN_SPI2_SS ( GPIO_GIUS | GPIO_PORTA | GPIO_OUT | 17 ) |
127 | #define PA18_AF_ETMTRACEPKT5 ( GPIO_PORTA | GPIO_AF | 18 ) | 141 | #define PA18_AF_ETMTRACEPKT5 ( GPIO_PORTA | GPIO_AF | 18 ) |
128 | #define PA19_AF_ETMTRACEPKT6 ( GPIO_PORTA | GPIO_AF | 19 ) | 142 | #define PA19_AF_ETMTRACEPKT6 ( GPIO_PORTA | GPIO_AF | 19 ) |
129 | #define PA20_AF_ETMTRACEPKT7 ( GPIO_PORTA | GPIO_AF | 20 ) | 143 | #define PA20_AF_ETMTRACEPKT7 ( GPIO_PORTA | GPIO_AF | 20 ) |
@@ -191,19 +205,27 @@ | |||
191 | #define PC15_PF_SPI1_SS ( GPIO_PORTC | GPIO_PF | 15 ) | 205 | #define PC15_PF_SPI1_SS ( GPIO_PORTC | GPIO_PF | 15 ) |
192 | #define PC16_PF_SPI1_MISO ( GPIO_PORTC | GPIO_PF | 16 ) | 206 | #define PC16_PF_SPI1_MISO ( GPIO_PORTC | GPIO_PF | 16 ) |
193 | #define PC17_PF_SPI1_MOSI ( GPIO_PORTC | GPIO_PF | 17 ) | 207 | #define PC17_PF_SPI1_MOSI ( GPIO_PORTC | GPIO_PF | 17 ) |
208 | #define PC24_BIN_UART3_RI ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 24 ) | ||
209 | #define PC25_BIN_UART3_DSR ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 25 ) | ||
210 | #define PC26_AOUT_UART3_DTR ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 26 ) | ||
211 | #define PC27_BIN_UART3_DCD ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 27 ) | ||
212 | #define PC28_BIN_UART3_CTS ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 28 ) | ||
213 | #define PC29_AOUT_UART3_RTS ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 29 ) | ||
214 | #define PC30_BIN_UART3_TX ( GPIO_GIUS | GPIO_PORTC | GPIO_BIN | 30 ) | ||
215 | #define PC31_AOUT_UART3_RX ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 31) | ||
194 | #define PD6_PF_LSCLK ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 6 ) | 216 | #define PD6_PF_LSCLK ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 6 ) |
195 | #define PD7_PF_REV ( GPIO_PORTD | GPIO_PF | 7 ) | 217 | #define PD7_PF_REV ( GPIO_PORTD | GPIO_PF | 7 ) |
196 | #define PD7_AF_UART2_DTR ( GPIO_PORTD | GPIO_IN | GPIO_AF | 7 ) | 218 | #define PD7_AF_UART2_DTR ( GPIO_PORTD | GPIO_IN | GPIO_AF | 7 ) |
197 | #define PD7_AIN_SPI2_SCLK ( GPIO_PORTD | GPIO_AIN | 7 ) | 219 | #define PD7_AIN_SPI2_SCLK ( GPIO_GIUS | GPIO_PORTD | GPIO_AIN | 7 ) |
198 | #define PD8_PF_CLS ( GPIO_PORTD | GPIO_PF | 8 ) | 220 | #define PD8_PF_CLS ( GPIO_PORTD | GPIO_PF | 8 ) |
199 | #define PD8_AF_UART2_DCD ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 8 ) | 221 | #define PD8_AF_UART2_DCD ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 8 ) |
200 | #define PD8_AIN_SPI2_SS ( GPIO_PORTD | GPIO_AIN | 8 ) | 222 | #define PD8_AIN_SPI2_SS ( GPIO_GIUS | GPIO_PORTD | GPIO_AIN | 8 ) |
201 | #define PD9_PF_PS ( GPIO_PORTD | GPIO_PF | 9 ) | 223 | #define PD9_PF_PS ( GPIO_PORTD | GPIO_PF | 9 ) |
202 | #define PD9_AF_UART2_RI ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 9 ) | 224 | #define PD9_AF_UART2_RI ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 9 ) |
203 | #define PD9_AOUT_SPI2_RXD ( GPIO_PORTD | GPIO_IN | GPIO_AOUT | 9 ) | 225 | #define PD9_AOUT_SPI2_RXD ( GPIO_GIUS | GPIO_PORTD | GPIO_IN | 9 ) |
204 | #define PD10_PF_SPL_SPR ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 10 ) | 226 | #define PD10_PF_SPL_SPR ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 10 ) |
205 | #define PD10_AF_UART2_DSR ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 10 ) | 227 | #define PD10_AF_UART2_DSR ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 10 ) |
206 | #define PD10_AIN_SPI2_TXD ( GPIO_PORTD | GPIO_OUT | GPIO_AIN | 10 ) | 228 | #define PD10_AIN_SPI2_TXD ( GPIO_GIUS | GPIO_PORTD | GPIO_OUT | 10 ) |
207 | #define PD11_PF_CONTRAST ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 11 ) | 229 | #define PD11_PF_CONTRAST ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 11 ) |
208 | #define PD12_PF_ACD_OE ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 12 ) | 230 | #define PD12_PF_ACD_OE ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 12 ) |
209 | #define PD13_PF_LP_HSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 13 ) | 231 | #define PD13_PF_LP_HSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 13 ) |
@@ -225,7 +247,7 @@ | |||
225 | #define PD29_PF_LD14 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 29 ) | 247 | #define PD29_PF_LD14 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 29 ) |
226 | #define PD30_PF_LD15 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 30 ) | 248 | #define PD30_PF_LD15 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 30 ) |
227 | #define PD31_PF_TMR2OUT ( GPIO_PORTD | GPIO_PF | 31 ) | 249 | #define PD31_PF_TMR2OUT ( GPIO_PORTD | GPIO_PF | 31 ) |
228 | #define PD31_BIN_SPI2_TXD ( GPIO_PORTD | GPIO_BIN | 31 ) | 250 | #define PD31_BIN_SPI2_TXD ( GPIO_GIUS | GPIO_PORTD | GPIO_BIN | 31 ) |
229 | 251 | ||
230 | /* | 252 | /* |
231 | * PWM controller | 253 | * PWM controller |
diff --git a/include/asm-arm/arch-ixp4xx/platform.h b/include/asm-arm/arch-ixp4xx/platform.h index d13ee7f78c70..f14ed63590c3 100644 --- a/include/asm-arm/arch-ixp4xx/platform.h +++ b/include/asm-arm/arch-ixp4xx/platform.h | |||
@@ -93,7 +93,7 @@ extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); | |||
93 | 93 | ||
94 | static inline void gpio_line_config(u8 line, u32 direction) | 94 | static inline void gpio_line_config(u8 line, u32 direction) |
95 | { | 95 | { |
96 | if (direction == IXP4XX_GPIO_OUT) | 96 | if (direction == IXP4XX_GPIO_IN) |
97 | *IXP4XX_GPIO_GPOER |= (1 << line); | 97 | *IXP4XX_GPIO_GPOER |= (1 << line); |
98 | else | 98 | else |
99 | *IXP4XX_GPIO_GPOER &= ~(1 << line); | 99 | *IXP4XX_GPIO_GPOER &= ~(1 << line); |
diff --git a/include/asm-sparc/btfixup.h b/include/asm-sparc/btfixup.h index b84c96c89581..6b29503256fd 100644 --- a/include/asm-sparc/btfixup.h +++ b/include/asm-sparc/btfixup.h | |||
@@ -51,7 +51,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); | |||
51 | #define BTFIXUPDEF_SIMM13(__name) \ | 51 | #define BTFIXUPDEF_SIMM13(__name) \ |
52 | extern unsigned int ___sf_##__name(void) __attribute_const__; \ | 52 | extern unsigned int ___sf_##__name(void) __attribute_const__; \ |
53 | extern unsigned ___ss_##__name[2]; \ | 53 | extern unsigned ___ss_##__name[2]; \ |
54 | extern __inline__ unsigned int ___sf_##__name(void) { \ | 54 | static inline unsigned int ___sf_##__name(void) { \ |
55 | unsigned int ret; \ | 55 | unsigned int ret; \ |
56 | __asm__ ("or %%g0, ___s_" #__name ", %0" : "=r"(ret)); \ | 56 | __asm__ ("or %%g0, ___s_" #__name ", %0" : "=r"(ret)); \ |
57 | return ret; \ | 57 | return ret; \ |
@@ -59,7 +59,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); | |||
59 | #define BTFIXUPDEF_SIMM13_INIT(__name,__val) \ | 59 | #define BTFIXUPDEF_SIMM13_INIT(__name,__val) \ |
60 | extern unsigned int ___sf_##__name(void) __attribute_const__; \ | 60 | extern unsigned int ___sf_##__name(void) __attribute_const__; \ |
61 | extern unsigned ___ss_##__name[2]; \ | 61 | extern unsigned ___ss_##__name[2]; \ |
62 | extern __inline__ unsigned int ___sf_##__name(void) { \ | 62 | static inline unsigned int ___sf_##__name(void) { \ |
63 | unsigned int ret; \ | 63 | unsigned int ret; \ |
64 | __asm__ ("or %%g0, ___s_" #__name "__btset_" #__val ", %0" : "=r"(ret));\ | 64 | __asm__ ("or %%g0, ___s_" #__name "__btset_" #__val ", %0" : "=r"(ret));\ |
65 | return ret; \ | 65 | return ret; \ |
@@ -73,7 +73,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); | |||
73 | #define BTFIXUPDEF_HALF(__name) \ | 73 | #define BTFIXUPDEF_HALF(__name) \ |
74 | extern unsigned int ___af_##__name(void) __attribute_const__; \ | 74 | extern unsigned int ___af_##__name(void) __attribute_const__; \ |
75 | extern unsigned ___as_##__name[2]; \ | 75 | extern unsigned ___as_##__name[2]; \ |
76 | extern __inline__ unsigned int ___af_##__name(void) { \ | 76 | static inline unsigned int ___af_##__name(void) { \ |
77 | unsigned int ret; \ | 77 | unsigned int ret; \ |
78 | __asm__ ("or %%g0, ___a_" #__name ", %0" : "=r"(ret)); \ | 78 | __asm__ ("or %%g0, ___a_" #__name ", %0" : "=r"(ret)); \ |
79 | return ret; \ | 79 | return ret; \ |
@@ -81,7 +81,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); | |||
81 | #define BTFIXUPDEF_HALF_INIT(__name,__val) \ | 81 | #define BTFIXUPDEF_HALF_INIT(__name,__val) \ |
82 | extern unsigned int ___af_##__name(void) __attribute_const__; \ | 82 | extern unsigned int ___af_##__name(void) __attribute_const__; \ |
83 | extern unsigned ___as_##__name[2]; \ | 83 | extern unsigned ___as_##__name[2]; \ |
84 | extern __inline__ unsigned int ___af_##__name(void) { \ | 84 | static inline unsigned int ___af_##__name(void) { \ |
85 | unsigned int ret; \ | 85 | unsigned int ret; \ |
86 | __asm__ ("or %%g0, ___a_" #__name "__btset_" #__val ", %0" : "=r"(ret));\ | 86 | __asm__ ("or %%g0, ___a_" #__name "__btset_" #__val ", %0" : "=r"(ret));\ |
87 | return ret; \ | 87 | return ret; \ |
@@ -92,7 +92,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); | |||
92 | #define BTFIXUPDEF_SETHI(__name) \ | 92 | #define BTFIXUPDEF_SETHI(__name) \ |
93 | extern unsigned int ___hf_##__name(void) __attribute_const__; \ | 93 | extern unsigned int ___hf_##__name(void) __attribute_const__; \ |
94 | extern unsigned ___hs_##__name[2]; \ | 94 | extern unsigned ___hs_##__name[2]; \ |
95 | extern __inline__ unsigned int ___hf_##__name(void) { \ | 95 | static inline unsigned int ___hf_##__name(void) { \ |
96 | unsigned int ret; \ | 96 | unsigned int ret; \ |
97 | __asm__ ("sethi %%hi(___h_" #__name "), %0" : "=r"(ret)); \ | 97 | __asm__ ("sethi %%hi(___h_" #__name "), %0" : "=r"(ret)); \ |
98 | return ret; \ | 98 | return ret; \ |
@@ -100,7 +100,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); | |||
100 | #define BTFIXUPDEF_SETHI_INIT(__name,__val) \ | 100 | #define BTFIXUPDEF_SETHI_INIT(__name,__val) \ |
101 | extern unsigned int ___hf_##__name(void) __attribute_const__; \ | 101 | extern unsigned int ___hf_##__name(void) __attribute_const__; \ |
102 | extern unsigned ___hs_##__name[2]; \ | 102 | extern unsigned ___hs_##__name[2]; \ |
103 | extern __inline__ unsigned int ___hf_##__name(void) { \ | 103 | static inline unsigned int ___hf_##__name(void) { \ |
104 | unsigned int ret; \ | 104 | unsigned int ret; \ |
105 | __asm__ ("sethi %%hi(___h_" #__name "__btset_" #__val "), %0" : \ | 105 | __asm__ ("sethi %%hi(___h_" #__name "__btset_" #__val "), %0" : \ |
106 | "=r"(ret)); \ | 106 | "=r"(ret)); \ |
diff --git a/include/asm-sparc/cache.h b/include/asm-sparc/cache.h index e6316fd7e1a4..a10522cb21b7 100644 --- a/include/asm-sparc/cache.h +++ b/include/asm-sparc/cache.h | |||
@@ -27,7 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | /* First, cache-tag access. */ | 29 | /* First, cache-tag access. */ |
30 | extern __inline__ unsigned int get_icache_tag(int setnum, int tagnum) | 30 | static inline unsigned int get_icache_tag(int setnum, int tagnum) |
31 | { | 31 | { |
32 | unsigned int vaddr, retval; | 32 | unsigned int vaddr, retval; |
33 | 33 | ||
@@ -38,7 +38,7 @@ extern __inline__ unsigned int get_icache_tag(int setnum, int tagnum) | |||
38 | return retval; | 38 | return retval; |
39 | } | 39 | } |
40 | 40 | ||
41 | extern __inline__ void put_icache_tag(int setnum, int tagnum, unsigned int entry) | 41 | static inline void put_icache_tag(int setnum, int tagnum, unsigned int entry) |
42 | { | 42 | { |
43 | unsigned int vaddr; | 43 | unsigned int vaddr; |
44 | 44 | ||
@@ -51,7 +51,7 @@ extern __inline__ void put_icache_tag(int setnum, int tagnum, unsigned int entry | |||
51 | /* Second cache-data access. The data is returned two-32bit quantities | 51 | /* Second cache-data access. The data is returned two-32bit quantities |
52 | * at a time. | 52 | * at a time. |
53 | */ | 53 | */ |
54 | extern __inline__ void get_icache_data(int setnum, int tagnum, int subblock, | 54 | static inline void get_icache_data(int setnum, int tagnum, int subblock, |
55 | unsigned int *data) | 55 | unsigned int *data) |
56 | { | 56 | { |
57 | unsigned int value1, value2, vaddr; | 57 | unsigned int value1, value2, vaddr; |
@@ -67,7 +67,7 @@ extern __inline__ void get_icache_data(int setnum, int tagnum, int subblock, | |||
67 | data[0] = value1; data[1] = value2; | 67 | data[0] = value1; data[1] = value2; |
68 | } | 68 | } |
69 | 69 | ||
70 | extern __inline__ void put_icache_data(int setnum, int tagnum, int subblock, | 70 | static inline void put_icache_data(int setnum, int tagnum, int subblock, |
71 | unsigned int *data) | 71 | unsigned int *data) |
72 | { | 72 | { |
73 | unsigned int value1, value2, vaddr; | 73 | unsigned int value1, value2, vaddr; |
@@ -92,35 +92,35 @@ extern __inline__ void put_icache_data(int setnum, int tagnum, int subblock, | |||
92 | */ | 92 | */ |
93 | 93 | ||
94 | /* Flushes which clear out both the on-chip and external caches */ | 94 | /* Flushes which clear out both the on-chip and external caches */ |
95 | extern __inline__ void flush_ei_page(unsigned int addr) | 95 | static inline void flush_ei_page(unsigned int addr) |
96 | { | 96 | { |
97 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | 97 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : |
98 | "r" (addr), "i" (ASI_M_FLUSH_PAGE) : | 98 | "r" (addr), "i" (ASI_M_FLUSH_PAGE) : |
99 | "memory"); | 99 | "memory"); |
100 | } | 100 | } |
101 | 101 | ||
102 | extern __inline__ void flush_ei_seg(unsigned int addr) | 102 | static inline void flush_ei_seg(unsigned int addr) |
103 | { | 103 | { |
104 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | 104 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : |
105 | "r" (addr), "i" (ASI_M_FLUSH_SEG) : | 105 | "r" (addr), "i" (ASI_M_FLUSH_SEG) : |
106 | "memory"); | 106 | "memory"); |
107 | } | 107 | } |
108 | 108 | ||
109 | extern __inline__ void flush_ei_region(unsigned int addr) | 109 | static inline void flush_ei_region(unsigned int addr) |
110 | { | 110 | { |
111 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | 111 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : |
112 | "r" (addr), "i" (ASI_M_FLUSH_REGION) : | 112 | "r" (addr), "i" (ASI_M_FLUSH_REGION) : |
113 | "memory"); | 113 | "memory"); |
114 | } | 114 | } |
115 | 115 | ||
116 | extern __inline__ void flush_ei_ctx(unsigned int addr) | 116 | static inline void flush_ei_ctx(unsigned int addr) |
117 | { | 117 | { |
118 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | 118 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : |
119 | "r" (addr), "i" (ASI_M_FLUSH_CTX) : | 119 | "r" (addr), "i" (ASI_M_FLUSH_CTX) : |
120 | "memory"); | 120 | "memory"); |
121 | } | 121 | } |
122 | 122 | ||
123 | extern __inline__ void flush_ei_user(unsigned int addr) | 123 | static inline void flush_ei_user(unsigned int addr) |
124 | { | 124 | { |
125 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | 125 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : |
126 | "r" (addr), "i" (ASI_M_FLUSH_USER) : | 126 | "r" (addr), "i" (ASI_M_FLUSH_USER) : |
diff --git a/include/asm-sparc/cypress.h b/include/asm-sparc/cypress.h index fc92fc839c3f..99599533efbc 100644 --- a/include/asm-sparc/cypress.h +++ b/include/asm-sparc/cypress.h | |||
@@ -48,25 +48,25 @@ | |||
48 | #define CYPRESS_NFAULT 0x00000002 | 48 | #define CYPRESS_NFAULT 0x00000002 |
49 | #define CYPRESS_MENABLE 0x00000001 | 49 | #define CYPRESS_MENABLE 0x00000001 |
50 | 50 | ||
51 | extern __inline__ void cypress_flush_page(unsigned long page) | 51 | static inline void cypress_flush_page(unsigned long page) |
52 | { | 52 | { |
53 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | 53 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : |
54 | "r" (page), "i" (ASI_M_FLUSH_PAGE)); | 54 | "r" (page), "i" (ASI_M_FLUSH_PAGE)); |
55 | } | 55 | } |
56 | 56 | ||
57 | extern __inline__ void cypress_flush_segment(unsigned long addr) | 57 | static inline void cypress_flush_segment(unsigned long addr) |
58 | { | 58 | { |
59 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | 59 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : |
60 | "r" (addr), "i" (ASI_M_FLUSH_SEG)); | 60 | "r" (addr), "i" (ASI_M_FLUSH_SEG)); |
61 | } | 61 | } |
62 | 62 | ||
63 | extern __inline__ void cypress_flush_region(unsigned long addr) | 63 | static inline void cypress_flush_region(unsigned long addr) |
64 | { | 64 | { |
65 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : | 65 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : |
66 | "r" (addr), "i" (ASI_M_FLUSH_REGION)); | 66 | "r" (addr), "i" (ASI_M_FLUSH_REGION)); |
67 | } | 67 | } |
68 | 68 | ||
69 | extern __inline__ void cypress_flush_context(void) | 69 | static inline void cypress_flush_context(void) |
70 | { | 70 | { |
71 | __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : | 71 | __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : |
72 | "i" (ASI_M_FLUSH_CTX)); | 72 | "i" (ASI_M_FLUSH_CTX)); |
diff --git a/include/asm-sparc/delay.h b/include/asm-sparc/delay.h index 6edf2cbb246b..7ec8e9f7ad4f 100644 --- a/include/asm-sparc/delay.h +++ b/include/asm-sparc/delay.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <linux/config.h> | 10 | #include <linux/config.h> |
11 | #include <asm/cpudata.h> | 11 | #include <asm/cpudata.h> |
12 | 12 | ||
13 | extern __inline__ void __delay(unsigned long loops) | 13 | static inline void __delay(unsigned long loops) |
14 | { | 14 | { |
15 | __asm__ __volatile__("cmp %0, 0\n\t" | 15 | __asm__ __volatile__("cmp %0, 0\n\t" |
16 | "1: bne 1b\n\t" | 16 | "1: bne 1b\n\t" |
diff --git a/include/asm-sparc/dma.h b/include/asm-sparc/dma.h index 07e6368a2521..8ec206aa5f2e 100644 --- a/include/asm-sparc/dma.h +++ b/include/asm-sparc/dma.h | |||
@@ -198,7 +198,7 @@ extern void dvma_init(struct sbus_bus *); | |||
198 | /* Pause until counter runs out or BIT isn't set in the DMA condition | 198 | /* Pause until counter runs out or BIT isn't set in the DMA condition |
199 | * register. | 199 | * register. |
200 | */ | 200 | */ |
201 | extern __inline__ void sparc_dma_pause(struct sparc_dma_registers *regs, | 201 | static inline void sparc_dma_pause(struct sparc_dma_registers *regs, |
202 | unsigned long bit) | 202 | unsigned long bit) |
203 | { | 203 | { |
204 | int ctr = 50000; /* Let's find some bugs ;) */ | 204 | int ctr = 50000; /* Let's find some bugs ;) */ |
diff --git a/include/asm-sparc/iommu.h b/include/asm-sparc/iommu.h index 8171362d56b9..70c589c05a10 100644 --- a/include/asm-sparc/iommu.h +++ b/include/asm-sparc/iommu.h | |||
@@ -108,12 +108,12 @@ struct iommu_struct { | |||
108 | struct bit_map usemap; | 108 | struct bit_map usemap; |
109 | }; | 109 | }; |
110 | 110 | ||
111 | extern __inline__ void iommu_invalidate(struct iommu_regs *regs) | 111 | static inline void iommu_invalidate(struct iommu_regs *regs) |
112 | { | 112 | { |
113 | regs->tlbflush = 0; | 113 | regs->tlbflush = 0; |
114 | } | 114 | } |
115 | 115 | ||
116 | extern __inline__ void iommu_invalidate_page(struct iommu_regs *regs, unsigned long ba) | 116 | static inline void iommu_invalidate_page(struct iommu_regs *regs, unsigned long ba) |
117 | { | 117 | { |
118 | regs->pageflush = (ba & PAGE_MASK); | 118 | regs->pageflush = (ba & PAGE_MASK); |
119 | } | 119 | } |
diff --git a/include/asm-sparc/kdebug.h b/include/asm-sparc/kdebug.h index 3ea4916635ee..fba92485fdba 100644 --- a/include/asm-sparc/kdebug.h +++ b/include/asm-sparc/kdebug.h | |||
@@ -46,7 +46,7 @@ struct kernel_debug { | |||
46 | extern struct kernel_debug *linux_dbvec; | 46 | extern struct kernel_debug *linux_dbvec; |
47 | 47 | ||
48 | /* Use this macro in C-code to enter the debugger. */ | 48 | /* Use this macro in C-code to enter the debugger. */ |
49 | extern __inline__ void sp_enter_debugger(void) | 49 | static inline void sp_enter_debugger(void) |
50 | { | 50 | { |
51 | __asm__ __volatile__("jmpl %0, %%o7\n\t" | 51 | __asm__ __volatile__("jmpl %0, %%o7\n\t" |
52 | "nop\n\t" : : | 52 | "nop\n\t" : : |
diff --git a/include/asm-sparc/mbus.h b/include/asm-sparc/mbus.h index 5f2749015342..ecacdf4075d7 100644 --- a/include/asm-sparc/mbus.h +++ b/include/asm-sparc/mbus.h | |||
@@ -83,7 +83,7 @@ extern unsigned int hwbug_bitmask; | |||
83 | */ | 83 | */ |
84 | #define TBR_ID_SHIFT 20 | 84 | #define TBR_ID_SHIFT 20 |
85 | 85 | ||
86 | extern __inline__ int get_cpuid(void) | 86 | static inline int get_cpuid(void) |
87 | { | 87 | { |
88 | register int retval; | 88 | register int retval; |
89 | __asm__ __volatile__("rd %%tbr, %0\n\t" | 89 | __asm__ __volatile__("rd %%tbr, %0\n\t" |
@@ -93,7 +93,7 @@ extern __inline__ int get_cpuid(void) | |||
93 | return (retval & 3); | 93 | return (retval & 3); |
94 | } | 94 | } |
95 | 95 | ||
96 | extern __inline__ int get_modid(void) | 96 | static inline int get_modid(void) |
97 | { | 97 | { |
98 | return (get_cpuid() | 0x8); | 98 | return (get_cpuid() | 0x8); |
99 | } | 99 | } |
diff --git a/include/asm-sparc/msi.h b/include/asm-sparc/msi.h index b69543dd3b46..ff72cbd946a4 100644 --- a/include/asm-sparc/msi.h +++ b/include/asm-sparc/msi.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #define MSI_ASYNC_MODE 0x80000000 /* Operate the MSI asynchronously */ | 19 | #define MSI_ASYNC_MODE 0x80000000 /* Operate the MSI asynchronously */ |
20 | 20 | ||
21 | 21 | ||
22 | extern __inline__ void msi_set_sync(void) | 22 | static inline void msi_set_sync(void) |
23 | { | 23 | { |
24 | __asm__ __volatile__ ("lda [%0] %1, %%g3\n\t" | 24 | __asm__ __volatile__ ("lda [%0] %1, %%g3\n\t" |
25 | "andn %%g3, %2, %%g3\n\t" | 25 | "andn %%g3, %2, %%g3\n\t" |
diff --git a/include/asm-sparc/mxcc.h b/include/asm-sparc/mxcc.h index 60ef9d6fe7bc..128fe9708135 100644 --- a/include/asm-sparc/mxcc.h +++ b/include/asm-sparc/mxcc.h | |||
@@ -85,7 +85,7 @@ | |||
85 | 85 | ||
86 | #ifndef __ASSEMBLY__ | 86 | #ifndef __ASSEMBLY__ |
87 | 87 | ||
88 | extern __inline__ void mxcc_set_stream_src(unsigned long *paddr) | 88 | static inline void mxcc_set_stream_src(unsigned long *paddr) |
89 | { | 89 | { |
90 | unsigned long data0 = paddr[0]; | 90 | unsigned long data0 = paddr[0]; |
91 | unsigned long data1 = paddr[1]; | 91 | unsigned long data1 = paddr[1]; |
@@ -98,7 +98,7 @@ extern __inline__ void mxcc_set_stream_src(unsigned long *paddr) | |||
98 | "i" (ASI_M_MXCC) : "g2", "g3"); | 98 | "i" (ASI_M_MXCC) : "g2", "g3"); |
99 | } | 99 | } |
100 | 100 | ||
101 | extern __inline__ void mxcc_set_stream_dst(unsigned long *paddr) | 101 | static inline void mxcc_set_stream_dst(unsigned long *paddr) |
102 | { | 102 | { |
103 | unsigned long data0 = paddr[0]; | 103 | unsigned long data0 = paddr[0]; |
104 | unsigned long data1 = paddr[1]; | 104 | unsigned long data1 = paddr[1]; |
@@ -111,7 +111,7 @@ extern __inline__ void mxcc_set_stream_dst(unsigned long *paddr) | |||
111 | "i" (ASI_M_MXCC) : "g2", "g3"); | 111 | "i" (ASI_M_MXCC) : "g2", "g3"); |
112 | } | 112 | } |
113 | 113 | ||
114 | extern __inline__ unsigned long mxcc_get_creg(void) | 114 | static inline unsigned long mxcc_get_creg(void) |
115 | { | 115 | { |
116 | unsigned long mxcc_control; | 116 | unsigned long mxcc_control; |
117 | 117 | ||
@@ -125,7 +125,7 @@ extern __inline__ unsigned long mxcc_get_creg(void) | |||
125 | return mxcc_control; | 125 | return mxcc_control; |
126 | } | 126 | } |
127 | 127 | ||
128 | extern __inline__ void mxcc_set_creg(unsigned long mxcc_control) | 128 | static inline void mxcc_set_creg(unsigned long mxcc_control) |
129 | { | 129 | { |
130 | __asm__ __volatile__("sta %0, [%1] %2\n\t" : : | 130 | __asm__ __volatile__("sta %0, [%1] %2\n\t" : : |
131 | "r" (mxcc_control), "r" (MXCC_CREG), | 131 | "r" (mxcc_control), "r" (MXCC_CREG), |
diff --git a/include/asm-sparc/obio.h b/include/asm-sparc/obio.h index 62e1d77965f3..47854a2a12cf 100644 --- a/include/asm-sparc/obio.h +++ b/include/asm-sparc/obio.h | |||
@@ -98,7 +98,7 @@ | |||
98 | 98 | ||
99 | #ifndef __ASSEMBLY__ | 99 | #ifndef __ASSEMBLY__ |
100 | 100 | ||
101 | extern __inline__ int bw_get_intr_mask(int sbus_level) | 101 | static inline int bw_get_intr_mask(int sbus_level) |
102 | { | 102 | { |
103 | int mask; | 103 | int mask; |
104 | 104 | ||
@@ -109,7 +109,7 @@ extern __inline__ int bw_get_intr_mask(int sbus_level) | |||
109 | return mask; | 109 | return mask; |
110 | } | 110 | } |
111 | 111 | ||
112 | extern __inline__ void bw_clear_intr_mask(int sbus_level, int mask) | 112 | static inline void bw_clear_intr_mask(int sbus_level, int mask) |
113 | { | 113 | { |
114 | __asm__ __volatile__ ("stha %0, [%1] %2" : : | 114 | __asm__ __volatile__ ("stha %0, [%1] %2" : : |
115 | "r" (mask), | 115 | "r" (mask), |
@@ -117,7 +117,7 @@ extern __inline__ void bw_clear_intr_mask(int sbus_level, int mask) | |||
117 | "i" (ASI_M_CTL)); | 117 | "i" (ASI_M_CTL)); |
118 | } | 118 | } |
119 | 119 | ||
120 | extern __inline__ unsigned bw_get_prof_limit(int cpu) | 120 | static inline unsigned bw_get_prof_limit(int cpu) |
121 | { | 121 | { |
122 | unsigned limit; | 122 | unsigned limit; |
123 | 123 | ||
@@ -128,7 +128,7 @@ extern __inline__ unsigned bw_get_prof_limit(int cpu) | |||
128 | return limit; | 128 | return limit; |
129 | } | 129 | } |
130 | 130 | ||
131 | extern __inline__ void bw_set_prof_limit(int cpu, unsigned limit) | 131 | static inline void bw_set_prof_limit(int cpu, unsigned limit) |
132 | { | 132 | { |
133 | __asm__ __volatile__ ("sta %0, [%1] %2" : : | 133 | __asm__ __volatile__ ("sta %0, [%1] %2" : : |
134 | "r" (limit), | 134 | "r" (limit), |
@@ -136,7 +136,7 @@ extern __inline__ void bw_set_prof_limit(int cpu, unsigned limit) | |||
136 | "i" (ASI_M_CTL)); | 136 | "i" (ASI_M_CTL)); |
137 | } | 137 | } |
138 | 138 | ||
139 | extern __inline__ unsigned bw_get_ctrl(int cpu) | 139 | static inline unsigned bw_get_ctrl(int cpu) |
140 | { | 140 | { |
141 | unsigned ctrl; | 141 | unsigned ctrl; |
142 | 142 | ||
@@ -147,7 +147,7 @@ extern __inline__ unsigned bw_get_ctrl(int cpu) | |||
147 | return ctrl; | 147 | return ctrl; |
148 | } | 148 | } |
149 | 149 | ||
150 | extern __inline__ void bw_set_ctrl(int cpu, unsigned ctrl) | 150 | static inline void bw_set_ctrl(int cpu, unsigned ctrl) |
151 | { | 151 | { |
152 | __asm__ __volatile__ ("sta %0, [%1] %2" : : | 152 | __asm__ __volatile__ ("sta %0, [%1] %2" : : |
153 | "r" (ctrl), | 153 | "r" (ctrl), |
@@ -157,7 +157,7 @@ extern __inline__ void bw_set_ctrl(int cpu, unsigned ctrl) | |||
157 | 157 | ||
158 | extern unsigned char cpu_leds[32]; | 158 | extern unsigned char cpu_leds[32]; |
159 | 159 | ||
160 | extern __inline__ void show_leds(int cpuid) | 160 | static inline void show_leds(int cpuid) |
161 | { | 161 | { |
162 | cpuid &= 0x1e; | 162 | cpuid &= 0x1e; |
163 | __asm__ __volatile__ ("stba %0, [%1] %2" : : | 163 | __asm__ __volatile__ ("stba %0, [%1] %2" : : |
@@ -166,7 +166,7 @@ extern __inline__ void show_leds(int cpuid) | |||
166 | "i" (ASI_M_CTL)); | 166 | "i" (ASI_M_CTL)); |
167 | } | 167 | } |
168 | 168 | ||
169 | extern __inline__ unsigned cc_get_ipen(void) | 169 | static inline unsigned cc_get_ipen(void) |
170 | { | 170 | { |
171 | unsigned pending; | 171 | unsigned pending; |
172 | 172 | ||
@@ -177,7 +177,7 @@ extern __inline__ unsigned cc_get_ipen(void) | |||
177 | return pending; | 177 | return pending; |
178 | } | 178 | } |
179 | 179 | ||
180 | extern __inline__ void cc_set_iclr(unsigned clear) | 180 | static inline void cc_set_iclr(unsigned clear) |
181 | { | 181 | { |
182 | __asm__ __volatile__ ("stha %0, [%1] %2" : : | 182 | __asm__ __volatile__ ("stha %0, [%1] %2" : : |
183 | "r" (clear), | 183 | "r" (clear), |
@@ -185,7 +185,7 @@ extern __inline__ void cc_set_iclr(unsigned clear) | |||
185 | "i" (ASI_M_MXCC)); | 185 | "i" (ASI_M_MXCC)); |
186 | } | 186 | } |
187 | 187 | ||
188 | extern __inline__ unsigned cc_get_imsk(void) | 188 | static inline unsigned cc_get_imsk(void) |
189 | { | 189 | { |
190 | unsigned mask; | 190 | unsigned mask; |
191 | 191 | ||
@@ -196,7 +196,7 @@ extern __inline__ unsigned cc_get_imsk(void) | |||
196 | return mask; | 196 | return mask; |
197 | } | 197 | } |
198 | 198 | ||
199 | extern __inline__ void cc_set_imsk(unsigned mask) | 199 | static inline void cc_set_imsk(unsigned mask) |
200 | { | 200 | { |
201 | __asm__ __volatile__ ("stha %0, [%1] %2" : : | 201 | __asm__ __volatile__ ("stha %0, [%1] %2" : : |
202 | "r" (mask), | 202 | "r" (mask), |
@@ -204,7 +204,7 @@ extern __inline__ void cc_set_imsk(unsigned mask) | |||
204 | "i" (ASI_M_MXCC)); | 204 | "i" (ASI_M_MXCC)); |
205 | } | 205 | } |
206 | 206 | ||
207 | extern __inline__ unsigned cc_get_imsk_other(int cpuid) | 207 | static inline unsigned cc_get_imsk_other(int cpuid) |
208 | { | 208 | { |
209 | unsigned mask; | 209 | unsigned mask; |
210 | 210 | ||
@@ -215,7 +215,7 @@ extern __inline__ unsigned cc_get_imsk_other(int cpuid) | |||
215 | return mask; | 215 | return mask; |
216 | } | 216 | } |
217 | 217 | ||
218 | extern __inline__ void cc_set_imsk_other(int cpuid, unsigned mask) | 218 | static inline void cc_set_imsk_other(int cpuid, unsigned mask) |
219 | { | 219 | { |
220 | __asm__ __volatile__ ("stha %0, [%1] %2" : : | 220 | __asm__ __volatile__ ("stha %0, [%1] %2" : : |
221 | "r" (mask), | 221 | "r" (mask), |
@@ -223,7 +223,7 @@ extern __inline__ void cc_set_imsk_other(int cpuid, unsigned mask) | |||
223 | "i" (ASI_M_CTL)); | 223 | "i" (ASI_M_CTL)); |
224 | } | 224 | } |
225 | 225 | ||
226 | extern __inline__ void cc_set_igen(unsigned gen) | 226 | static inline void cc_set_igen(unsigned gen) |
227 | { | 227 | { |
228 | __asm__ __volatile__ ("sta %0, [%1] %2" : : | 228 | __asm__ __volatile__ ("sta %0, [%1] %2" : : |
229 | "r" (gen), | 229 | "r" (gen), |
@@ -239,7 +239,7 @@ extern __inline__ void cc_set_igen(unsigned gen) | |||
239 | #define IGEN_MESSAGE(bcast, devid, sid, levels) \ | 239 | #define IGEN_MESSAGE(bcast, devid, sid, levels) \ |
240 | (((bcast) << 31) | ((devid) << 23) | ((sid) << 15) | (levels)) | 240 | (((bcast) << 31) | ((devid) << 23) | ((sid) << 15) | (levels)) |
241 | 241 | ||
242 | extern __inline__ void sun4d_send_ipi(int cpu, int level) | 242 | static inline void sun4d_send_ipi(int cpu, int level) |
243 | { | 243 | { |
244 | cc_set_igen(IGEN_MESSAGE(0, cpu << 3, 6 + ((level >> 1) & 7), 1 << (level - 1))); | 244 | cc_set_igen(IGEN_MESSAGE(0, cpu << 3, 6 + ((level >> 1) & 7), 1 << (level - 1))); |
245 | } | 245 | } |
diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h index 97052baf90c1..38644742f011 100644 --- a/include/asm-sparc/pci.h +++ b/include/asm-sparc/pci.h | |||
@@ -15,12 +15,12 @@ | |||
15 | 15 | ||
16 | #define PCI_IRQ_NONE 0xffffffff | 16 | #define PCI_IRQ_NONE 0xffffffff |
17 | 17 | ||
18 | extern inline void pcibios_set_master(struct pci_dev *dev) | 18 | static inline void pcibios_set_master(struct pci_dev *dev) |
19 | { | 19 | { |
20 | /* No special bus mastering setup handling */ | 20 | /* No special bus mastering setup handling */ |
21 | } | 21 | } |
22 | 22 | ||
23 | extern inline void pcibios_penalize_isa_irq(int irq, int active) | 23 | static inline void pcibios_penalize_isa_irq(int irq, int active) |
24 | { | 24 | { |
25 | /* We don't do dynamic PCI IRQ allocation */ | 25 | /* We don't do dynamic PCI IRQ allocation */ |
26 | } | 26 | } |
@@ -137,7 +137,7 @@ extern void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist | |||
137 | * only drive the low 24-bits during PCI bus mastering, then | 137 | * only drive the low 24-bits during PCI bus mastering, then |
138 | * you would pass 0x00ffffff as the mask to this function. | 138 | * you would pass 0x00ffffff as the mask to this function. |
139 | */ | 139 | */ |
140 | extern inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) | 140 | static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) |
141 | { | 141 | { |
142 | return 1; | 142 | return 1; |
143 | } | 143 | } |
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index 8395ad2f1c09..ae883f295f1f 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h | |||
@@ -154,7 +154,7 @@ BTFIXUPDEF_CALL_CONST(int, pte_present, pte_t) | |||
154 | BTFIXUPDEF_CALL(void, pte_clear, pte_t *) | 154 | BTFIXUPDEF_CALL(void, pte_clear, pte_t *) |
155 | BTFIXUPDEF_CALL(int, pte_read, pte_t) | 155 | BTFIXUPDEF_CALL(int, pte_read, pte_t) |
156 | 156 | ||
157 | extern __inline__ int pte_none(pte_t pte) | 157 | static inline int pte_none(pte_t pte) |
158 | { | 158 | { |
159 | return !(pte_val(pte) & ~BTFIXUP_SETHI(none_mask)); | 159 | return !(pte_val(pte) & ~BTFIXUP_SETHI(none_mask)); |
160 | } | 160 | } |
@@ -167,7 +167,7 @@ BTFIXUPDEF_CALL_CONST(int, pmd_bad, pmd_t) | |||
167 | BTFIXUPDEF_CALL_CONST(int, pmd_present, pmd_t) | 167 | BTFIXUPDEF_CALL_CONST(int, pmd_present, pmd_t) |
168 | BTFIXUPDEF_CALL(void, pmd_clear, pmd_t *) | 168 | BTFIXUPDEF_CALL(void, pmd_clear, pmd_t *) |
169 | 169 | ||
170 | extern __inline__ int pmd_none(pmd_t pmd) | 170 | static inline int pmd_none(pmd_t pmd) |
171 | { | 171 | { |
172 | return !(pmd_val(pmd) & ~BTFIXUP_SETHI(none_mask)); | 172 | return !(pmd_val(pmd) & ~BTFIXUP_SETHI(none_mask)); |
173 | } | 173 | } |
@@ -195,19 +195,19 @@ BTFIXUPDEF_HALF(pte_dirtyi) | |||
195 | BTFIXUPDEF_HALF(pte_youngi) | 195 | BTFIXUPDEF_HALF(pte_youngi) |
196 | 196 | ||
197 | extern int pte_write(pte_t pte) __attribute_const__; | 197 | extern int pte_write(pte_t pte) __attribute_const__; |
198 | extern __inline__ int pte_write(pte_t pte) | 198 | static inline int pte_write(pte_t pte) |
199 | { | 199 | { |
200 | return pte_val(pte) & BTFIXUP_HALF(pte_writei); | 200 | return pte_val(pte) & BTFIXUP_HALF(pte_writei); |
201 | } | 201 | } |
202 | 202 | ||
203 | extern int pte_dirty(pte_t pte) __attribute_const__; | 203 | extern int pte_dirty(pte_t pte) __attribute_const__; |
204 | extern __inline__ int pte_dirty(pte_t pte) | 204 | static inline int pte_dirty(pte_t pte) |
205 | { | 205 | { |
206 | return pte_val(pte) & BTFIXUP_HALF(pte_dirtyi); | 206 | return pte_val(pte) & BTFIXUP_HALF(pte_dirtyi); |
207 | } | 207 | } |
208 | 208 | ||
209 | extern int pte_young(pte_t pte) __attribute_const__; | 209 | extern int pte_young(pte_t pte) __attribute_const__; |
210 | extern __inline__ int pte_young(pte_t pte) | 210 | static inline int pte_young(pte_t pte) |
211 | { | 211 | { |
212 | return pte_val(pte) & BTFIXUP_HALF(pte_youngi); | 212 | return pte_val(pte) & BTFIXUP_HALF(pte_youngi); |
213 | } | 213 | } |
@@ -218,7 +218,7 @@ extern __inline__ int pte_young(pte_t pte) | |||
218 | BTFIXUPDEF_HALF(pte_filei) | 218 | BTFIXUPDEF_HALF(pte_filei) |
219 | 219 | ||
220 | extern int pte_file(pte_t pte) __attribute_const__; | 220 | extern int pte_file(pte_t pte) __attribute_const__; |
221 | extern __inline__ int pte_file(pte_t pte) | 221 | static inline int pte_file(pte_t pte) |
222 | { | 222 | { |
223 | return pte_val(pte) & BTFIXUP_HALF(pte_filei); | 223 | return pte_val(pte) & BTFIXUP_HALF(pte_filei); |
224 | } | 224 | } |
@@ -230,19 +230,19 @@ BTFIXUPDEF_HALF(pte_mkcleani) | |||
230 | BTFIXUPDEF_HALF(pte_mkoldi) | 230 | BTFIXUPDEF_HALF(pte_mkoldi) |
231 | 231 | ||
232 | extern pte_t pte_wrprotect(pte_t pte) __attribute_const__; | 232 | extern pte_t pte_wrprotect(pte_t pte) __attribute_const__; |
233 | extern __inline__ pte_t pte_wrprotect(pte_t pte) | 233 | static inline pte_t pte_wrprotect(pte_t pte) |
234 | { | 234 | { |
235 | return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_wrprotecti)); | 235 | return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_wrprotecti)); |
236 | } | 236 | } |
237 | 237 | ||
238 | extern pte_t pte_mkclean(pte_t pte) __attribute_const__; | 238 | extern pte_t pte_mkclean(pte_t pte) __attribute_const__; |
239 | extern __inline__ pte_t pte_mkclean(pte_t pte) | 239 | static inline pte_t pte_mkclean(pte_t pte) |
240 | { | 240 | { |
241 | return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkcleani)); | 241 | return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkcleani)); |
242 | } | 242 | } |
243 | 243 | ||
244 | extern pte_t pte_mkold(pte_t pte) __attribute_const__; | 244 | extern pte_t pte_mkold(pte_t pte) __attribute_const__; |
245 | extern __inline__ pte_t pte_mkold(pte_t pte) | 245 | static inline pte_t pte_mkold(pte_t pte) |
246 | { | 246 | { |
247 | return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkoldi)); | 247 | return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkoldi)); |
248 | } | 248 | } |
@@ -279,7 +279,7 @@ BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_io, unsigned long, pgprot_t, int) | |||
279 | BTFIXUPDEF_INT(pte_modify_mask) | 279 | BTFIXUPDEF_INT(pte_modify_mask) |
280 | 280 | ||
281 | extern pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute_const__; | 281 | extern pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute_const__; |
282 | extern __inline__ pte_t pte_modify(pte_t pte, pgprot_t newprot) | 282 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
283 | { | 283 | { |
284 | return __pte((pte_val(pte) & BTFIXUP_INT(pte_modify_mask)) | | 284 | return __pte((pte_val(pte) & BTFIXUP_INT(pte_modify_mask)) | |
285 | pgprot_val(newprot)); | 285 | pgprot_val(newprot)); |
@@ -386,13 +386,13 @@ extern struct ctx_list ctx_used; /* Head of used contexts list */ | |||
386 | 386 | ||
387 | #define NO_CONTEXT -1 | 387 | #define NO_CONTEXT -1 |
388 | 388 | ||
389 | extern __inline__ void remove_from_ctx_list(struct ctx_list *entry) | 389 | static inline void remove_from_ctx_list(struct ctx_list *entry) |
390 | { | 390 | { |
391 | entry->next->prev = entry->prev; | 391 | entry->next->prev = entry->prev; |
392 | entry->prev->next = entry->next; | 392 | entry->prev->next = entry->next; |
393 | } | 393 | } |
394 | 394 | ||
395 | extern __inline__ void add_to_ctx_list(struct ctx_list *head, struct ctx_list *entry) | 395 | static inline void add_to_ctx_list(struct ctx_list *head, struct ctx_list *entry) |
396 | { | 396 | { |
397 | entry->next = head; | 397 | entry->next = head; |
398 | (entry->prev = head->prev)->next = entry; | 398 | (entry->prev = head->prev)->next = entry; |
@@ -401,7 +401,7 @@ extern __inline__ void add_to_ctx_list(struct ctx_list *head, struct ctx_list *e | |||
401 | #define add_to_free_ctxlist(entry) add_to_ctx_list(&ctx_free, entry) | 401 | #define add_to_free_ctxlist(entry) add_to_ctx_list(&ctx_free, entry) |
402 | #define add_to_used_ctxlist(entry) add_to_ctx_list(&ctx_used, entry) | 402 | #define add_to_used_ctxlist(entry) add_to_ctx_list(&ctx_used, entry) |
403 | 403 | ||
404 | extern __inline__ unsigned long | 404 | static inline unsigned long |
405 | __get_phys (unsigned long addr) | 405 | __get_phys (unsigned long addr) |
406 | { | 406 | { |
407 | switch (sparc_cpu_model){ | 407 | switch (sparc_cpu_model){ |
@@ -416,7 +416,7 @@ __get_phys (unsigned long addr) | |||
416 | } | 416 | } |
417 | } | 417 | } |
418 | 418 | ||
419 | extern __inline__ int | 419 | static inline int |
420 | __get_iospace (unsigned long addr) | 420 | __get_iospace (unsigned long addr) |
421 | { | 421 | { |
422 | switch (sparc_cpu_model){ | 422 | switch (sparc_cpu_model){ |
diff --git a/include/asm-sparc/pgtsrmmu.h b/include/asm-sparc/pgtsrmmu.h index ee3b9d93187c..edeb9811e728 100644 --- a/include/asm-sparc/pgtsrmmu.h +++ b/include/asm-sparc/pgtsrmmu.h | |||
@@ -148,7 +148,7 @@ extern void *srmmu_nocache_pool; | |||
148 | #define __nocache_fix(VADDR) __va(__nocache_pa(VADDR)) | 148 | #define __nocache_fix(VADDR) __va(__nocache_pa(VADDR)) |
149 | 149 | ||
150 | /* Accessing the MMU control register. */ | 150 | /* Accessing the MMU control register. */ |
151 | extern __inline__ unsigned int srmmu_get_mmureg(void) | 151 | static inline unsigned int srmmu_get_mmureg(void) |
152 | { | 152 | { |
153 | unsigned int retval; | 153 | unsigned int retval; |
154 | __asm__ __volatile__("lda [%%g0] %1, %0\n\t" : | 154 | __asm__ __volatile__("lda [%%g0] %1, %0\n\t" : |
@@ -157,14 +157,14 @@ extern __inline__ unsigned int srmmu_get_mmureg(void) | |||
157 | return retval; | 157 | return retval; |
158 | } | 158 | } |
159 | 159 | ||
160 | extern __inline__ void srmmu_set_mmureg(unsigned long regval) | 160 | static inline void srmmu_set_mmureg(unsigned long regval) |
161 | { | 161 | { |
162 | __asm__ __volatile__("sta %0, [%%g0] %1\n\t" : : | 162 | __asm__ __volatile__("sta %0, [%%g0] %1\n\t" : : |
163 | "r" (regval), "i" (ASI_M_MMUREGS) : "memory"); | 163 | "r" (regval), "i" (ASI_M_MMUREGS) : "memory"); |
164 | 164 | ||
165 | } | 165 | } |
166 | 166 | ||
167 | extern __inline__ void srmmu_set_ctable_ptr(unsigned long paddr) | 167 | static inline void srmmu_set_ctable_ptr(unsigned long paddr) |
168 | { | 168 | { |
169 | paddr = ((paddr >> 4) & SRMMU_CTX_PMASK); | 169 | paddr = ((paddr >> 4) & SRMMU_CTX_PMASK); |
170 | __asm__ __volatile__("sta %0, [%1] %2\n\t" : : | 170 | __asm__ __volatile__("sta %0, [%1] %2\n\t" : : |
@@ -173,7 +173,7 @@ extern __inline__ void srmmu_set_ctable_ptr(unsigned long paddr) | |||
173 | "memory"); | 173 | "memory"); |
174 | } | 174 | } |
175 | 175 | ||
176 | extern __inline__ unsigned long srmmu_get_ctable_ptr(void) | 176 | static inline unsigned long srmmu_get_ctable_ptr(void) |
177 | { | 177 | { |
178 | unsigned int retval; | 178 | unsigned int retval; |
179 | 179 | ||
@@ -184,14 +184,14 @@ extern __inline__ unsigned long srmmu_get_ctable_ptr(void) | |||
184 | return (retval & SRMMU_CTX_PMASK) << 4; | 184 | return (retval & SRMMU_CTX_PMASK) << 4; |
185 | } | 185 | } |
186 | 186 | ||
187 | extern __inline__ void srmmu_set_context(int context) | 187 | static inline void srmmu_set_context(int context) |
188 | { | 188 | { |
189 | __asm__ __volatile__("sta %0, [%1] %2\n\t" : : | 189 | __asm__ __volatile__("sta %0, [%1] %2\n\t" : : |
190 | "r" (context), "r" (SRMMU_CTX_REG), | 190 | "r" (context), "r" (SRMMU_CTX_REG), |
191 | "i" (ASI_M_MMUREGS) : "memory"); | 191 | "i" (ASI_M_MMUREGS) : "memory"); |
192 | } | 192 | } |
193 | 193 | ||
194 | extern __inline__ int srmmu_get_context(void) | 194 | static inline int srmmu_get_context(void) |
195 | { | 195 | { |
196 | register int retval; | 196 | register int retval; |
197 | __asm__ __volatile__("lda [%1] %2, %0\n\t" : | 197 | __asm__ __volatile__("lda [%1] %2, %0\n\t" : |
@@ -201,7 +201,7 @@ extern __inline__ int srmmu_get_context(void) | |||
201 | return retval; | 201 | return retval; |
202 | } | 202 | } |
203 | 203 | ||
204 | extern __inline__ unsigned int srmmu_get_fstatus(void) | 204 | static inline unsigned int srmmu_get_fstatus(void) |
205 | { | 205 | { |
206 | unsigned int retval; | 206 | unsigned int retval; |
207 | 207 | ||
@@ -211,7 +211,7 @@ extern __inline__ unsigned int srmmu_get_fstatus(void) | |||
211 | return retval; | 211 | return retval; |
212 | } | 212 | } |
213 | 213 | ||
214 | extern __inline__ unsigned int srmmu_get_faddr(void) | 214 | static inline unsigned int srmmu_get_faddr(void) |
215 | { | 215 | { |
216 | unsigned int retval; | 216 | unsigned int retval; |
217 | 217 | ||
@@ -222,7 +222,7 @@ extern __inline__ unsigned int srmmu_get_faddr(void) | |||
222 | } | 222 | } |
223 | 223 | ||
224 | /* This is guaranteed on all SRMMU's. */ | 224 | /* This is guaranteed on all SRMMU's. */ |
225 | extern __inline__ void srmmu_flush_whole_tlb(void) | 225 | static inline void srmmu_flush_whole_tlb(void) |
226 | { | 226 | { |
227 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : | 227 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : |
228 | "r" (0x400), /* Flush entire TLB!! */ | 228 | "r" (0x400), /* Flush entire TLB!! */ |
@@ -231,7 +231,7 @@ extern __inline__ void srmmu_flush_whole_tlb(void) | |||
231 | } | 231 | } |
232 | 232 | ||
233 | /* These flush types are not available on all chips... */ | 233 | /* These flush types are not available on all chips... */ |
234 | extern __inline__ void srmmu_flush_tlb_ctx(void) | 234 | static inline void srmmu_flush_tlb_ctx(void) |
235 | { | 235 | { |
236 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : | 236 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : |
237 | "r" (0x300), /* Flush TLB ctx.. */ | 237 | "r" (0x300), /* Flush TLB ctx.. */ |
@@ -239,7 +239,7 @@ extern __inline__ void srmmu_flush_tlb_ctx(void) | |||
239 | 239 | ||
240 | } | 240 | } |
241 | 241 | ||
242 | extern __inline__ void srmmu_flush_tlb_region(unsigned long addr) | 242 | static inline void srmmu_flush_tlb_region(unsigned long addr) |
243 | { | 243 | { |
244 | addr &= SRMMU_PGDIR_MASK; | 244 | addr &= SRMMU_PGDIR_MASK; |
245 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : | 245 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : |
@@ -249,7 +249,7 @@ extern __inline__ void srmmu_flush_tlb_region(unsigned long addr) | |||
249 | } | 249 | } |
250 | 250 | ||
251 | 251 | ||
252 | extern __inline__ void srmmu_flush_tlb_segment(unsigned long addr) | 252 | static inline void srmmu_flush_tlb_segment(unsigned long addr) |
253 | { | 253 | { |
254 | addr &= SRMMU_REAL_PMD_MASK; | 254 | addr &= SRMMU_REAL_PMD_MASK; |
255 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : | 255 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : |
@@ -258,7 +258,7 @@ extern __inline__ void srmmu_flush_tlb_segment(unsigned long addr) | |||
258 | 258 | ||
259 | } | 259 | } |
260 | 260 | ||
261 | extern __inline__ void srmmu_flush_tlb_page(unsigned long page) | 261 | static inline void srmmu_flush_tlb_page(unsigned long page) |
262 | { | 262 | { |
263 | page &= PAGE_MASK; | 263 | page &= PAGE_MASK; |
264 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : | 264 | __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : |
@@ -267,7 +267,7 @@ extern __inline__ void srmmu_flush_tlb_page(unsigned long page) | |||
267 | 267 | ||
268 | } | 268 | } |
269 | 269 | ||
270 | extern __inline__ unsigned long srmmu_hwprobe(unsigned long vaddr) | 270 | static inline unsigned long srmmu_hwprobe(unsigned long vaddr) |
271 | { | 271 | { |
272 | unsigned long retval; | 272 | unsigned long retval; |
273 | 273 | ||
@@ -279,7 +279,7 @@ extern __inline__ unsigned long srmmu_hwprobe(unsigned long vaddr) | |||
279 | return retval; | 279 | return retval; |
280 | } | 280 | } |
281 | 281 | ||
282 | extern __inline__ int | 282 | static inline int |
283 | srmmu_get_pte (unsigned long addr) | 283 | srmmu_get_pte (unsigned long addr) |
284 | { | 284 | { |
285 | register unsigned long entry; | 285 | register unsigned long entry; |
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h index 5a7a1a8d29ac..6fbb3f0af8d8 100644 --- a/include/asm-sparc/processor.h +++ b/include/asm-sparc/processor.h | |||
@@ -79,7 +79,7 @@ struct thread_struct { | |||
79 | extern unsigned long thread_saved_pc(struct task_struct *t); | 79 | extern unsigned long thread_saved_pc(struct task_struct *t); |
80 | 80 | ||
81 | /* Do necessary setup to start up a newly executed thread. */ | 81 | /* Do necessary setup to start up a newly executed thread. */ |
82 | extern __inline__ void start_thread(struct pt_regs * regs, unsigned long pc, | 82 | static inline void start_thread(struct pt_regs * regs, unsigned long pc, |
83 | unsigned long sp) | 83 | unsigned long sp) |
84 | { | 84 | { |
85 | register unsigned long zero asm("g1"); | 85 | register unsigned long zero asm("g1"); |
diff --git a/include/asm-sparc/psr.h b/include/asm-sparc/psr.h index 9778b8c8b15b..19c978051118 100644 --- a/include/asm-sparc/psr.h +++ b/include/asm-sparc/psr.h | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | #ifndef __ASSEMBLY__ | 39 | #ifndef __ASSEMBLY__ |
40 | /* Get the %psr register. */ | 40 | /* Get the %psr register. */ |
41 | extern __inline__ unsigned int get_psr(void) | 41 | static inline unsigned int get_psr(void) |
42 | { | 42 | { |
43 | unsigned int psr; | 43 | unsigned int psr; |
44 | __asm__ __volatile__( | 44 | __asm__ __volatile__( |
@@ -53,7 +53,7 @@ extern __inline__ unsigned int get_psr(void) | |||
53 | return psr; | 53 | return psr; |
54 | } | 54 | } |
55 | 55 | ||
56 | extern __inline__ void put_psr(unsigned int new_psr) | 56 | static inline void put_psr(unsigned int new_psr) |
57 | { | 57 | { |
58 | __asm__ __volatile__( | 58 | __asm__ __volatile__( |
59 | "wr %0, 0x0, %%psr\n\t" | 59 | "wr %0, 0x0, %%psr\n\t" |
@@ -72,7 +72,7 @@ extern __inline__ void put_psr(unsigned int new_psr) | |||
72 | 72 | ||
73 | extern unsigned int fsr_storage; | 73 | extern unsigned int fsr_storage; |
74 | 74 | ||
75 | extern __inline__ unsigned int get_fsr(void) | 75 | static inline unsigned int get_fsr(void) |
76 | { | 76 | { |
77 | unsigned int fsr = 0; | 77 | unsigned int fsr = 0; |
78 | 78 | ||
diff --git a/include/asm-sparc/sbi.h b/include/asm-sparc/sbi.h index 739ccac5dcf2..86a603ac7b20 100644 --- a/include/asm-sparc/sbi.h +++ b/include/asm-sparc/sbi.h | |||
@@ -65,7 +65,7 @@ struct sbi_regs { | |||
65 | 65 | ||
66 | #ifndef __ASSEMBLY__ | 66 | #ifndef __ASSEMBLY__ |
67 | 67 | ||
68 | extern __inline__ int acquire_sbi(int devid, int mask) | 68 | static inline int acquire_sbi(int devid, int mask) |
69 | { | 69 | { |
70 | __asm__ __volatile__ ("swapa [%2] %3, %0" : | 70 | __asm__ __volatile__ ("swapa [%2] %3, %0" : |
71 | "=r" (mask) : | 71 | "=r" (mask) : |
@@ -75,7 +75,7 @@ extern __inline__ int acquire_sbi(int devid, int mask) | |||
75 | return mask; | 75 | return mask; |
76 | } | 76 | } |
77 | 77 | ||
78 | extern __inline__ void release_sbi(int devid, int mask) | 78 | static inline void release_sbi(int devid, int mask) |
79 | { | 79 | { |
80 | __asm__ __volatile__ ("sta %0, [%1] %2" : : | 80 | __asm__ __volatile__ ("sta %0, [%1] %2" : : |
81 | "r" (mask), | 81 | "r" (mask), |
@@ -83,7 +83,7 @@ extern __inline__ void release_sbi(int devid, int mask) | |||
83 | "i" (ASI_M_CTL)); | 83 | "i" (ASI_M_CTL)); |
84 | } | 84 | } |
85 | 85 | ||
86 | extern __inline__ void set_sbi_tid(int devid, int targetid) | 86 | static inline void set_sbi_tid(int devid, int targetid) |
87 | { | 87 | { |
88 | __asm__ __volatile__ ("sta %0, [%1] %2" : : | 88 | __asm__ __volatile__ ("sta %0, [%1] %2" : : |
89 | "r" (targetid), | 89 | "r" (targetid), |
@@ -91,7 +91,7 @@ extern __inline__ void set_sbi_tid(int devid, int targetid) | |||
91 | "i" (ASI_M_CTL)); | 91 | "i" (ASI_M_CTL)); |
92 | } | 92 | } |
93 | 93 | ||
94 | extern __inline__ int get_sbi_ctl(int devid, int cfgno) | 94 | static inline int get_sbi_ctl(int devid, int cfgno) |
95 | { | 95 | { |
96 | int cfg; | 96 | int cfg; |
97 | 97 | ||
@@ -102,7 +102,7 @@ extern __inline__ int get_sbi_ctl(int devid, int cfgno) | |||
102 | return cfg; | 102 | return cfg; |
103 | } | 103 | } |
104 | 104 | ||
105 | extern __inline__ void set_sbi_ctl(int devid, int cfgno, int cfg) | 105 | static inline void set_sbi_ctl(int devid, int cfgno, int cfg) |
106 | { | 106 | { |
107 | __asm__ __volatile__ ("sta %0, [%1] %2" : : | 107 | __asm__ __volatile__ ("sta %0, [%1] %2" : : |
108 | "r" (cfg), | 108 | "r" (cfg), |
diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h index 3a8b3908728a..a13cddcecec5 100644 --- a/include/asm-sparc/sbus.h +++ b/include/asm-sparc/sbus.h | |||
@@ -28,12 +28,12 @@ | |||
28 | * numbers + offsets, and vice versa. | 28 | * numbers + offsets, and vice versa. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | extern __inline__ unsigned long sbus_devaddr(int slotnum, unsigned long offset) | 31 | static inline unsigned long sbus_devaddr(int slotnum, unsigned long offset) |
32 | { | 32 | { |
33 | return (unsigned long) (SUN_SBUS_BVADDR+((slotnum)<<25)+(offset)); | 33 | return (unsigned long) (SUN_SBUS_BVADDR+((slotnum)<<25)+(offset)); |
34 | } | 34 | } |
35 | 35 | ||
36 | extern __inline__ int sbus_dev_slot(unsigned long dev_addr) | 36 | static inline int sbus_dev_slot(unsigned long dev_addr) |
37 | { | 37 | { |
38 | return (int) (((dev_addr)-SUN_SBUS_BVADDR)>>25); | 38 | return (int) (((dev_addr)-SUN_SBUS_BVADDR)>>25); |
39 | } | 39 | } |
@@ -80,7 +80,7 @@ struct sbus_bus { | |||
80 | 80 | ||
81 | extern struct sbus_bus *sbus_root; | 81 | extern struct sbus_bus *sbus_root; |
82 | 82 | ||
83 | extern __inline__ int | 83 | static inline int |
84 | sbus_is_slave(struct sbus_dev *dev) | 84 | sbus_is_slave(struct sbus_dev *dev) |
85 | { | 85 | { |
86 | /* XXX Have to write this for sun4c's */ | 86 | /* XXX Have to write this for sun4c's */ |
diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h index 4f96d8333a12..580c51d011df 100644 --- a/include/asm-sparc/smp.h +++ b/include/asm-sparc/smp.h | |||
@@ -60,22 +60,22 @@ BTFIXUPDEF_BLACKBOX(load_current) | |||
60 | #define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5) | 60 | #define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5) |
61 | #define smp_message_pass(target,msg,data,wait) BTFIXUP_CALL(smp_message_pass)(target,msg,data,wait) | 61 | #define smp_message_pass(target,msg,data,wait) BTFIXUP_CALL(smp_message_pass)(target,msg,data,wait) |
62 | 62 | ||
63 | extern __inline__ void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); } | 63 | static inline void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); } |
64 | extern __inline__ void xc1(smpfunc_t func, unsigned long arg1) | 64 | static inline void xc1(smpfunc_t func, unsigned long arg1) |
65 | { smp_cross_call(func, arg1, 0, 0, 0, 0); } | 65 | { smp_cross_call(func, arg1, 0, 0, 0, 0); } |
66 | extern __inline__ void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2) | 66 | static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2) |
67 | { smp_cross_call(func, arg1, arg2, 0, 0, 0); } | 67 | { smp_cross_call(func, arg1, arg2, 0, 0, 0); } |
68 | extern __inline__ void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2, | 68 | static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2, |
69 | unsigned long arg3) | 69 | unsigned long arg3) |
70 | { smp_cross_call(func, arg1, arg2, arg3, 0, 0); } | 70 | { smp_cross_call(func, arg1, arg2, arg3, 0, 0); } |
71 | extern __inline__ void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2, | 71 | static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2, |
72 | unsigned long arg3, unsigned long arg4) | 72 | unsigned long arg3, unsigned long arg4) |
73 | { smp_cross_call(func, arg1, arg2, arg3, arg4, 0); } | 73 | { smp_cross_call(func, arg1, arg2, arg3, arg4, 0); } |
74 | extern __inline__ void xc5(smpfunc_t func, unsigned long arg1, unsigned long arg2, | 74 | static inline void xc5(smpfunc_t func, unsigned long arg1, unsigned long arg2, |
75 | unsigned long arg3, unsigned long arg4, unsigned long arg5) | 75 | unsigned long arg3, unsigned long arg4, unsigned long arg5) |
76 | { smp_cross_call(func, arg1, arg2, arg3, arg4, arg5); } | 76 | { smp_cross_call(func, arg1, arg2, arg3, arg4, arg5); } |
77 | 77 | ||
78 | extern __inline__ int smp_call_function(void (*func)(void *info), void *info, int nonatomic, int wait) | 78 | static inline int smp_call_function(void (*func)(void *info), void *info, int nonatomic, int wait) |
79 | { | 79 | { |
80 | xc1((smpfunc_t)func, (unsigned long)info); | 80 | xc1((smpfunc_t)func, (unsigned long)info); |
81 | return 0; | 81 | return 0; |
@@ -84,16 +84,16 @@ extern __inline__ int smp_call_function(void (*func)(void *info), void *info, in | |||
84 | extern __volatile__ int __cpu_number_map[NR_CPUS]; | 84 | extern __volatile__ int __cpu_number_map[NR_CPUS]; |
85 | extern __volatile__ int __cpu_logical_map[NR_CPUS]; | 85 | extern __volatile__ int __cpu_logical_map[NR_CPUS]; |
86 | 86 | ||
87 | extern __inline__ int cpu_logical_map(int cpu) | 87 | static inline int cpu_logical_map(int cpu) |
88 | { | 88 | { |
89 | return __cpu_logical_map[cpu]; | 89 | return __cpu_logical_map[cpu]; |
90 | } | 90 | } |
91 | extern __inline__ int cpu_number_map(int cpu) | 91 | static inline int cpu_number_map(int cpu) |
92 | { | 92 | { |
93 | return __cpu_number_map[cpu]; | 93 | return __cpu_number_map[cpu]; |
94 | } | 94 | } |
95 | 95 | ||
96 | extern __inline__ int hard_smp4m_processor_id(void) | 96 | static inline int hard_smp4m_processor_id(void) |
97 | { | 97 | { |
98 | int cpuid; | 98 | int cpuid; |
99 | 99 | ||
@@ -104,7 +104,7 @@ extern __inline__ int hard_smp4m_processor_id(void) | |||
104 | return cpuid; | 104 | return cpuid; |
105 | } | 105 | } |
106 | 106 | ||
107 | extern __inline__ int hard_smp4d_processor_id(void) | 107 | static inline int hard_smp4d_processor_id(void) |
108 | { | 108 | { |
109 | int cpuid; | 109 | int cpuid; |
110 | 110 | ||
@@ -114,7 +114,7 @@ extern __inline__ int hard_smp4d_processor_id(void) | |||
114 | } | 114 | } |
115 | 115 | ||
116 | #ifndef MODULE | 116 | #ifndef MODULE |
117 | extern __inline__ int hard_smp_processor_id(void) | 117 | static inline int hard_smp_processor_id(void) |
118 | { | 118 | { |
119 | int cpuid; | 119 | int cpuid; |
120 | 120 | ||
@@ -136,7 +136,7 @@ extern __inline__ int hard_smp_processor_id(void) | |||
136 | return cpuid; | 136 | return cpuid; |
137 | } | 137 | } |
138 | #else | 138 | #else |
139 | extern __inline__ int hard_smp_processor_id(void) | 139 | static inline int hard_smp_processor_id(void) |
140 | { | 140 | { |
141 | int cpuid; | 141 | int cpuid; |
142 | 142 | ||
diff --git a/include/asm-sparc/smpprim.h b/include/asm-sparc/smpprim.h index 9b9c28ed748e..e7b6d346ae10 100644 --- a/include/asm-sparc/smpprim.h +++ b/include/asm-sparc/smpprim.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * atomic. | 15 | * atomic. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | extern __inline__ __volatile__ char test_and_set(void *addr) | 18 | static inline __volatile__ char test_and_set(void *addr) |
19 | { | 19 | { |
20 | char state = 0; | 20 | char state = 0; |
21 | 21 | ||
@@ -27,7 +27,7 @@ extern __inline__ __volatile__ char test_and_set(void *addr) | |||
27 | } | 27 | } |
28 | 28 | ||
29 | /* Initialize a spin-lock. */ | 29 | /* Initialize a spin-lock. */ |
30 | extern __inline__ __volatile__ smp_initlock(void *spinlock) | 30 | static inline __volatile__ smp_initlock(void *spinlock) |
31 | { | 31 | { |
32 | /* Unset the lock. */ | 32 | /* Unset the lock. */ |
33 | *((unsigned char *) spinlock) = 0; | 33 | *((unsigned char *) spinlock) = 0; |
@@ -36,7 +36,7 @@ extern __inline__ __volatile__ smp_initlock(void *spinlock) | |||
36 | } | 36 | } |
37 | 37 | ||
38 | /* This routine spins until it acquires the lock at ADDR. */ | 38 | /* This routine spins until it acquires the lock at ADDR. */ |
39 | extern __inline__ __volatile__ smp_lock(void *addr) | 39 | static inline __volatile__ smp_lock(void *addr) |
40 | { | 40 | { |
41 | while(test_and_set(addr) == 0xff) | 41 | while(test_and_set(addr) == 0xff) |
42 | ; | 42 | ; |
@@ -46,7 +46,7 @@ extern __inline__ __volatile__ smp_lock(void *addr) | |||
46 | } | 46 | } |
47 | 47 | ||
48 | /* This routine releases the lock at ADDR. */ | 48 | /* This routine releases the lock at ADDR. */ |
49 | extern __inline__ __volatile__ smp_unlock(void *addr) | 49 | static inline __volatile__ smp_unlock(void *addr) |
50 | { | 50 | { |
51 | *((unsigned char *) addr) = 0; | 51 | *((unsigned char *) addr) = 0; |
52 | } | 52 | } |
diff --git a/include/asm-sparc/spinlock.h b/include/asm-sparc/spinlock.h index 111727a2bb4e..e344c98a6f5f 100644 --- a/include/asm-sparc/spinlock.h +++ b/include/asm-sparc/spinlock.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #define __raw_spin_unlock_wait(lock) \ | 17 | #define __raw_spin_unlock_wait(lock) \ |
18 | do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) | 18 | do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) |
19 | 19 | ||
20 | extern __inline__ void __raw_spin_lock(raw_spinlock_t *lock) | 20 | static inline void __raw_spin_lock(raw_spinlock_t *lock) |
21 | { | 21 | { |
22 | __asm__ __volatile__( | 22 | __asm__ __volatile__( |
23 | "\n1:\n\t" | 23 | "\n1:\n\t" |
@@ -37,7 +37,7 @@ extern __inline__ void __raw_spin_lock(raw_spinlock_t *lock) | |||
37 | : "g2", "memory", "cc"); | 37 | : "g2", "memory", "cc"); |
38 | } | 38 | } |
39 | 39 | ||
40 | extern __inline__ int __raw_spin_trylock(raw_spinlock_t *lock) | 40 | static inline int __raw_spin_trylock(raw_spinlock_t *lock) |
41 | { | 41 | { |
42 | unsigned int result; | 42 | unsigned int result; |
43 | __asm__ __volatile__("ldstub [%1], %0" | 43 | __asm__ __volatile__("ldstub [%1], %0" |
@@ -47,7 +47,7 @@ extern __inline__ int __raw_spin_trylock(raw_spinlock_t *lock) | |||
47 | return (result == 0); | 47 | return (result == 0); |
48 | } | 48 | } |
49 | 49 | ||
50 | extern __inline__ void __raw_spin_unlock(raw_spinlock_t *lock) | 50 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) |
51 | { | 51 | { |
52 | __asm__ __volatile__("stb %%g0, [%0]" : : "r" (lock) : "memory"); | 52 | __asm__ __volatile__("stb %%g0, [%0]" : : "r" (lock) : "memory"); |
53 | } | 53 | } |
@@ -78,7 +78,7 @@ extern __inline__ void __raw_spin_unlock(raw_spinlock_t *lock) | |||
78 | * | 78 | * |
79 | * Unfortunately this scheme limits us to ~16,000,000 cpus. | 79 | * Unfortunately this scheme limits us to ~16,000,000 cpus. |
80 | */ | 80 | */ |
81 | extern __inline__ void __read_lock(raw_rwlock_t *rw) | 81 | static inline void __read_lock(raw_rwlock_t *rw) |
82 | { | 82 | { |
83 | register raw_rwlock_t *lp asm("g1"); | 83 | register raw_rwlock_t *lp asm("g1"); |
84 | lp = rw; | 84 | lp = rw; |
@@ -98,7 +98,7 @@ do { unsigned long flags; \ | |||
98 | local_irq_restore(flags); \ | 98 | local_irq_restore(flags); \ |
99 | } while(0) | 99 | } while(0) |
100 | 100 | ||
101 | extern __inline__ void __read_unlock(raw_rwlock_t *rw) | 101 | static inline void __read_unlock(raw_rwlock_t *rw) |
102 | { | 102 | { |
103 | register raw_rwlock_t *lp asm("g1"); | 103 | register raw_rwlock_t *lp asm("g1"); |
104 | lp = rw; | 104 | lp = rw; |
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h index 3557781a4bfd..1f6b71f9e1b6 100644 --- a/include/asm-sparc/system.h +++ b/include/asm-sparc/system.h | |||
@@ -204,7 +204,7 @@ static inline unsigned long getipl(void) | |||
204 | BTFIXUPDEF_CALL(void, ___xchg32, void) | 204 | BTFIXUPDEF_CALL(void, ___xchg32, void) |
205 | #endif | 205 | #endif |
206 | 206 | ||
207 | extern __inline__ unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned long val) | 207 | static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned long val) |
208 | { | 208 | { |
209 | #ifdef CONFIG_SMP | 209 | #ifdef CONFIG_SMP |
210 | __asm__ __volatile__("swap [%2], %0" | 210 | __asm__ __volatile__("swap [%2], %0" |
diff --git a/include/asm-sparc/traps.h b/include/asm-sparc/traps.h index 6690ab956ea6..f62c7f878ee1 100644 --- a/include/asm-sparc/traps.h +++ b/include/asm-sparc/traps.h | |||
@@ -22,7 +22,7 @@ struct tt_entry { | |||
22 | /* We set this to _start in system setup. */ | 22 | /* We set this to _start in system setup. */ |
23 | extern struct tt_entry *sparc_ttable; | 23 | extern struct tt_entry *sparc_ttable; |
24 | 24 | ||
25 | extern __inline__ unsigned long get_tbr(void) | 25 | static inline unsigned long get_tbr(void) |
26 | { | 26 | { |
27 | unsigned long tbr; | 27 | unsigned long tbr; |
28 | 28 | ||
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h index 2d242360c3d6..075771c371f6 100644 --- a/include/asm-um/processor-generic.h +++ b/include/asm-um/processor-generic.h | |||
@@ -13,6 +13,7 @@ struct task_struct; | |||
13 | #include "linux/config.h" | 13 | #include "linux/config.h" |
14 | #include "asm/ptrace.h" | 14 | #include "asm/ptrace.h" |
15 | #include "choose-mode.h" | 15 | #include "choose-mode.h" |
16 | #include "registers.h" | ||
16 | 17 | ||
17 | struct mm_struct; | 18 | struct mm_struct; |
18 | 19 | ||
@@ -136,19 +137,15 @@ extern struct cpuinfo_um cpu_data[]; | |||
136 | #define current_cpu_data boot_cpu_data | 137 | #define current_cpu_data boot_cpu_data |
137 | #endif | 138 | #endif |
138 | 139 | ||
139 | #define KSTK_EIP(tsk) (PT_REGS_IP(&tsk->thread.regs)) | ||
140 | #define KSTK_ESP(tsk) (PT_REGS_SP(&tsk->thread.regs)) | ||
141 | #define get_wchan(p) (0) | ||
142 | 140 | ||
141 | #ifdef CONFIG_MODE_SKAS | ||
142 | #define KSTK_REG(tsk, reg) \ | ||
143 | ({ union uml_pt_regs regs; \ | ||
144 | get_thread_regs(®s, tsk->thread.mode.skas.switch_buf); \ | ||
145 | UPT_REG(®s, reg); }) | ||
146 | #else | ||
147 | #define KSTK_REG(tsk, reg) (0xbadbabe) | ||
143 | #endif | 148 | #endif |
149 | #define get_wchan(p) (0) | ||
144 | 150 | ||
145 | /* | 151 | #endif |
146 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
147 | * Emacs will notice this stuff at the end of the file and automatically | ||
148 | * adjust the settings for this buffer only. This must remain at the end | ||
149 | * of the file. | ||
150 | * --------------------------------------------------------------------------- | ||
151 | * Local variables: | ||
152 | * c-file-style: "linux" | ||
153 | * End: | ||
154 | */ | ||
diff --git a/include/asm-um/processor-i386.h b/include/asm-um/processor-i386.h index 431bad3ae9d7..4108a579eb92 100644 --- a/include/asm-um/processor-i386.h +++ b/include/asm-um/processor-i386.h | |||
@@ -43,17 +43,10 @@ static inline void rep_nop(void) | |||
43 | #define ARCH_IS_STACKGROW(address) \ | 43 | #define ARCH_IS_STACKGROW(address) \ |
44 | (address + 32 >= UPT_SP(¤t->thread.regs.regs)) | 44 | (address + 32 >= UPT_SP(¤t->thread.regs.regs)) |
45 | 45 | ||
46 | #define KSTK_EIP(tsk) KSTK_REG(tsk, EIP) | ||
47 | #define KSTK_ESP(tsk) KSTK_REG(tsk, UESP) | ||
48 | #define KSTK_EBP(tsk) KSTK_REG(tsk, EBP) | ||
49 | |||
46 | #include "asm/processor-generic.h" | 50 | #include "asm/processor-generic.h" |
47 | 51 | ||
48 | #endif | 52 | #endif |
49 | |||
50 | /* | ||
51 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
52 | * Emacs will notice this stuff at the end of the file and automatically | ||
53 | * adjust the settings for this buffer only. This must remain at the end | ||
54 | * of the file. | ||
55 | * --------------------------------------------------------------------------- | ||
56 | * Local variables: | ||
57 | * c-file-style: "linux" | ||
58 | * End: | ||
59 | */ | ||
diff --git a/include/asm-um/processor-x86_64.h b/include/asm-um/processor-x86_64.h index 0beb9a42ae05..e1e1255a1d36 100644 --- a/include/asm-um/processor-x86_64.h +++ b/include/asm-um/processor-x86_64.h | |||
@@ -36,17 +36,9 @@ extern inline void rep_nop(void) | |||
36 | #define ARCH_IS_STACKGROW(address) \ | 36 | #define ARCH_IS_STACKGROW(address) \ |
37 | (address + 128 >= UPT_SP(¤t->thread.regs.regs)) | 37 | (address + 128 >= UPT_SP(¤t->thread.regs.regs)) |
38 | 38 | ||
39 | #define KSTK_EIP(tsk) KSTK_REG(tsk, RIP) | ||
40 | #define KSTK_ESP(tsk) KSTK_REG(tsk, RSP) | ||
41 | |||
39 | #include "asm/processor-generic.h" | 42 | #include "asm/processor-generic.h" |
40 | 43 | ||
41 | #endif | 44 | #endif |
42 | |||
43 | /* | ||
44 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
45 | * Emacs will notice this stuff at the end of the file and automatically | ||
46 | * adjust the settings for this buffer only. This must remain at the end | ||
47 | * of the file. | ||
48 | * --------------------------------------------------------------------------- | ||
49 | * Local variables: | ||
50 | * c-file-style: "linux" | ||
51 | * End: | ||
52 | */ | ||
diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h index c1237aa92e38..8ed6dfdcd783 100644 --- a/include/linux/bfs_fs.h +++ b/include/linux/bfs_fs.h | |||
@@ -20,19 +20,19 @@ | |||
20 | 20 | ||
21 | /* BFS inode layout on disk */ | 21 | /* BFS inode layout on disk */ |
22 | struct bfs_inode { | 22 | struct bfs_inode { |
23 | __u16 i_ino; | 23 | __le16 i_ino; |
24 | __u16 i_unused; | 24 | __u16 i_unused; |
25 | __u32 i_sblock; | 25 | __le32 i_sblock; |
26 | __u32 i_eblock; | 26 | __le32 i_eblock; |
27 | __u32 i_eoffset; | 27 | __le32 i_eoffset; |
28 | __u32 i_vtype; | 28 | __le32 i_vtype; |
29 | __u32 i_mode; | 29 | __le32 i_mode; |
30 | __s32 i_uid; | 30 | __le32 i_uid; |
31 | __s32 i_gid; | 31 | __le32 i_gid; |
32 | __u32 i_nlink; | 32 | __le32 i_nlink; |
33 | __u32 i_atime; | 33 | __le32 i_atime; |
34 | __u32 i_mtime; | 34 | __le32 i_mtime; |
35 | __u32 i_ctime; | 35 | __le32 i_ctime; |
36 | __u32 i_padding[4]; | 36 | __u32 i_padding[4]; |
37 | }; | 37 | }; |
38 | 38 | ||
@@ -41,17 +41,17 @@ struct bfs_inode { | |||
41 | #define BFS_DIRS_PER_BLOCK 32 | 41 | #define BFS_DIRS_PER_BLOCK 32 |
42 | 42 | ||
43 | struct bfs_dirent { | 43 | struct bfs_dirent { |
44 | __u16 ino; | 44 | __le16 ino; |
45 | char name[BFS_NAMELEN]; | 45 | char name[BFS_NAMELEN]; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | /* BFS superblock layout on disk */ | 48 | /* BFS superblock layout on disk */ |
49 | struct bfs_super_block { | 49 | struct bfs_super_block { |
50 | __u32 s_magic; | 50 | __le32 s_magic; |
51 | __u32 s_start; | 51 | __le32 s_start; |
52 | __u32 s_end; | 52 | __le32 s_end; |
53 | __s32 s_from; | 53 | __le32 s_from; |
54 | __s32 s_to; | 54 | __le32 s_to; |
55 | __s32 s_bfrom; | 55 | __s32 s_bfrom; |
56 | __s32 s_bto; | 56 | __s32 s_bto; |
57 | char s_fsname[6]; | 57 | char s_fsname[6]; |
@@ -66,15 +66,15 @@ struct bfs_super_block { | |||
66 | #define BFS_INO2OFF(ino) \ | 66 | #define BFS_INO2OFF(ino) \ |
67 | ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) | 67 | ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) |
68 | #define BFS_NZFILESIZE(ip) \ | 68 | #define BFS_NZFILESIZE(ip) \ |
69 | ((cpu_to_le32((ip)->i_eoffset) + 1) - cpu_to_le32((ip)->i_sblock) * BFS_BSIZE) | 69 | ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE) |
70 | 70 | ||
71 | #define BFS_FILESIZE(ip) \ | 71 | #define BFS_FILESIZE(ip) \ |
72 | ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) | 72 | ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) |
73 | 73 | ||
74 | #define BFS_FILEBLOCKS(ip) \ | 74 | #define BFS_FILEBLOCKS(ip) \ |
75 | ((ip)->i_sblock == 0 ? 0 : (cpu_to_le32((ip)->i_eblock) + 1) - cpu_to_le32((ip)->i_sblock)) | 75 | ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock)) |
76 | #define BFS_UNCLEAN(bfs_sb, sb) \ | 76 | #define BFS_UNCLEAN(bfs_sb, sb) \ |
77 | ((cpu_to_le32(bfs_sb->s_from) != -1) && (cpu_to_le32(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY)) | 77 | ((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY)) |
78 | 78 | ||
79 | 79 | ||
80 | #endif /* _LINUX_BFS_FS_H */ | 80 | #endif /* _LINUX_BFS_FS_H */ |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 50c0519cd70d..0093ea08c7f5 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -286,6 +286,8 @@ static inline void check_tnode(const struct tnode *tn) | |||
286 | 286 | ||
287 | static int halve_threshold = 25; | 287 | static int halve_threshold = 25; |
288 | static int inflate_threshold = 50; | 288 | static int inflate_threshold = 50; |
289 | static int halve_threshold_root = 15; | ||
290 | static int inflate_threshold_root = 25; | ||
289 | 291 | ||
290 | 292 | ||
291 | static void __alias_free_mem(struct rcu_head *head) | 293 | static void __alias_free_mem(struct rcu_head *head) |
@@ -449,6 +451,8 @@ static struct node *resize(struct trie *t, struct tnode *tn) | |||
449 | int i; | 451 | int i; |
450 | int err = 0; | 452 | int err = 0; |
451 | struct tnode *old_tn; | 453 | struct tnode *old_tn; |
454 | int inflate_threshold_use; | ||
455 | int halve_threshold_use; | ||
452 | 456 | ||
453 | if (!tn) | 457 | if (!tn) |
454 | return NULL; | 458 | return NULL; |
@@ -541,10 +545,17 @@ static struct node *resize(struct trie *t, struct tnode *tn) | |||
541 | 545 | ||
542 | check_tnode(tn); | 546 | check_tnode(tn); |
543 | 547 | ||
548 | /* Keep root node larger */ | ||
549 | |||
550 | if(!tn->parent) | ||
551 | inflate_threshold_use = inflate_threshold_root; | ||
552 | else | ||
553 | inflate_threshold_use = inflate_threshold; | ||
554 | |||
544 | err = 0; | 555 | err = 0; |
545 | while ((tn->full_children > 0 && | 556 | while ((tn->full_children > 0 && |
546 | 50 * (tn->full_children + tnode_child_length(tn) - tn->empty_children) >= | 557 | 50 * (tn->full_children + tnode_child_length(tn) - tn->empty_children) >= |
547 | inflate_threshold * tnode_child_length(tn))) { | 558 | inflate_threshold_use * tnode_child_length(tn))) { |
548 | 559 | ||
549 | old_tn = tn; | 560 | old_tn = tn; |
550 | tn = inflate(t, tn); | 561 | tn = inflate(t, tn); |
@@ -564,10 +575,18 @@ static struct node *resize(struct trie *t, struct tnode *tn) | |||
564 | * node is above threshold. | 575 | * node is above threshold. |
565 | */ | 576 | */ |
566 | 577 | ||
578 | |||
579 | /* Keep root node larger */ | ||
580 | |||
581 | if(!tn->parent) | ||
582 | halve_threshold_use = halve_threshold_root; | ||
583 | else | ||
584 | halve_threshold_use = halve_threshold; | ||
585 | |||
567 | err = 0; | 586 | err = 0; |
568 | while (tn->bits > 1 && | 587 | while (tn->bits > 1 && |
569 | 100 * (tnode_child_length(tn) - tn->empty_children) < | 588 | 100 * (tnode_child_length(tn) - tn->empty_children) < |
570 | halve_threshold * tnode_child_length(tn)) { | 589 | halve_threshold_use * tnode_child_length(tn)) { |
571 | 590 | ||
572 | old_tn = tn; | 591 | old_tn = tn; |
573 | tn = halve(t, tn); | 592 | tn = halve(t, tn); |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index e4cad11f284a..bf9519341fd3 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -99,7 +99,7 @@ static int udp_v6_get_port(struct sock *sk, unsigned short snum) | |||
99 | next:; | 99 | next:; |
100 | } | 100 | } |
101 | result = best; | 101 | result = best; |
102 | for(;; result += UDP_HTABLE_SIZE) { | 102 | for(i = 0; i < (1 << 16) / UDP_HTABLE_SIZE; i++, result += UDP_HTABLE_SIZE) { |
103 | if (result > sysctl_local_port_range[1]) | 103 | if (result > sysctl_local_port_range[1]) |
104 | result = sysctl_local_port_range[0] | 104 | result = sysctl_local_port_range[0] |
105 | + ((result - sysctl_local_port_range[0]) & | 105 | + ((result - sysctl_local_port_range[0]) & |
@@ -107,6 +107,8 @@ static int udp_v6_get_port(struct sock *sk, unsigned short snum) | |||
107 | if (!udp_lport_inuse(result)) | 107 | if (!udp_lport_inuse(result)) |
108 | break; | 108 | break; |
109 | } | 109 | } |
110 | if (i >= (1 << 16) / UDP_HTABLE_SIZE) | ||
111 | goto fail; | ||
110 | gotit: | 112 | gotit: |
111 | udp_port_rover = snum = result; | 113 | udp_port_rover = snum = result; |
112 | } else { | 114 | } else { |