Commit 7071b291 authored by Hirokazu Takata's avatar Hirokazu Takata

m32r: Rename STI/CLI macros

The names of STI and CLI macros were derived from i386 arch historically,
but their name are incomprehensible.
So, for easy to understand, rename these macros to ENABLE_INTERRUPTS
and DISABLE_INTERRUPTS, respectively.
Signed-off-by: default avatarHirokazu Takata <takata@linux-m32r.org>
parent 33205613
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
#define nr_syscalls ((syscall_table_size)/4) #define nr_syscalls ((syscall_table_size)/4)
#ifdef CONFIG_PREEMPT #ifdef CONFIG_PREEMPT
#define preempt_stop(x) CLI(x) #define preempt_stop(x) DISABLE_INTERRUPTS(x)
#else #else
#define preempt_stop(x) #define preempt_stop(x)
#define resume_kernel restore_all #define resume_kernel restore_all
...@@ -144,7 +144,7 @@ ret_from_intr: ...@@ -144,7 +144,7 @@ ret_from_intr:
#endif #endif
beqz r4, resume_kernel beqz r4, resume_kernel
ENTRY(resume_userspace) ENTRY(resume_userspace)
CLI(r4) ; make sure we don't miss an interrupt DISABLE_INTERRUPTS(r4) ; make sure we don't miss an interrupt
; setting need_resched or sigpending ; setting need_resched or sigpending
; between sampling and the iret ; between sampling and the iret
GET_THREAD_INFO(r8) GET_THREAD_INFO(r8)
...@@ -168,11 +168,11 @@ need_resched: ...@@ -168,11 +168,11 @@ need_resched:
beqz r4, restore_all beqz r4, restore_all
LDIMM (r4, PREEMPT_ACTIVE) LDIMM (r4, PREEMPT_ACTIVE)
st r4, @(TI_PRE_COUNT, r8) st r4, @(TI_PRE_COUNT, r8)
STI(r4) ENABLE_INTERRUPTS(r4)
bl schedule bl schedule
ldi r4, #0 ldi r4, #0
st r4, @(TI_PRE_COUNT, r8) st r4, @(TI_PRE_COUNT, r8)
CLI(r4) DISABLE_INTERRUPTS(r4)
bra need_resched bra need_resched
#endif #endif
...@@ -180,7 +180,7 @@ need_resched: ...@@ -180,7 +180,7 @@ need_resched:
ENTRY(system_call) ENTRY(system_call)
SWITCH_TO_KERNEL_STACK SWITCH_TO_KERNEL_STACK
SAVE_ALL SAVE_ALL
STI(r4) ; Enable interrupt ENABLE_INTERRUPTS(r4) ; Enable interrupt
st sp, PTREGS(sp) ; implicit pt_regs parameter st sp, PTREGS(sp) ; implicit pt_regs parameter
cmpui r7, #NR_syscalls cmpui r7, #NR_syscalls
bnc syscall_badsys bnc syscall_badsys
...@@ -198,7 +198,7 @@ syscall_call: ...@@ -198,7 +198,7 @@ syscall_call:
jl r7 ; execute system call jl r7 ; execute system call
st r0, R0(sp) ; save the return value st r0, R0(sp) ; save the return value
syscall_exit: syscall_exit:
CLI(r4) ; make sure we don't miss an interrupt DISABLE_INTERRUPTS(r4) ; make sure we don't miss an interrupt
; setting need_resched or sigpending ; setting need_resched or sigpending
; between sampling and the iret ; between sampling and the iret
ld r9, @(TI_FLAGS, r8) ld r9, @(TI_FLAGS, r8)
...@@ -215,7 +215,7 @@ work_pending: ...@@ -215,7 +215,7 @@ work_pending:
beqz r4, work_notifysig beqz r4, work_notifysig
work_resched: work_resched:
bl schedule bl schedule
CLI(r4) ; make sure we don't miss an interrupt DISABLE_INTERRUPTS(r4) ; make sure we don't miss an interrupt
; setting need_resched or sigpending ; setting need_resched or sigpending
; between sampling and the iret ; between sampling and the iret
ld r9, @(TI_FLAGS, r8) ld r9, @(TI_FLAGS, r8)
...@@ -257,7 +257,7 @@ syscall_exit_work: ...@@ -257,7 +257,7 @@ syscall_exit_work:
ld r9, @(TI_FLAGS, r8) ld r9, @(TI_FLAGS, r8)
and3 r4, r9, #_TIF_SYSCALL_TRACE and3 r4, r9, #_TIF_SYSCALL_TRACE
beqz r4, work_pending beqz r4, work_pending
STI(r4) ; could let do_syscall_trace() call ENABLE_INTERRUPTS(r4) ; could let do_syscall_trace() call
; schedule() instead ; schedule() instead
bl do_syscall_trace bl do_syscall_trace
bra resume_userspace bra resume_userspace
......
...@@ -52,27 +52,27 @@ ...@@ -52,27 +52,27 @@
.endm .endm
#if !(defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_M32104)) #if !(defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_M32104))
#define STI(reg) STI_M reg #define ENABLE_INTERRUPTS(reg) ENABLE_INTERRUPTS reg
.macro STI_M reg .macro ENABLE_INTERRUPTS reg
setpsw #0x40 -> nop setpsw #0x40 -> nop
; WORKAROUND: "-> nop" is a workaround for the M32700(TS1). ; WORKAROUND: "-> nop" is a workaround for the M32700(TS1).
.endm .endm
#define CLI(reg) CLI_M reg #define DISABLE_INTERRUPTS(reg) DISABLE_INTERRUPTS reg
.macro CLI_M reg .macro DISABLE_INTERRUPTS reg
clrpsw #0x40 -> nop clrpsw #0x40 -> nop
; WORKAROUND: "-> nop" is a workaround for the M32700(TS1). ; WORKAROUND: "-> nop" is a workaround for the M32700(TS1).
.endm .endm
#else /* CONFIG_CHIP_M32102 || CONFIG_CHIP_M32104 */ #else /* CONFIG_CHIP_M32102 || CONFIG_CHIP_M32104 */
#define STI(reg) STI_M reg #define ENABLE_INTERRUPTS(reg) ENABLE_INTERRUPTS reg
.macro STI_M reg .macro ENABLE_INTERRUPTS reg
mvfc \reg, psw mvfc \reg, psw
or3 \reg, \reg, #0x0040 or3 \reg, \reg, #0x0040
mvtc \reg, psw mvtc \reg, psw
.endm .endm
#define CLI(reg) CLI_M reg #define DISABLE_INTERRUPTS(reg) DISABLE_INTERRUPTS reg
.macro CLI_M reg .macro DISABLE_INTERRUPTS reg
mvfc \reg, psw mvfc \reg, psw
and3 \reg, \reg, #0xffbf and3 \reg, \reg, #0xffbf
mvtc \reg, psw mvtc \reg, psw
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment