1 #ifndef _ASM_M32R_ASSEMBLER_H
2 #define _ASM_M32R_ASSEMBLER_H
7 * linux/asm-m32r/assembler.h
9 * This file contains M32R architecture specific defines.
11 * Do not include any C declarations in this file - it is included by
15 #include <linux/config.h>
19 #define ENTRY(name) ENTRY_M name
27 * LDIMM: load immediate value
29 * STI: enable interruption
30 * CLI: disable interruption
35 #define LDIMM(reg,x) LDIMM reg x
38 or3 \reg, \reg, #low(\x)
41 #if !defined(CONFIG_CHIP_M32102)
42 #define STI(reg) STI_M reg
45 ; WORKAROUND: "-> nop" is a workaround for the M32700(TS1).
48 #define CLI(reg) CLI_M reg
51 ; WORKAROUND: "-> nop" is a workaround for the M32700(TS1).
53 #else /* CONFIG_CHIP_M32102 */
54 #define STI(reg) STI_M reg
57 or3 \reg, \reg, #0x0040
61 #define CLI(reg) CLI_M reg
64 and3 \reg, \reg, #0xffbf
67 #endif /* CONFIG_CHIP_M32102 */
84 #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
93 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
99 #error unknown isa configuration
102 push r13 ; syscall_nr (default: -1)
113 addi sp, #-4 ; room for implicit pt_regs parameter
134 addi r15, #4 ; Skip syscall number
135 #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
144 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
150 #error unknown isa configuration
156 addi sp, #8 ; Skip bbpsw, bbpc
162 addi sp, #4 ; Skip orig_r0
168 .section __ex_table,"a"
174 #define GET_CURRENT(reg) get_current reg
175 .macro get_current reg
180 #if !defined(CONFIG_CHIP_M32102)
181 .macro SWITCH_TO_KERNEL_STACK
182 ; switch to kernel stack (spi)
185 #else /* CONFIG_CHIP_M32102 */
186 .macro SWITCH_TO_KERNEL_STACK
187 push r0 ; save r0 for working
189 and3 r0, r0, #0x00ff7f
192 bltz r0, 1f ; check BSM-bit
194 ;; called from kernel context: previous stack = spi
199 ;; called from user context: previous stack = spu
203 ld r0, @(-4,r0) ; retrieve r0
207 #endif /* CONFIG_CHIP_M32102 */
209 #endif /* __ASSEMBLY__ */
211 #endif /* _ASM_M32R_ASSEMBLER_H */