diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-06-22 23:05:57 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-06-22 23:05:57 +0000 |
commit | 51d3b7814cdccef9188240fe0cbd8d97ff2c7470 (patch) | |
tree | 5cbb01d0323d4f63ade66bdf48ba4a91aaa6df16 /include/asm-arm/proc-armo | |
parent | 52273a23c9a84336b93a35e4847fc88fac7eb0e4 (diff) |
Merge with Linux 2.3.7.
WARNING: 2.3.7 is known to eat filesystems for breakfast and little
children for lunch, so if you try this on your machine make backups
first ...
Diffstat (limited to 'include/asm-arm/proc-armo')
-rw-r--r-- | include/asm-arm/proc-armo/ptrace.h | 12 | ||||
-rw-r--r-- | include/asm-arm/proc-armo/semaphore.h | 23 | ||||
-rw-r--r-- | include/asm-arm/proc-armo/system.h | 6 |
3 files changed, 27 insertions, 14 deletions
diff --git a/include/asm-arm/proc-armo/ptrace.h b/include/asm-arm/proc-armo/ptrace.h index f53aa229d..513501b7d 100644 --- a/include/asm-arm/proc-armo/ptrace.h +++ b/include/asm-arm/proc-armo/ptrace.h @@ -44,6 +44,8 @@ struct pt_regs { #define CC_Z_BIT (1 << 30) #define CC_N_BIT (1 << 31) +#ifdef __KERNEL__ + #define processor_mode(regs) \ ((regs)->ARM_pc & MODE_MASK) @@ -70,11 +72,19 @@ struct pt_regs { */ static inline int valid_user_regs(struct pt_regs *regs) { - if (!user_mode(regs) || regs->ARM_pc & (F_BIT | I_BIT)) + if (user_mode(regs) && + (regs->ARM_pc & (F_BIT | I_BIT)) == 0) return 1; + /* + * force it to be something sensible + */ + regs->ARM_pc &= ~(MODE_MASK | F_BIT | I_BIT); + return 0; } +#endif /* __KERNEL__ */ + #endif diff --git a/include/asm-arm/proc-armo/semaphore.h b/include/asm-arm/proc-armo/semaphore.h index 9cd99cf50..19fa29bf9 100644 --- a/include/asm-arm/proc-armo/semaphore.h +++ b/include/asm-arm/proc-armo/semaphore.h @@ -14,13 +14,13 @@ extern inline void down(struct semaphore * sem) @ atomic down operation mov r0, pc orr lr, r0, #0x08000000 - and r0, r0, #0x0c000003 teqp lr, #0 ldr lr, [%0] + and r0, r0, #0x0c000003 subs lr, lr, #1 str lr, [%0] - mov lr, pc, lsr #28 - teqp r0, lr, lsl #28 + orrmi r0, r0, #0x80000000 @ set N + teqp r0, #0 movmi r0, %0 blmi " SYMBOL_NAME_STR(__down_failed) : @@ -39,14 +39,13 @@ extern inline int down_interruptible (struct semaphore * sem) @ atomic down operation mov r0, pc orr lr, r0, #0x08000000 - and r0, r0, #0x0c000003 teqp lr, #0 ldr lr, [%1] + and r0, r0, #0x0c000003 subs lr, lr, #1 str lr, [%1] - mov lr, pc, lsr #28 orrmi r0, r0, #0x80000000 @ set N - teqp r0, lr, lsl #28 + teqp r0, #0 movmi r0, %1 movpl r0, #0 blmi " SYMBOL_NAME_STR(__down_interruptible_failed) " @@ -64,14 +63,13 @@ extern inline int down_trylock(struct semaphore * sem) @ atomic down operation mov r0, pc orr lr, r0, #0x08000000 - and r0, r0, #0x0c000003 teqp lr, #0 ldr lr, [%1] + and r0, r0, #0x0c000003 subs lr, lr, #1 str lr, [%1] - mov lr, pc, lsr #28 orrmi r0, r0, #0x80000000 @ set N - teqp r0, lr, lsl #28 + teqp r0, #0 movmi r0, %1 movpl r0, #0 blmi " SYMBOL_NAME_STR(__down_trylock_failed) " @@ -94,14 +92,13 @@ extern inline void up(struct semaphore * sem) @ atomic up operation mov r0, pc orr lr, r0, #0x08000000 - and r0, r0, #0x0c000003 teqp lr, #0 ldr lr, [%0] + and r0, r0, #0x0c000003 adds lr, lr, #1 str lr, [%0] - mov lr, pc, lsr #28 - orrls r0, r0, #0x80000000 @ set N - teqp r0, lr, lsl #28 + orrle r0, r0, #0x80000000 @ set N + teqp r0, #0 movmi r0, %0 blmi " SYMBOL_NAME_STR(__up_wakeup) : diff --git a/include/asm-arm/proc-armo/system.h b/include/asm-arm/proc-armo/system.h index 471daf654..733a6cdff 100644 --- a/include/asm-arm/proc-armo/system.h +++ b/include/asm-arm/proc-armo/system.h @@ -110,6 +110,12 @@ extern __inline__ unsigned long __xchg(unsigned long x, volatile void *ptr, int : "memory"); \ } while (0) +/* For spinlocks etc */ +#define local_irq_save(x) __save_flags_cli(x) +#define local_irq_restore(x) __restore_flags(x) +#define local_irq_disable() __cli() +#define local_irq_enable() __sti() + #ifdef __SMP__ #error SMP not supported #else |