diff options
Diffstat (limited to 'include/asm-arm/proc-armv')
-rw-r--r-- | include/asm-arm/proc-armv/assembler.h | 13 | ||||
-rw-r--r-- | include/asm-arm/proc-armv/elf.h | 2 | ||||
-rw-r--r-- | include/asm-arm/proc-armv/system.h | 30 | ||||
-rw-r--r-- | include/asm-arm/proc-armv/uaccess.h | 24 |
4 files changed, 47 insertions, 22 deletions
diff --git a/include/asm-arm/proc-armv/assembler.h b/include/asm-arm/proc-armv/assembler.h index 788a22b87..aaec7f9c7 100644 --- a/include/asm-arm/proc-armv/assembler.h +++ b/include/asm-arm/proc-armv/assembler.h @@ -6,10 +6,6 @@ * This file contains ARM processor specifics for * the ARM6 and better processors. */ -#ifndef __ASSEMBLY__ -#error "Only include this from assembly code" -#endif - #define MODE_USR USR_MODE #define MODE_FIQ FIQ_MODE #define MODE_IRQ IRQ_MODE @@ -35,9 +31,8 @@ instr regs /* - * Save the current IRQ state and disable IRQs - * Note that this macro assumes FIQs are enabled, and - * that the processor is in SVC mode. + * Save the current IRQ state and disable IRQs. Note that this macro + * assumes FIQs are enabled, and that the processor is in SVC mode. */ .macro save_and_disable_irqs, oldcpsr, temp mrs \oldcpsr, cpsr @@ -46,8 +41,8 @@ .endm /* - * Restore interrupt state previously stored in - * a register + * Restore interrupt state previously stored in a register. We don't + * guarantee that this will preserve the flags. */ .macro restore_irqs, oldcpsr msr cpsr_c, \oldcpsr diff --git a/include/asm-arm/proc-armv/elf.h b/include/asm-arm/proc-armv/elf.h index 3c41d577b..c5eb263aa 100644 --- a/include/asm-arm/proc-armv/elf.h +++ b/include/asm-arm/proc-armv/elf.h @@ -17,6 +17,6 @@ there is no other ELF system currently supported by iBCS. @@ Could print a warning message to encourage users to upgrade. */ #define SET_PERSONALITY(ex,ibcs2) \ - set_personality((ex).e_flags&EF_ARM_APCS26 ?PER_LINUX :PER_LINUX_32BIT) + set_personality(((ex).e_flags&EF_ARM_APCS26 ?PER_LINUX :PER_LINUX_32BIT)) #endif diff --git a/include/asm-arm/proc-armv/system.h b/include/asm-arm/proc-armv/system.h index d9ef8ffd9..e05e6356f 100644 --- a/include/asm-arm/proc-armv/system.h +++ b/include/asm-arm/proc-armv/system.h @@ -79,6 +79,36 @@ extern unsigned long cr_alignment; /* defined in entry-armv.S */ }) /* + * Enable FIQs + */ +#define __stf() \ + ({ \ + unsigned long temp; \ + __asm__ __volatile__( \ + "mrs %0, cpsr @ stf\n" \ +" bic %0, %0, #64\n" \ +" msr cpsr_c, %0" \ + : "=r" (temp) \ + : \ + : "memory"); \ + }) + +/* + * Disable FIQs + */ +#define __clf() \ + ({ \ + unsigned long temp; \ + __asm__ __volatile__( \ + "mrs %0, cpsr @ clf\n" \ +" orr %0, %0, #64\n" \ +" msr cpsr_c, %0" \ + : "=r" (temp) \ + : \ + : "memory"); \ + }) + +/* * save current IRQ & FIQ state */ #define __save_flags(x) \ diff --git a/include/asm-arm/proc-armv/uaccess.h b/include/asm-arm/proc-armv/uaccess.h index 67afdd2ae..af146abf9 100644 --- a/include/asm-arm/proc-armv/uaccess.h +++ b/include/asm-arm/proc-armv/uaccess.h @@ -41,7 +41,7 @@ extern __inline__ void set_fs (mm_segment_t fs) "2:\n" \ " .section .fixup,\"ax\"\n" \ " .align 2\n" \ - "3: mvn %0, %3\n" \ + "3: mov %0, %3\n" \ " b 2b\n" \ " .previous\n" \ " .section __ex_table,\"a\"\n" \ @@ -49,7 +49,7 @@ extern __inline__ void set_fs (mm_segment_t fs) " .long 1b, 3b\n" \ " .previous" \ : "=r" (err) \ - : "r" (x), "r" (addr), "i" (EFAULT), "0" (err)) + : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err)) #define __put_user_asm_half(x,addr,err) \ ({ \ @@ -60,7 +60,7 @@ extern __inline__ void set_fs (mm_segment_t fs) "3:\n" \ " .section .fixup,\"ax\"\n" \ " .align 2\n" \ - "4: mvn %0, %5\n" \ + "4: mov %0, %5\n" \ " b 3b\n" \ " .previous\n" \ " .section __ex_table,\"a\"\n" \ @@ -71,7 +71,7 @@ extern __inline__ void set_fs (mm_segment_t fs) : "=r" (err) \ : "r" (__temp), "r" (__temp >> 8), \ "r" (addr), "r" ((int)(addr) + 1), \ - "i" (EFAULT), "0" (err)); \ + "i" (-EFAULT), "0" (err)); \ }) #define __put_user_asm_word(x,addr,err) \ @@ -80,7 +80,7 @@ extern __inline__ void set_fs (mm_segment_t fs) "2:\n" \ " .section .fixup,\"ax\"\n" \ " .align 2\n" \ - "3: mvn %0, %3\n" \ + "3: mov %0, %3\n" \ " b 2b\n" \ " .previous\n" \ " .section __ex_table,\"a\"\n" \ @@ -88,7 +88,7 @@ extern __inline__ void set_fs (mm_segment_t fs) " .long 1b, 3b\n" \ " .previous" \ : "=r" (err) \ - : "r" (x), "r" (addr), "i" (EFAULT), "0" (err)) + : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err)) #define __get_user_asm_byte(x,addr,err) \ __asm__ __volatile__( \ @@ -96,7 +96,7 @@ extern __inline__ void set_fs (mm_segment_t fs) "2:\n" \ " .section .fixup,\"ax\"\n" \ " .align 2\n" \ - "3: mvn %0, %3\n" \ + "3: mov %0, %3\n" \ " mov %1, #0\n" \ " b 2b\n" \ " .previous\n" \ @@ -105,7 +105,7 @@ extern __inline__ void set_fs (mm_segment_t fs) " .long 1b, 3b\n" \ " .previous" \ : "=r" (err), "=r" (x) \ - : "r" (addr), "i" (EFAULT), "0" (err)) + : "r" (addr), "i" (-EFAULT), "0" (err)) #define __get_user_asm_half(x,addr,err) \ ({ \ @@ -117,7 +117,7 @@ extern __inline__ void set_fs (mm_segment_t fs) "3:\n" \ " .section .fixup,\"ax\"\n" \ " .align 2\n" \ - "4: mvn %0, %5\n" \ + "4: mov %0, %5\n" \ " mov %1, #0\n" \ " b 3b\n" \ " .previous\n" \ @@ -128,7 +128,7 @@ extern __inline__ void set_fs (mm_segment_t fs) " .previous" \ : "=r" (err), "=r" (x), "=&r" (__temp) \ : "r" (addr), "r" ((int)(addr) + 1), \ - "i" (EFAULT), "0" (err)); \ + "i" (-EFAULT), "0" (err)); \ }) @@ -138,7 +138,7 @@ extern __inline__ void set_fs (mm_segment_t fs) "2:\n" \ " .section .fixup,\"ax\"\n" \ " .align 2\n" \ - "3: mvn %0, %3\n" \ + "3: mov %0, %3\n" \ " mov %1, #0\n" \ " b 2b\n" \ " .previous\n" \ @@ -147,7 +147,7 @@ extern __inline__ void set_fs (mm_segment_t fs) " .long 1b, 3b\n" \ " .previous" \ : "=r" (err), "=r" (x) \ - : "r" (addr), "i" (EFAULT), "0" (err)) + : "r" (addr), "i" (-EFAULT), "0" (err)) extern unsigned long __arch_copy_from_user(void *to, const void *from, unsigned long n); #define __do_copy_from_user(to,from,n) \ |