diff options
Diffstat (limited to 'arch/ppc')
-rw-r--r-- | arch/ppc/8xx_io/cs4218_tdm.c | 12 | ||||
-rw-r--r-- | arch/ppc/Kconfig | 13 | ||||
-rw-r--r-- | arch/ppc/kernel/traps.c | 64 |
3 files changed, 25 insertions, 64 deletions
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 | } |