diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-16 19:48:45 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-16 19:48:45 -0400 |
| commit | 9c0d2a20fe331946c1a65a5865faf56e93255c5c (patch) | |
| tree | 9d47a9239b6249a5dd4244195ec4cc1e55fda3cd /arch/arm/kernel/traps.c | |
| parent | 5e6b83ed8c00f2e2ae5b2413c5907bed735b600d (diff) | |
| parent | 66bfa2f03191aec2e2958414b1dfb80a56637133 (diff) | |
Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm: (38 commits)
[ARM] 5191/1: ARM: remove CVS keywords
[ARM] pxafb: fix the warning of incorrect lccr when lcd_conn is specified
[ARM] pxafb: add flag to specify output format on LDD pins when base is RGBT16
[ARM] pxafb: fix the incorrect configuration of GPIO77 as ACBIAS for TFT LCD
[ARM] 5198/1: PalmTX: PCMCIA fixes
[ARM] Fix a pile of broken watchdog drivers
[ARM] update mach-types
[ARM] 5196/1: fix inline asm constraints for preload
[ARM] 5194/1: update .gitignore
[ARM] add proc-macros.S include to proc-arm940 and proc-arm946
[ARM] 5192/1: ARM TLB: add v7wbi_{possible,always}_flags to {possible,always}_tlb_flags
[ARM] 5193/1: Wire up missing syscalls
[ARM] traps: don't call undef hook functions with spinlock held
[ARM] 5183/2: Provide Poodle LoCoMo GPIO names
[ARM] dma-mapping: provide sync_range APIs
[ARM] dma-mapping: improve type-safeness of DMA translations
[ARM] Kirkwood: instantiate the orion_spi driver in the platform code
[ARM] prevent crashing when too much RAM installed
[ARM] Kirkwood: Instantiate mv_xor driver
[ARM] Orion: Instantiate mv_xor driver for 5182
...
Diffstat (limited to 'arch/arm/kernel/traps.c')
| -rw-r--r-- | arch/arm/kernel/traps.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 7277aef83098..872f1f8fbb57 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
| @@ -288,14 +288,28 @@ void unregister_undef_hook(struct undef_hook *hook) | |||
| 288 | spin_unlock_irqrestore(&undef_lock, flags); | 288 | spin_unlock_irqrestore(&undef_lock, flags); |
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | static int call_undef_hook(struct pt_regs *regs, unsigned int instr) | ||
| 292 | { | ||
| 293 | struct undef_hook *hook; | ||
| 294 | unsigned long flags; | ||
| 295 | int (*fn)(struct pt_regs *regs, unsigned int instr) = NULL; | ||
| 296 | |||
| 297 | spin_lock_irqsave(&undef_lock, flags); | ||
| 298 | list_for_each_entry(hook, &undef_hook, node) | ||
| 299 | if ((instr & hook->instr_mask) == hook->instr_val && | ||
| 300 | (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) | ||
| 301 | fn = hook->fn; | ||
| 302 | spin_unlock_irqrestore(&undef_lock, flags); | ||
| 303 | |||
| 304 | return fn ? fn(regs, instr) : 1; | ||
| 305 | } | ||
| 306 | |||
| 291 | asmlinkage void __exception do_undefinstr(struct pt_regs *regs) | 307 | asmlinkage void __exception do_undefinstr(struct pt_regs *regs) |
| 292 | { | 308 | { |
| 293 | unsigned int correction = thumb_mode(regs) ? 2 : 4; | 309 | unsigned int correction = thumb_mode(regs) ? 2 : 4; |
| 294 | unsigned int instr; | 310 | unsigned int instr; |
| 295 | struct undef_hook *hook; | ||
| 296 | siginfo_t info; | 311 | siginfo_t info; |
| 297 | void __user *pc; | 312 | void __user *pc; |
| 298 | unsigned long flags; | ||
| 299 | 313 | ||
| 300 | /* | 314 | /* |
| 301 | * According to the ARM ARM, PC is 2 or 4 bytes ahead, | 315 | * According to the ARM ARM, PC is 2 or 4 bytes ahead, |
| @@ -325,17 +339,8 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs) | |||
| 325 | } | 339 | } |
| 326 | #endif | 340 | #endif |
| 327 | 341 | ||
| 328 | spin_lock_irqsave(&undef_lock, flags); | 342 | if (call_undef_hook(regs, instr) == 0) |
| 329 | list_for_each_entry(hook, &undef_hook, node) { | 343 | return; |
| 330 | if ((instr & hook->instr_mask) == hook->instr_val && | ||
| 331 | (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) { | ||
| 332 | if (hook->fn(regs, instr) == 0) { | ||
| 333 | spin_unlock_irqrestore(&undef_lock, flags); | ||
| 334 | return; | ||
| 335 | } | ||
| 336 | } | ||
| 337 | } | ||
| 338 | spin_unlock_irqrestore(&undef_lock, flags); | ||
| 339 | 344 | ||
| 340 | #ifdef CONFIG_DEBUG_USER | 345 | #ifdef CONFIG_DEBUG_USER |
| 341 | if (user_debug & UDBG_UNDEFINED) { | 346 | if (user_debug & UDBG_UNDEFINED) { |
