diff options
Diffstat (limited to 'arch')
86 files changed, 541 insertions, 722 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 7e55ea66c6d4..84caf50725b5 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -25,6 +25,14 @@ config RWSEM_XCHGADD_ALGORITHM | |||
25 | bool | 25 | bool |
26 | default y | 26 | default y |
27 | 27 | ||
28 | config ARCH_HAS_ILOG2_U32 | ||
29 | bool | ||
30 | default n | ||
31 | |||
32 | config ARCH_HAS_ILOG2_U64 | ||
33 | bool | ||
34 | default n | ||
35 | |||
28 | config GENERIC_FIND_NEXT_BIT | 36 | config GENERIC_FIND_NEXT_BIT |
29 | bool | 37 | bool |
30 | default y | 38 | default y |
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index ad6173651995..fb804043b320 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
@@ -277,7 +277,7 @@ osf_fstatfs(unsigned long fd, struct osf_statfs __user *buffer, unsigned long bu | |||
277 | retval = -EBADF; | 277 | retval = -EBADF; |
278 | file = fget(fd); | 278 | file = fget(fd); |
279 | if (file) { | 279 | if (file) { |
280 | retval = do_osf_statfs(file->f_dentry, buffer, bufsiz); | 280 | retval = do_osf_statfs(file->f_path.dentry, buffer, bufsiz); |
281 | fput(file); | 281 | fput(file); |
282 | } | 282 | } |
283 | return retval; | 283 | return retval; |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 8c05d4321ae9..aa1d400d721a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -74,6 +74,14 @@ config RWSEM_GENERIC_SPINLOCK | |||
74 | config RWSEM_XCHGADD_ALGORITHM | 74 | config RWSEM_XCHGADD_ALGORITHM |
75 | bool | 75 | bool |
76 | 76 | ||
77 | config ARCH_HAS_ILOG2_U32 | ||
78 | bool | ||
79 | default n | ||
80 | |||
81 | config ARCH_HAS_ILOG2_U64 | ||
82 | bool | ||
83 | default n | ||
84 | |||
77 | config GENERIC_HWEIGHT | 85 | config GENERIC_HWEIGHT |
78 | bool | 86 | bool |
79 | default y | 87 | default y |
diff --git a/arch/arm26/Kconfig b/arch/arm26/Kconfig index c14fe918bc4c..74eba8b5a8ca 100644 --- a/arch/arm26/Kconfig +++ b/arch/arm26/Kconfig | |||
@@ -41,6 +41,14 @@ config RWSEM_GENERIC_SPINLOCK | |||
41 | config RWSEM_XCHGADD_ALGORITHM | 41 | config RWSEM_XCHGADD_ALGORITHM |
42 | bool | 42 | bool |
43 | 43 | ||
44 | config ARCH_HAS_ILOG2_U32 | ||
45 | bool | ||
46 | default n | ||
47 | |||
48 | config ARCH_HAS_ILOG2_U64 | ||
49 | bool | ||
50 | default n | ||
51 | |||
44 | config GENERIC_HWEIGHT | 52 | config GENERIC_HWEIGHT |
45 | bool | 53 | bool |
46 | default y | 54 | default y |
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index 5f1694eea842..bb059a4e1df9 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig | |||
@@ -45,6 +45,14 @@ config GENERIC_TIME | |||
45 | config RWSEM_XCHGADD_ALGORITHM | 45 | config RWSEM_XCHGADD_ALGORITHM |
46 | bool | 46 | bool |
47 | 47 | ||
48 | config ARCH_HAS_ILOG2_U32 | ||
49 | bool | ||
50 | default n | ||
51 | |||
52 | config ARCH_HAS_ILOG2_U64 | ||
53 | bool | ||
54 | default n | ||
55 | |||
48 | config GENERIC_BUST_SPINLOCK | 56 | config GENERIC_BUST_SPINLOCK |
49 | bool | 57 | bool |
50 | 58 | ||
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 6a1238a29d6c..3474309e049c 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig | |||
@@ -16,6 +16,14 @@ config RWSEM_GENERIC_SPINLOCK | |||
16 | config RWSEM_XCHGADD_ALGORITHM | 16 | config RWSEM_XCHGADD_ALGORITHM |
17 | bool | 17 | bool |
18 | 18 | ||
19 | config ARCH_HAS_ILOG2_U32 | ||
20 | bool | ||
21 | default n | ||
22 | |||
23 | config ARCH_HAS_ILOG2_U64 | ||
24 | bool | ||
25 | default n | ||
26 | |||
19 | config GENERIC_FIND_NEXT_BIT | 27 | config GENERIC_FIND_NEXT_BIT |
20 | bool | 28 | bool |
21 | default y | 29 | default y |
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index e067806b2208..424eb0eb1cd5 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c | |||
@@ -504,7 +504,7 @@ static int sync_serial_release(struct inode *inode, struct file *file) | |||
504 | 504 | ||
505 | static unsigned int sync_serial_poll(struct file *file, poll_table *wait) | 505 | static unsigned int sync_serial_poll(struct file *file, poll_table *wait) |
506 | { | 506 | { |
507 | int dev = iminor(file->f_dentry->d_inode); | 507 | int dev = iminor(file->f_path.dentry->d_inode); |
508 | unsigned int mask = 0; | 508 | unsigned int mask = 0; |
509 | sync_port* port; | 509 | sync_port* port; |
510 | DEBUGPOLL( static unsigned int prev_mask = 0; ); | 510 | DEBUGPOLL( static unsigned int prev_mask = 0; ); |
@@ -531,7 +531,7 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file, | |||
531 | unsigned int cmd, unsigned long arg) | 531 | unsigned int cmd, unsigned long arg) |
532 | { | 532 | { |
533 | int return_val = 0; | 533 | int return_val = 0; |
534 | int dev = iminor(file->f_dentry->d_inode); | 534 | int dev = iminor(file->f_path.dentry->d_inode); |
535 | sync_port* port; | 535 | sync_port* port; |
536 | reg_sser_rw_tr_cfg tr_cfg; | 536 | reg_sser_rw_tr_cfg tr_cfg; |
537 | reg_sser_rw_rec_cfg rec_cfg; | 537 | reg_sser_rw_rec_cfg rec_cfg; |
@@ -789,7 +789,7 @@ static int sync_serial_ioctl(struct inode *inode, struct file *file, | |||
789 | static ssize_t sync_serial_write(struct file * file, const char * buf, | 789 | static ssize_t sync_serial_write(struct file * file, const char * buf, |
790 | size_t count, loff_t *ppos) | 790 | size_t count, loff_t *ppos) |
791 | { | 791 | { |
792 | int dev = iminor(file->f_dentry->d_inode); | 792 | int dev = iminor(file->f_path.dentry->d_inode); |
793 | DECLARE_WAITQUEUE(wait, current); | 793 | DECLARE_WAITQUEUE(wait, current); |
794 | sync_port *port; | 794 | sync_port *port; |
795 | unsigned long c, c1; | 795 | unsigned long c, c1; |
@@ -919,7 +919,7 @@ static ssize_t sync_serial_write(struct file * file, const char * buf, | |||
919 | static ssize_t sync_serial_read(struct file * file, char * buf, | 919 | static ssize_t sync_serial_read(struct file * file, char * buf, |
920 | size_t count, loff_t *ppos) | 920 | size_t count, loff_t *ppos) |
921 | { | 921 | { |
922 | int dev = iminor(file->f_dentry->d_inode); | 922 | int dev = iminor(file->f_path.dentry->d_inode); |
923 | int avail; | 923 | int avail; |
924 | sync_port *port; | 924 | sync_port *port; |
925 | unsigned char* start; | 925 | unsigned char* start; |
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index cf1c446e003a..7561d7b72e75 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig | |||
@@ -41,6 +41,14 @@ config TIME_LOW_RES | |||
41 | bool | 41 | bool |
42 | default y | 42 | default y |
43 | 43 | ||
44 | config ARCH_HAS_ILOG2_U32 | ||
45 | bool | ||
46 | default y | ||
47 | |||
48 | config ARCH_HAS_ILOG2_U64 | ||
49 | bool | ||
50 | default y | ||
51 | |||
44 | mainmenu "Fujitsu FR-V Kernel Configuration" | 52 | mainmenu "Fujitsu FR-V Kernel Configuration" |
45 | 53 | ||
46 | source "init/Kconfig" | 54 | source "init/Kconfig" |
diff --git a/arch/frv/mm/elf-fdpic.c b/arch/frv/mm/elf-fdpic.c index f5a653033fe0..9477ccce070e 100644 --- a/arch/frv/mm/elf-fdpic.c +++ b/arch/frv/mm/elf-fdpic.c | |||
@@ -110,14 +110,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi | |||
110 | 110 | ||
111 | #if 0 | 111 | #if 0 |
112 | printk("[area] l=%lx (ENOMEM) f='%s'\n", | 112 | printk("[area] l=%lx (ENOMEM) f='%s'\n", |
113 | len, filp ? filp->f_dentry->d_name.name : ""); | 113 | len, filp ? filp->f_path.dentry->d_name.name : ""); |
114 | #endif | 114 | #endif |
115 | return -ENOMEM; | 115 | return -ENOMEM; |
116 | 116 | ||
117 | success: | 117 | success: |
118 | #if 0 | 118 | #if 0 |
119 | printk("[area] l=%lx ad=%lx f='%s'\n", | 119 | printk("[area] l=%lx ad=%lx f='%s'\n", |
120 | len, addr, filp ? filp->f_dentry->d_name.name : ""); | 120 | len, addr, filp ? filp->f_path.dentry->d_name.name : ""); |
121 | #endif | 121 | #endif |
122 | return addr; | 122 | return addr; |
123 | } /* end arch_get_unmapped_area() */ | 123 | } /* end arch_get_unmapped_area() */ |
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index cabf0bfffc53..34a84bc4baf5 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig | |||
@@ -29,6 +29,14 @@ config RWSEM_XCHGADD_ALGORITHM | |||
29 | bool | 29 | bool |
30 | default n | 30 | default n |
31 | 31 | ||
32 | config ARCH_HAS_ILOG2_U32 | ||
33 | bool | ||
34 | default n | ||
35 | |||
36 | config ARCH_HAS_ILOG2_U64 | ||
37 | bool | ||
38 | default n | ||
39 | |||
32 | config GENERIC_FIND_NEXT_BIT | 40 | config GENERIC_FIND_NEXT_BIT |
33 | bool | 41 | bool |
34 | default y | 42 | default y |
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index ea70359b02d0..c2362c7ba749 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig | |||
@@ -49,6 +49,11 @@ config GENERIC_IOMAP | |||
49 | bool | 49 | bool |
50 | default y | 50 | default y |
51 | 51 | ||
52 | config GENERIC_BUG | ||
53 | bool | ||
54 | default y | ||
55 | depends on BUG | ||
56 | |||
52 | config GENERIC_HWEIGHT | 57 | config GENERIC_HWEIGHT |
53 | bool | 58 | bool |
54 | default y | 59 | default y |
diff --git a/arch/i386/Kconfig.cpu b/arch/i386/Kconfig.cpu index 821fd269ca58..2aecfba4ac4f 100644 --- a/arch/i386/Kconfig.cpu +++ b/arch/i386/Kconfig.cpu | |||
@@ -248,6 +248,14 @@ config RWSEM_XCHGADD_ALGORITHM | |||
248 | depends on !M386 | 248 | depends on !M386 |
249 | default y | 249 | default y |
250 | 250 | ||
251 | config ARCH_HAS_ILOG2_U32 | ||
252 | bool | ||
253 | default n | ||
254 | |||
255 | config ARCH_HAS_ILOG2_U64 | ||
256 | bool | ||
257 | default n | ||
258 | |||
251 | config GENERIC_CALIBRATE_DELAY | 259 | config GENERIC_CALIBRATE_DELAY |
252 | bool | 260 | bool |
253 | default y | 261 | default y |
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c index db6dd20c3589..51130b39cd2e 100644 --- a/arch/i386/kernel/cpuid.c +++ b/arch/i386/kernel/cpuid.c | |||
@@ -116,7 +116,7 @@ static ssize_t cpuid_read(struct file *file, char __user *buf, | |||
116 | char __user *tmp = buf; | 116 | char __user *tmp = buf; |
117 | u32 data[4]; | 117 | u32 data[4]; |
118 | u32 reg = *ppos; | 118 | u32 reg = *ppos; |
119 | int cpu = iminor(file->f_dentry->d_inode); | 119 | int cpu = iminor(file->f_path.dentry->d_inode); |
120 | 120 | ||
121 | if (count % 16) | 121 | if (count % 16) |
122 | return -EINVAL; /* Invalid chunk size */ | 122 | return -EINVAL; /* Invalid chunk size */ |
@@ -134,7 +134,7 @@ static ssize_t cpuid_read(struct file *file, char __user *buf, | |||
134 | 134 | ||
135 | static int cpuid_open(struct inode *inode, struct file *file) | 135 | static int cpuid_open(struct inode *inode, struct file *file) |
136 | { | 136 | { |
137 | unsigned int cpu = iminor(file->f_dentry->d_inode); | 137 | unsigned int cpu = iminor(file->f_path.dentry->d_inode); |
138 | struct cpuinfo_x86 *c = &(cpu_data)[cpu]; | 138 | struct cpuinfo_x86 *c = &(cpu_data)[cpu]; |
139 | 139 | ||
140 | if (cpu >= NR_CPUS || !cpu_online(cpu)) | 140 | if (cpu >= NR_CPUS || !cpu_online(cpu)) |
diff --git a/arch/i386/kernel/module.c b/arch/i386/kernel/module.c index d7d9c8b23f72..3db0a5442eb1 100644 --- a/arch/i386/kernel/module.c +++ b/arch/i386/kernel/module.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
22 | #include <linux/string.h> | 22 | #include <linux/string.h> |
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/bug.h> | ||
24 | 25 | ||
25 | #if 0 | 26 | #if 0 |
26 | #define DEBUGP printk | 27 | #define DEBUGP printk |
@@ -141,10 +142,11 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
141 | apply_paravirt(pseg, pseg + para->sh_size); | 142 | apply_paravirt(pseg, pseg + para->sh_size); |
142 | } | 143 | } |
143 | 144 | ||
144 | return 0; | 145 | return module_bug_finalize(hdr, sechdrs, me); |
145 | } | 146 | } |
146 | 147 | ||
147 | void module_arch_cleanup(struct module *mod) | 148 | void module_arch_cleanup(struct module *mod) |
148 | { | 149 | { |
149 | alternatives_smp_module_del(mod); | 150 | alternatives_smp_module_del(mod); |
151 | module_bug_cleanup(mod); | ||
150 | } | 152 | } |
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c index 1d1a56cae340..4a472a17d1c6 100644 --- a/arch/i386/kernel/msr.c +++ b/arch/i386/kernel/msr.c | |||
@@ -172,7 +172,7 @@ static ssize_t msr_read(struct file *file, char __user * buf, | |||
172 | u32 __user *tmp = (u32 __user *) buf; | 172 | u32 __user *tmp = (u32 __user *) buf; |
173 | u32 data[2]; | 173 | u32 data[2]; |
174 | u32 reg = *ppos; | 174 | u32 reg = *ppos; |
175 | int cpu = iminor(file->f_dentry->d_inode); | 175 | int cpu = iminor(file->f_path.dentry->d_inode); |
176 | int err; | 176 | int err; |
177 | 177 | ||
178 | if (count % 8) | 178 | if (count % 8) |
@@ -196,7 +196,7 @@ static ssize_t msr_write(struct file *file, const char __user *buf, | |||
196 | const u32 __user *tmp = (const u32 __user *)buf; | 196 | const u32 __user *tmp = (const u32 __user *)buf; |
197 | u32 data[2]; | 197 | u32 data[2]; |
198 | u32 reg = *ppos; | 198 | u32 reg = *ppos; |
199 | int cpu = iminor(file->f_dentry->d_inode); | 199 | int cpu = iminor(file->f_path.dentry->d_inode); |
200 | int err; | 200 | int err; |
201 | 201 | ||
202 | if (count % 8) | 202 | if (count % 8) |
@@ -216,7 +216,7 @@ static ssize_t msr_write(struct file *file, const char __user *buf, | |||
216 | 216 | ||
217 | static int msr_open(struct inode *inode, struct file *file) | 217 | static int msr_open(struct inode *inode, struct file *file) |
218 | { | 218 | { |
219 | unsigned int cpu = iminor(file->f_dentry->d_inode); | 219 | unsigned int cpu = iminor(file->f_path.dentry->d_inode); |
220 | struct cpuinfo_x86 *c = &(cpu_data)[cpu]; | 220 | struct cpuinfo_x86 *c = &(cpu_data)[cpu]; |
221 | 221 | ||
222 | if (cpu >= NR_CPUS || !cpu_online(cpu)) | 222 | if (cpu >= NR_CPUS || !cpu_online(cpu)) |
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index 4bf0e3c83b8b..1e00b03163b9 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c | |||
@@ -1118,7 +1118,7 @@ static int __cpuinit __smp_prepare_cpu(int cpu) | |||
1118 | 1118 | ||
1119 | /* init low mem mapping */ | 1119 | /* init low mem mapping */ |
1120 | clone_pgd_range(swapper_pg_dir, swapper_pg_dir + USER_PGD_PTRS, | 1120 | clone_pgd_range(swapper_pg_dir, swapper_pg_dir + USER_PGD_PTRS, |
1121 | KERNEL_PGD_PTRS); | 1121 | min_t(unsigned long, KERNEL_PGD_PTRS, USER_PGD_PTRS)); |
1122 | flush_tlb_all(); | 1122 | flush_tlb_all(); |
1123 | schedule_work(&info.task); | 1123 | schedule_work(&info.task); |
1124 | wait_for_completion(&done); | 1124 | wait_for_completion(&done); |
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 68de48e498ca..2b30dbf8d117 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/unwind.h> | 30 | #include <linux/unwind.h> |
31 | #include <linux/uaccess.h> | 31 | #include <linux/uaccess.h> |
32 | #include <linux/nmi.h> | 32 | #include <linux/nmi.h> |
33 | #include <linux/bug.h> | ||
33 | 34 | ||
34 | #ifdef CONFIG_EISA | 35 | #ifdef CONFIG_EISA |
35 | #include <linux/ioport.h> | 36 | #include <linux/ioport.h> |
@@ -420,43 +421,22 @@ void show_registers(struct pt_regs *regs) | |||
420 | printk("\n"); | 421 | printk("\n"); |
421 | } | 422 | } |
422 | 423 | ||
423 | static void handle_BUG(struct pt_regs *regs) | 424 | int is_valid_bugaddr(unsigned long eip) |
424 | { | 425 | { |
425 | unsigned long eip = regs->eip; | ||
426 | unsigned short ud2; | 426 | unsigned short ud2; |
427 | 427 | ||
428 | if (eip < PAGE_OFFSET) | 428 | if (eip < PAGE_OFFSET) |
429 | return; | 429 | return 0; |
430 | if (probe_kernel_address((unsigned short *)eip, ud2)) | 430 | if (probe_kernel_address((unsigned short *)eip, ud2)) |
431 | return; | 431 | return 0; |
432 | if (ud2 != 0x0b0f) | ||
433 | return; | ||
434 | |||
435 | printk(KERN_EMERG "------------[ cut here ]------------\n"); | ||
436 | |||
437 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
438 | do { | ||
439 | unsigned short line; | ||
440 | char *file; | ||
441 | char c; | ||
442 | |||
443 | if (probe_kernel_address((unsigned short *)(eip + 2), line)) | ||
444 | break; | ||
445 | if (probe_kernel_address((char **)(eip + 4), file) || | ||
446 | (unsigned long)file < PAGE_OFFSET || | ||
447 | probe_kernel_address(file, c)) | ||
448 | file = "<bad filename>"; | ||
449 | 432 | ||
450 | printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line); | 433 | return ud2 == 0x0b0f; |
451 | return; | ||
452 | } while (0); | ||
453 | #endif | ||
454 | printk(KERN_EMERG "Kernel BUG at [verbose debug info unavailable]\n"); | ||
455 | } | 434 | } |
456 | 435 | ||
457 | /* This is gone through when something in the kernel | 436 | /* |
458 | * has done something bad and is about to be terminated. | 437 | * This is gone through when something in the kernel has done something bad and |
459 | */ | 438 | * is about to be terminated. |
439 | */ | ||
460 | void die(const char * str, struct pt_regs * regs, long err) | 440 | void die(const char * str, struct pt_regs * regs, long err) |
461 | { | 441 | { |
462 | static struct { | 442 | static struct { |
@@ -488,7 +468,8 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
488 | unsigned long esp; | 468 | unsigned long esp; |
489 | unsigned short ss; | 469 | unsigned short ss; |
490 | 470 | ||
491 | handle_BUG(regs); | 471 | report_bug(regs->eip); |
472 | |||
492 | printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); | 473 | printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); |
493 | #ifdef CONFIG_PREEMPT | 474 | #ifdef CONFIG_PREEMPT |
494 | printk(KERN_EMERG "PREEMPT "); | 475 | printk(KERN_EMERG "PREEMPT "); |
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S index 56e6ad5cb045..16d3c7133ad7 100644 --- a/arch/i386/kernel/vmlinux.lds.S +++ b/arch/i386/kernel/vmlinux.lds.S | |||
@@ -57,6 +57,8 @@ SECTIONS | |||
57 | 57 | ||
58 | RODATA | 58 | RODATA |
59 | 59 | ||
60 | BUG_TABLE | ||
61 | |||
60 | . = ALIGN(4); | 62 | . = ALIGN(4); |
61 | .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { | 63 | .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { |
62 | __tracedata_start = .; | 64 | __tracedata_start = .; |
diff --git a/arch/i386/mach-visws/setup.c b/arch/i386/mach-visws/setup.c index 885c7cbfd478..233ee20907b9 100644 --- a/arch/i386/mach-visws/setup.c +++ b/arch/i386/mach-visws/setup.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/smp.h> | 6 | #include <linux/smp.h> |
7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
8 | #include <linux/interrupt.h> | 8 | #include <linux/interrupt.h> |
9 | #include <linux/module.h> | ||
9 | 10 | ||
10 | #include <asm/fixmap.h> | 11 | #include <asm/fixmap.h> |
11 | #include <asm/arch_hooks.h> | 12 | #include <asm/arch_hooks.h> |
@@ -142,6 +143,8 @@ void __init time_init_hook(void) | |||
142 | 143 | ||
143 | unsigned long sgivwfb_mem_phys; | 144 | unsigned long sgivwfb_mem_phys; |
144 | unsigned long sgivwfb_mem_size; | 145 | unsigned long sgivwfb_mem_size; |
146 | EXPORT_SYMBOL(sgivwfb_mem_phys); | ||
147 | EXPORT_SYMBOL(sgivwfb_mem_size); | ||
145 | 148 | ||
146 | long long mem_size __initdata = 0; | 149 | long long mem_size __initdata = 0; |
147 | 150 | ||
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 75d839715b2f..fcacfe291b9b 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -34,6 +34,14 @@ config RWSEM_XCHGADD_ALGORITHM | |||
34 | bool | 34 | bool |
35 | default y | 35 | default y |
36 | 36 | ||
37 | config ARCH_HAS_ILOG2_U32 | ||
38 | bool | ||
39 | default n | ||
40 | |||
41 | config ARCH_HAS_ILOG2_U64 | ||
42 | bool | ||
43 | default n | ||
44 | |||
37 | config GENERIC_FIND_NEXT_BIT | 45 | config GENERIC_FIND_NEXT_BIT |
38 | bool | 46 | bool |
39 | default y | 47 | default y |
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index a4a6e1463af8..957681c39ad9 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c | |||
@@ -235,7 +235,7 @@ mmap_subpage (struct file *file, unsigned long start, unsigned long end, int pro | |||
235 | 235 | ||
236 | if (!(flags & MAP_ANONYMOUS)) { | 236 | if (!(flags & MAP_ANONYMOUS)) { |
237 | /* read the file contents */ | 237 | /* read the file contents */ |
238 | inode = file->f_dentry->d_inode; | 238 | inode = file->f_path.dentry->d_inode; |
239 | if (!inode->i_fop || !file->f_op->read | 239 | if (!inode->i_fop || !file->f_op->read |
240 | || ((*file->f_op->read)(file, (char __user *) start, end - start, &off) < 0)) | 240 | || ((*file->f_op->read)(file, (char __user *) start, end - start, &off) < 0)) |
241 | { | 241 | { |
@@ -837,7 +837,7 @@ emulate_mmap (struct file *file, unsigned long start, unsigned long len, int pro | |||
837 | 837 | ||
838 | if (!is_congruent) { | 838 | if (!is_congruent) { |
839 | /* read the file contents */ | 839 | /* read the file contents */ |
840 | inode = file->f_dentry->d_inode; | 840 | inode = file->f_path.dentry->d_inode; |
841 | if (!inode->i_fop || !file->f_op->read | 841 | if (!inode->i_fop || !file->f_op->read |
842 | || ((*file->f_op->read)(file, (char __user *) pstart, pend - pstart, &poff) | 842 | || ((*file->f_op->read)(file, (char __user *) pstart, pend - pstart, &poff) |
843 | < 0)) | 843 | < 0)) |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index dbb28164b19b..aa94f60fa8e7 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -2188,13 +2188,13 @@ pfm_alloc_fd(struct file **cfile) | |||
2188 | /* | 2188 | /* |
2189 | * allocate a new dcache entry | 2189 | * allocate a new dcache entry |
2190 | */ | 2190 | */ |
2191 | file->f_dentry = d_alloc(pfmfs_mnt->mnt_sb->s_root, &this); | 2191 | file->f_path.dentry = d_alloc(pfmfs_mnt->mnt_sb->s_root, &this); |
2192 | if (!file->f_dentry) goto out; | 2192 | if (!file->f_path.dentry) goto out; |
2193 | 2193 | ||
2194 | file->f_dentry->d_op = &pfmfs_dentry_operations; | 2194 | file->f_path.dentry->d_op = &pfmfs_dentry_operations; |
2195 | 2195 | ||
2196 | d_add(file->f_dentry, inode); | 2196 | d_add(file->f_path.dentry, inode); |
2197 | file->f_vfsmnt = mntget(pfmfs_mnt); | 2197 | file->f_path.mnt = mntget(pfmfs_mnt); |
2198 | file->f_mapping = inode->i_mapping; | 2198 | file->f_mapping = inode->i_mapping; |
2199 | 2199 | ||
2200 | file->f_op = &pfm_file_ops; | 2200 | file->f_op = &pfm_file_ops; |
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index fd607ca51a8d..e375a2f0f2c3 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c | |||
@@ -302,7 +302,7 @@ salinfo_event_open(struct inode *inode, struct file *file) | |||
302 | static ssize_t | 302 | static ssize_t |
303 | salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) | 303 | salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) |
304 | { | 304 | { |
305 | struct inode *inode = file->f_dentry->d_inode; | 305 | struct inode *inode = file->f_path.dentry->d_inode; |
306 | struct proc_dir_entry *entry = PDE(inode); | 306 | struct proc_dir_entry *entry = PDE(inode); |
307 | struct salinfo_data *data = entry->data; | 307 | struct salinfo_data *data = entry->data; |
308 | char cmd[32]; | 308 | char cmd[32]; |
@@ -464,7 +464,7 @@ retry: | |||
464 | static ssize_t | 464 | static ssize_t |
465 | salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) | 465 | salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) |
466 | { | 466 | { |
467 | struct inode *inode = file->f_dentry->d_inode; | 467 | struct inode *inode = file->f_path.dentry->d_inode; |
468 | struct proc_dir_entry *entry = PDE(inode); | 468 | struct proc_dir_entry *entry = PDE(inode); |
469 | struct salinfo_data *data = entry->data; | 469 | struct salinfo_data *data = entry->data; |
470 | u8 *buf; | 470 | u8 *buf; |
@@ -525,7 +525,7 @@ salinfo_log_clear(struct salinfo_data *data, int cpu) | |||
525 | static ssize_t | 525 | static ssize_t |
526 | salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) | 526 | salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) |
527 | { | 527 | { |
528 | struct inode *inode = file->f_dentry->d_inode; | 528 | struct inode *inode = file->f_path.dentry->d_inode; |
529 | struct proc_dir_entry *entry = PDE(inode); | 529 | struct proc_dir_entry *entry = PDE(inode); |
530 | struct salinfo_data *data = entry->data; | 530 | struct salinfo_data *data = entry->data; |
531 | char cmd[32]; | 531 | char cmd[32]; |
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig index 41fd490af3b4..f383dab973f5 100644 --- a/arch/m32r/Kconfig +++ b/arch/m32r/Kconfig | |||
@@ -214,6 +214,14 @@ config RWSEM_XCHGADD_ALGORITHM | |||
214 | bool | 214 | bool |
215 | default n | 215 | default n |
216 | 216 | ||
217 | config ARCH_HAS_ILOG2_U32 | ||
218 | bool | ||
219 | default n | ||
220 | |||
221 | config ARCH_HAS_ILOG2_U64 | ||
222 | bool | ||
223 | default n | ||
224 | |||
217 | config GENERIC_FIND_NEXT_BIT | 225 | config GENERIC_FIND_NEXT_BIT |
218 | bool | 226 | bool |
219 | default y | 227 | default y |
diff --git a/arch/m32r/boot/compressed/m32r_sio.c b/arch/m32r/boot/compressed/m32r_sio.c index bce8af5e3bb2..ee3c8be12fa0 100644 --- a/arch/m32r/boot/compressed/m32r_sio.c +++ b/arch/m32r/boot/compressed/m32r_sio.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * arch/m32r/boot/compressed/m32r_sio.c | 2 | * arch/m32r/boot/compressed/m32r_sio.c |
3 | * | 3 | * |
4 | * 2003-02-12: Takeo Takahashi | 4 | * 2003-02-12: Takeo Takahashi |
5 | * 2006-11-30: OPSPUT support by Kazuhiro Inaoka | ||
5 | * | 6 | * |
6 | */ | 7 | */ |
7 | 8 | ||
@@ -16,7 +17,7 @@ static int puts(const char *s) | |||
16 | return 0; | 17 | return 0; |
17 | } | 18 | } |
18 | 19 | ||
19 | #if defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_M32700UT) | 20 | #if defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_OPSPUT) |
20 | #include <asm/m32r.h> | 21 | #include <asm/m32r.h> |
21 | #include <asm/io.h> | 22 | #include <asm/io.h> |
22 | 23 | ||
@@ -31,7 +32,11 @@ static int puts(const char *s) | |||
31 | #define BOOT_SIO0TXB (volatile unsigned short *)(0x02c00000 + 0x2000c) | 32 | #define BOOT_SIO0TXB (volatile unsigned short *)(0x02c00000 + 0x2000c) |
32 | #else | 33 | #else |
33 | #undef PLD_BASE | 34 | #undef PLD_BASE |
35 | #if defined(CONFIG_PLAT_OPSPUT) | ||
36 | #define PLD_BASE 0x1cc00000 | ||
37 | #else | ||
34 | #define PLD_BASE 0xa4c00000 | 38 | #define PLD_BASE 0xa4c00000 |
39 | #endif | ||
35 | #define BOOT_SIO0STS PLD_ESIO0STS | 40 | #define BOOT_SIO0STS PLD_ESIO0STS |
36 | #define BOOT_SIO0TXB PLD_ESIO0TXB | 41 | #define BOOT_SIO0TXB PLD_ESIO0TXB |
37 | #endif | 42 | #endif |
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S index ac6d840b382b..a2c472c0549f 100644 --- a/arch/m32r/kernel/entry.S +++ b/arch/m32r/kernel/entry.S | |||
@@ -23,35 +23,35 @@ | |||
23 | * updated in fork.c:copy_thread, signal.c:do_signal, | 23 | * updated in fork.c:copy_thread, signal.c:do_signal, |
24 | * ptrace.c and ptrace.h | 24 | * ptrace.c and ptrace.h |
25 | * | 25 | * |
26 | * M32Rx/M32R2 M32R | 26 | * M32R/M32Rx/M32R2 |
27 | * @(sp) - r4 ditto | 27 | * @(sp) - r4 |
28 | * @(0x04,sp) - r5 ditto | 28 | * @(0x04,sp) - r5 |
29 | * @(0x08,sp) - r6 ditto | 29 | * @(0x08,sp) - r6 |
30 | * @(0x0c,sp) - *pt_regs ditto | 30 | * @(0x0c,sp) - *pt_regs |
31 | * @(0x10,sp) - r0 ditto | 31 | * @(0x10,sp) - r0 |
32 | * @(0x14,sp) - r1 ditto | 32 | * @(0x14,sp) - r1 |
33 | * @(0x18,sp) - r2 ditto | 33 | * @(0x18,sp) - r2 |
34 | * @(0x1c,sp) - r3 ditto | 34 | * @(0x1c,sp) - r3 |
35 | * @(0x20,sp) - r7 ditto | 35 | * @(0x20,sp) - r7 |
36 | * @(0x24,sp) - r8 ditto | 36 | * @(0x24,sp) - r8 |
37 | * @(0x28,sp) - r9 ditto | 37 | * @(0x28,sp) - r9 |
38 | * @(0x2c,sp) - r10 ditto | 38 | * @(0x2c,sp) - r10 |
39 | * @(0x30,sp) - r11 ditto | 39 | * @(0x30,sp) - r11 |
40 | * @(0x34,sp) - r12 ditto | 40 | * @(0x34,sp) - r12 |
41 | * @(0x38,sp) - syscall_nr ditto | 41 | * @(0x38,sp) - syscall_nr |
42 | * @(0x3c,sp) - acc0h @(0x3c,sp) - acch | 42 | * @(0x3c,sp) - acc0h |
43 | * @(0x40,sp) - acc0l @(0x40,sp) - accl | 43 | * @(0x40,sp) - acc0l |
44 | * @(0x44,sp) - acc1h @(0x44,sp) - dummy_acc1h | 44 | * @(0x44,sp) - acc1h ; ISA_DSP_LEVEL2 only |
45 | * @(0x48,sp) - acc1l @(0x48,sp) - dummy_acc1l | 45 | * @(0x48,sp) - acc1l ; ISA_DSP_LEVEL2 only |
46 | * @(0x4c,sp) - psw ditto | 46 | * @(0x4c,sp) - psw |
47 | * @(0x50,sp) - bpc ditto | 47 | * @(0x50,sp) - bpc |
48 | * @(0x54,sp) - bbpsw ditto | 48 | * @(0x54,sp) - bbpsw |
49 | * @(0x58,sp) - bbpc ditto | 49 | * @(0x58,sp) - bbpc |
50 | * @(0x5c,sp) - spu (cr3) ditto | 50 | * @(0x5c,sp) - spu (cr3) |
51 | * @(0x60,sp) - fp (r13) ditto | 51 | * @(0x60,sp) - fp (r13) |
52 | * @(0x64,sp) - lr (r14) ditto | 52 | * @(0x64,sp) - lr (r14) |
53 | * @(0x68,sp) - spi (cr2) ditto | 53 | * @(0x68,sp) - spi (cr2) |
54 | * @(0x6c,sp) - orig_r0 ditto | 54 | * @(0x6c,sp) - orig_r0 |
55 | */ | 55 | */ |
56 | 56 | ||
57 | #include <linux/linkage.h> | 57 | #include <linux/linkage.h> |
@@ -95,17 +95,10 @@ | |||
95 | #define R11(reg) @(0x30,reg) | 95 | #define R11(reg) @(0x30,reg) |
96 | #define R12(reg) @(0x34,reg) | 96 | #define R12(reg) @(0x34,reg) |
97 | #define SYSCALL_NR(reg) @(0x38,reg) | 97 | #define SYSCALL_NR(reg) @(0x38,reg) |
98 | #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2) | ||
99 | #define ACC0H(reg) @(0x3C,reg) | 98 | #define ACC0H(reg) @(0x3C,reg) |
100 | #define ACC0L(reg) @(0x40,reg) | 99 | #define ACC0L(reg) @(0x40,reg) |
101 | #define ACC1H(reg) @(0x44,reg) | 100 | #define ACC1H(reg) @(0x44,reg) |
102 | #define ACC1L(reg) @(0x48,reg) | 101 | #define ACC1L(reg) @(0x48,reg) |
103 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
104 | #define ACCH(reg) @(0x3C,reg) | ||
105 | #define ACCL(reg) @(0x40,reg) | ||
106 | #else | ||
107 | #error unknown isa configuration | ||
108 | #endif | ||
109 | #define PSW(reg) @(0x4C,reg) | 102 | #define PSW(reg) @(0x4C,reg) |
110 | #define BPC(reg) @(0x50,reg) | 103 | #define BPC(reg) @(0x50,reg) |
111 | #define BBPSW(reg) @(0x54,reg) | 104 | #define BBPSW(reg) @(0x54,reg) |
@@ -603,8 +596,6 @@ ENTRY(ace_handler) | |||
603 | beqz r1, inst | 596 | beqz r1, inst |
604 | oprand: | 597 | oprand: |
605 | ld r2, @(low(MDEVA_offset),r2) ; set address | 598 | ld r2, @(low(MDEVA_offset),r2) ; set address |
606 | srli r2, #12 | ||
607 | slli r2, #12 | ||
608 | srli r1, #1 | 599 | srli r1, #1 |
609 | bra 1f | 600 | bra 1f |
610 | inst: | 601 | inst: |
diff --git a/arch/m32r/kernel/io_opsput.c b/arch/m32r/kernel/io_opsput.c index da6c5f5c1f82..3cbb1f717e50 100644 --- a/arch/m32r/kernel/io_opsput.c +++ b/arch/m32r/kernel/io_opsput.c | |||
@@ -30,14 +30,34 @@ extern void pcc_iowrite_byte(int, unsigned long, void *, size_t, size_t, int); | |||
30 | extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); | 30 | extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); |
31 | #endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */ | 31 | #endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */ |
32 | 32 | ||
33 | #define PORT2ADDR(port) _port2addr(port) | 33 | #define PORT2ADDR(port) _port2addr(port) |
34 | #define PORT2ADDR_USB(port) _port2addr_usb(port) | 34 | #define PORT2ADDR_USB(port) _port2addr_usb(port) |
35 | 35 | ||
36 | static inline void *_port2addr(unsigned long port) | 36 | static inline void *_port2addr(unsigned long port) |
37 | { | 37 | { |
38 | return (void *)(port | NONCACHE_OFFSET); | 38 | return (void *)(port | NONCACHE_OFFSET); |
39 | } | 39 | } |
40 | 40 | ||
41 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
42 | static inline void *__port2addr_ata(unsigned long port) | ||
43 | { | ||
44 | static int dummy_reg; | ||
45 | |||
46 | switch (port) { | ||
47 | case 0x1f0: return (void *)(0x0c002000 | NONCACHE_OFFSET); | ||
48 | case 0x1f1: return (void *)(0x0c012800 | NONCACHE_OFFSET); | ||
49 | case 0x1f2: return (void *)(0x0c012002 | NONCACHE_OFFSET); | ||
50 | case 0x1f3: return (void *)(0x0c012802 | NONCACHE_OFFSET); | ||
51 | case 0x1f4: return (void *)(0x0c012004 | NONCACHE_OFFSET); | ||
52 | case 0x1f5: return (void *)(0x0c012804 | NONCACHE_OFFSET); | ||
53 | case 0x1f6: return (void *)(0x0c012006 | NONCACHE_OFFSET); | ||
54 | case 0x1f7: return (void *)(0x0c012806 | NONCACHE_OFFSET); | ||
55 | case 0x3f6: return (void *)(0x0c01200e | NONCACHE_OFFSET); | ||
56 | default: return (void *)&dummy_reg; | ||
57 | } | ||
58 | } | ||
59 | #endif | ||
60 | |||
41 | /* | 61 | /* |
42 | * OPSPUT-LAN is located in the extended bus space | 62 | * OPSPUT-LAN is located in the extended bus space |
43 | * from 0x10000000 to 0x13ffffff on physical address. | 63 | * from 0x10000000 to 0x13ffffff on physical address. |
@@ -97,6 +117,12 @@ unsigned char _inb(unsigned long port) | |||
97 | { | 117 | { |
98 | if (port >= LAN_IOSTART && port < LAN_IOEND) | 118 | if (port >= LAN_IOSTART && port < LAN_IOEND) |
99 | return _ne_inb(PORT2ADDR_NE(port)); | 119 | return _ne_inb(PORT2ADDR_NE(port)); |
120 | |||
121 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
122 | else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
123 | return *(volatile unsigned char *)__port2addr_ata(port); | ||
124 | } | ||
125 | #endif | ||
100 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) | 126 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) |
101 | else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { | 127 | else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { |
102 | unsigned char b; | 128 | unsigned char b; |
@@ -112,6 +138,11 @@ unsigned short _inw(unsigned long port) | |||
112 | { | 138 | { |
113 | if (port >= LAN_IOSTART && port < LAN_IOEND) | 139 | if (port >= LAN_IOSTART && port < LAN_IOEND) |
114 | return _ne_inw(PORT2ADDR_NE(port)); | 140 | return _ne_inw(PORT2ADDR_NE(port)); |
141 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
142 | else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
143 | return *(volatile unsigned short *)__port2addr_ata(port); | ||
144 | } | ||
145 | #endif | ||
115 | #if defined(CONFIG_USB) | 146 | #if defined(CONFIG_USB) |
116 | else if(port >= 0x340 && port < 0x3a0) | 147 | else if(port >= 0x340 && port < 0x3a0) |
117 | return *(volatile unsigned short *)PORT2ADDR_USB(port); | 148 | return *(volatile unsigned short *)PORT2ADDR_USB(port); |
@@ -164,6 +195,11 @@ void _outb(unsigned char b, unsigned long port) | |||
164 | if (port >= LAN_IOSTART && port < LAN_IOEND) | 195 | if (port >= LAN_IOSTART && port < LAN_IOEND) |
165 | _ne_outb(b, PORT2ADDR_NE(port)); | 196 | _ne_outb(b, PORT2ADDR_NE(port)); |
166 | else | 197 | else |
198 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
199 | if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
200 | *(volatile unsigned char *)__port2addr_ata(port) = b; | ||
201 | } else | ||
202 | #endif | ||
167 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) | 203 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) |
168 | if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { | 204 | if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { |
169 | pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); | 205 | pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); |
@@ -177,6 +213,11 @@ void _outw(unsigned short w, unsigned long port) | |||
177 | if (port >= LAN_IOSTART && port < LAN_IOEND) | 213 | if (port >= LAN_IOSTART && port < LAN_IOEND) |
178 | _ne_outw(w, PORT2ADDR_NE(port)); | 214 | _ne_outw(w, PORT2ADDR_NE(port)); |
179 | else | 215 | else |
216 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
217 | if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
218 | *(volatile unsigned short *)__port2addr_ata(port) = w; | ||
219 | } else | ||
220 | #endif | ||
180 | #if defined(CONFIG_USB) | 221 | #if defined(CONFIG_USB) |
181 | if(port >= 0x340 && port < 0x3a0) | 222 | if(port >= 0x340 && port < 0x3a0) |
182 | *(volatile unsigned short *)PORT2ADDR_USB(port) = w; | 223 | *(volatile unsigned short *)PORT2ADDR_USB(port) = w; |
@@ -222,6 +263,14 @@ void _insb(unsigned int port, void *addr, unsigned long count) | |||
222 | { | 263 | { |
223 | if (port >= LAN_IOSTART && port < LAN_IOEND) | 264 | if (port >= LAN_IOSTART && port < LAN_IOEND) |
224 | _ne_insb(PORT2ADDR_NE(port), addr, count); | 265 | _ne_insb(PORT2ADDR_NE(port), addr, count); |
266 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
267 | else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
268 | unsigned char *buf = addr; | ||
269 | unsigned char *portp = __port2addr_ata(port); | ||
270 | while (count--) | ||
271 | *buf++ = *(volatile unsigned char *)portp; | ||
272 | } | ||
273 | #endif | ||
225 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) | 274 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) |
226 | else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { | 275 | else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { |
227 | pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), | 276 | pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), |
@@ -254,6 +303,12 @@ void _insw(unsigned int port, void *addr, unsigned long count) | |||
254 | pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), | 303 | pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), |
255 | count, 1); | 304 | count, 1); |
256 | #endif | 305 | #endif |
306 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
307 | } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
308 | portp = __port2addr_ata(port); | ||
309 | while (count--) | ||
310 | *buf++ = *(volatile unsigned short *)portp; | ||
311 | #endif | ||
257 | } else { | 312 | } else { |
258 | portp = PORT2ADDR(port); | 313 | portp = PORT2ADDR(port); |
259 | while (count--) | 314 | while (count--) |
@@ -280,6 +335,12 @@ void _outsb(unsigned int port, const void *addr, unsigned long count) | |||
280 | portp = PORT2ADDR_NE(port); | 335 | portp = PORT2ADDR_NE(port); |
281 | while (count--) | 336 | while (count--) |
282 | _ne_outb(*buf++, portp); | 337 | _ne_outb(*buf++, portp); |
338 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
339 | } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
340 | portp = __port2addr_ata(port); | ||
341 | while (count--) | ||
342 | *(volatile unsigned char *)portp = *buf++; | ||
343 | #endif | ||
283 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) | 344 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) |
284 | } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { | 345 | } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { |
285 | pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), | 346 | pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), |
@@ -305,6 +366,12 @@ void _outsw(unsigned int port, const void *addr, unsigned long count) | |||
305 | portp = PORT2ADDR_NE(port); | 366 | portp = PORT2ADDR_NE(port); |
306 | while (count--) | 367 | while (count--) |
307 | *(volatile unsigned short *)portp = *buf++; | 368 | *(volatile unsigned short *)portp = *buf++; |
369 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
370 | } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
371 | portp = __port2addr_ata(port); | ||
372 | while (count--) | ||
373 | *(volatile unsigned short *)portp = *buf++; | ||
374 | #endif | ||
308 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) | 375 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) |
309 | } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { | 376 | } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { |
310 | pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), | 377 | pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), |
diff --git a/arch/m32r/kernel/setup_opsput.c b/arch/m32r/kernel/setup_opsput.c index 61d3b01cbe07..62d6b71de45f 100644 --- a/arch/m32r/kernel/setup_opsput.c +++ b/arch/m32r/kernel/setup_opsput.c | |||
@@ -218,13 +218,13 @@ static void shutdown_opsput_lanpld_irq(unsigned int irq) | |||
218 | 218 | ||
219 | static struct hw_interrupt_type opsput_lanpld_irq_type = | 219 | static struct hw_interrupt_type opsput_lanpld_irq_type = |
220 | { | 220 | { |
221 | "OPSPUT-PLD-LAN-IRQ", | 221 | .typename = "OPSPUT-PLD-LAN-IRQ", |
222 | startup_opsput_lanpld_irq, | 222 | .startup = startup_opsput_lanpld_irq, |
223 | shutdown_opsput_lanpld_irq, | 223 | .shutdown = shutdown_opsput_lanpld_irq, |
224 | enable_opsput_lanpld_irq, | 224 | .enable = enable_opsput_lanpld_irq, |
225 | disable_opsput_lanpld_irq, | 225 | .disable = disable_opsput_lanpld_irq, |
226 | mask_and_ack_opsput_lanpld, | 226 | .ack = mask_and_ack_opsput_lanpld, |
227 | end_opsput_lanpld_irq | 227 | .end = end_opsput_lanpld_irq |
228 | }; | 228 | }; |
229 | 229 | ||
230 | /* | 230 | /* |
@@ -374,7 +374,6 @@ void __init init_IRQ(void) | |||
374 | disable_opsput_pld_irq(PLD_IRQ_SIO0_SND); | 374 | disable_opsput_pld_irq(PLD_IRQ_SIO0_SND); |
375 | #endif /* CONFIG_SERIAL_M32R_PLDSIO */ | 375 | #endif /* CONFIG_SERIAL_M32R_PLDSIO */ |
376 | 376 | ||
377 | #if defined(CONFIG_M32R_CFC) | ||
378 | /* INT#1: CFC IREQ on PLD */ | 377 | /* INT#1: CFC IREQ on PLD */ |
379 | irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; | 378 | irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; |
380 | irq_desc[PLD_IRQ_CFIREQ].chip = &opsput_pld_irq_type; | 379 | irq_desc[PLD_IRQ_CFIREQ].chip = &opsput_pld_irq_type; |
@@ -398,8 +397,6 @@ void __init init_IRQ(void) | |||
398 | irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ | 397 | irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ |
399 | pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */ | 398 | pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */ |
400 | disable_opsput_pld_irq(PLD_IRQ_CFC_EJECT); | 399 | disable_opsput_pld_irq(PLD_IRQ_CFC_EJECT); |
401 | #endif /* CONFIG_M32R_CFC */ | ||
402 | |||
403 | 400 | ||
404 | /* | 401 | /* |
405 | * INT0# is used for LAN, DIO | 402 | * INT0# is used for LAN, DIO |
diff --git a/arch/m32r/mm/fault.c b/arch/m32r/mm/fault.c index 8d5f551b5754..9b9feb0f1610 100644 --- a/arch/m32r/mm/fault.c +++ b/arch/m32r/mm/fault.c | |||
@@ -173,7 +173,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, | |||
173 | goto good_area; | 173 | goto good_area; |
174 | if (!(vma->vm_flags & VM_GROWSDOWN)) | 174 | if (!(vma->vm_flags & VM_GROWSDOWN)) |
175 | goto bad_area; | 175 | goto bad_area; |
176 | #if 0 | 176 | |
177 | if (error_code & ACE_USERMODE) { | 177 | if (error_code & ACE_USERMODE) { |
178 | /* | 178 | /* |
179 | * accessing the stack below "spu" is always a bug. | 179 | * accessing the stack below "spu" is always a bug. |
@@ -184,7 +184,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, | |||
184 | if (address + 4 < regs->spu) | 184 | if (address + 4 < regs->spu) |
185 | goto bad_area; | 185 | goto bad_area; |
186 | } | 186 | } |
187 | #endif | 187 | |
188 | if (expand_stack(vma, address)) | 188 | if (expand_stack(vma, address)) |
189 | goto bad_area; | 189 | goto bad_area; |
190 | /* | 190 | /* |
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 7bc14461a6ac..70a577c89c7c 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig | |||
@@ -17,6 +17,14 @@ config RWSEM_GENERIC_SPINLOCK | |||
17 | config RWSEM_XCHGADD_ALGORITHM | 17 | config RWSEM_XCHGADD_ALGORITHM |
18 | bool | 18 | bool |
19 | 19 | ||
20 | config ARCH_HAS_ILOG2_U32 | ||
21 | bool | ||
22 | default n | ||
23 | |||
24 | config ARCH_HAS_ILOG2_U64 | ||
25 | bool | ||
26 | default n | ||
27 | |||
20 | config GENERIC_HWEIGHT | 28 | config GENERIC_HWEIGHT |
21 | bool | 29 | bool |
22 | default y | 30 | default y |
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig index aa70dde54228..25993c2a8fbb 100644 --- a/arch/m68knommu/Kconfig +++ b/arch/m68knommu/Kconfig | |||
@@ -25,6 +25,14 @@ config RWSEM_XCHGADD_ALGORITHM | |||
25 | bool | 25 | bool |
26 | default n | 26 | default n |
27 | 27 | ||
28 | config ARCH_HAS_ILOG2_U32 | ||
29 | bool | ||
30 | default n | ||
31 | |||
32 | config ARCH_HAS_ILOG2_U64 | ||
33 | bool | ||
34 | default n | ||
35 | |||
28 | config GENERIC_FIND_NEXT_BIT | 36 | config GENERIC_FIND_NEXT_BIT |
29 | bool | 37 | bool |
30 | default y | 38 | default y |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d8af858fe3f5..57af8d8cf46f 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -819,6 +819,14 @@ config RWSEM_GENERIC_SPINLOCK | |||
819 | config RWSEM_XCHGADD_ALGORITHM | 819 | config RWSEM_XCHGADD_ALGORITHM |
820 | bool | 820 | bool |
821 | 821 | ||
822 | config ARCH_HAS_ILOG2_U32 | ||
823 | bool | ||
824 | default n | ||
825 | |||
826 | config ARCH_HAS_ILOG2_U64 | ||
827 | bool | ||
828 | default n | ||
829 | |||
822 | config GENERIC_FIND_NEXT_BIT | 830 | config GENERIC_FIND_NEXT_BIT |
823 | bool | 831 | bool |
824 | default y | 832 | default y |
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c index 1bbefbf43373..37cad5de515c 100644 --- a/arch/mips/kernel/irixelf.c +++ b/arch/mips/kernel/irixelf.c | |||
@@ -1145,7 +1145,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file) | |||
1145 | psinfo.pr_pid = prstatus.pr_pid = current->pid; | 1145 | psinfo.pr_pid = prstatus.pr_pid = current->pid; |
1146 | psinfo.pr_ppid = prstatus.pr_ppid = current->parent->pid; | 1146 | psinfo.pr_ppid = prstatus.pr_ppid = current->parent->pid; |
1147 | psinfo.pr_pgrp = prstatus.pr_pgrp = process_group(current); | 1147 | psinfo.pr_pgrp = prstatus.pr_pgrp = process_group(current); |
1148 | psinfo.pr_sid = prstatus.pr_sid = current->signal->session; | 1148 | psinfo.pr_sid = prstatus.pr_sid = process_session(current); |
1149 | if (current->pid == current->tgid) { | 1149 | if (current->pid == current->tgid) { |
1150 | /* | 1150 | /* |
1151 | * This is the record for the group leader. Add in the | 1151 | * This is the record for the group leader. Add in the |
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index 8c8c8324f775..5a99e3e0c96d 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
@@ -415,7 +415,7 @@ static unsigned int file_poll(struct file *file, poll_table * wait) | |||
415 | int minor; | 415 | int minor; |
416 | unsigned int mask = 0; | 416 | unsigned int mask = 0; |
417 | 417 | ||
418 | minor = iminor(file->f_dentry->d_inode); | 418 | minor = iminor(file->f_path.dentry->d_inode); |
419 | 419 | ||
420 | poll_wait(file, &channel_wqs[minor].rt_queue, wait); | 420 | poll_wait(file, &channel_wqs[minor].rt_queue, wait); |
421 | poll_wait(file, &channel_wqs[minor].lx_queue, wait); | 421 | poll_wait(file, &channel_wqs[minor].lx_queue, wait); |
@@ -437,7 +437,7 @@ static unsigned int file_poll(struct file *file, poll_table * wait) | |||
437 | static ssize_t file_read(struct file *file, char __user * buffer, size_t count, | 437 | static ssize_t file_read(struct file *file, char __user * buffer, size_t count, |
438 | loff_t * ppos) | 438 | loff_t * ppos) |
439 | { | 439 | { |
440 | int minor = iminor(file->f_dentry->d_inode); | 440 | int minor = iminor(file->f_path.dentry->d_inode); |
441 | 441 | ||
442 | /* data available? */ | 442 | /* data available? */ |
443 | if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { | 443 | if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { |
@@ -454,7 +454,7 @@ static ssize_t file_write(struct file *file, const char __user * buffer, | |||
454 | struct rtlx_channel *rt; | 454 | struct rtlx_channel *rt; |
455 | DECLARE_WAITQUEUE(wait, current); | 455 | DECLARE_WAITQUEUE(wait, current); |
456 | 456 | ||
457 | minor = iminor(file->f_dentry->d_inode); | 457 | minor = iminor(file->f_path.dentry->d_inode); |
458 | rt = &rtlx->channel[minor]; | 458 | rt = &rtlx->channel[minor]; |
459 | 459 | ||
460 | /* any space left... */ | 460 | /* any space left... */ |
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c index 93c74fefff76..6c2406a93f2b 100644 --- a/arch/mips/kernel/sysirix.c +++ b/arch/mips/kernel/sysirix.c | |||
@@ -732,7 +732,7 @@ asmlinkage int irix_fstatfs(unsigned int fd, struct irix_statfs __user *buf) | |||
732 | goto out; | 732 | goto out; |
733 | } | 733 | } |
734 | 734 | ||
735 | error = vfs_statfs(file->f_dentry, &kbuf); | 735 | error = vfs_statfs(file->f_path.dentry, &kbuf); |
736 | if (error) | 736 | if (error) |
737 | goto out_f; | 737 | goto out_f; |
738 | 738 | ||
@@ -1041,7 +1041,7 @@ asmlinkage unsigned long irix_mmap32(unsigned long addr, size_t len, int prot, | |||
1041 | unsigned long old_pos; | 1041 | unsigned long old_pos; |
1042 | long max_size = offset + len; | 1042 | long max_size = offset + len; |
1043 | 1043 | ||
1044 | if (max_size > file->f_dentry->d_inode->i_size) { | 1044 | if (max_size > file->f_path.dentry->d_inode->i_size) { |
1045 | old_pos = sys_lseek (fd, max_size - 1, 0); | 1045 | old_pos = sys_lseek (fd, max_size - 1, 0); |
1046 | sys_write (fd, (void __user *) "", 1); | 1046 | sys_write (fd, (void __user *) "", 1); |
1047 | sys_lseek (fd, old_pos, 0); | 1047 | sys_lseek (fd, old_pos, 0); |
@@ -1406,7 +1406,7 @@ asmlinkage int irix_fstatvfs(int fd, struct irix_statvfs __user *buf) | |||
1406 | error = -EBADF; | 1406 | error = -EBADF; |
1407 | goto out; | 1407 | goto out; |
1408 | } | 1408 | } |
1409 | error = vfs_statfs(file->f_dentry, &kbuf); | 1409 | error = vfs_statfs(file->f_path.dentry, &kbuf); |
1410 | if (error) | 1410 | if (error) |
1411 | goto out_f; | 1411 | goto out_f; |
1412 | 1412 | ||
@@ -1526,7 +1526,7 @@ asmlinkage int irix_mmap64(struct pt_regs *regs) | |||
1526 | unsigned long old_pos; | 1526 | unsigned long old_pos; |
1527 | long max_size = off2 + len; | 1527 | long max_size = off2 + len; |
1528 | 1528 | ||
1529 | if (max_size > file->f_dentry->d_inode->i_size) { | 1529 | if (max_size > file->f_path.dentry->d_inode->i_size) { |
1530 | old_pos = sys_lseek (fd, max_size - 1, 0); | 1530 | old_pos = sys_lseek (fd, max_size - 1, 0); |
1531 | sys_write (fd, (void __user *) "", 1); | 1531 | sys_write (fd, (void __user *) "", 1); |
1532 | sys_lseek (fd, old_pos, 0); | 1532 | sys_lseek (fd, old_pos, 0); |
@@ -1658,7 +1658,7 @@ asmlinkage int irix_fstatvfs64(int fd, struct irix_statvfs __user *buf) | |||
1658 | error = -EBADF; | 1658 | error = -EBADF; |
1659 | goto out; | 1659 | goto out; |
1660 | } | 1660 | } |
1661 | error = vfs_statfs(file->f_dentry, &kbuf); | 1661 | error = vfs_statfs(file->f_path.dentry, &kbuf); |
1662 | if (error) | 1662 | if (error) |
1663 | goto out_f; | 1663 | goto out_f; |
1664 | 1664 | ||
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 51ddd2166898..666bef484dcb 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -1179,7 +1179,7 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer, | |||
1179 | size_t ret = count; | 1179 | size_t ret = count; |
1180 | struct vpe *v; | 1180 | struct vpe *v; |
1181 | 1181 | ||
1182 | minor = iminor(file->f_dentry->d_inode); | 1182 | minor = iminor(file->f_path.dentry->d_inode); |
1183 | if ((v = get_vpe(minor)) == NULL) | 1183 | if ((v = get_vpe(minor)) == NULL) |
1184 | return -ENODEV; | 1184 | return -ENODEV; |
1185 | 1185 | ||
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c index 6dd7ae1b7c25..da35d4555491 100644 --- a/arch/mips/lasat/sysctl.c +++ b/arch/mips/lasat/sysctl.c | |||
@@ -286,11 +286,11 @@ int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp, | |||
286 | mutex_unlock(&lasat_info_mutex); | 286 | mutex_unlock(&lasat_info_mutex); |
287 | return r; | 287 | return r; |
288 | } | 288 | } |
289 | if (filp && filp->f_dentry) | 289 | if (filp && filp->f_path.dentry) |
290 | { | 290 | { |
291 | if (!strcmp(filp->f_dentry->d_name.name, "prid")) | 291 | if (!strcmp(filp->f_path.dentry->d_name.name, "prid")) |
292 | lasat_board_info.li_eeprom_info.prid = lasat_board_info.li_prid; | 292 | lasat_board_info.li_eeprom_info.prid = lasat_board_info.li_prid; |
293 | if (!strcmp(filp->f_dentry->d_name.name, "debugaccess")) | 293 | if (!strcmp(filp->f_path.dentry->d_name.name, "debugaccess")) |
294 | lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess; | 294 | lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess; |
295 | } | 295 | } |
296 | lasat_write_eeprom_info(); | 296 | lasat_write_eeprom_info(); |
diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c index cea7d0ea36e4..fc2c96f0a1fd 100644 --- a/arch/mips/mm/ioremap.c +++ b/arch/mips/mm/ioremap.c | |||
@@ -6,98 +6,13 @@ | |||
6 | * (C) Copyright 1995 1996 Linus Torvalds | 6 | * (C) Copyright 1995 1996 Linus Torvalds |
7 | * (C) Copyright 2001, 2002 Ralf Baechle | 7 | * (C) Copyright 2001, 2002 Ralf Baechle |
8 | */ | 8 | */ |
9 | #include <linux/mm.h> | ||
9 | #include <linux/module.h> | 10 | #include <linux/module.h> |
10 | #include <asm/addrspace.h> | 11 | #include <asm/addrspace.h> |
11 | #include <asm/byteorder.h> | 12 | #include <asm/byteorder.h> |
12 | 13 | ||
13 | #include <linux/vmalloc.h> | 14 | #include <linux/vmalloc.h> |
14 | #include <asm/cacheflush.h> | 15 | #include <linux/io.h> |
15 | #include <asm/io.h> | ||
16 | #include <asm/tlbflush.h> | ||
17 | |||
18 | static inline void remap_area_pte(pte_t * pte, unsigned long address, | ||
19 | phys_t size, phys_t phys_addr, unsigned long flags) | ||
20 | { | ||
21 | phys_t end; | ||
22 | unsigned long pfn; | ||
23 | pgprot_t pgprot = __pgprot(_PAGE_GLOBAL | _PAGE_PRESENT | __READABLE | ||
24 | | __WRITEABLE | flags); | ||
25 | |||
26 | address &= ~PMD_MASK; | ||
27 | end = address + size; | ||
28 | if (end > PMD_SIZE) | ||
29 | end = PMD_SIZE; | ||
30 | if (address >= end) | ||
31 | BUG(); | ||
32 | pfn = phys_addr >> PAGE_SHIFT; | ||
33 | do { | ||
34 | if (!pte_none(*pte)) { | ||
35 | printk("remap_area_pte: page already exists\n"); | ||
36 | BUG(); | ||
37 | } | ||
38 | set_pte(pte, pfn_pte(pfn, pgprot)); | ||
39 | address += PAGE_SIZE; | ||
40 | pfn++; | ||
41 | pte++; | ||
42 | } while (address && (address < end)); | ||
43 | } | ||
44 | |||
45 | static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, | ||
46 | phys_t size, phys_t phys_addr, unsigned long flags) | ||
47 | { | ||
48 | phys_t end; | ||
49 | |||
50 | address &= ~PGDIR_MASK; | ||
51 | end = address + size; | ||
52 | if (end > PGDIR_SIZE) | ||
53 | end = PGDIR_SIZE; | ||
54 | phys_addr -= address; | ||
55 | if (address >= end) | ||
56 | BUG(); | ||
57 | do { | ||
58 | pte_t * pte = pte_alloc_kernel(pmd, address); | ||
59 | if (!pte) | ||
60 | return -ENOMEM; | ||
61 | remap_area_pte(pte, address, end - address, address + phys_addr, flags); | ||
62 | address = (address + PMD_SIZE) & PMD_MASK; | ||
63 | pmd++; | ||
64 | } while (address && (address < end)); | ||
65 | return 0; | ||
66 | } | ||
67 | |||
68 | static int remap_area_pages(unsigned long address, phys_t phys_addr, | ||
69 | phys_t size, unsigned long flags) | ||
70 | { | ||
71 | int error; | ||
72 | pgd_t * dir; | ||
73 | unsigned long end = address + size; | ||
74 | |||
75 | phys_addr -= address; | ||
76 | dir = pgd_offset(&init_mm, address); | ||
77 | flush_cache_all(); | ||
78 | if (address >= end) | ||
79 | BUG(); | ||
80 | do { | ||
81 | pud_t *pud; | ||
82 | pmd_t *pmd; | ||
83 | |||
84 | error = -ENOMEM; | ||
85 | pud = pud_alloc(&init_mm, dir, address); | ||
86 | if (!pud) | ||
87 | break; | ||
88 | pmd = pmd_alloc(&init_mm, pud, address); | ||
89 | if (!pmd) | ||
90 | break; | ||
91 | if (remap_area_pmd(pmd, address, end - address, | ||
92 | phys_addr + address, flags)) | ||
93 | break; | ||
94 | error = 0; | ||
95 | address = (address + PGDIR_SIZE) & PGDIR_MASK; | ||
96 | dir++; | ||
97 | } while (address && (address < end)); | ||
98 | flush_tlb_all(); | ||
99 | return error; | ||
100 | } | ||
101 | 16 | ||
102 | /* | 17 | /* |
103 | * Generic mapping function (not visible outside): | 18 | * Generic mapping function (not visible outside): |
@@ -121,6 +36,7 @@ void __iomem * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) | |||
121 | unsigned long offset; | 36 | unsigned long offset; |
122 | phys_t last_addr; | 37 | phys_t last_addr; |
123 | void * addr; | 38 | void * addr; |
39 | pgprot_t pgprot; | ||
124 | 40 | ||
125 | phys_addr = fixup_bigphys_addr(phys_addr, size); | 41 | phys_addr = fixup_bigphys_addr(phys_addr, size); |
126 | 42 | ||
@@ -152,6 +68,9 @@ void __iomem * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) | |||
152 | return NULL; | 68 | return NULL; |
153 | } | 69 | } |
154 | 70 | ||
71 | pgprot = __pgprot(_PAGE_GLOBAL | _PAGE_PRESENT | __READABLE | ||
72 | | __WRITEABLE | flags); | ||
73 | |||
155 | /* | 74 | /* |
156 | * Mappings have to be page-aligned | 75 | * Mappings have to be page-aligned |
157 | */ | 76 | */ |
@@ -166,7 +85,8 @@ void __iomem * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) | |||
166 | if (!area) | 85 | if (!area) |
167 | return NULL; | 86 | return NULL; |
168 | addr = area->addr; | 87 | addr = area->addr; |
169 | if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { | 88 | if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size, |
89 | phys_addr, pgprot)) { | ||
170 | vunmap(addr); | 90 | vunmap(addr); |
171 | return NULL; | 91 | return NULL; |
172 | } | 92 | } |
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index d2101237442e..0f9ff618c6d7 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -25,6 +25,14 @@ config RWSEM_GENERIC_SPINLOCK | |||
25 | config RWSEM_XCHGADD_ALGORITHM | 25 | config RWSEM_XCHGADD_ALGORITHM |
26 | bool | 26 | bool |
27 | 27 | ||
28 | config ARCH_HAS_ILOG2_U32 | ||
29 | bool | ||
30 | default n | ||
31 | |||
32 | config ARCH_HAS_ILOG2_U64 | ||
33 | bool | ||
34 | default n | ||
35 | |||
28 | config GENERIC_FIND_NEXT_BIT | 36 | config GENERIC_FIND_NEXT_BIT |
29 | bool | 37 | bool |
30 | default y | 38 | default y |
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index 2e2dc4f2c853..d88309209f56 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c | |||
@@ -237,7 +237,7 @@ asmlinkage long hpux_fstatfs(unsigned int fd, struct hpux_statfs __user * buf) | |||
237 | file = fget(fd); | 237 | file = fget(fd); |
238 | if (!file) | 238 | if (!file) |
239 | goto out; | 239 | goto out; |
240 | error = vfs_statfs_hpux(file->f_dentry, &tmp); | 240 | error = vfs_statfs_hpux(file->f_path.dentry, &tmp); |
241 | if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) | 241 | if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) |
242 | error = -EFAULT; | 242 | error = -EFAULT; |
243 | fput(file); | 243 | fput(file); |
diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c index 47a1d2ac9419..44b42c7f639d 100644 --- a/arch/parisc/mm/ioremap.c +++ b/arch/parisc/mm/ioremap.c | |||
@@ -9,110 +9,8 @@ | |||
9 | #include <linux/vmalloc.h> | 9 | #include <linux/vmalloc.h> |
10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <asm/io.h> | 12 | #include <linux/io.h> |
13 | #include <asm/pgalloc.h> | 13 | #include <asm/pgalloc.h> |
14 | #include <asm/tlbflush.h> | ||
15 | #include <asm/cacheflush.h> | ||
16 | |||
17 | static inline void | ||
18 | remap_area_pte(pte_t *pte, unsigned long address, unsigned long size, | ||
19 | unsigned long phys_addr, unsigned long flags) | ||
20 | { | ||
21 | unsigned long end, pfn; | ||
22 | pgprot_t pgprot = __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | | ||
23 | _PAGE_ACCESSED | flags); | ||
24 | |||
25 | address &= ~PMD_MASK; | ||
26 | |||
27 | end = address + size; | ||
28 | if (end > PMD_SIZE) | ||
29 | end = PMD_SIZE; | ||
30 | |||
31 | BUG_ON(address >= end); | ||
32 | |||
33 | pfn = phys_addr >> PAGE_SHIFT; | ||
34 | do { | ||
35 | BUG_ON(!pte_none(*pte)); | ||
36 | |||
37 | set_pte(pte, pfn_pte(pfn, pgprot)); | ||
38 | |||
39 | address += PAGE_SIZE; | ||
40 | pfn++; | ||
41 | pte++; | ||
42 | } while (address && (address < end)); | ||
43 | } | ||
44 | |||
45 | static inline int | ||
46 | remap_area_pmd(pmd_t *pmd, unsigned long address, unsigned long size, | ||
47 | unsigned long phys_addr, unsigned long flags) | ||
48 | { | ||
49 | unsigned long end; | ||
50 | |||
51 | address &= ~PGDIR_MASK; | ||
52 | |||
53 | end = address + size; | ||
54 | if (end > PGDIR_SIZE) | ||
55 | end = PGDIR_SIZE; | ||
56 | |||
57 | BUG_ON(address >= end); | ||
58 | |||
59 | phys_addr -= address; | ||
60 | do { | ||
61 | pte_t *pte = pte_alloc_kernel(pmd, address); | ||
62 | if (!pte) | ||
63 | return -ENOMEM; | ||
64 | |||
65 | remap_area_pte(pte, address, end - address, | ||
66 | address + phys_addr, flags); | ||
67 | |||
68 | address = (address + PMD_SIZE) & PMD_MASK; | ||
69 | pmd++; | ||
70 | } while (address && (address < end)); | ||
71 | |||
72 | return 0; | ||
73 | } | ||
74 | |||
75 | static int | ||
76 | remap_area_pages(unsigned long address, unsigned long phys_addr, | ||
77 | unsigned long size, unsigned long flags) | ||
78 | { | ||
79 | pgd_t *dir; | ||
80 | int error = 0; | ||
81 | unsigned long end = address + size; | ||
82 | |||
83 | BUG_ON(address >= end); | ||
84 | |||
85 | phys_addr -= address; | ||
86 | dir = pgd_offset_k(address); | ||
87 | |||
88 | flush_cache_all(); | ||
89 | |||
90 | do { | ||
91 | pud_t *pud; | ||
92 | pmd_t *pmd; | ||
93 | |||
94 | error = -ENOMEM; | ||
95 | pud = pud_alloc(&init_mm, dir, address); | ||
96 | if (!pud) | ||
97 | break; | ||
98 | |||
99 | pmd = pmd_alloc(&init_mm, pud, address); | ||
100 | if (!pmd) | ||
101 | break; | ||
102 | |||
103 | if (remap_area_pmd(pmd, address, end - address, | ||
104 | phys_addr + address, flags)) | ||
105 | break; | ||
106 | |||
107 | error = 0; | ||
108 | address = (address + PGDIR_SIZE) & PGDIR_MASK; | ||
109 | dir++; | ||
110 | } while (address && (address < end)); | ||
111 | |||
112 | flush_tlb_all(); | ||
113 | |||
114 | return error; | ||
115 | } | ||
116 | 14 | ||
117 | /* | 15 | /* |
118 | * Generic mapping function (not visible outside): | 16 | * Generic mapping function (not visible outside): |
@@ -131,6 +29,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l | |||
131 | void *addr; | 29 | void *addr; |
132 | struct vm_struct *area; | 30 | struct vm_struct *area; |
133 | unsigned long offset, last_addr; | 31 | unsigned long offset, last_addr; |
32 | pgprot_t pgprot; | ||
134 | 33 | ||
135 | #ifdef CONFIG_EISA | 34 | #ifdef CONFIG_EISA |
136 | unsigned long end = phys_addr + size - 1; | 35 | unsigned long end = phys_addr + size - 1; |
@@ -164,6 +63,9 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l | |||
164 | } | 63 | } |
165 | } | 64 | } |
166 | 65 | ||
66 | pgprot = __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | | ||
67 | _PAGE_ACCESSED | flags); | ||
68 | |||
167 | /* | 69 | /* |
168 | * Mappings have to be page-aligned | 70 | * Mappings have to be page-aligned |
169 | */ | 71 | */ |
@@ -179,7 +81,8 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l | |||
179 | return NULL; | 81 | return NULL; |
180 | 82 | ||
181 | addr = area->addr; | 83 | addr = area->addr; |
182 | if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { | 84 | if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size, |
85 | phys_addr, pgprot)) { | ||
183 | vfree(addr); | 86 | vfree(addr); |
184 | return NULL; | 87 | return NULL; |
185 | } | 88 | } |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 291c95ac4b31..56c3c4065eb0 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -41,6 +41,14 @@ config RWSEM_XCHGADD_ALGORITHM | |||
41 | bool | 41 | bool |
42 | default y | 42 | default y |
43 | 43 | ||
44 | config ARCH_HAS_ILOG2_U32 | ||
45 | bool | ||
46 | default y | ||
47 | |||
48 | config ARCH_HAS_ILOG2_U64 | ||
49 | bool | ||
50 | default y if 64BIT | ||
51 | |||
44 | config GENERIC_HWEIGHT | 52 | config GENERIC_HWEIGHT |
45 | bool | 53 | bool |
46 | default y | 54 | default y |
diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c index f598cb519539..dd7001cacf75 100644 --- a/arch/powerpc/kernel/proc_ppc64.c +++ b/arch/powerpc/kernel/proc_ppc64.c | |||
@@ -83,7 +83,7 @@ __initcall(proc_ppc64_init); | |||
83 | static loff_t page_map_seek( struct file *file, loff_t off, int whence) | 83 | static loff_t page_map_seek( struct file *file, loff_t off, int whence) |
84 | { | 84 | { |
85 | loff_t new; | 85 | loff_t new; |
86 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 86 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
87 | 87 | ||
88 | switch(whence) { | 88 | switch(whence) { |
89 | case 0: | 89 | case 0: |
@@ -106,13 +106,13 @@ static loff_t page_map_seek( struct file *file, loff_t off, int whence) | |||
106 | static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, | 106 | static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, |
107 | loff_t *ppos) | 107 | loff_t *ppos) |
108 | { | 108 | { |
109 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 109 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
110 | return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size); | 110 | return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size); |
111 | } | 111 | } |
112 | 112 | ||
113 | static int page_map_mmap( struct file *file, struct vm_area_struct *vma ) | 113 | static int page_map_mmap( struct file *file, struct vm_area_struct *vma ) |
114 | { | 114 | { |
115 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 115 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
116 | 116 | ||
117 | if ((vma->vm_end - vma->vm_start) > dp->size) | 117 | if ((vma->vm_end - vma->vm_start) > dp->size) |
118 | return -EINVAL; | 118 | return -EINVAL; |
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 7d0f13fecc0e..0c4fcd34bfe5 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c | |||
@@ -193,7 +193,7 @@ static void free_flash_list(struct flash_block_list *f) | |||
193 | 193 | ||
194 | static int rtas_flash_release(struct inode *inode, struct file *file) | 194 | static int rtas_flash_release(struct inode *inode, struct file *file) |
195 | { | 195 | { |
196 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 196 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
197 | struct rtas_update_flash_t *uf; | 197 | struct rtas_update_flash_t *uf; |
198 | 198 | ||
199 | uf = (struct rtas_update_flash_t *) dp->data; | 199 | uf = (struct rtas_update_flash_t *) dp->data; |
@@ -255,7 +255,7 @@ static void get_flash_status_msg(int status, char *buf) | |||
255 | static ssize_t rtas_flash_read(struct file *file, char __user *buf, | 255 | static ssize_t rtas_flash_read(struct file *file, char __user *buf, |
256 | size_t count, loff_t *ppos) | 256 | size_t count, loff_t *ppos) |
257 | { | 257 | { |
258 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 258 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
259 | struct rtas_update_flash_t *uf; | 259 | struct rtas_update_flash_t *uf; |
260 | char msg[RTAS_MSG_MAXLEN]; | 260 | char msg[RTAS_MSG_MAXLEN]; |
261 | int msglen; | 261 | int msglen; |
@@ -299,7 +299,7 @@ void rtas_block_ctor(void *ptr, struct kmem_cache *cache, unsigned long flags) | |||
299 | static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, | 299 | static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, |
300 | size_t count, loff_t *off) | 300 | size_t count, loff_t *off) |
301 | { | 301 | { |
302 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 302 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
303 | struct rtas_update_flash_t *uf; | 303 | struct rtas_update_flash_t *uf; |
304 | char *p; | 304 | char *p; |
305 | int next_free; | 305 | int next_free; |
@@ -391,7 +391,7 @@ static void manage_flash(struct rtas_manage_flash_t *args_buf) | |||
391 | static ssize_t manage_flash_read(struct file *file, char __user *buf, | 391 | static ssize_t manage_flash_read(struct file *file, char __user *buf, |
392 | size_t count, loff_t *ppos) | 392 | size_t count, loff_t *ppos) |
393 | { | 393 | { |
394 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 394 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
395 | struct rtas_manage_flash_t *args_buf; | 395 | struct rtas_manage_flash_t *args_buf; |
396 | char msg[RTAS_MSG_MAXLEN]; | 396 | char msg[RTAS_MSG_MAXLEN]; |
397 | int msglen; | 397 | int msglen; |
@@ -421,7 +421,7 @@ static ssize_t manage_flash_read(struct file *file, char __user *buf, | |||
421 | static ssize_t manage_flash_write(struct file *file, const char __user *buf, | 421 | static ssize_t manage_flash_write(struct file *file, const char __user *buf, |
422 | size_t count, loff_t *off) | 422 | size_t count, loff_t *off) |
423 | { | 423 | { |
424 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 424 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
425 | struct rtas_manage_flash_t *args_buf; | 425 | struct rtas_manage_flash_t *args_buf; |
426 | const char reject_str[] = "0"; | 426 | const char reject_str[] = "0"; |
427 | const char commit_str[] = "1"; | 427 | const char commit_str[] = "1"; |
@@ -492,7 +492,7 @@ static int get_validate_flash_msg(struct rtas_validate_flash_t *args_buf, | |||
492 | static ssize_t validate_flash_read(struct file *file, char __user *buf, | 492 | static ssize_t validate_flash_read(struct file *file, char __user *buf, |
493 | size_t count, loff_t *ppos) | 493 | size_t count, loff_t *ppos) |
494 | { | 494 | { |
495 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 495 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
496 | struct rtas_validate_flash_t *args_buf; | 496 | struct rtas_validate_flash_t *args_buf; |
497 | char msg[RTAS_MSG_MAXLEN]; | 497 | char msg[RTAS_MSG_MAXLEN]; |
498 | int msglen; | 498 | int msglen; |
@@ -520,7 +520,7 @@ static ssize_t validate_flash_read(struct file *file, char __user *buf, | |||
520 | static ssize_t validate_flash_write(struct file *file, const char __user *buf, | 520 | static ssize_t validate_flash_write(struct file *file, const char __user *buf, |
521 | size_t count, loff_t *off) | 521 | size_t count, loff_t *off) |
522 | { | 522 | { |
523 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 523 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
524 | struct rtas_validate_flash_t *args_buf; | 524 | struct rtas_validate_flash_t *args_buf; |
525 | int rc; | 525 | int rc; |
526 | 526 | ||
@@ -569,7 +569,7 @@ done: | |||
569 | 569 | ||
570 | static int validate_flash_release(struct inode *inode, struct file *file) | 570 | static int validate_flash_release(struct inode *inode, struct file *file) |
571 | { | 571 | { |
572 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 572 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
573 | struct rtas_validate_flash_t *args_buf; | 573 | struct rtas_validate_flash_t *args_buf; |
574 | 574 | ||
575 | args_buf = (struct rtas_validate_flash_t *) dp->data; | 575 | args_buf = (struct rtas_validate_flash_t *) dp->data; |
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index e3af9112c026..738b9244382f 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -205,7 +205,7 @@ static int spufs_dir_close(struct inode *inode, struct file *file) | |||
205 | struct dentry *dir; | 205 | struct dentry *dir; |
206 | int ret; | 206 | int ret; |
207 | 207 | ||
208 | dir = file->f_dentry; | 208 | dir = file->f_path.dentry; |
209 | parent = dir->d_parent->d_inode; | 209 | parent = dir->d_parent->d_inode; |
210 | ctx = SPUFS_I(dir->d_inode)->i_ctx; | 210 | ctx = SPUFS_I(dir->d_inode)->i_ctx; |
211 | 211 | ||
@@ -363,7 +363,7 @@ static int spufs_gang_close(struct inode *inode, struct file *file) | |||
363 | struct dentry *dir; | 363 | struct dentry *dir; |
364 | int ret; | 364 | int ret; |
365 | 365 | ||
366 | dir = file->f_dentry; | 366 | dir = file->f_path.dentry; |
367 | parent = dir->d_parent->d_inode; | 367 | parent = dir->d_parent->d_inode; |
368 | 368 | ||
369 | ret = spufs_rmgang(parent, dir); | 369 | ret = spufs_rmgang(parent, dir); |
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c index a6d1ae4dc2a3..8e37bdf4dfda 100644 --- a/arch/powerpc/platforms/cell/spufs/syscalls.c +++ b/arch/powerpc/platforms/cell/spufs/syscalls.c | |||
@@ -46,7 +46,7 @@ static long do_spu_run(struct file *filp, | |||
46 | if (filp->f_op != &spufs_context_fops) | 46 | if (filp->f_op != &spufs_context_fops) |
47 | goto out; | 47 | goto out; |
48 | 48 | ||
49 | i = SPUFS_I(filp->f_dentry->d_inode); | 49 | i = SPUFS_I(filp->f_path.dentry->d_inode); |
50 | ret = spufs_run_spu(filp, i->i_ctx, &npc, &status); | 50 | ret = spufs_run_spu(filp, i->i_ctx, &npc, &status); |
51 | 51 | ||
52 | if (put_user(npc, unpc)) | 52 | if (put_user(npc, unpc)) |
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c index b5737d68d6c4..cff15ae24f6b 100644 --- a/arch/powerpc/platforms/iseries/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c | |||
@@ -1178,7 +1178,7 @@ static ssize_t proc_mf_change_vmlinux(struct file *file, | |||
1178 | const char __user *buf, | 1178 | const char __user *buf, |
1179 | size_t count, loff_t *ppos) | 1179 | size_t count, loff_t *ppos) |
1180 | { | 1180 | { |
1181 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 1181 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
1182 | ssize_t rc; | 1182 | ssize_t rc; |
1183 | dma_addr_t dma_addr; | 1183 | dma_addr_t dma_addr; |
1184 | char *page; | 1184 | char *page; |
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c index 446e17d162a5..80181c4c49eb 100644 --- a/arch/powerpc/platforms/pseries/hvCall_inst.c +++ b/arch/powerpc/platforms/pseries/hvCall_inst.c | |||
@@ -85,7 +85,7 @@ static int hcall_inst_seq_open(struct inode *inode, struct file *file) | |||
85 | 85 | ||
86 | rc = seq_open(file, &hcall_inst_seq_ops); | 86 | rc = seq_open(file, &hcall_inst_seq_ops); |
87 | seq = file->private_data; | 87 | seq = file->private_data; |
88 | seq->private = file->f_dentry->d_inode->i_private; | 88 | seq->private = file->f_path.dentry->d_inode->i_private; |
89 | 89 | ||
90 | return rc; | 90 | return rc; |
91 | } | 91 | } |
diff --git a/arch/powerpc/platforms/pseries/scanlog.c b/arch/powerpc/platforms/pseries/scanlog.c index 77a5bb1d9c30..45368a57d7dd 100644 --- a/arch/powerpc/platforms/pseries/scanlog.c +++ b/arch/powerpc/platforms/pseries/scanlog.c | |||
@@ -47,7 +47,7 @@ static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */ | |||
47 | static ssize_t scanlog_read(struct file *file, char __user *buf, | 47 | static ssize_t scanlog_read(struct file *file, char __user *buf, |
48 | size_t count, loff_t *ppos) | 48 | size_t count, loff_t *ppos) |
49 | { | 49 | { |
50 | struct inode * inode = file->f_dentry->d_inode; | 50 | struct inode * inode = file->f_path.dentry->d_inode; |
51 | struct proc_dir_entry *dp; | 51 | struct proc_dir_entry *dp; |
52 | unsigned int *data; | 52 | unsigned int *data; |
53 | int status; | 53 | int status; |
diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c index 959d31c26cbb..c71ef3c2e7bf 100644 --- a/arch/ppc/8xx_io/cs4218_tdm.c +++ b/arch/ppc/8xx_io/cs4218_tdm.c | |||
@@ -2165,7 +2165,7 @@ static int sq_release(struct inode *inode, struct file *file) | |||
2165 | int rc = 0; | 2165 | int rc = 0; |
2166 | 2166 | ||
2167 | if (sq.busy) | 2167 | if (sq.busy) |
2168 | rc = sq_fsync(file, file->f_dentry); | 2168 | rc = sq_fsync(file, file->f_path.dentry); |
2169 | sound.soft = sound.dsp; | 2169 | sound.soft = sound.dsp; |
2170 | sound.hard = sound.dsp; | 2170 | sound.hard = sound.dsp; |
2171 | sound_silence(); | 2171 | sound_silence(); |
@@ -2218,25 +2218,25 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd, | |||
2218 | return 0; | 2218 | return 0; |
2219 | case SNDCTL_DSP_POST: | 2219 | case SNDCTL_DSP_POST: |
2220 | case SNDCTL_DSP_SYNC: | 2220 | case SNDCTL_DSP_SYNC: |
2221 | return sq_fsync(file, file->f_dentry); | 2221 | return sq_fsync(file, file->f_path.dentry); |
2222 | 2222 | ||
2223 | /* ++TeSche: before changing any of these it's | 2223 | /* ++TeSche: before changing any of these it's |
2224 | * probably wise to wait until sound playing has | 2224 | * probably wise to wait until sound playing has |
2225 | * settled down. */ | 2225 | * settled down. */ |
2226 | case SNDCTL_DSP_SPEED: | 2226 | case SNDCTL_DSP_SPEED: |
2227 | sq_fsync(file, file->f_dentry); | 2227 | sq_fsync(file, file->f_path.dentry); |
2228 | IOCTL_IN(arg, data); | 2228 | IOCTL_IN(arg, data); |
2229 | return IOCTL_OUT(arg, sound_set_speed(data)); | 2229 | return IOCTL_OUT(arg, sound_set_speed(data)); |
2230 | case SNDCTL_DSP_STEREO: | 2230 | case SNDCTL_DSP_STEREO: |
2231 | sq_fsync(file, file->f_dentry); | 2231 | sq_fsync(file, file->f_path.dentry); |
2232 | IOCTL_IN(arg, data); | 2232 | IOCTL_IN(arg, data); |
2233 | return IOCTL_OUT(arg, sound_set_stereo(data)); | 2233 | return IOCTL_OUT(arg, sound_set_stereo(data)); |
2234 | case SOUND_PCM_WRITE_CHANNELS: | 2234 | case SOUND_PCM_WRITE_CHANNELS: |
2235 | sq_fsync(file, file->f_dentry); | 2235 | sq_fsync(file, file->f_path.dentry); |
2236 | IOCTL_IN(arg, data); | 2236 | IOCTL_IN(arg, data); |
2237 | return IOCTL_OUT(arg, sound_set_stereo(data-1)+1); | 2237 | return IOCTL_OUT(arg, sound_set_stereo(data-1)+1); |
2238 | case SNDCTL_DSP_SETFMT: | 2238 | case SNDCTL_DSP_SETFMT: |
2239 | sq_fsync(file, file->f_dentry); | 2239 | sq_fsync(file, file->f_path.dentry); |
2240 | IOCTL_IN(arg, data); | 2240 | IOCTL_IN(arg, data); |
2241 | return IOCTL_OUT(arg, sound_set_format(data)); | 2241 | return IOCTL_OUT(arg, sound_set_format(data)); |
2242 | case SNDCTL_DSP_GETFMTS: | 2242 | case SNDCTL_DSP_GETFMTS: |
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index edf71a4ecc95..692b5ba53209 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig | |||
@@ -19,6 +19,14 @@ config RWSEM_XCHGADD_ALGORITHM | |||
19 | bool | 19 | bool |
20 | default y | 20 | default y |
21 | 21 | ||
22 | config ARCH_HAS_ILOG2_U32 | ||
23 | bool | ||
24 | default y | ||
25 | |||
26 | config ARCH_HAS_ILOG2_U64 | ||
27 | bool | ||
28 | default n | ||
29 | |||
22 | config GENERIC_HWEIGHT | 30 | config GENERIC_HWEIGHT |
23 | bool | 31 | bool |
24 | default y | 32 | default y |
@@ -52,6 +60,11 @@ config ARCH_MAY_HAVE_PC_FDC | |||
52 | bool | 60 | bool |
53 | default y | 61 | default y |
54 | 62 | ||
63 | config GENERIC_BUG | ||
64 | bool | ||
65 | default y | ||
66 | depends on BUG | ||
67 | |||
55 | source "init/Kconfig" | 68 | source "init/Kconfig" |
56 | 69 | ||
57 | menu "Processor" | 70 | menu "Processor" |
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c index 2f835b9e95e4..810f7aa72e92 100644 --- a/arch/ppc/kernel/traps.c +++ b/arch/ppc/kernel/traps.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/prctl.h> | 30 | #include <linux/prctl.h> |
31 | #include <linux/bug.h> | ||
31 | 32 | ||
32 | #include <asm/pgtable.h> | 33 | #include <asm/pgtable.h> |
33 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
@@ -559,64 +560,9 @@ static void emulate_single_step(struct pt_regs *regs) | |||
559 | } | 560 | } |
560 | } | 561 | } |
561 | 562 | ||
562 | /* | 563 | int is_valid_bugaddr(unsigned long addr) |
563 | * Look through the list of trap instructions that are used for BUG(), | ||
564 | * BUG_ON() and WARN_ON() and see if we hit one. At this point we know | ||
565 | * that the exception was caused by a trap instruction of some kind. | ||
566 | * Returns 1 if we should continue (i.e. it was a WARN_ON) or 0 | ||
567 | * otherwise. | ||
568 | */ | ||
569 | extern struct bug_entry __start___bug_table[], __stop___bug_table[]; | ||
570 | |||
571 | #ifndef CONFIG_MODULES | ||
572 | #define module_find_bug(x) NULL | ||
573 | #endif | ||
574 | |||
575 | struct bug_entry *find_bug(unsigned long bugaddr) | ||
576 | { | ||
577 | struct bug_entry *bug; | ||
578 | |||
579 | for (bug = __start___bug_table; bug < __stop___bug_table; ++bug) | ||
580 | if (bugaddr == bug->bug_addr) | ||
581 | return bug; | ||
582 | return module_find_bug(bugaddr); | ||
583 | } | ||
584 | |||
585 | int check_bug_trap(struct pt_regs *regs) | ||
586 | { | 564 | { |
587 | struct bug_entry *bug; | 565 | return addr >= PAGE_OFFSET; |
588 | unsigned long addr; | ||
589 | |||
590 | if (regs->msr & MSR_PR) | ||
591 | return 0; /* not in kernel */ | ||
592 | addr = regs->nip; /* address of trap instruction */ | ||
593 | if (addr < PAGE_OFFSET) | ||
594 | return 0; | ||
595 | bug = find_bug(regs->nip); | ||
596 | if (bug == NULL) | ||
597 | return 0; | ||
598 | if (bug->line & BUG_WARNING_TRAP) { | ||
599 | /* this is a WARN_ON rather than BUG/BUG_ON */ | ||
600 | #ifdef CONFIG_XMON | ||
601 | xmon_printf(KERN_ERR "Badness in %s at %s:%ld\n", | ||
602 | bug->function, bug->file, | ||
603 | bug->line & ~BUG_WARNING_TRAP); | ||
604 | #endif /* CONFIG_XMON */ | ||
605 | printk(KERN_ERR "Badness in %s at %s:%ld\n", | ||
606 | bug->function, bug->file, | ||
607 | bug->line & ~BUG_WARNING_TRAP); | ||
608 | dump_stack(); | ||
609 | return 1; | ||
610 | } | ||
611 | #ifdef CONFIG_XMON | ||
612 | xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%ld!\n", | ||
613 | bug->function, bug->file, bug->line); | ||
614 | xmon(regs); | ||
615 | #endif /* CONFIG_XMON */ | ||
616 | printk(KERN_CRIT "kernel BUG in %s at %s:%ld!\n", | ||
617 | bug->function, bug->file, bug->line); | ||
618 | |||
619 | return 0; | ||
620 | } | 566 | } |
621 | 567 | ||
622 | void program_check_exception(struct pt_regs *regs) | 568 | void program_check_exception(struct pt_regs *regs) |
@@ -671,7 +617,9 @@ void program_check_exception(struct pt_regs *regs) | |||
671 | /* trap exception */ | 617 | /* trap exception */ |
672 | if (debugger_bpt(regs)) | 618 | if (debugger_bpt(regs)) |
673 | return; | 619 | return; |
674 | if (check_bug_trap(regs)) { | 620 | |
621 | if (!(regs->msr & MSR_PR) && /* not user-mode */ | ||
622 | report_bug(regs->nip) == BUG_TRAP_TYPE_WARN) { | ||
675 | regs->nip += 4; | 623 | regs->nip += 4; |
676 | return; | 624 | return; |
677 | } | 625 | } |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 04f5a0230298..ff690564edbd 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -22,6 +22,14 @@ config RWSEM_XCHGADD_ALGORITHM | |||
22 | bool | 22 | bool |
23 | default y | 23 | default y |
24 | 24 | ||
25 | config ARCH_HAS_ILOG2_U32 | ||
26 | bool | ||
27 | default n | ||
28 | |||
29 | config ARCH_HAS_ILOG2_U64 | ||
30 | bool | ||
31 | default n | ||
32 | |||
25 | config GENERIC_HWEIGHT | 33 | config GENERIC_HWEIGHT |
26 | bool | 34 | bool |
27 | default y | 35 | default y |
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index cd702ae45d6d..b6716c4b9934 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
@@ -109,7 +109,7 @@ static void hypfs_drop_inode(struct inode *inode) | |||
109 | 109 | ||
110 | static int hypfs_open(struct inode *inode, struct file *filp) | 110 | static int hypfs_open(struct inode *inode, struct file *filp) |
111 | { | 111 | { |
112 | char *data = filp->f_dentry->d_inode->i_private; | 112 | char *data = filp->f_path.dentry->d_inode->i_private; |
113 | struct hypfs_sb_info *fs_info; | 113 | struct hypfs_sb_info *fs_info; |
114 | 114 | ||
115 | if (filp->f_mode & FMODE_WRITE) { | 115 | if (filp->f_mode & FMODE_WRITE) { |
@@ -174,7 +174,7 @@ static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
174 | struct hypfs_sb_info *fs_info; | 174 | struct hypfs_sb_info *fs_info; |
175 | size_t count = iov_length(iov, nr_segs); | 175 | size_t count = iov_length(iov, nr_segs); |
176 | 176 | ||
177 | sb = iocb->ki_filp->f_dentry->d_inode->i_sb; | 177 | sb = iocb->ki_filp->f_path.dentry->d_inode->i_sb; |
178 | fs_info = sb->s_fs_info; | 178 | fs_info = sb->s_fs_info; |
179 | /* | 179 | /* |
180 | * Currently we only allow one update per second for two reasons: | 180 | * Currently we only allow one update per second for two reasons: |
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index 43f3d0c7e132..ef5266fbce62 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
@@ -603,13 +603,13 @@ debug_open(struct inode *inode, struct file *file) | |||
603 | debug_info_t *debug_info, *debug_info_snapshot; | 603 | debug_info_t *debug_info, *debug_info_snapshot; |
604 | 604 | ||
605 | down(&debug_lock); | 605 | down(&debug_lock); |
606 | debug_info = file->f_dentry->d_inode->i_private; | 606 | debug_info = file->f_path.dentry->d_inode->i_private; |
607 | /* find debug view */ | 607 | /* find debug view */ |
608 | for (i = 0; i < DEBUG_MAX_VIEWS; i++) { | 608 | for (i = 0; i < DEBUG_MAX_VIEWS; i++) { |
609 | if (!debug_info->views[i]) | 609 | if (!debug_info->views[i]) |
610 | continue; | 610 | continue; |
611 | else if (debug_info->debugfs_entries[i] == | 611 | else if (debug_info->debugfs_entries[i] == |
612 | file->f_dentry) { | 612 | file->f_path.dentry) { |
613 | goto found; /* found view ! */ | 613 | goto found; /* found view ! */ |
614 | } | 614 | } |
615 | } | 615 | } |
diff --git a/arch/s390/mm/ioremap.c b/arch/s390/mm/ioremap.c index 0f6e9ecbefe2..3d2100a4e209 100644 --- a/arch/s390/mm/ioremap.c +++ b/arch/s390/mm/ioremap.c | |||
@@ -15,87 +15,8 @@ | |||
15 | 15 | ||
16 | #include <linux/vmalloc.h> | 16 | #include <linux/vmalloc.h> |
17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
18 | #include <asm/io.h> | 18 | #include <linux/io.h> |
19 | #include <asm/pgalloc.h> | 19 | #include <asm/pgalloc.h> |
20 | #include <asm/cacheflush.h> | ||
21 | #include <asm/tlbflush.h> | ||
22 | |||
23 | static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, | ||
24 | unsigned long phys_addr, unsigned long flags) | ||
25 | { | ||
26 | unsigned long end; | ||
27 | unsigned long pfn; | ||
28 | |||
29 | address &= ~PMD_MASK; | ||
30 | end = address + size; | ||
31 | if (end > PMD_SIZE) | ||
32 | end = PMD_SIZE; | ||
33 | if (address >= end) | ||
34 | BUG(); | ||
35 | pfn = phys_addr >> PAGE_SHIFT; | ||
36 | do { | ||
37 | if (!pte_none(*pte)) { | ||
38 | printk("remap_area_pte: page already exists\n"); | ||
39 | BUG(); | ||
40 | } | ||
41 | set_pte(pte, pfn_pte(pfn, __pgprot(flags))); | ||
42 | address += PAGE_SIZE; | ||
43 | pfn++; | ||
44 | pte++; | ||
45 | } while (address && (address < end)); | ||
46 | } | ||
47 | |||
48 | static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size, | ||
49 | unsigned long phys_addr, unsigned long flags) | ||
50 | { | ||
51 | unsigned long end; | ||
52 | |||
53 | address &= ~PGDIR_MASK; | ||
54 | end = address + size; | ||
55 | if (end > PGDIR_SIZE) | ||
56 | end = PGDIR_SIZE; | ||
57 | phys_addr -= address; | ||
58 | if (address >= end) | ||
59 | BUG(); | ||
60 | do { | ||
61 | pte_t * pte = pte_alloc_kernel(pmd, address); | ||
62 | if (!pte) | ||
63 | return -ENOMEM; | ||
64 | remap_area_pte(pte, address, end - address, address + phys_addr, flags); | ||
65 | address = (address + PMD_SIZE) & PMD_MASK; | ||
66 | pmd++; | ||
67 | } while (address && (address < end)); | ||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static int remap_area_pages(unsigned long address, unsigned long phys_addr, | ||
72 | unsigned long size, unsigned long flags) | ||
73 | { | ||
74 | int error; | ||
75 | pgd_t * dir; | ||
76 | unsigned long end = address + size; | ||
77 | |||
78 | phys_addr -= address; | ||
79 | dir = pgd_offset(&init_mm, address); | ||
80 | flush_cache_all(); | ||
81 | if (address >= end) | ||
82 | BUG(); | ||
83 | do { | ||
84 | pmd_t *pmd; | ||
85 | pmd = pmd_alloc(&init_mm, dir, address); | ||
86 | error = -ENOMEM; | ||
87 | if (!pmd) | ||
88 | break; | ||
89 | if (remap_area_pmd(pmd, address, end - address, | ||
90 | phys_addr + address, flags)) | ||
91 | break; | ||
92 | error = 0; | ||
93 | address = (address + PGDIR_SIZE) & PGDIR_MASK; | ||
94 | dir++; | ||
95 | } while (address && (address < end)); | ||
96 | flush_tlb_all(); | ||
97 | return 0; | ||
98 | } | ||
99 | 20 | ||
100 | /* | 21 | /* |
101 | * Generic mapping function (not visible outside): | 22 | * Generic mapping function (not visible outside): |
@@ -122,7 +43,8 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag | |||
122 | if (!area) | 43 | if (!area) |
123 | return NULL; | 44 | return NULL; |
124 | addr = area->addr; | 45 | addr = area->addr; |
125 | if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { | 46 | if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size, |
47 | phys_addr, __pgprot(flags))) { | ||
126 | vfree(addr); | 48 | vfree(addr); |
127 | return NULL; | 49 | return NULL; |
128 | } | 50 | } |
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index d83d64af31f2..8e24c40662e3 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -59,6 +59,14 @@ config LOCKDEP_SUPPORT | |||
59 | bool | 59 | bool |
60 | default y | 60 | default y |
61 | 61 | ||
62 | config ARCH_HAS_ILOG2_U32 | ||
63 | bool | ||
64 | default n | ||
65 | |||
66 | config ARCH_HAS_ILOG2_U64 | ||
67 | bool | ||
68 | default n | ||
69 | |||
62 | source "init/Kconfig" | 70 | source "init/Kconfig" |
63 | 71 | ||
64 | menu "System type" | 72 | menu "System type" |
diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c index 11d54c149821..90b494a0cf45 100644 --- a/arch/sh/mm/ioremap.c +++ b/arch/sh/mm/ioremap.c | |||
@@ -16,97 +16,13 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
18 | #include <linux/pci.h> | 18 | #include <linux/pci.h> |
19 | #include <asm/io.h> | 19 | #include <linux/io.h> |
20 | #include <asm/page.h> | 20 | #include <asm/page.h> |
21 | #include <asm/pgalloc.h> | 21 | #include <asm/pgalloc.h> |
22 | #include <asm/addrspace.h> | 22 | #include <asm/addrspace.h> |
23 | #include <asm/cacheflush.h> | 23 | #include <asm/cacheflush.h> |
24 | #include <asm/tlbflush.h> | 24 | #include <asm/tlbflush.h> |
25 | 25 | ||
26 | static inline void remap_area_pte(pte_t * pte, unsigned long address, | ||
27 | unsigned long size, unsigned long phys_addr, unsigned long flags) | ||
28 | { | ||
29 | unsigned long end; | ||
30 | unsigned long pfn; | ||
31 | pgprot_t pgprot = __pgprot(pgprot_val(PAGE_KERNEL_NOCACHE) | flags); | ||
32 | |||
33 | address &= ~PMD_MASK; | ||
34 | end = address + size; | ||
35 | if (end > PMD_SIZE) | ||
36 | end = PMD_SIZE; | ||
37 | if (address >= end) | ||
38 | BUG(); | ||
39 | pfn = phys_addr >> PAGE_SHIFT; | ||
40 | do { | ||
41 | if (!pte_none(*pte)) { | ||
42 | printk("remap_area_pte: page already exists\n"); | ||
43 | BUG(); | ||
44 | } | ||
45 | set_pte(pte, pfn_pte(pfn, pgprot)); | ||
46 | address += PAGE_SIZE; | ||
47 | pfn++; | ||
48 | pte++; | ||
49 | } while (address && (address < end)); | ||
50 | } | ||
51 | |||
52 | static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, | ||
53 | unsigned long size, unsigned long phys_addr, unsigned long flags) | ||
54 | { | ||
55 | unsigned long end; | ||
56 | |||
57 | address &= ~PGDIR_MASK; | ||
58 | end = address + size; | ||
59 | if (end > PGDIR_SIZE) | ||
60 | end = PGDIR_SIZE; | ||
61 | phys_addr -= address; | ||
62 | if (address >= end) | ||
63 | BUG(); | ||
64 | do { | ||
65 | pte_t * pte = pte_alloc_kernel(pmd, address); | ||
66 | if (!pte) | ||
67 | return -ENOMEM; | ||
68 | remap_area_pte(pte, address, end - address, address + phys_addr, flags); | ||
69 | address = (address + PMD_SIZE) & PMD_MASK; | ||
70 | pmd++; | ||
71 | } while (address && (address < end)); | ||
72 | return 0; | ||
73 | } | ||
74 | |||
75 | int remap_area_pages(unsigned long address, unsigned long phys_addr, | ||
76 | unsigned long size, unsigned long flags) | ||
77 | { | ||
78 | int error; | ||
79 | pgd_t * dir; | ||
80 | unsigned long end = address + size; | ||
81 | |||
82 | phys_addr -= address; | ||
83 | dir = pgd_offset_k(address); | ||
84 | flush_cache_all(); | ||
85 | if (address >= end) | ||
86 | BUG(); | ||
87 | do { | ||
88 | pud_t *pud; | ||
89 | pmd_t *pmd; | ||
90 | |||
91 | error = -ENOMEM; | ||
92 | |||
93 | pud = pud_alloc(&init_mm, dir, address); | ||
94 | if (!pud) | ||
95 | break; | ||
96 | pmd = pmd_alloc(&init_mm, pud, address); | ||
97 | if (!pmd) | ||
98 | break; | ||
99 | if (remap_area_pmd(pmd, address, end - address, | ||
100 | phys_addr + address, flags)) | ||
101 | break; | ||
102 | error = 0; | ||
103 | address = (address + PGDIR_SIZE) & PGDIR_MASK; | ||
104 | dir++; | ||
105 | } while (address && (address < end)); | ||
106 | flush_tlb_all(); | ||
107 | return error; | ||
108 | } | ||
109 | |||
110 | /* | 26 | /* |
111 | * Remap an arbitrary physical address space into the kernel virtual | 27 | * Remap an arbitrary physical address space into the kernel virtual |
112 | * address space. Needed when the kernel wants to access high addresses | 28 | * address space. Needed when the kernel wants to access high addresses |
@@ -121,6 +37,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, | |||
121 | { | 37 | { |
122 | struct vm_struct * area; | 38 | struct vm_struct * area; |
123 | unsigned long offset, last_addr, addr, orig_addr; | 39 | unsigned long offset, last_addr, addr, orig_addr; |
40 | pgprot_t pgprot; | ||
124 | 41 | ||
125 | /* Don't allow wraparound or zero size */ | 42 | /* Don't allow wraparound or zero size */ |
126 | last_addr = phys_addr + size - 1; | 43 | last_addr = phys_addr + size - 1; |
@@ -190,8 +107,9 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, | |||
190 | } | 107 | } |
191 | #endif | 108 | #endif |
192 | 109 | ||
110 | pgprot = __pgprot(pgprot_val(PAGE_KERNEL_NOCACHE) | flags); | ||
193 | if (likely(size)) | 111 | if (likely(size)) |
194 | if (remap_area_pages(addr, phys_addr, size, flags)) { | 112 | if (ioremap_page_range(addr, addr + size, phys_addr, pgprot)) { |
195 | vunmap((void *)orig_addr); | 113 | vunmap((void *)orig_addr); |
196 | return NULL; | 114 | return NULL; |
197 | } | 115 | } |
diff --git a/arch/sh/oprofile/op_model_sh7750.c b/arch/sh/oprofile/op_model_sh7750.c index c265185b22a7..60402eec4b4d 100644 --- a/arch/sh/oprofile/op_model_sh7750.c +++ b/arch/sh/oprofile/op_model_sh7750.c | |||
@@ -142,7 +142,7 @@ static u64 sh7750_read_counter(int counter) | |||
142 | */ | 142 | */ |
143 | static inline int to_counter(struct file *file) | 143 | static inline int to_counter(struct file *file) |
144 | { | 144 | { |
145 | const unsigned char *name = file->f_dentry->d_parent->d_name.name; | 145 | const unsigned char *name = file->f_path.dentry->d_parent->d_name.name; |
146 | 146 | ||
147 | return (int)simple_strtol(name, NULL, 10); | 147 | return (int)simple_strtol(name, NULL, 10); |
148 | } | 148 | } |
diff --git a/arch/sh64/Kconfig b/arch/sh64/Kconfig index 58c678e06667..7bc0744b7ab6 100644 --- a/arch/sh64/Kconfig +++ b/arch/sh64/Kconfig | |||
@@ -39,6 +39,14 @@ config RWSEM_XCHGADD_ALGORITHM | |||
39 | config GENERIC_ISA_DMA | 39 | config GENERIC_ISA_DMA |
40 | bool | 40 | bool |
41 | 41 | ||
42 | config ARCH_HAS_ILOG2_U32 | ||
43 | bool | ||
44 | default n | ||
45 | |||
46 | config ARCH_HAS_ILOG2_U64 | ||
47 | bool | ||
48 | default n | ||
49 | |||
42 | source init/Kconfig | 50 | source init/Kconfig |
43 | 51 | ||
44 | menu "System type" | 52 | menu "System type" |
diff --git a/arch/sh64/mm/ioremap.c b/arch/sh64/mm/ioremap.c index 80c56754f513..ff26c02511aa 100644 --- a/arch/sh64/mm/ioremap.c +++ b/arch/sh64/mm/ioremap.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/vmalloc.h> | 18 | #include <linux/vmalloc.h> |
19 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
20 | #include <linux/string.h> | 20 | #include <linux/string.h> |
21 | #include <asm/io.h> | 21 | #include <linux/io.h> |
22 | #include <asm/pgalloc.h> | 22 | #include <asm/pgalloc.h> |
23 | #include <asm/tlbflush.h> | 23 | #include <asm/tlbflush.h> |
24 | #include <linux/ioport.h> | 24 | #include <linux/ioport.h> |
@@ -28,96 +28,6 @@ | |||
28 | static void shmedia_mapioaddr(unsigned long, unsigned long); | 28 | static void shmedia_mapioaddr(unsigned long, unsigned long); |
29 | static unsigned long shmedia_ioremap(struct resource *, u32, int); | 29 | static unsigned long shmedia_ioremap(struct resource *, u32, int); |
30 | 30 | ||
31 | static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, | ||
32 | unsigned long phys_addr, unsigned long flags) | ||
33 | { | ||
34 | unsigned long end; | ||
35 | unsigned long pfn; | ||
36 | pgprot_t pgprot = __pgprot(_PAGE_PRESENT | _PAGE_READ | | ||
37 | _PAGE_WRITE | _PAGE_DIRTY | | ||
38 | _PAGE_ACCESSED | _PAGE_SHARED | flags); | ||
39 | |||
40 | address &= ~PMD_MASK; | ||
41 | end = address + size; | ||
42 | if (end > PMD_SIZE) | ||
43 | end = PMD_SIZE; | ||
44 | if (address >= end) | ||
45 | BUG(); | ||
46 | |||
47 | pfn = phys_addr >> PAGE_SHIFT; | ||
48 | |||
49 | pr_debug(" %s: pte %p address %lx size %lx phys_addr %lx\n", | ||
50 | __FUNCTION__,pte,address,size,phys_addr); | ||
51 | |||
52 | do { | ||
53 | if (!pte_none(*pte)) { | ||
54 | printk("remap_area_pte: page already exists\n"); | ||
55 | BUG(); | ||
56 | } | ||
57 | |||
58 | set_pte(pte, pfn_pte(pfn, pgprot)); | ||
59 | address += PAGE_SIZE; | ||
60 | pfn++; | ||
61 | pte++; | ||
62 | } while (address && (address < end)); | ||
63 | } | ||
64 | |||
65 | static inline int remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size, | ||
66 | unsigned long phys_addr, unsigned long flags) | ||
67 | { | ||
68 | unsigned long end; | ||
69 | |||
70 | address &= ~PGDIR_MASK; | ||
71 | end = address + size; | ||
72 | |||
73 | if (end > PGDIR_SIZE) | ||
74 | end = PGDIR_SIZE; | ||
75 | |||
76 | phys_addr -= address; | ||
77 | |||
78 | if (address >= end) | ||
79 | BUG(); | ||
80 | |||
81 | do { | ||
82 | pte_t * pte = pte_alloc_kernel(pmd, address); | ||
83 | if (!pte) | ||
84 | return -ENOMEM; | ||
85 | remap_area_pte(pte, address, end - address, address + phys_addr, flags); | ||
86 | address = (address + PMD_SIZE) & PMD_MASK; | ||
87 | pmd++; | ||
88 | } while (address && (address < end)); | ||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | static int remap_area_pages(unsigned long address, unsigned long phys_addr, | ||
93 | unsigned long size, unsigned long flags) | ||
94 | { | ||
95 | int error; | ||
96 | pgd_t * dir; | ||
97 | unsigned long end = address + size; | ||
98 | |||
99 | phys_addr -= address; | ||
100 | dir = pgd_offset_k(address); | ||
101 | flush_cache_all(); | ||
102 | if (address >= end) | ||
103 | BUG(); | ||
104 | do { | ||
105 | pmd_t *pmd = pmd_alloc(&init_mm, dir, address); | ||
106 | error = -ENOMEM; | ||
107 | if (!pmd) | ||
108 | break; | ||
109 | if (remap_area_pmd(pmd, address, end - address, | ||
110 | phys_addr + address, flags)) { | ||
111 | break; | ||
112 | } | ||
113 | error = 0; | ||
114 | address = (address + PGDIR_SIZE) & PGDIR_MASK; | ||
115 | dir++; | ||
116 | } while (address && (address < end)); | ||
117 | flush_tlb_all(); | ||
118 | return 0; | ||
119 | } | ||
120 | |||
121 | /* | 31 | /* |
122 | * Generic mapping function (not visible outside): | 32 | * Generic mapping function (not visible outside): |
123 | */ | 33 | */ |
@@ -136,12 +46,17 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag | |||
136 | void * addr; | 46 | void * addr; |
137 | struct vm_struct * area; | 47 | struct vm_struct * area; |
138 | unsigned long offset, last_addr; | 48 | unsigned long offset, last_addr; |
49 | pgprot_t pgprot; | ||
139 | 50 | ||
140 | /* Don't allow wraparound or zero size */ | 51 | /* Don't allow wraparound or zero size */ |
141 | last_addr = phys_addr + size - 1; | 52 | last_addr = phys_addr + size - 1; |
142 | if (!size || last_addr < phys_addr) | 53 | if (!size || last_addr < phys_addr) |
143 | return NULL; | 54 | return NULL; |
144 | 55 | ||
56 | pgprot = __pgprot(_PAGE_PRESENT | _PAGE_READ | | ||
57 | _PAGE_WRITE | _PAGE_DIRTY | | ||
58 | _PAGE_ACCESSED | _PAGE_SHARED | flags); | ||
59 | |||
145 | /* | 60 | /* |
146 | * Mappings have to be page-aligned | 61 | * Mappings have to be page-aligned |
147 | */ | 62 | */ |
@@ -158,7 +73,8 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag | |||
158 | return NULL; | 73 | return NULL; |
159 | area->phys_addr = phys_addr; | 74 | area->phys_addr = phys_addr; |
160 | addr = area->addr; | 75 | addr = area->addr; |
161 | if (remap_area_pages((unsigned long)addr, phys_addr, size, flags)) { | 76 | if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size, |
77 | phys_addr, pgprot)) { | ||
162 | vunmap(addr); | 78 | vunmap(addr); |
163 | return NULL; | 79 | return NULL; |
164 | } | 80 | } |
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 92a7c8a636d3..d0dec1ea2eed 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -166,6 +166,14 @@ config ARCH_MAY_HAVE_PC_FDC | |||
166 | bool | 166 | bool |
167 | default y | 167 | default y |
168 | 168 | ||
169 | config ARCH_HAS_ILOG2_U32 | ||
170 | bool | ||
171 | default n | ||
172 | |||
173 | config ARCH_HAS_ILOG2_U64 | ||
174 | bool | ||
175 | default n | ||
176 | |||
169 | config SUN_PM | 177 | config SUN_PM |
170 | bool | 178 | bool |
171 | default y | 179 | default y |
diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c index 6f3ac548ee66..0bf8c165fc92 100644 --- a/arch/sparc/kernel/sys_sunos.c +++ b/arch/sparc/kernel/sys_sunos.c | |||
@@ -94,8 +94,8 @@ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len, | |||
94 | * SunOS is so stupid some times... hmph! | 94 | * SunOS is so stupid some times... hmph! |
95 | */ | 95 | */ |
96 | if (file) { | 96 | if (file) { |
97 | if (imajor(file->f_dentry->d_inode) == MEM_MAJOR && | 97 | if (imajor(file->f_path.dentry->d_inode) == MEM_MAJOR && |
98 | iminor(file->f_dentry->d_inode) == 5) { | 98 | iminor(file->f_path.dentry->d_inode) == 5) { |
99 | flags |= MAP_ANONYMOUS; | 99 | flags |= MAP_ANONYMOUS; |
100 | fput(file); | 100 | fput(file); |
101 | file = NULL; | 101 | file = NULL; |
@@ -655,7 +655,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr) | |||
655 | if (!file) | 655 | if (!file) |
656 | goto out; | 656 | goto out; |
657 | 657 | ||
658 | inode = file->f_dentry->d_inode; | 658 | inode = file->f_path.dentry->d_inode; |
659 | 659 | ||
660 | socket = SOCKET_I(inode); | 660 | socket = SOCKET_I(inode); |
661 | local.sin_family = AF_INET; | 661 | local.sin_family = AF_INET; |
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig index b627f8dbcaad..d391d11f245a 100644 --- a/arch/sparc64/Kconfig +++ b/arch/sparc64/Kconfig | |||
@@ -34,6 +34,14 @@ config ARCH_MAY_HAVE_PC_FDC | |||
34 | bool | 34 | bool |
35 | default y | 35 | default y |
36 | 36 | ||
37 | config ARCH_HAS_ILOG2_U32 | ||
38 | bool | ||
39 | default n | ||
40 | |||
41 | config ARCH_HAS_ILOG2_U64 | ||
42 | bool | ||
43 | default n | ||
44 | |||
37 | config AUDIT_ARCH | 45 | config AUDIT_ARCH |
38 | bool | 46 | bool |
39 | default y | 47 | default y |
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c index d7caa60a0074..f205fc7cbcd0 100644 --- a/arch/sparc64/kernel/binfmt_aout32.c +++ b/arch/sparc64/kernel/binfmt_aout32.c | |||
@@ -209,7 +209,7 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs) | |||
209 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && | 209 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && |
210 | N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || | 210 | N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || |
211 | N_TRSIZE(ex) || N_DRSIZE(ex) || | 211 | N_TRSIZE(ex) || N_DRSIZE(ex) || |
212 | bprm->file->f_dentry->d_inode->i_size < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { | 212 | bprm->file->f_path.dentry->d_inode->i_size < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { |
213 | return -ENOEXEC; | 213 | return -ENOEXEC; |
214 | } | 214 | } |
215 | 215 | ||
@@ -349,7 +349,7 @@ static int load_aout32_library(struct file *file) | |||
349 | int retval; | 349 | int retval; |
350 | struct exec ex; | 350 | struct exec ex; |
351 | 351 | ||
352 | inode = file->f_dentry->d_inode; | 352 | inode = file->f_path.dentry->d_inode; |
353 | 353 | ||
354 | retval = -ENOEXEC; | 354 | retval = -ENOEXEC; |
355 | error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); | 355 | error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); |
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index 7da72d3b322a..4446f66590fa 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c | |||
@@ -83,7 +83,7 @@ asmlinkage u32 sunos_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u32 of | |||
83 | file = fget(fd); | 83 | file = fget(fd); |
84 | if (!file) | 84 | if (!file) |
85 | goto out; | 85 | goto out; |
86 | inode = file->f_dentry->d_inode; | 86 | inode = file->f_path.dentry->d_inode; |
87 | if (imajor(inode) == MEM_MAJOR && iminor(inode) == 5) { | 87 | if (imajor(inode) == MEM_MAJOR && iminor(inode) == 5) { |
88 | flags |= MAP_ANONYMOUS; | 88 | flags |= MAP_ANONYMOUS; |
89 | fput(file); | 89 | fput(file); |
@@ -615,7 +615,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr) | |||
615 | if (!file) | 615 | if (!file) |
616 | return 0; | 616 | return 0; |
617 | 617 | ||
618 | inode = file->f_dentry->d_inode; | 618 | inode = file->f_path.dentry->d_inode; |
619 | 619 | ||
620 | socket = SOCKET_I(inode); | 620 | socket = SOCKET_I(inode); |
621 | local.sin_family = AF_INET; | 621 | local.sin_family = AF_INET; |
diff --git a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c index 12a940cc791f..61be597bf430 100644 --- a/arch/sparc64/solaris/fs.c +++ b/arch/sparc64/solaris/fs.c | |||
@@ -449,7 +449,7 @@ asmlinkage int solaris_fstatvfs(unsigned int fd, u32 buf) | |||
449 | error = -EBADF; | 449 | error = -EBADF; |
450 | file = fget(fd); | 450 | file = fget(fd); |
451 | if (file) { | 451 | if (file) { |
452 | error = report_statvfs(file->f_vfsmnt, file->f_dentry->d_inode, buf); | 452 | error = report_statvfs(file->f_path.mnt, file->f_path.dentry->d_inode, buf); |
453 | fput(file); | 453 | fput(file); |
454 | } | 454 | } |
455 | 455 | ||
@@ -481,7 +481,7 @@ asmlinkage int solaris_fstatvfs64(unsigned int fd, u32 buf) | |||
481 | file = fget(fd); | 481 | file = fget(fd); |
482 | if (file) { | 482 | if (file) { |
483 | lock_kernel(); | 483 | lock_kernel(); |
484 | error = report_statvfs64(file->f_vfsmnt, file->f_dentry->d_inode, buf); | 484 | error = report_statvfs64(file->f_path.mnt, file->f_path.dentry->d_inode, buf); |
485 | unlock_kernel(); | 485 | unlock_kernel(); |
486 | fput(file); | 486 | fput(file); |
487 | } | 487 | } |
diff --git a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c index be0a054e3ed6..330743c5b3d8 100644 --- a/arch/sparc64/solaris/ioctl.c +++ b/arch/sparc64/solaris/ioctl.c | |||
@@ -299,8 +299,8 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg) | |||
299 | rcu_read_lock(); | 299 | rcu_read_lock(); |
300 | fdt = files_fdtable(current->files); | 300 | fdt = files_fdtable(current->files); |
301 | if (! fdt->fd[fd] || | 301 | if (! fdt->fd[fd] || |
302 | ! fdt->fd[fd]->f_dentry || | 302 | ! fdt->fd[fd]->f_path.dentry || |
303 | ! (ino = fdt->fd[fd]->f_dentry->d_inode) || | 303 | ! (ino = fdt->fd[fd]->f_path.dentry->d_inode) || |
304 | ! S_ISSOCK(ino->i_mode)) { | 304 | ! S_ISSOCK(ino->i_mode)) { |
305 | rcu_read_unlock(); | 305 | rcu_read_unlock(); |
306 | return TBADF; | 306 | return TBADF; |
@@ -480,7 +480,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd | |||
480 | struct sol_socket_struct *sock; | 480 | struct sol_socket_struct *sock; |
481 | struct module_info *mi; | 481 | struct module_info *mi; |
482 | 482 | ||
483 | ino = filp->f_dentry->d_inode; | 483 | ino = filp->f_path.dentry->d_inode; |
484 | if (!S_ISSOCK(ino->i_mode)) | 484 | if (!S_ISSOCK(ino->i_mode)) |
485 | return -EBADF; | 485 | return -EBADF; |
486 | sock = filp->private_data; | 486 | sock = filp->private_data; |
diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c index 9ed997982f8d..bca16e8c95c3 100644 --- a/arch/sparc64/solaris/misc.c +++ b/arch/sparc64/solaris/misc.c | |||
@@ -77,7 +77,7 @@ static u32 do_solaris_mmap(u32 addr, u32 len, u32 prot, u32 flags, u32 fd, u64 o | |||
77 | if (!file) | 77 | if (!file) |
78 | goto out; | 78 | goto out; |
79 | else { | 79 | else { |
80 | struct inode * inode = file->f_dentry->d_inode; | 80 | struct inode * inode = file->f_path.dentry->d_inode; |
81 | if(imajor(inode) == MEM_MAJOR && | 81 | if(imajor(inode) == MEM_MAJOR && |
82 | iminor(inode) == 5) { | 82 | iminor(inode) == 5) { |
83 | flags |= MAP_ANONYMOUS; | 83 | flags |= MAP_ANONYMOUS; |
@@ -423,9 +423,7 @@ asmlinkage int solaris_procids(int cmd, s32 pid, s32 pgid) | |||
423 | Solaris setpgrp and setsid? */ | 423 | Solaris setpgrp and setsid? */ |
424 | ret = sys_setpgid(0, 0); | 424 | ret = sys_setpgid(0, 0); |
425 | if (ret) return ret; | 425 | if (ret) return ret; |
426 | mutex_lock(&tty_mutex); | 426 | proc_clear_tty(current); |
427 | current->signal->tty = NULL; | ||
428 | mutex_unlock(&tty_mutex); | ||
429 | return process_group(current); | 427 | return process_group(current); |
430 | } | 428 | } |
431 | case 2: /* getsid */ | 429 | case 2: /* getsid */ |
diff --git a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c index 7c90e41fd3be..89a4757f192f 100644 --- a/arch/sparc64/solaris/socksys.c +++ b/arch/sparc64/solaris/socksys.c | |||
@@ -96,13 +96,13 @@ static int socksys_open(struct inode * inode, struct file * filp) | |||
96 | * No shit. WTF is it supposed to do, anyway? | 96 | * No shit. WTF is it supposed to do, anyway? |
97 | * | 97 | * |
98 | * Try instead: | 98 | * Try instead: |
99 | * d_delete(filp->f_dentry), then d_instantiate with sock inode | 99 | * d_delete(filp->f_path.dentry), then d_instantiate with sock inode |
100 | */ | 100 | */ |
101 | dentry = filp->f_dentry; | 101 | dentry = filp->f_path.dentry; |
102 | filp->f_dentry = dget(fcheck(fd)->f_dentry); | 102 | filp->f_path.dentry = dget(fcheck(fd)->f_path.dentry); |
103 | filp->f_dentry->d_inode->i_rdev = inode->i_rdev; | 103 | filp->f_path.dentry->d_inode->i_rdev = inode->i_rdev; |
104 | filp->f_dentry->d_inode->i_flock = inode->i_flock; | 104 | filp->f_path.dentry->d_inode->i_flock = inode->i_flock; |
105 | SOCKET_I(filp->f_dentry->d_inode)->file = filp; | 105 | SOCKET_I(filp->f_path.dentry->d_inode)->file = filp; |
106 | filp->f_op = &socksys_file_ops; | 106 | filp->f_op = &socksys_file_ops; |
107 | sock = (struct sol_socket_struct*) | 107 | sock = (struct sol_socket_struct*) |
108 | mykmalloc(sizeof(struct sol_socket_struct), GFP_KERNEL); | 108 | mykmalloc(sizeof(struct sol_socket_struct), GFP_KERNEL); |
@@ -148,7 +148,7 @@ static unsigned int socksys_poll(struct file * filp, poll_table * wait) | |||
148 | struct inode *ino; | 148 | struct inode *ino; |
149 | unsigned int mask = 0; | 149 | unsigned int mask = 0; |
150 | 150 | ||
151 | ino=filp->f_dentry->d_inode; | 151 | ino=filp->f_path.dentry->d_inode; |
152 | if (ino && S_ISSOCK(ino->i_mode)) { | 152 | if (ino && S_ISSOCK(ino->i_mode)) { |
153 | struct sol_socket_struct *sock; | 153 | struct sol_socket_struct *sock; |
154 | sock = (struct sol_socket_struct*)filp->private_data; | 154 | sock = (struct sol_socket_struct*)filp->private_data; |
diff --git a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c index b84e5456b025..a9d32ceabf26 100644 --- a/arch/sparc64/solaris/timod.c +++ b/arch/sparc64/solaris/timod.c | |||
@@ -147,7 +147,7 @@ static void timod_wake_socket(unsigned int fd) | |||
147 | 147 | ||
148 | SOLD("wakeing socket"); | 148 | SOLD("wakeing socket"); |
149 | fdt = files_fdtable(current->files); | 149 | fdt = files_fdtable(current->files); |
150 | sock = SOCKET_I(fdt->fd[fd]->f_dentry->d_inode); | 150 | sock = SOCKET_I(fdt->fd[fd]->f_path.dentry->d_inode); |
151 | wake_up_interruptible(&sock->wait); | 151 | wake_up_interruptible(&sock->wait); |
152 | read_lock(&sock->sk->sk_callback_lock); | 152 | read_lock(&sock->sk->sk_callback_lock); |
153 | if (sock->fasync_list && !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags)) | 153 | if (sock->fasync_list && !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags)) |
@@ -361,7 +361,7 @@ int timod_putmsg(unsigned int fd, char __user *ctl_buf, int ctl_len, | |||
361 | 361 | ||
362 | fdt = files_fdtable(current->files); | 362 | fdt = files_fdtable(current->files); |
363 | filp = fdt->fd[fd]; | 363 | filp = fdt->fd[fd]; |
364 | ino = filp->f_dentry->d_inode; | 364 | ino = filp->f_path.dentry->d_inode; |
365 | sock = (struct sol_socket_struct *)filp->private_data; | 365 | sock = (struct sol_socket_struct *)filp->private_data; |
366 | SOLD("entry"); | 366 | SOLD("entry"); |
367 | if (get_user(ret, (int __user *)A(ctl_buf))) | 367 | if (get_user(ret, (int __user *)A(ctl_buf))) |
@@ -644,7 +644,7 @@ int timod_getmsg(unsigned int fd, char __user *ctl_buf, int ctl_maxlen, s32 __us | |||
644 | SOLDD(("%u %p %d %p %p %d %p %d\n", fd, ctl_buf, ctl_maxlen, ctl_len, data_buf, data_maxlen, data_len, *flags_p)); | 644 | SOLDD(("%u %p %d %p %p %d %p %d\n", fd, ctl_buf, ctl_maxlen, ctl_len, data_buf, data_maxlen, data_len, *flags_p)); |
645 | fdt = files_fdtable(current->files); | 645 | fdt = files_fdtable(current->files); |
646 | filp = fdt->fd[fd]; | 646 | filp = fdt->fd[fd]; |
647 | ino = filp->f_dentry->d_inode; | 647 | ino = filp->f_path.dentry->d_inode; |
648 | sock = (struct sol_socket_struct *)filp->private_data; | 648 | sock = (struct sol_socket_struct *)filp->private_data; |
649 | SOLDD(("%p %p\n", sock->pfirst, sock->pfirst ? sock->pfirst->next : NULL)); | 649 | SOLDD(("%p %p\n", sock->pfirst, sock->pfirst ? sock->pfirst->next : NULL)); |
650 | if ( ctl_maxlen > 0 && !sock->pfirst && SOCKET_I(ino)->type == SOCK_STREAM | 650 | if ( ctl_maxlen > 0 && !sock->pfirst && SOCKET_I(ino)->type == SOCK_STREAM |
@@ -865,7 +865,7 @@ asmlinkage int solaris_getmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3) | |||
865 | filp = fdt->fd[fd]; | 865 | filp = fdt->fd[fd]; |
866 | if(!filp) goto out; | 866 | if(!filp) goto out; |
867 | 867 | ||
868 | ino = filp->f_dentry->d_inode; | 868 | ino = filp->f_path.dentry->d_inode; |
869 | if (!ino || !S_ISSOCK(ino->i_mode)) | 869 | if (!ino || !S_ISSOCK(ino->i_mode)) |
870 | goto out; | 870 | goto out; |
871 | 871 | ||
@@ -933,7 +933,7 @@ asmlinkage int solaris_putmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3) | |||
933 | filp = fdt->fd[fd]; | 933 | filp = fdt->fd[fd]; |
934 | if(!filp) goto out; | 934 | if(!filp) goto out; |
935 | 935 | ||
936 | ino = filp->f_dentry->d_inode; | 936 | ino = filp->f_path.dentry->d_inode; |
937 | if (!ino) goto out; | 937 | if (!ino) goto out; |
938 | 938 | ||
939 | if (!S_ISSOCK(ino->i_mode) && | 939 | if (!S_ISSOCK(ino->i_mode) && |
diff --git a/arch/um/Kconfig b/arch/um/Kconfig index 5ac1f2963ae3..d32a80e6668c 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig | |||
@@ -47,6 +47,11 @@ config GENERIC_CALIBRATE_DELAY | |||
47 | bool | 47 | bool |
48 | default y | 48 | default y |
49 | 49 | ||
50 | config GENERIC_BUG | ||
51 | bool | ||
52 | default y | ||
53 | depends on BUG | ||
54 | |||
50 | # Used in kernel/irq/manage.c and include/linux/irq.h | 55 | # Used in kernel/irq/manage.c and include/linux/irq.h |
51 | config IRQ_RELEASE_METHOD | 56 | config IRQ_RELEASE_METHOD |
52 | bool | 57 | bool |
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index aa3090d05a8f..83301e1ef67c 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
@@ -246,7 +246,7 @@ out_up: | |||
246 | return ret; | 246 | return ret; |
247 | } | 247 | } |
248 | 248 | ||
249 | void line_set_termios(struct tty_struct *tty, struct termios * old) | 249 | void line_set_termios(struct tty_struct *tty, struct ktermios * old) |
250 | { | 250 | { |
251 | /* nothing */ | 251 | /* nothing */ |
252 | } | 252 | } |
diff --git a/arch/um/include/line.h b/arch/um/include/line.h index 214ee76c40df..5f232ae89fbb 100644 --- a/arch/um/include/line.h +++ b/arch/um/include/line.h | |||
@@ -76,7 +76,7 @@ extern int line_setup(struct line *lines, unsigned int sizeof_lines, | |||
76 | extern int line_write(struct tty_struct *tty, const unsigned char *buf, | 76 | extern int line_write(struct tty_struct *tty, const unsigned char *buf, |
77 | int len); | 77 | int len); |
78 | extern void line_put_char(struct tty_struct *tty, unsigned char ch); | 78 | extern void line_put_char(struct tty_struct *tty, unsigned char ch); |
79 | extern void line_set_termios(struct tty_struct *tty, struct termios * old); | 79 | extern void line_set_termios(struct tty_struct *tty, struct ktermios * old); |
80 | extern int line_chars_in_buffer(struct tty_struct *tty); | 80 | extern int line_chars_in_buffer(struct tty_struct *tty); |
81 | extern void line_flush_buffer(struct tty_struct *tty); | 81 | extern void line_flush_buffer(struct tty_struct *tty); |
82 | extern void line_flush_chars(struct tty_struct *tty); | 82 | extern void line_flush_chars(struct tty_struct *tty); |
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index 0561c43b4685..8d56ec6cca79 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c | |||
@@ -39,12 +39,13 @@ static long execve1(char *file, char __user * __user *argv, | |||
39 | char __user *__user *env) | 39 | char __user *__user *env) |
40 | { | 40 | { |
41 | long error; | 41 | long error; |
42 | struct tty_struct *tty; | ||
42 | 43 | ||
43 | #ifdef CONFIG_TTY_LOG | 44 | #ifdef CONFIG_TTY_LOG |
44 | mutex_lock(&tty_mutex); | 45 | mutex_lock(&tty_mutex); |
45 | task_lock(current); /* FIXME: is this needed ? */ | 46 | tty = get_current_tty(); |
46 | log_exec(argv, current->signal->tty); | 47 | if (tty) |
47 | task_unlock(current); | 48 | log_exec(argv, tty); |
48 | mutex_unlock(&tty_mutex); | 49 | mutex_unlock(&tty_mutex); |
49 | #endif | 50 | #endif |
50 | error = do_execve(file, argv, env, ¤t->thread.regs); | 51 | error = do_execve(file, argv, env, ¤t->thread.regs); |
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile index 0e32adf03be1..098720be019a 100644 --- a/arch/um/sys-i386/Makefile +++ b/arch/um/sys-i386/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | obj-y = bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ | 1 | obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ |
2 | ptrace_user.o setjmp.o signal.o sigcontext.o syscalls.o sysrq.o \ | 2 | ptrace_user.o setjmp.o signal.o sigcontext.o syscalls.o sysrq.o \ |
3 | sys_call_table.o tls.o | 3 | sys_call_table.o tls.o |
4 | 4 | ||
diff --git a/arch/um/sys-i386/bug.c b/arch/um/sys-i386/bug.c new file mode 100644 index 000000000000..200c8ba2879b --- /dev/null +++ b/arch/um/sys-i386/bug.c | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006 Jeff Dike (jdike@addtoit.com) | ||
3 | * Licensed under the GPL V2 | ||
4 | */ | ||
5 | |||
6 | #include <linux/uaccess.h> | ||
7 | |||
8 | /* Mostly copied from i386/x86_86 - eliminated the eip < PAGE_OFFSET because | ||
9 | * that's not relevent in skas mode. | ||
10 | */ | ||
11 | |||
12 | int is_valid_bugaddr(unsigned long eip) | ||
13 | { | ||
14 | unsigned short ud2; | ||
15 | |||
16 | if (probe_kernel_address((unsigned short __user *)eip, ud2)) | ||
17 | return 0; | ||
18 | |||
19 | return ud2 == 0x0b0f; | ||
20 | } | ||
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile index f41768b8e25e..4d9e5efa6fb9 100644 --- a/arch/um/sys-x86_64/Makefile +++ b/arch/um/sys-x86_64/Makefile | |||
@@ -4,7 +4,7 @@ | |||
4 | # Licensed under the GPL | 4 | # Licensed under the GPL |
5 | # | 5 | # |
6 | 6 | ||
7 | obj-y = bugs.o delay.o fault.o ldt.o mem.o ptrace.o ptrace_user.o \ | 7 | obj-y = bug.o bugs.o delay.o fault.o ldt.o mem.o ptrace.o ptrace_user.o \ |
8 | setjmp.o sigcontext.o signal.o syscalls.o syscall_table.o sysrq.o \ | 8 | setjmp.o sigcontext.o signal.o syscalls.o syscall_table.o sysrq.o \ |
9 | ksyms.o tls.o | 9 | ksyms.o tls.o |
10 | 10 | ||
diff --git a/arch/um/sys-x86_64/bug.c b/arch/um/sys-x86_64/bug.c new file mode 100644 index 000000000000..200c8ba2879b --- /dev/null +++ b/arch/um/sys-x86_64/bug.c | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006 Jeff Dike (jdike@addtoit.com) | ||
3 | * Licensed under the GPL V2 | ||
4 | */ | ||
5 | |||
6 | #include <linux/uaccess.h> | ||
7 | |||
8 | /* Mostly copied from i386/x86_86 - eliminated the eip < PAGE_OFFSET because | ||
9 | * that's not relevent in skas mode. | ||
10 | */ | ||
11 | |||
12 | int is_valid_bugaddr(unsigned long eip) | ||
13 | { | ||
14 | unsigned short ud2; | ||
15 | |||
16 | if (probe_kernel_address((unsigned short __user *)eip, ud2)) | ||
17 | return 0; | ||
18 | |||
19 | return ud2 == 0x0b0f; | ||
20 | } | ||
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig index 37ec644603ab..bcf825875d17 100644 --- a/arch/v850/Kconfig +++ b/arch/v850/Kconfig | |||
@@ -38,6 +38,14 @@ config TIME_LOW_RES | |||
38 | bool | 38 | bool |
39 | default y | 39 | default y |
40 | 40 | ||
41 | config ARCH_HAS_ILOG2_U32 | ||
42 | bool | ||
43 | default n | ||
44 | |||
45 | config ARCH_HAS_ILOG2_U64 | ||
46 | bool | ||
47 | default n | ||
48 | |||
41 | # Turn off some random 386 crap that can affect device config | 49 | # Turn off some random 386 crap that can affect device config |
42 | config ISA | 50 | config ISA |
43 | bool | 51 | bool |
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index bfbb9bcae123..3ac581d17202 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig | |||
@@ -96,6 +96,19 @@ config AUDIT_ARCH | |||
96 | bool | 96 | bool |
97 | default y | 97 | default y |
98 | 98 | ||
99 | config GENERIC_BUG | ||
100 | bool | ||
101 | default y | ||
102 | depends on BUG | ||
103 | |||
104 | config ARCH_HAS_ILOG2_U32 | ||
105 | bool | ||
106 | default n | ||
107 | |||
108 | config ARCH_HAS_ILOG2_U64 | ||
109 | bool | ||
110 | default n | ||
111 | |||
99 | source "init/Kconfig" | 112 | source "init/Kconfig" |
100 | 113 | ||
101 | 114 | ||
diff --git a/arch/x86_64/ia32/ia32_aout.c b/arch/x86_64/ia32/ia32_aout.c index 396d3c100011..be87df506f39 100644 --- a/arch/x86_64/ia32/ia32_aout.c +++ b/arch/x86_64/ia32/ia32_aout.c | |||
@@ -272,7 +272,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) | |||
272 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && | 272 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && |
273 | N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || | 273 | N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || |
274 | N_TRSIZE(ex) || N_DRSIZE(ex) || | 274 | N_TRSIZE(ex) || N_DRSIZE(ex) || |
275 | i_size_read(bprm->file->f_dentry->d_inode) < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { | 275 | i_size_read(bprm->file->f_path.dentry->d_inode) < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { |
276 | return -ENOEXEC; | 276 | return -ENOEXEC; |
277 | } | 277 | } |
278 | 278 | ||
@@ -357,7 +357,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) | |||
357 | { | 357 | { |
358 | printk(KERN_WARNING | 358 | printk(KERN_WARNING |
359 | "fd_offset is not page aligned. Please convert program: %s\n", | 359 | "fd_offset is not page aligned. Please convert program: %s\n", |
360 | bprm->file->f_dentry->d_name.name); | 360 | bprm->file->f_path.dentry->d_name.name); |
361 | error_time = jiffies; | 361 | error_time = jiffies; |
362 | } | 362 | } |
363 | #endif | 363 | #endif |
@@ -440,7 +440,7 @@ static int load_aout_library(struct file *file) | |||
440 | int retval; | 440 | int retval; |
441 | struct exec ex; | 441 | struct exec ex; |
442 | 442 | ||
443 | inode = file->f_dentry->d_inode; | 443 | inode = file->f_path.dentry->d_inode; |
444 | 444 | ||
445 | retval = -ENOEXEC; | 445 | retval = -ENOEXEC; |
446 | error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); | 446 | error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); |
@@ -471,7 +471,7 @@ static int load_aout_library(struct file *file) | |||
471 | { | 471 | { |
472 | printk(KERN_WARNING | 472 | printk(KERN_WARNING |
473 | "N_TXTOFF is not page aligned. Please convert library: %s\n", | 473 | "N_TXTOFF is not page aligned. Please convert library: %s\n", |
474 | file->f_dentry->d_name.name); | 474 | file->f_path.dentry->d_name.name); |
475 | error_time = jiffies; | 475 | error_time = jiffies; |
476 | } | 476 | } |
477 | #endif | 477 | #endif |
diff --git a/arch/x86_64/kernel/module.c b/arch/x86_64/kernel/module.c index 9d0958ff547f..a888e67f5874 100644 --- a/arch/x86_64/kernel/module.c +++ b/arch/x86_64/kernel/module.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/string.h> | 23 | #include <linux/string.h> |
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/bug.h> | ||
26 | 27 | ||
27 | #include <asm/system.h> | 28 | #include <asm/system.h> |
28 | #include <asm/page.h> | 29 | #include <asm/page.h> |
@@ -173,10 +174,12 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
173 | lseg, lseg + locks->sh_size, | 174 | lseg, lseg + locks->sh_size, |
174 | tseg, tseg + text->sh_size); | 175 | tseg, tseg + text->sh_size); |
175 | } | 176 | } |
176 | return 0; | 177 | |
178 | return module_bug_finalize(hdr, sechdrs, me); | ||
177 | } | 179 | } |
178 | 180 | ||
179 | void module_arch_cleanup(struct module *mod) | 181 | void module_arch_cleanup(struct module *mod) |
180 | { | 182 | { |
181 | alternatives_smp_module_del(mod); | 183 | alternatives_smp_module_del(mod); |
184 | module_bug_cleanup(mod); | ||
182 | } | 185 | } |
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index a1641ffdffcf..b54ccc07f379 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/kexec.h> | 31 | #include <linux/kexec.h> |
32 | #include <linux/unwind.h> | 32 | #include <linux/unwind.h> |
33 | #include <linux/uaccess.h> | 33 | #include <linux/uaccess.h> |
34 | #include <linux/bug.h> | ||
34 | 35 | ||
35 | #include <asm/system.h> | 36 | #include <asm/system.h> |
36 | #include <asm/io.h> | 37 | #include <asm/io.h> |
@@ -524,30 +525,15 @@ bad: | |||
524 | printk("\n"); | 525 | printk("\n"); |
525 | } | 526 | } |
526 | 527 | ||
527 | void handle_BUG(struct pt_regs *regs) | 528 | int is_valid_bugaddr(unsigned long rip) |
528 | { | 529 | { |
529 | struct bug_frame f; | 530 | unsigned short ud2; |
530 | long len; | ||
531 | const char *prefix = ""; | ||
532 | 531 | ||
533 | if (user_mode(regs)) | 532 | if (__copy_from_user(&ud2, (const void __user *) rip, sizeof(ud2))) |
534 | return; | 533 | return 0; |
535 | if (__copy_from_user(&f, (const void __user *) regs->rip, | 534 | |
536 | sizeof(struct bug_frame))) | 535 | return ud2 == 0x0b0f; |
537 | return; | 536 | } |
538 | if (f.filename >= 0 || | ||
539 | f.ud2[0] != 0x0f || f.ud2[1] != 0x0b) | ||
540 | return; | ||
541 | len = __strnlen_user((char *)(long)f.filename, PATH_MAX) - 1; | ||
542 | if (len < 0 || len >= PATH_MAX) | ||
543 | f.filename = (int)(long)"unmapped filename"; | ||
544 | else if (len > 50) { | ||
545 | f.filename += len - 50; | ||
546 | prefix = "..."; | ||
547 | } | ||
548 | printk("----------- [cut here ] --------- [please bite here ] ---------\n"); | ||
549 | printk(KERN_ALERT "Kernel BUG at %s%.50s:%d\n", prefix, (char *)(long)f.filename, f.line); | ||
550 | } | ||
551 | 537 | ||
552 | #ifdef CONFIG_BUG | 538 | #ifdef CONFIG_BUG |
553 | void out_of_line_bug(void) | 539 | void out_of_line_bug(void) |
@@ -627,7 +613,9 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
627 | { | 613 | { |
628 | unsigned long flags = oops_begin(); | 614 | unsigned long flags = oops_begin(); |
629 | 615 | ||
630 | handle_BUG(regs); | 616 | if (!user_mode(regs)) |
617 | report_bug(regs->rip); | ||
618 | |||
631 | __die(str, regs, err); | 619 | __die(str, regs, err); |
632 | oops_end(flags); | 620 | oops_end(flags); |
633 | do_exit(SIGSEGV); | 621 | do_exit(SIGSEGV); |
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S index 6a1f8f491e5d..6c417788c54b 100644 --- a/arch/x86_64/kernel/vmlinux.lds.S +++ b/arch/x86_64/kernel/vmlinux.lds.S | |||
@@ -51,6 +51,8 @@ SECTIONS | |||
51 | 51 | ||
52 | RODATA | 52 | RODATA |
53 | 53 | ||
54 | BUG_TABLE | ||
55 | |||
54 | . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */ | 56 | . = ALIGN(PAGE_SIZE); /* Align data segment to page size boundary */ |
55 | /* Data */ | 57 | /* Data */ |
56 | .data : AT(ADDR(.data) - LOAD_OFFSET) { | 58 | .data : AT(ADDR(.data) - LOAD_OFFSET) { |
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index c1e69a1f92a4..9eccfbd1b536 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -34,6 +34,14 @@ config GENERIC_HARDIRQS | |||
34 | bool | 34 | bool |
35 | default y | 35 | default y |
36 | 36 | ||
37 | config ARCH_HAS_ILOG2_U32 | ||
38 | bool | ||
39 | default n | ||
40 | |||
41 | config ARCH_HAS_ILOG2_U64 | ||
42 | bool | ||
43 | default n | ||
44 | |||
37 | source "init/Kconfig" | 45 | source "init/Kconfig" |
38 | 46 | ||
39 | menu "Processor type and features" | 47 | menu "Processor type and features" |