提交 865c1d4d 编写于 作者: D dzzxzz

fix a spelling error

rt_thread_switch_interrput_flag -> rt_thread_switch_interrupt_flag

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1712 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 c883902d
...@@ -75,16 +75,16 @@ rt_hw_context_switch_to: ...@@ -75,16 +75,16 @@ rt_hw_context_switch_to:
/* /*
* void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to)/* * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to)/*
*/ */
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
.globl rt_hw_context_switch_interrupt .globl rt_hw_context_switch_interrupt
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
ldr r2, =rt_thread_switch_interrput_flag ldr r2, =rt_thread_switch_interrupt_flag
ldr r3, [r2] ldr r3, [r2]
cmp r3, #1 cmp r3, #1
beq _reswitch beq _reswitch
mov r3, #1 /* set rt_thread_switch_interrput_flag to 1 */ mov r3, #1 /* set rt_thread_switch_interrupt_flag to 1 */
str r3, [r2] str r3, [r2]
ldr r2, =rt_interrupt_from_thread /* set rt_interrupt_from_thread */ ldr r2, =rt_interrupt_from_thread /* set rt_interrupt_from_thread */
str r0, [r2] str r0, [r2]
......
...@@ -84,17 +84,17 @@ rt_hw_context_switch_to PROC ...@@ -84,17 +84,17 @@ rt_hw_context_switch_to PROC
;/* ;/*
; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); ; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
; */ ; */
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
rt_hw_context_switch_interrupt PROC rt_hw_context_switch_interrupt PROC
EXPORT rt_hw_context_switch_interrupt EXPORT rt_hw_context_switch_interrupt
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
MOV r3, #1 ; set rt_thread_switch_interrput_flag to 1 MOV r3, #1 ; set rt_thread_switch_interrupt_flag to 1
STR r3, [r2] STR r3, [r2]
LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread
STR r0, [r2] STR r0, [r2]
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
extern rt_uint32_t rt_interrupt_nest; extern rt_uint32_t rt_interrupt_nest;
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
/** /**
* @addtogroup AT91SAM7 * @addtogroup AT91SAM7
...@@ -48,7 +48,7 @@ void rt_hw_interrupt_init() ...@@ -48,7 +48,7 @@ void rt_hw_interrupt_init()
rt_interrupt_nest = 0; rt_interrupt_nest = 0;
rt_interrupt_from_thread = 0; rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0; rt_interrupt_to_thread = 0;
rt_thread_switch_interrput_flag = 0; rt_thread_switch_interrupt_flag = 0;
} }
/** /**
......
...@@ -164,7 +164,7 @@ vector_resv : b vector_resv ...@@ -164,7 +164,7 @@ vector_resv : b vector_resv
.globl rt_interrupt_enter .globl rt_interrupt_enter
.globl rt_interrupt_leave .globl rt_interrupt_leave
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
vector_irq: vector_irq:
...@@ -174,10 +174,10 @@ vector_irq: ...@@ -174,10 +174,10 @@ vector_irq:
bl rt_interrupt_leave bl rt_interrupt_leave
/* /*
* if rt_thread_switch_interrput_flag set, jump to * if rt_thread_switch_interrupt_flag set, jump to
* rt_hw_context_switch_interrupt_do and don't return * rt_hw_context_switch_interrupt_do and don't return
*/ */
ldr r0, =rt_thread_switch_interrput_flag ldr r0, =rt_thread_switch_interrupt_flag
ldr r1, [r0] ldr r1, [r0]
cmp r1, #1 cmp r1, #1
beq rt_hw_context_switch_interrupt_do beq rt_hw_context_switch_interrupt_do
......
...@@ -408,7 +408,7 @@ MC_RCR EQU 0x00 ; MC_RCR Offset ...@@ -408,7 +408,7 @@ MC_RCR EQU 0x00 ; MC_RCR Offset
IMPORT rt_interrupt_enter IMPORT rt_interrupt_enter
IMPORT rt_interrupt_leave IMPORT rt_interrupt_leave
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
IMPORT rt_hw_trap_irq IMPORT rt_hw_trap_irq
...@@ -420,9 +420,9 @@ IRQ_Handler PROC ...@@ -420,9 +420,9 @@ IRQ_Handler PROC
BL rt_hw_trap_irq BL rt_hw_trap_irq
BL rt_interrupt_leave BL rt_interrupt_leave
; if rt_thread_switch_interrput_flag set, jump to ; if rt_thread_switch_interrupt_flag set, jump to
; rt_hw_context_switch_interrupt_do and don't return ; rt_hw_context_switch_interrupt_do and don't return
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CMP r1, #1 CMP r1, #1
BEQ rt_hw_context_switch_interrupt_do BEQ rt_hw_context_switch_interrupt_do
......
...@@ -80,16 +80,16 @@ rt_hw_context_switch_to: ...@@ -80,16 +80,16 @@ rt_hw_context_switch_to:
/* /*
* void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
*/ */
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
.globl rt_hw_context_switch_interrupt .globl rt_hw_context_switch_interrupt
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
ldr r2, =rt_thread_switch_interrput_flag ldr r2, =rt_thread_switch_interrupt_flag
ldr r3, [r2] ldr r3, [r2]
cmp r3, #1 cmp r3, #1
beq _reswitch beq _reswitch
mov r3, #1 @ set rt_thread_switch_interrput_flag to 1 mov r3, #1 @ set rt_thread_switch_interrupt_flag to 1
str r3, [r2] str r3, [r2]
ldr r2, =rt_interrupt_from_thread @ set rt_interrupt_from_thread ldr r2, =rt_interrupt_from_thread @ set rt_interrupt_from_thread
str r0, [r2] str r0, [r2]
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
; * 2009-01-20 Bernard first version ; * 2009-01-20 Bernard first version
; */ ; */
NOINT EQU 0xc0 ; disable interrupt in psr NOINT EQU 0xc0 ; disable interrupt in psr
AREA |.text|, CODE, READONLY, ALIGN=2 AREA |.text|, CODE, READONLY, ALIGN=2
ARM ARM
REQUIRE8 REQUIRE8
PRESERVE8 PRESERVE8
;/* ;/*
; * rt_base_t rt_hw_interrupt_disable(); ; * rt_base_t rt_hw_interrupt_disable();
...@@ -26,16 +26,16 @@ rt_hw_interrupt_disable PROC ...@@ -26,16 +26,16 @@ rt_hw_interrupt_disable PROC
EXPORT rt_hw_interrupt_disable EXPORT rt_hw_interrupt_disable
MRS r0, cpsr MRS r0, cpsr
ORR r1, r0, #NOINT ORR r1, r0, #NOINT
MSR cpsr_c, r1 MSR cpsr_c, r1
BX lr BX lr
ENDP ENDP
;/* ;/*
; * void rt_hw_interrupt_enable(rt_base_t level); ; * void rt_hw_interrupt_enable(rt_base_t level);
; */ ; */
rt_hw_interrupt_enable PROC rt_hw_interrupt_enable PROC
EXPORT rt_hw_interrupt_enable EXPORT rt_hw_interrupt_enable
MSR cpsr_c, r0 MSR cpsr_c, r0
BX lr BX lr
ENDP ENDP
...@@ -63,7 +63,7 @@ rt_hw_context_switch PROC ...@@ -63,7 +63,7 @@ rt_hw_context_switch PROC
MSR cpsr_cxsf, r4 MSR cpsr_cxsf, r4
LDMFD sp!, {r0-r12, lr, pc} ; pop new task r0-r12, lr & pc LDMFD sp!, {r0-r12, lr, pc} ; pop new task r0-r12, lr & pc
ENDP ENDP
;/* ;/*
; * void rt_hw_context_switch_to(rt_uint32 to); ; * void rt_hw_context_switch_to(rt_uint32 to);
...@@ -79,29 +79,29 @@ rt_hw_context_switch_to PROC ...@@ -79,29 +79,29 @@ rt_hw_context_switch_to PROC
MSR cpsr_cxsf, r4 MSR cpsr_cxsf, r4
LDMFD sp!, {r0-r12, lr, pc} ; pop new task r0-r12, lr & pc LDMFD sp!, {r0-r12, lr, pc} ; pop new task r0-r12, lr & pc
ENDP ENDP
;/* ;/*
; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); ; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
; */ ; */
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
rt_hw_context_switch_interrupt PROC rt_hw_context_switch_interrupt PROC
EXPORT rt_hw_context_switch_interrupt EXPORT rt_hw_context_switch_interrupt
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
MOV r3, #1 ; set rt_thread_switch_interrput_flag to 1 MOV r3, #1 ; set rt_thread_switch_interrupt_flag to 1
STR r3, [r2] STR r3, [r2]
LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread
STR r0, [r2] STR r0, [r2]
_reswitch _reswitch
LDR r2, =rt_interrupt_to_thread ; set rt_interrupt_to_thread LDR r2, =rt_interrupt_to_thread ; set rt_interrupt_to_thread
STR r1, [r2] STR r1, [r2]
BX lr BX lr
ENDP ENDP
END END
\ No newline at end of file
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
extern rt_uint32_t rt_interrupt_nest; extern rt_uint32_t rt_interrupt_nest;
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
/** /**
* @addtogroup AT91SAM7 * @addtogroup AT91SAM7
...@@ -48,7 +48,7 @@ void rt_hw_interrupt_init() ...@@ -48,7 +48,7 @@ void rt_hw_interrupt_init()
rt_interrupt_nest = 0; rt_interrupt_nest = 0;
rt_interrupt_from_thread = 0; rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0; rt_interrupt_to_thread = 0;
rt_thread_switch_interrput_flag = 0; rt_thread_switch_interrupt_flag = 0;
} }
/** /**
...@@ -56,11 +56,11 @@ void rt_hw_interrupt_init() ...@@ -56,11 +56,11 @@ void rt_hw_interrupt_init()
* @param vector the interrupt number * @param vector the interrupt number
*/ */
void rt_hw_interrupt_mask(int vector) void rt_hw_interrupt_mask(int vector)
{ {
/* disable interrupt */ /* disable interrupt */
AT91C_BASE_AIC->AIC_IDCR = 1 << vector; AT91C_BASE_AIC->AIC_IDCR = 1 << vector;
/* clear interrupt */ /* clear interrupt */
AT91C_BASE_AIC->AIC_ICCR = 1 << vector; AT91C_BASE_AIC->AIC_ICCR = 1 << vector;
} }
......
...@@ -206,7 +206,7 @@ vector_resv : b vector_resv ...@@ -206,7 +206,7 @@ vector_resv : b vector_resv
.globl rt_interrupt_enter .globl rt_interrupt_enter
.globl rt_interrupt_leave .globl rt_interrupt_leave
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
vector_irq: vector_irq:
...@@ -216,10 +216,10 @@ vector_irq: ...@@ -216,10 +216,10 @@ vector_irq:
bl rt_interrupt_leave bl rt_interrupt_leave
/* /*
* if rt_thread_switch_interrput_flag set, jump to * if rt_thread_switch_interrupt_flag set, jump to
* rt_hw_context_switch_interrupt_do and don't return * rt_hw_context_switch_interrupt_do and don't return
*/ */
ldr r0, =rt_thread_switch_interrput_flag ldr r0, =rt_thread_switch_interrupt_flag
ldr r1, [r0] ldr r1, [r0]
cmp r1, #1 cmp r1, #1
beq rt_hw_context_switch_interrupt_do beq rt_hw_context_switch_interrupt_do
......
...@@ -411,7 +411,7 @@ MC_RCR EQU 0x00 ; MC_RCR Offset ...@@ -411,7 +411,7 @@ MC_RCR EQU 0x00 ; MC_RCR Offset
IMPORT rt_interrupt_enter IMPORT rt_interrupt_enter
IMPORT rt_interrupt_leave IMPORT rt_interrupt_leave
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
IMPORT rt_hw_trap_irq IMPORT rt_hw_trap_irq
...@@ -438,9 +438,9 @@ IRQ_Handler PROC ...@@ -438,9 +438,9 @@ IRQ_Handler PROC
BL rt_hw_trap_irq BL rt_hw_trap_irq
BL rt_interrupt_leave BL rt_interrupt_leave
; if rt_thread_switch_interrput_flag set, jump to ; if rt_thread_switch_interrupt_flag set, jump to
; rt_hw_context_switch_interrupt_do and don't return ; rt_hw_context_switch_interrupt_do and don't return
SWITCH LDR r0, =rt_thread_switch_interrput_flag SWITCH LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CMP r1, #1 CMP r1, #1
BEQ rt_hw_context_switch_interrupt_do BEQ rt_hw_context_switch_interrupt_do
......
...@@ -29,7 +29,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep ...@@ -29,7 +29,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep
REQUIRE8 REQUIRE8
PRESERVE8 PRESERVE8
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
...@@ -62,8 +62,8 @@ rt_hw_context_switch_interrupt ...@@ -62,8 +62,8 @@ rt_hw_context_switch_interrupt
rt_hw_context_switch PROC rt_hw_context_switch PROC
EXPORT rt_hw_context_switch EXPORT rt_hw_context_switch
; set rt_thread_switch_interrput_flag to 1 ; set rt_thread_switch_interrupt_flag to 1
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
...@@ -94,11 +94,11 @@ rt_hw_pend_sv PROC ...@@ -94,11 +94,11 @@ rt_hw_pend_sv PROC
CPSID I CPSID I
; get rt_thread_switch_interrupt_flag ; get rt_thread_switch_interrupt_flag
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CBZ r1, pendsv_exit ; pendsv already handled CBZ r1, pendsv_exit ; pendsv already handled
; clear rt_thread_switch_interrput_flag to 0 ; clear rt_thread_switch_interrupt_flag to 0
MOV r1, #0x00 MOV r1, #0x00
STR r1, [r0] STR r1, [r0]
...@@ -144,7 +144,7 @@ rt_hw_context_switch_to PROC ...@@ -144,7 +144,7 @@ rt_hw_context_switch_to PROC
STR r0, [r1] STR r0, [r1]
; set interrupt flag to 1 ; set interrupt flag to 1
LDR r1, =rt_thread_switch_interrput_flag LDR r1, =rt_thread_switch_interrupt_flag
MOV r0, #1 MOV r0, #1
STR r0, [r1] STR r0, [r1]
......
...@@ -16,6 +16,6 @@ ...@@ -16,6 +16,6 @@
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
/*@}*/ /*@}*/
...@@ -81,16 +81,16 @@ rt_hw_context_switch_to: ...@@ -81,16 +81,16 @@ rt_hw_context_switch_to:
/* /*
* void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
*/ */
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
.globl rt_hw_context_switch_interrupt .globl rt_hw_context_switch_interrupt
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
ldr r2, =rt_thread_switch_interrput_flag ldr r2, =rt_thread_switch_interrupt_flag
ldr r3, [r2] ldr r3, [r2]
cmp r3, #1 cmp r3, #1
beq _reswitch beq _reswitch
mov r3, #1 @ set rt_thread_switch_interrput_flag to 1 mov r3, #1 @ set rt_thread_switch_interrupt_flag to 1
str r3, [r2] str r3, [r2]
ldr r2, =rt_interrupt_from_thread @ set rt_interrupt_from_thread ldr r2, =rt_interrupt_from_thread @ set rt_interrupt_from_thread
str r0, [r2] str r0, [r2]
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
; * 2011-08-14 weety copy from mini2440 ; * 2011-08-14 weety copy from mini2440
; */ ; */
NOINT EQU 0xc0 ; disable interrupt in psr NOINT EQU 0xc0 ; disable interrupt in psr
AREA |.text|, CODE, READONLY, ALIGN=2 AREA |.text|, CODE, READONLY, ALIGN=2
ARM ARM
REQUIRE8 REQUIRE8
PRESERVE8 PRESERVE8
;/* ;/*
; * rt_base_t rt_hw_interrupt_disable(); ; * rt_base_t rt_hw_interrupt_disable();
...@@ -26,16 +26,16 @@ rt_hw_interrupt_disable PROC ...@@ -26,16 +26,16 @@ rt_hw_interrupt_disable PROC
EXPORT rt_hw_interrupt_disable EXPORT rt_hw_interrupt_disable
MRS r0, cpsr MRS r0, cpsr
ORR r1, r0, #NOINT ORR r1, r0, #NOINT
MSR cpsr_c, r1 MSR cpsr_c, r1
BX lr BX lr
ENDP ENDP
;/* ;/*
; * void rt_hw_interrupt_enable(rt_base_t level); ; * void rt_hw_interrupt_enable(rt_base_t level);
; */ ; */
rt_hw_interrupt_enable PROC rt_hw_interrupt_enable PROC
EXPORT rt_hw_interrupt_enable EXPORT rt_hw_interrupt_enable
MSR cpsr_c, r0 MSR cpsr_c, r0
BX lr BX lr
ENDP ENDP
...@@ -63,7 +63,7 @@ rt_hw_context_switch PROC ...@@ -63,7 +63,7 @@ rt_hw_context_switch PROC
MSR cpsr_cxsf, r4 MSR cpsr_cxsf, r4
LDMFD sp!, {r0-r12, lr, pc} ; pop new task r0-r12, lr & pc LDMFD sp!, {r0-r12, lr, pc} ; pop new task r0-r12, lr & pc
ENDP ENDP
;/* ;/*
; * void rt_hw_context_switch_to(rt_uint32 to); ; * void rt_hw_context_switch_to(rt_uint32 to);
...@@ -79,29 +79,29 @@ rt_hw_context_switch_to PROC ...@@ -79,29 +79,29 @@ rt_hw_context_switch_to PROC
MSR cpsr_cxsf, r4 MSR cpsr_cxsf, r4
LDMFD sp!, {r0-r12, lr, pc} ; pop new task r0-r12, lr & pc LDMFD sp!, {r0-r12, lr, pc} ; pop new task r0-r12, lr & pc
ENDP ENDP
;/* ;/*
; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); ; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
; */ ; */
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
rt_hw_context_switch_interrupt PROC rt_hw_context_switch_interrupt PROC
EXPORT rt_hw_context_switch_interrupt EXPORT rt_hw_context_switch_interrupt
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
MOV r3, #1 ; set rt_thread_switch_interrput_flag to 1 MOV r3, #1 ; set rt_thread_switch_interrupt_flag to 1
STR r3, [r2] STR r3, [r2]
LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread
STR r0, [r2] STR r0, [r2]
_reswitch _reswitch
LDR r2, =rt_interrupt_to_thread ; set rt_interrupt_to_thread LDR r2, =rt_interrupt_to_thread ; set rt_interrupt_to_thread
STR r1, [r2] STR r1, [r2]
BX lr BX lr
ENDP ENDP
END END
...@@ -22,7 +22,7 @@ extern rt_uint32_t rt_interrupt_nest; ...@@ -22,7 +22,7 @@ extern rt_uint32_t rt_interrupt_nest;
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_isr_handler_t isr_table[MAX_HANDLERS]; rt_isr_handler_t isr_table[MAX_HANDLERS];
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
...@@ -201,7 +201,7 @@ void rt_hw_interrupt_init(void) ...@@ -201,7 +201,7 @@ void rt_hw_interrupt_init(void)
rt_interrupt_nest = 0; rt_interrupt_nest = 0;
rt_interrupt_from_thread = 0; rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0; rt_interrupt_to_thread = 0;
rt_thread_switch_interrput_flag = 0; rt_thread_switch_interrupt_flag = 0;
} }
static void at91_gpio_irq_mask(int irq) static void at91_gpio_irq_mask(int irq)
......
...@@ -285,7 +285,7 @@ vector_resv: ...@@ -285,7 +285,7 @@ vector_resv:
.globl rt_interrupt_enter .globl rt_interrupt_enter
.globl rt_interrupt_leave .globl rt_interrupt_leave
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
vector_irq: vector_irq:
...@@ -294,8 +294,8 @@ vector_irq: ...@@ -294,8 +294,8 @@ vector_irq:
bl rt_hw_trap_irq bl rt_hw_trap_irq
bl rt_interrupt_leave bl rt_interrupt_leave
/* if rt_thread_switch_interrput_flag set, jump to _interrupt_thread_switch and don't return */ /* if rt_thread_switch_interrupt_flag set, jump to _interrupt_thread_switch and don't return */
ldr r0, =rt_thread_switch_interrput_flag ldr r0, =rt_thread_switch_interrupt_flag
ldr r1, [r0] ldr r1, [r0]
cmp r1, #1 cmp r1, #1
beq _interrupt_thread_switch beq _interrupt_thread_switch
...@@ -311,7 +311,7 @@ vector_fiq: ...@@ -311,7 +311,7 @@ vector_fiq:
subs pc,lr,#4 subs pc,lr,#4
_interrupt_thread_switch: _interrupt_thread_switch:
mov r1, #0 /* clear rt_thread_switch_interrput_flag*/ mov r1, #0 /* clear rt_thread_switch_interrupt_flag*/
str r1, [r0] str r1, [r0]
ldmfd sp!, {r0-r12,lr} /* reload saved registers */ ldmfd sp!, {r0-r12,lr} /* reload saved registers */
......
...@@ -222,7 +222,7 @@ Reset_Handler ...@@ -222,7 +222,7 @@ Reset_Handler
IMPORT rt_interrupt_enter IMPORT rt_interrupt_enter
IMPORT rt_interrupt_leave IMPORT rt_interrupt_leave
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
IMPORT rt_hw_trap_irq IMPORT rt_hw_trap_irq
...@@ -234,9 +234,9 @@ IRQ_Handler PROC ...@@ -234,9 +234,9 @@ IRQ_Handler PROC
BL rt_hw_trap_irq BL rt_hw_trap_irq
BL rt_interrupt_leave BL rt_interrupt_leave
; if rt_thread_switch_interrput_flag set, jump to ; if rt_thread_switch_interrupt_flag set, jump to
; rt_hw_context_switch_interrupt_do and don't return ; rt_hw_context_switch_interrupt_do and don't return
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CMP r1, #1 CMP r1, #1
BEQ rt_hw_context_switch_interrupt_do BEQ rt_hw_context_switch_interrupt_do
......
...@@ -66,8 +66,8 @@ rt_hw_interrupt_enable: ...@@ -66,8 +66,8 @@ rt_hw_interrupt_enable:
.type rt_hw_context_switch, %function .type rt_hw_context_switch, %function
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
rt_hw_context_switch: rt_hw_context_switch:
/* set rt_thread_switch_interrput_flag to 1 */ /* set rt_thread_switch_interrupt_flag to 1 */
LDR R2, =rt_thread_switch_interrput_flag LDR R2, =rt_thread_switch_interrupt_flag
LDR R3, [R2] LDR R3, [R2]
CMP R3, #1 CMP R3, #1
BEQ _reswitch BEQ _reswitch
...@@ -98,11 +98,11 @@ PendSV_Handler: ...@@ -98,11 +98,11 @@ PendSV_Handler:
CPSID I CPSID I
/* get rt_thread_switch_interrupt_flag */ /* get rt_thread_switch_interrupt_flag */
LDR R0, =rt_thread_switch_interrput_flag LDR R0, =rt_thread_switch_interrupt_flag
LDR R1, [R0] LDR R1, [R0]
CBZ R1, pendsv_exit /* pendsv aLReady handled */ CBZ R1, pendsv_exit /* pendsv aLReady handled */
/* clear rt_thread_switch_interrput_flag to 0 */ /* clear rt_thread_switch_interrupt_flag to 0 */
MOV R1, #0 MOV R1, #0
STR R1, [R0] STR R1, [R0]
...@@ -146,7 +146,7 @@ rt_hw_context_switch_to: ...@@ -146,7 +146,7 @@ rt_hw_context_switch_to:
STR R0, [R1] STR R0, [R1]
/* set interrupt flag to 1 */ /* set interrupt flag to 1 */
LDR R1, =rt_thread_switch_interrput_flag LDR R1, =rt_thread_switch_interrupt_flag
MOV R0, #1 MOV R0, #1
STR R0, [R1] STR R0, [R1]
......
...@@ -42,7 +42,7 @@ struct stack_contex ...@@ -42,7 +42,7 @@ struct stack_contex
/* Private variables ------------------------------------------------------------*/ /* Private variables ------------------------------------------------------------*/
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
/* Private function prototypes ---------------------------------------------------*/ /* Private function prototypes ---------------------------------------------------*/
/* Private functions ------------------------------------------------------------*/ /* Private functions ------------------------------------------------------------*/
......
...@@ -59,8 +59,8 @@ rt_hw_interrupt_enable: ...@@ -59,8 +59,8 @@ rt_hw_interrupt_enable:
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
rt_hw_context_switch: rt_hw_context_switch:
/* set rt_thread_switch_interrput_flag to 1 */ /* set rt_thread_switch_interrupt_flag to 1 */
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
...@@ -91,11 +91,11 @@ rt_hw_pend_sv: ...@@ -91,11 +91,11 @@ rt_hw_pend_sv:
CPSID I CPSID I
/* get rt_thread_switch_interrupt_flag */ /* get rt_thread_switch_interrupt_flag */
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CBZ r1, pendsv_exit /* pendsv already handled */ CBZ r1, pendsv_exit /* pendsv already handled */
/* clear rt_thread_switch_interrput_flag to 0 */ /* clear rt_thread_switch_interrupt_flag to 0 */
MOV r1, #0x00 MOV r1, #0x00
STR r1, [r0] STR r1, [r0]
...@@ -139,7 +139,7 @@ rt_hw_context_switch_to: ...@@ -139,7 +139,7 @@ rt_hw_context_switch_to:
STR r0, [r1] STR r0, [r1]
/* set interrupt flag to 1 */ /* set interrupt flag to 1 */
LDR r1, =rt_thread_switch_interrput_flag LDR r1, =rt_thread_switch_interrupt_flag
MOV r0, #1 MOV r0, #1
STR r0, [r1] STR r0, [r1]
......
...@@ -27,7 +27,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep ...@@ -27,7 +27,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep
REQUIRE8 REQUIRE8
PRESERVE8 PRESERVE8
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
...@@ -60,8 +60,8 @@ rt_hw_context_switch_interrupt ...@@ -60,8 +60,8 @@ rt_hw_context_switch_interrupt
rt_hw_context_switch PROC rt_hw_context_switch PROC
EXPORT rt_hw_context_switch EXPORT rt_hw_context_switch
; set rt_thread_switch_interrput_flag to 1 ; set rt_thread_switch_interrupt_flag to 1
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
...@@ -92,11 +92,11 @@ rt_hw_pend_sv PROC ...@@ -92,11 +92,11 @@ rt_hw_pend_sv PROC
CPSID I CPSID I
; get rt_thread_switch_interrupt_flag ; get rt_thread_switch_interrupt_flag
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CBZ r1, pendsv_exit ; pendsv already handled CBZ r1, pendsv_exit ; pendsv already handled
; clear rt_thread_switch_interrput_flag to 0 ; clear rt_thread_switch_interrupt_flag to 0
MOV r1, #0x00 MOV r1, #0x00
STR r1, [r0] STR r1, [r0]
...@@ -143,7 +143,7 @@ rt_hw_context_switch_to PROC ...@@ -143,7 +143,7 @@ rt_hw_context_switch_to PROC
STR r0, [r1] STR r0, [r1]
; set interrupt flag to 1 ; set interrupt flag to 1
LDR r1, =rt_thread_switch_interrput_flag LDR r1, =rt_thread_switch_interrupt_flag
MOV r0, #1 MOV r0, #1
STR r0, [r1] STR r0, [r1]
......
...@@ -16,6 +16,6 @@ ...@@ -16,6 +16,6 @@
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
/*@}*/ /*@}*/
...@@ -27,7 +27,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep ...@@ -27,7 +27,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep
REQUIRE8 REQUIRE8
PRESERVE8 PRESERVE8
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
...@@ -60,8 +60,8 @@ rt_hw_context_switch_interrupt ...@@ -60,8 +60,8 @@ rt_hw_context_switch_interrupt
rt_hw_context_switch PROC rt_hw_context_switch PROC
EXPORT rt_hw_context_switch EXPORT rt_hw_context_switch
; set rt_thread_switch_interrput_flag to 1 ; set rt_thread_switch_interrupt_flag to 1
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
...@@ -92,12 +92,12 @@ rt_hw_pend_sv PROC ...@@ -92,12 +92,12 @@ rt_hw_pend_sv PROC
CPSID I CPSID I
; get rt_thread_switch_interrupt_flag ; get rt_thread_switch_interrupt_flag
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CMP r1, #0x00 CMP r1, #0x00
BEQ pendsv_exit ; pendsv already handled BEQ pendsv_exit ; pendsv already handled
; clear rt_thread_switch_interrput_flag to 0 ; clear rt_thread_switch_interrupt_flag to 0
MOVS r1, #0x00 MOVS r1, #0x00
STR r1, [r0] STR r1, [r0]
...@@ -146,7 +146,7 @@ rt_hw_context_switch_to PROC ...@@ -146,7 +146,7 @@ rt_hw_context_switch_to PROC
STR r0, [r1] STR r0, [r1]
; set interrupt flag to 1 ; set interrupt flag to 1
LDR r1, =rt_thread_switch_interrput_flag LDR r1, =rt_thread_switch_interrupt_flag
MOVS r0, #1 MOVS r0, #1
STR r0, [r1] STR r0, [r1]
......
...@@ -16,6 +16,6 @@ ...@@ -16,6 +16,6 @@
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint8_t rt_thread_switch_interrput_flag; rt_uint8_t rt_thread_switch_interrupt_flag;
/*@}*/ /*@}*/
...@@ -27,7 +27,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep ...@@ -27,7 +27,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep
REQUIRE8 REQUIRE8
PRESERVE8 PRESERVE8
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
...@@ -60,8 +60,8 @@ rt_hw_context_switch_interrupt ...@@ -60,8 +60,8 @@ rt_hw_context_switch_interrupt
rt_hw_context_switch PROC rt_hw_context_switch PROC
EXPORT rt_hw_context_switch EXPORT rt_hw_context_switch
; set rt_thread_switch_interrput_flag to 1 ; set rt_thread_switch_interrupt_flag to 1
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
...@@ -92,12 +92,12 @@ rt_hw_pend_sv PROC ...@@ -92,12 +92,12 @@ rt_hw_pend_sv PROC
CPSID I CPSID I
; get rt_thread_switch_interrupt_flag ; get rt_thread_switch_interrupt_flag
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CMP r1, #0x00 CMP r1, #0x00
BEQ pendsv_exit ; pendsv already handled BEQ pendsv_exit ; pendsv already handled
; clear rt_thread_switch_interrput_flag to 0 ; clear rt_thread_switch_interrupt_flag to 0
MOVS r1, #0x00 MOVS r1, #0x00
STR r1, [r0] STR r1, [r0]
...@@ -146,7 +146,7 @@ rt_hw_context_switch_to PROC ...@@ -146,7 +146,7 @@ rt_hw_context_switch_to PROC
STR r0, [r1] STR r0, [r1]
; set interrupt flag to 1 ; set interrupt flag to 1
LDR r1, =rt_thread_switch_interrput_flag LDR r1, =rt_thread_switch_interrupt_flag
MOVS r0, #1 MOVS r0, #1
STR r0, [r1] STR r0, [r1]
......
...@@ -16,6 +16,6 @@ ...@@ -16,6 +16,6 @@
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint8_t rt_thread_switch_interrput_flag; rt_uint8_t rt_thread_switch_interrupt_flag;
/*@}*/ /*@}*/
...@@ -29,7 +29,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep ...@@ -29,7 +29,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep
REQUIRE8 REQUIRE8
PRESERVE8 PRESERVE8
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
...@@ -61,8 +61,8 @@ rt_hw_interrupt_enable: ...@@ -61,8 +61,8 @@ rt_hw_interrupt_enable:
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
rt_hw_context_switch: rt_hw_context_switch:
; set rt_thread_switch_interrput_flag to 1 ; set rt_thread_switch_interrupt_flag to 1
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
...@@ -92,11 +92,11 @@ rt_hw_pend_sv: ...@@ -92,11 +92,11 @@ rt_hw_pend_sv:
CPSID I CPSID I
; get rt_thread_switch_interrupt_flag ; get rt_thread_switch_interrupt_flag
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CBZ r1, pendsv_exit ; pendsv already handled CBZ r1, pendsv_exit ; pendsv already handled
; clear rt_thread_switch_interrput_flag to 0 ; clear rt_thread_switch_interrupt_flag to 0
MOV r1, #0x00 MOV r1, #0x00
STR r1, [r0] STR r1, [r0]
...@@ -141,7 +141,7 @@ rt_hw_context_switch_to: ...@@ -141,7 +141,7 @@ rt_hw_context_switch_to:
STR r0, [r1] STR r0, [r1]
; set interrupt flag to 1 ; set interrupt flag to 1
LDR r1, =rt_thread_switch_interrput_flag LDR r1, =rt_thread_switch_interrupt_flag
MOV r0, #1 MOV r0, #1
STR r0, [r1] STR r0, [r1]
......
...@@ -28,7 +28,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep ...@@ -28,7 +28,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep
REQUIRE8 REQUIRE8
PRESERVE8 PRESERVE8
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
...@@ -61,8 +61,8 @@ rt_hw_context_switch_interrupt ...@@ -61,8 +61,8 @@ rt_hw_context_switch_interrupt
rt_hw_context_switch PROC rt_hw_context_switch PROC
EXPORT rt_hw_context_switch EXPORT rt_hw_context_switch
; set rt_thread_switch_interrput_flag to 1 ; set rt_thread_switch_interrupt_flag to 1
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
...@@ -93,11 +93,11 @@ rt_hw_pend_sv PROC ...@@ -93,11 +93,11 @@ rt_hw_pend_sv PROC
CPSID I CPSID I
; get rt_thread_switch_interrupt_flag ; get rt_thread_switch_interrupt_flag
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CBZ r1, pendsv_exit ; pendsv already handled CBZ r1, pendsv_exit ; pendsv already handled
; clear rt_thread_switch_interrput_flag to 0 ; clear rt_thread_switch_interrupt_flag to 0
MOV r1, #0x00 MOV r1, #0x00
STR r1, [r0] STR r1, [r0]
...@@ -143,7 +143,7 @@ rt_hw_context_switch_to PROC ...@@ -143,7 +143,7 @@ rt_hw_context_switch_to PROC
STR r0, [r1] STR r0, [r1]
; set interrupt flag to 1 ; set interrupt flag to 1
LDR r1, =rt_thread_switch_interrput_flag LDR r1, =rt_thread_switch_interrupt_flag
MOV r0, #1 MOV r0, #1
STR r0, [r1] STR r0, [r1]
......
...@@ -16,6 +16,6 @@ ...@@ -16,6 +16,6 @@
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
/*@}*/ /*@}*/
...@@ -84,11 +84,11 @@ rt_hw_context_switch_to: ...@@ -84,11 +84,11 @@ rt_hw_context_switch_to:
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
//EXPORT rt_hw_context_switch_interrupt //EXPORT rt_hw_context_switch_interrupt
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] /* 载入中断中切换标致地址 */ LDR r3, [r2] /* 载入中断中切换标致地址 */
CMP r3, #1 /* 等于 1 */ CMP r3, #1 /* 等于 1 */
BEQ _reswitch /* 如果等于1,跳转到_reswitch*/ BEQ _reswitch /* 如果等于1,跳转到_reswitch*/
MOV r3, #1 /* set rt_thread_switch_interrput_flag to 1*/ MOV r3, #1 /* set rt_thread_switch_interrupt_flag to 1*/
/* 设置中断中切换标志位1 */ /* 设置中断中切换标志位1 */
STR r3, [r2] /* */ STR r3, [r2] /* */
LDR r2, =rt_interrupt_from_thread /* set rt_interrupt_from_thread*/ LDR r2, =rt_interrupt_from_thread /* set rt_interrupt_from_thread*/
......
...@@ -84,17 +84,17 @@ rt_hw_context_switch_to PROC ...@@ -84,17 +84,17 @@ rt_hw_context_switch_to PROC
;/* ;/*
; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); ; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
; */ ; */
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
rt_hw_context_switch_interrupt PROC rt_hw_context_switch_interrupt PROC
EXPORT rt_hw_context_switch_interrupt EXPORT rt_hw_context_switch_interrupt
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
MOV r3, #1 ; set rt_thread_switch_interrput_flag to 1 MOV r3, #1 ; set rt_thread_switch_interrupt_flag to 1
STR r3, [r2] STR r3, [r2]
LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread
STR r0, [r2] STR r0, [r2]
......
...@@ -65,7 +65,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, ...@@ -65,7 +65,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
void rt_hw_interrupt_handler(int vector) void rt_hw_interrupt_handler(int vector)
{ {
...@@ -99,7 +99,7 @@ void rt_hw_interrupt_init() ...@@ -99,7 +99,7 @@ void rt_hw_interrupt_init()
rt_interrupt_nest = 0; rt_interrupt_nest = 0;
rt_interrupt_from_thread = 0; rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0; rt_interrupt_to_thread = 0;
rt_thread_switch_interrput_flag = 0; rt_thread_switch_interrupt_flag = 0;
} }
/** /**
......
...@@ -417,7 +417,7 @@ MEMMAP EQU 0xE01FC040 ; Memory Mapping Control ...@@ -417,7 +417,7 @@ MEMMAP EQU 0xE01FC040 ; Memory Mapping Control
IMPORT rt_interrupt_enter IMPORT rt_interrupt_enter
IMPORT rt_interrupt_leave IMPORT rt_interrupt_leave
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
IMPORT rt_hw_trap_irq IMPORT rt_hw_trap_irq
...@@ -429,9 +429,9 @@ IRQ_Handler PROC ...@@ -429,9 +429,9 @@ IRQ_Handler PROC
BL rt_hw_trap_irq BL rt_hw_trap_irq
BL rt_interrupt_leave BL rt_interrupt_leave
; if rt_thread_switch_interrput_flag set, jump to ; if rt_thread_switch_interrupt_flag set, jump to
; rt_hw_context_switch_interrupt_do and don't return ; rt_hw_context_switch_interrupt_do and don't return
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CMP r1, #1 CMP r1, #1
BEQ rt_hw_context_switch_interrupt_do BEQ rt_hw_context_switch_interrupt_do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.extern rt_interrupt_enter .extern rt_interrupt_enter
.extern rt_interrupt_leave .extern rt_interrupt_leave
.extern rt_thread_switch_interrput_flag .extern rt_thread_switch_interrupt_flag
.extern rt_interrupt_from_thread .extern rt_interrupt_from_thread
.extern rt_interrupt_to_thread .extern rt_interrupt_to_thread
.extern rt_hw_trap_irq .extern rt_hw_trap_irq
...@@ -224,8 +224,8 @@ IRQ_Handler : ...@@ -224,8 +224,8 @@ IRQ_Handler :
bl rt_hw_trap_irq /* 相应中断服务例程处理 */ bl rt_hw_trap_irq /* 相应中断服务例程处理 */
bl rt_interrupt_leave /* ; 通知RT-Thread要离开中断模式 */ bl rt_interrupt_leave /* ; 通知RT-Thread要离开中断模式 */
/* 如果设置了rt_thread_switch_interrput_flag,进行中断中的线程上下文处理 */ /* 如果设置了rt_thread_switch_interrupt_flag,进行中断中的线程上下文处理 */
ldr r0, =rt_thread_switch_interrput_flag ldr r0, =rt_thread_switch_interrupt_flag
ldr r1, [r0] ldr r1, [r0]
cmp r1, #1 cmp r1, #1
beq rt_hw_context_switch_interrupt_do /* 中断中切换发生 */ beq rt_hw_context_switch_interrupt_do /* 中断中切换发生 */
......
...@@ -80,16 +80,16 @@ rt_hw_context_switch_to: ...@@ -80,16 +80,16 @@ rt_hw_context_switch_to:
/* /*
* void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
*/ */
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
.globl rt_hw_context_switch_interrupt .globl rt_hw_context_switch_interrupt
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
ldr r2, =rt_thread_switch_interrput_flag ldr r2, =rt_thread_switch_interrupt_flag
ldr r3, [r2] ldr r3, [r2]
cmp r3, #1 cmp r3, #1
beq _reswitch beq _reswitch
mov r3, #1 @ set rt_thread_switch_interrput_flag to 1 mov r3, #1 @ set rt_thread_switch_interrupt_flag to 1
str r3, [r2] str r3, [r2]
ldr r2, =rt_interrupt_from_thread @ set rt_interrupt_from_thread ldr r2, =rt_interrupt_from_thread @ set rt_interrupt_from_thread
str r0, [r2] str r0, [r2]
......
...@@ -87,17 +87,17 @@ rt_hw_context_switch_to PROC ...@@ -87,17 +87,17 @@ rt_hw_context_switch_to PROC
;/* ;/*
; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); ; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
; */ ; */
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
rt_hw_context_switch_interrupt PROC rt_hw_context_switch_interrupt PROC
EXPORT rt_hw_context_switch_interrupt EXPORT rt_hw_context_switch_interrupt
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
MOV r3, #1 ; set rt_thread_switch_interrput_flag to 1 MOV r3, #1 ; set rt_thread_switch_interrupt_flag to 1
STR r3, [r2] STR r3, [r2]
LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread
STR r0, [r2] STR r0, [r2]
......
...@@ -21,7 +21,7 @@ extern rt_uint32_t rt_interrupt_nest; ...@@ -21,7 +21,7 @@ extern rt_uint32_t rt_interrupt_nest;
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
/** /**
...@@ -57,7 +57,7 @@ void rt_hw_interrupt_init() ...@@ -57,7 +57,7 @@ void rt_hw_interrupt_init()
rt_interrupt_nest = 0; rt_interrupt_nest = 0;
rt_interrupt_from_thread = 0; rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0; rt_interrupt_to_thread = 0;
rt_thread_switch_interrput_flag = 0; rt_thread_switch_interrupt_flag = 0;
} }
void rt_hw_interrupt_mask(int vector) void rt_hw_interrupt_mask(int vector)
......
...@@ -189,7 +189,7 @@ vector_resv: bl rt_hw_trap_resv ...@@ -189,7 +189,7 @@ vector_resv: bl rt_hw_trap_resv
.globl rt_interrupt_enter .globl rt_interrupt_enter
.globl rt_interrupt_leave .globl rt_interrupt_leave
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
vector_irq: vector_irq:
...@@ -198,10 +198,10 @@ vector_irq: ...@@ -198,10 +198,10 @@ vector_irq:
bl rt_hw_trap_irq bl rt_hw_trap_irq
bl rt_interrupt_leave bl rt_interrupt_leave
/* if rt_thread_switch_interrput_flag set, /* if rt_thread_switch_interrupt_flag set,
* jump to _interrupt_thread_switch and don't return * jump to _interrupt_thread_switch and don't return
*/ */
ldr r0, =rt_thread_switch_interrput_flag ldr r0, =rt_thread_switch_interrupt_flag
ldr r1, [r0] ldr r1, [r0]
cmp r1, #1 cmp r1, #1
beq _interrupt_thread_switch beq _interrupt_thread_switch
...@@ -217,7 +217,7 @@ vector_fiq: ...@@ -217,7 +217,7 @@ vector_fiq:
subs pc,lr,#4 subs pc,lr,#4
_interrupt_thread_switch: _interrupt_thread_switch:
mov r1, #0 /* clear rt_thread_switch_interrput_flag */ mov r1, #0 /* clear rt_thread_switch_interrupt_flag */
str r1, [r0] str r1, [r0]
ldmfd sp!, {r0-r12,lr} /* reload saved registers */ ldmfd sp!, {r0-r12,lr} /* reload saved registers */
......
...@@ -1489,7 +1489,7 @@ MEMMAP EQU 0xE01FC040 ; Memory Mapping Control ...@@ -1489,7 +1489,7 @@ MEMMAP EQU 0xE01FC040 ; Memory Mapping Control
IMPORT rt_interrupt_enter IMPORT rt_interrupt_enter
IMPORT rt_interrupt_leave IMPORT rt_interrupt_leave
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
IMPORT rt_hw_trap_irq IMPORT rt_hw_trap_irq
...@@ -1501,9 +1501,9 @@ IRQ_Handler PROC ...@@ -1501,9 +1501,9 @@ IRQ_Handler PROC
BL rt_hw_trap_irq BL rt_hw_trap_irq
BL rt_interrupt_leave BL rt_interrupt_leave
; if rt_thread_switch_interrput_flag set, jump to ; if rt_thread_switch_interrupt_flag set, jump to
; rt_hw_context_switch_interrupt_do and don't return ; rt_hw_context_switch_interrupt_do and don't return
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CMP r1, #1 CMP r1, #1
BEQ rt_hw_context_switch_interrupt_do BEQ rt_hw_context_switch_interrupt_do
......
...@@ -27,7 +27,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep ...@@ -27,7 +27,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep
REQUIRE8 REQUIRE8
PRESERVE8 PRESERVE8
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
...@@ -60,8 +60,8 @@ rt_hw_context_switch_interrupt ...@@ -60,8 +60,8 @@ rt_hw_context_switch_interrupt
rt_hw_context_switch PROC rt_hw_context_switch PROC
EXPORT rt_hw_context_switch EXPORT rt_hw_context_switch
; set rt_thread_switch_interrput_flag to 1 ; set rt_thread_switch_interrupt_flag to 1
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
...@@ -92,12 +92,12 @@ rt_hw_pend_sv PROC ...@@ -92,12 +92,12 @@ rt_hw_pend_sv PROC
CPSID I CPSID I
; get rt_thread_switch_interrupt_flag ; get rt_thread_switch_interrupt_flag
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CMP r1, #0x00 CMP r1, #0x00
BEQ pendsv_exit ; pendsv already handled BEQ pendsv_exit ; pendsv already handled
; clear rt_thread_switch_interrput_flag to 0 ; clear rt_thread_switch_interrupt_flag to 0
MOVS r1, #0x00 MOVS r1, #0x00
STR r1, [r0] STR r1, [r0]
...@@ -146,7 +146,7 @@ rt_hw_context_switch_to PROC ...@@ -146,7 +146,7 @@ rt_hw_context_switch_to PROC
STR r0, [r1] STR r0, [r1]
; set interrupt flag to 1 ; set interrupt flag to 1
LDR r1, =rt_thread_switch_interrput_flag LDR r1, =rt_thread_switch_interrupt_flag
MOVS r0, #1 MOVS r0, #1
STR r0, [r1] STR r0, [r1]
......
...@@ -16,6 +16,6 @@ ...@@ -16,6 +16,6 @@
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint8_t rt_thread_switch_interrput_flag; rt_uint8_t rt_thread_switch_interrupt_flag;
/*@}*/ /*@}*/
...@@ -80,16 +80,16 @@ rt_hw_context_switch_to: ...@@ -80,16 +80,16 @@ rt_hw_context_switch_to:
/* /*
* void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
*/ */
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
.globl rt_hw_context_switch_interrupt .globl rt_hw_context_switch_interrupt
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
ldr r2, =rt_thread_switch_interrput_flag ldr r2, =rt_thread_switch_interrupt_flag
ldr r3, [r2] ldr r3, [r2]
cmp r3, #1 cmp r3, #1
beq _reswitch beq _reswitch
mov r3, #1 @ set rt_thread_switch_interrput_flag to 1 mov r3, #1 @ set rt_thread_switch_interrupt_flag to 1
str r3, [r2] str r3, [r2]
ldr r2, =rt_interrupt_from_thread @ set rt_interrupt_from_thread ldr r2, =rt_interrupt_from_thread @ set rt_interrupt_from_thread
str r0, [r2] str r0, [r2]
......
...@@ -84,17 +84,17 @@ rt_hw_context_switch_to PROC ...@@ -84,17 +84,17 @@ rt_hw_context_switch_to PROC
;/* ;/*
; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); ; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
; */ ; */
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
rt_hw_context_switch_interrupt PROC rt_hw_context_switch_interrupt PROC
EXPORT rt_hw_context_switch_interrupt EXPORT rt_hw_context_switch_interrupt
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
MOV r3, #1 ; set rt_thread_switch_interrput_flag to 1 MOV r3, #1 ; set rt_thread_switch_interrupt_flag to 1
STR r3, [r2] STR r3, [r2]
LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread
STR r0, [r2] STR r0, [r2]
......
...@@ -22,7 +22,7 @@ extern rt_uint32_t rt_interrupt_nest; ...@@ -22,7 +22,7 @@ extern rt_uint32_t rt_interrupt_nest;
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_isr_handler_t isr_table[MAX_HANDLERS]; rt_isr_handler_t isr_table[MAX_HANDLERS];
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
/** /**
* @addtogroup S3C24X0 * @addtogroup S3C24X0
...@@ -70,7 +70,7 @@ void rt_hw_interrupt_init(void) ...@@ -70,7 +70,7 @@ void rt_hw_interrupt_init(void)
rt_interrupt_nest = 0; rt_interrupt_nest = 0;
rt_interrupt_from_thread = 0; rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0; rt_interrupt_to_thread = 0;
rt_thread_switch_interrput_flag = 0; rt_thread_switch_interrupt_flag = 0;
} }
/** /**
......
...@@ -291,7 +291,7 @@ vector_resv: ...@@ -291,7 +291,7 @@ vector_resv:
.globl rt_interrupt_enter .globl rt_interrupt_enter
.globl rt_interrupt_leave .globl rt_interrupt_leave
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
vector_irq: vector_irq:
...@@ -300,8 +300,8 @@ vector_irq: ...@@ -300,8 +300,8 @@ vector_irq:
bl rt_hw_trap_irq bl rt_hw_trap_irq
bl rt_interrupt_leave bl rt_interrupt_leave
/* if rt_thread_switch_interrput_flag set, jump to _interrupt_thread_switch and don't return */ /* if rt_thread_switch_interrupt_flag set, jump to _interrupt_thread_switch and don't return */
ldr r0, =rt_thread_switch_interrput_flag ldr r0, =rt_thread_switch_interrupt_flag
ldr r1, [r0] ldr r1, [r0]
cmp r1, #1 cmp r1, #1
beq _interrupt_thread_switch beq _interrupt_thread_switch
...@@ -317,7 +317,7 @@ vector_fiq: ...@@ -317,7 +317,7 @@ vector_fiq:
subs pc,lr,#4 subs pc,lr,#4
_interrupt_thread_switch: _interrupt_thread_switch:
mov r1, #0 /* clear rt_thread_switch_interrput_flag*/ mov r1, #0 /* clear rt_thread_switch_interrupt_flag*/
str r1, [r0] str r1, [r0]
ldmfd sp!, {r0-r12,lr} /* reload saved registers */ ldmfd sp!, {r0-r12,lr} /* reload saved registers */
......
...@@ -1097,7 +1097,7 @@ Reset_Handler ...@@ -1097,7 +1097,7 @@ Reset_Handler
IMPORT rt_interrupt_enter IMPORT rt_interrupt_enter
IMPORT rt_interrupt_leave IMPORT rt_interrupt_leave
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
IMPORT rt_hw_trap_irq IMPORT rt_hw_trap_irq
...@@ -1109,9 +1109,9 @@ IRQ_Handler PROC ...@@ -1109,9 +1109,9 @@ IRQ_Handler PROC
BL rt_hw_trap_irq BL rt_hw_trap_irq
BL rt_interrupt_leave BL rt_interrupt_leave
; if rt_thread_switch_interrput_flag set, jump to ; if rt_thread_switch_interrupt_flag set, jump to
; rt_hw_context_switch_interrupt_do and don't return ; rt_hw_context_switch_interrupt_do and don't return
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CMP r1, #1 CMP r1, #1
BEQ rt_hw_context_switch_interrupt_do BEQ rt_hw_context_switch_interrupt_do
......
...@@ -80,16 +80,16 @@ rt_hw_context_switch_to: ...@@ -80,16 +80,16 @@ rt_hw_context_switch_to:
/* /*
* void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
*/ */
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
.globl rt_hw_context_switch_interrupt .globl rt_hw_context_switch_interrupt
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
ldr r2, =rt_thread_switch_interrput_flag ldr r2, =rt_thread_switch_interrupt_flag
ldr r3, [r2] ldr r3, [r2]
cmp r3, #1 cmp r3, #1
beq _reswitch beq _reswitch
mov r3, #1 @ set rt_thread_switch_interrput_flag to 1 mov r3, #1 @ set rt_thread_switch_interrupt_flag to 1
str r3, [r2] str r3, [r2]
ldr r2, =rt_interrupt_from_thread @ set rt_interrupt_from_thread ldr r2, =rt_interrupt_from_thread @ set rt_interrupt_from_thread
str r0, [r2] str r0, [r2]
......
...@@ -84,17 +84,17 @@ rt_hw_context_switch_to PROC ...@@ -84,17 +84,17 @@ rt_hw_context_switch_to PROC
;/* ;/*
; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); ; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
; */ ; */
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
rt_hw_context_switch_interrupt PROC rt_hw_context_switch_interrupt PROC
EXPORT rt_hw_context_switch_interrupt EXPORT rt_hw_context_switch_interrupt
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
MOV r3, #1 ; set rt_thread_switch_interrput_flag to 1 MOV r3, #1 ; set rt_thread_switch_interrupt_flag to 1
STR r3, [r2] STR r3, [r2]
LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread
STR r0, [r2] STR r0, [r2]
......
...@@ -24,7 +24,7 @@ extern rt_uint32_t rt_interrupt_nest; ...@@ -24,7 +24,7 @@ extern rt_uint32_t rt_interrupt_nest;
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_isr_handler_t isr_table[MAX_HANDLERS]; rt_isr_handler_t isr_table[MAX_HANDLERS];
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
unsigned char interrupt_bank0[256]; unsigned char interrupt_bank0[256];
unsigned char interrupt_bank1[256]; unsigned char interrupt_bank1[256];
...@@ -109,7 +109,7 @@ void rt_hw_interrupt_init() ...@@ -109,7 +109,7 @@ void rt_hw_interrupt_init()
rt_interrupt_nest = 0; rt_interrupt_nest = 0;
rt_interrupt_from_thread = 0; rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0; rt_interrupt_to_thread = 0;
rt_thread_switch_interrput_flag = 0; rt_thread_switch_interrupt_flag = 0;
} }
/** /**
......
...@@ -138,7 +138,7 @@ vector_resv: bl rt_hw_trap_resv ...@@ -138,7 +138,7 @@ vector_resv: bl rt_hw_trap_resv
.globl rt_interrupt_enter .globl rt_interrupt_enter
.globl rt_interrupt_leave .globl rt_interrupt_leave
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
vector_irq: vector_irq:
...@@ -148,8 +148,8 @@ vector_irq: ...@@ -148,8 +148,8 @@ vector_irq:
bl rt_hw_trap_irq bl rt_hw_trap_irq
bl rt_interrupt_leave bl rt_interrupt_leave
/* if rt_thread_switch_interrput_flag set, jump to _interrupt_thread_switch and don't return */ /* if rt_thread_switch_interrupt_flag set, jump to _interrupt_thread_switch and don't return */
ldr r0, =rt_thread_switch_interrput_flag ldr r0, =rt_thread_switch_interrupt_flag
ldr r1, [r0] ldr r1, [r0]
cmp r1, #1 cmp r1, #1
beq _interrupt_thread_switch beq _interrupt_thread_switch
...@@ -165,7 +165,7 @@ vector_fiq: ...@@ -165,7 +165,7 @@ vector_fiq:
subs pc,lr,#4 subs pc,lr,#4
_interrupt_thread_switch: _interrupt_thread_switch:
mov r1, #0 @ clear rt_thread_switch_interrput_flag mov r1, #0 @ clear rt_thread_switch_interrupt_flag
str r1, [r0] str r1, [r0]
ldmfd sp!, {r0-r12,lr} @ reload saved registers ldmfd sp!, {r0-r12,lr} @ reload saved registers
......
...@@ -980,7 +980,7 @@ Reset_Handler ...@@ -980,7 +980,7 @@ Reset_Handler
IMPORT rt_interrupt_enter IMPORT rt_interrupt_enter
IMPORT rt_interrupt_leave IMPORT rt_interrupt_leave
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
IMPORT rt_hw_trap_irq IMPORT rt_hw_trap_irq
...@@ -992,9 +992,9 @@ IRQ_Handler PROC ...@@ -992,9 +992,9 @@ IRQ_Handler PROC
BL rt_hw_trap_irq BL rt_hw_trap_irq
BL rt_interrupt_leave BL rt_interrupt_leave
; if rt_thread_switch_interrput_flag set, jump to ; if rt_thread_switch_interrupt_flag set, jump to
; rt_hw_context_switch_interrupt_do and don't return ; rt_hw_context_switch_interrupt_do and don't return
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CMP r1, #1 CMP r1, #1
BEQ rt_hw_context_switch_interrupt_do BEQ rt_hw_context_switch_interrupt_do
......
...@@ -84,17 +84,17 @@ rt_hw_context_switch_to PROC ...@@ -84,17 +84,17 @@ rt_hw_context_switch_to PROC
;/* ;/*
; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); ; * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
; */ ; */
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
rt_hw_context_switch_interrupt PROC rt_hw_context_switch_interrupt PROC
EXPORT rt_hw_context_switch_interrupt EXPORT rt_hw_context_switch_interrupt
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
MOV r3, #1 ; set rt_thread_switch_interrput_flag to 1 MOV r3, #1 ; set rt_thread_switch_interrupt_flag to 1
STR r3, [r2] STR r3, [r2]
LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread LDR r2, =rt_interrupt_from_thread ; set rt_interrupt_from_thread
STR r0, [r2] STR r0, [r2]
......
...@@ -22,7 +22,7 @@ extern rt_uint32_t rt_interrupt_nest; ...@@ -22,7 +22,7 @@ extern rt_uint32_t rt_interrupt_nest;
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_isr_handler_t isr_table[MAX_HANDLERS]; rt_isr_handler_t isr_table[MAX_HANDLERS];
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
/** /**
* @addtogroup S3C24X0 * @addtogroup S3C24X0
...@@ -75,7 +75,7 @@ void rt_hw_interrupt_init() ...@@ -75,7 +75,7 @@ void rt_hw_interrupt_init()
rt_interrupt_nest = 0; rt_interrupt_nest = 0;
rt_interrupt_from_thread = 0; rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0; rt_interrupt_to_thread = 0;
rt_thread_switch_interrput_flag = 0; rt_thread_switch_interrupt_flag = 0;
} }
/** /**
......
...@@ -290,7 +290,7 @@ Reset_Handler ...@@ -290,7 +290,7 @@ Reset_Handler
IMPORT rt_interrupt_enter IMPORT rt_interrupt_enter
IMPORT rt_interrupt_leave IMPORT rt_interrupt_leave
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
IMPORT rt_hw_trap_irq IMPORT rt_hw_trap_irq
...@@ -302,9 +302,9 @@ IRQ_Handler PROC ...@@ -302,9 +302,9 @@ IRQ_Handler PROC
BL rt_hw_trap_irq BL rt_hw_trap_irq
BL rt_interrupt_leave BL rt_interrupt_leave
; if rt_thread_switch_interrput_flag set, jump to ; if rt_thread_switch_interrupt_flag set, jump to
; rt_hw_context_switch_interrupt_do and don't return ; rt_hw_context_switch_interrupt_do and don't return
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CMP r1, #1 CMP r1, #1
BEQ rt_hw_context_switch_interrupt_do BEQ rt_hw_context_switch_interrupt_do
......
...@@ -59,8 +59,8 @@ rt_hw_interrupt_enable: ...@@ -59,8 +59,8 @@ rt_hw_interrupt_enable:
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
rt_hw_context_switch: rt_hw_context_switch:
/* set rt_thread_switch_interrput_flag to 1 */ /* set rt_thread_switch_interrupt_flag to 1 */
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
...@@ -91,11 +91,11 @@ PendSV_Handler: ...@@ -91,11 +91,11 @@ PendSV_Handler:
CPSID I CPSID I
/* get rt_thread_switch_interrupt_flag */ /* get rt_thread_switch_interrupt_flag */
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CBZ r1, pendsv_exit /* pendsv already handled */ CBZ r1, pendsv_exit /* pendsv already handled */
/* clear rt_thread_switch_interrput_flag to 0 */ /* clear rt_thread_switch_interrupt_flag to 0 */
MOV r1, #0x00 MOV r1, #0x00
STR r1, [r0] STR r1, [r0]
...@@ -139,7 +139,7 @@ rt_hw_context_switch_to: ...@@ -139,7 +139,7 @@ rt_hw_context_switch_to:
STR r0, [r1] STR r0, [r1]
/* set interrupt flag to 1 */ /* set interrupt flag to 1 */
LDR r1, =rt_thread_switch_interrput_flag LDR r1, =rt_thread_switch_interrupt_flag
MOV r0, #1 MOV r0, #1
STR r0, [r1] STR r0, [r1]
......
...@@ -28,7 +28,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep ...@@ -28,7 +28,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep
REQUIRE8 REQUIRE8
PRESERVE8 PRESERVE8
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
...@@ -58,8 +58,8 @@ rt_hw_interrupt_enable: ...@@ -58,8 +58,8 @@ rt_hw_interrupt_enable:
EXPORT rt_hw_context_switch EXPORT rt_hw_context_switch
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
rt_hw_context_switch: rt_hw_context_switch:
; set rt_thread_switch_interrput_flag to 1 ; set rt_thread_switch_interrupt_flag to 1
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
...@@ -89,11 +89,11 @@ PendSV_Handler: ...@@ -89,11 +89,11 @@ PendSV_Handler:
CPSID I CPSID I
; get rt_thread_switch_interrupt_flag ; get rt_thread_switch_interrupt_flag
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CBZ r1, pendsv_exit ; pendsv already handled CBZ r1, pendsv_exit ; pendsv already handled
; clear rt_thread_switch_interrput_flag to 0 ; clear rt_thread_switch_interrupt_flag to 0
MOV r1, #0x00 MOV r1, #0x00
STR r1, [r0] STR r1, [r0]
...@@ -136,7 +136,7 @@ rt_hw_context_switch_to: ...@@ -136,7 +136,7 @@ rt_hw_context_switch_to:
STR r0, [r1] STR r0, [r1]
; set interrupt flag to 1 ; set interrupt flag to 1
LDR r1, =rt_thread_switch_interrput_flag LDR r1, =rt_thread_switch_interrupt_flag
MOV r0, #1 MOV r0, #1
STR r0, [r1] STR r0, [r1]
......
...@@ -27,7 +27,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep ...@@ -27,7 +27,7 @@ NVIC_PENDSVSET EQU 0x10000000 ; value to trigger PendSV excep
REQUIRE8 REQUIRE8
PRESERVE8 PRESERVE8
IMPORT rt_thread_switch_interrput_flag IMPORT rt_thread_switch_interrupt_flag
IMPORT rt_interrupt_from_thread IMPORT rt_interrupt_from_thread
IMPORT rt_interrupt_to_thread IMPORT rt_interrupt_to_thread
...@@ -60,8 +60,8 @@ rt_hw_context_switch_interrupt ...@@ -60,8 +60,8 @@ rt_hw_context_switch_interrupt
rt_hw_context_switch PROC rt_hw_context_switch PROC
EXPORT rt_hw_context_switch EXPORT rt_hw_context_switch
; set rt_thread_switch_interrput_flag to 1 ; set rt_thread_switch_interrupt_flag to 1
LDR r2, =rt_thread_switch_interrput_flag LDR r2, =rt_thread_switch_interrupt_flag
LDR r3, [r2] LDR r3, [r2]
CMP r3, #1 CMP r3, #1
BEQ _reswitch BEQ _reswitch
...@@ -92,11 +92,11 @@ PendSV_Handler PROC ...@@ -92,11 +92,11 @@ PendSV_Handler PROC
CPSID I CPSID I
; get rt_thread_switch_interrupt_flag ; get rt_thread_switch_interrupt_flag
LDR r0, =rt_thread_switch_interrput_flag LDR r0, =rt_thread_switch_interrupt_flag
LDR r1, [r0] LDR r1, [r0]
CBZ r1, pendsv_exit ; pendsv already handled CBZ r1, pendsv_exit ; pendsv already handled
; clear rt_thread_switch_interrput_flag to 0 ; clear rt_thread_switch_interrupt_flag to 0
MOV r1, #0x00 MOV r1, #0x00
STR r1, [r0] STR r1, [r0]
...@@ -142,7 +142,7 @@ rt_hw_context_switch_to PROC ...@@ -142,7 +142,7 @@ rt_hw_context_switch_to PROC
STR r0, [r1] STR r0, [r1]
; set interrupt flag to 1 ; set interrupt flag to 1
LDR r1, =rt_thread_switch_interrput_flag LDR r1, =rt_thread_switch_interrupt_flag
MOV r0, #1 MOV r0, #1
STR r0, [r1] STR r0, [r1]
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
struct stack_contex struct stack_contex
{ {
......
...@@ -87,7 +87,7 @@ rt_hw_context_switch_to: ...@@ -87,7 +87,7 @@ rt_hw_context_switch_to:
/* /*
* void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to);
*/ */
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
.globl rt_hw_context_switch_interrupt .globl rt_hw_context_switch_interrupt
...@@ -97,12 +97,12 @@ rt_hw_context_switch_interrupt: ...@@ -97,12 +97,12 @@ rt_hw_context_switch_interrupt:
movl 0xc(%ebp), %eax movl 0xc(%ebp), %eax
movl 0x8(%ebp), %ebx movl 0x8(%ebp), %ebx
movl $rt_thread_switch_interrput_flag, %ecx movl $rt_thread_switch_interrupt_flag, %ecx
movl (%ecx), %edx movl (%ecx), %edx
cmp $0x1, %edx cmp $0x1, %edx
jz _reswitch jz _reswitch
movl $0x1, %edx /*set rt_thread_switch_interrput_flag to 1*/ movl $0x1, %edx /*set rt_thread_switch_interrupt_flag to 1*/
movl %edx, (%ecx) movl %edx, (%ecx)
movl $rt_interrupt_from_thread, %edx /*set rt_interrupt_from_thread*/ movl $rt_interrupt_from_thread, %edx /*set rt_interrupt_from_thread*/
movl %ebx, (%edx) movl %ebx, (%edx)
......
...@@ -60,7 +60,7 @@ HDINTERRUPTFNC(irq15, 15) ...@@ -60,7 +60,7 @@ HDINTERRUPTFNC(irq15, 15)
.globl rt_interrupt_enter .globl rt_interrupt_enter
.globl rt_interrupt_leave .globl rt_interrupt_leave
.globl isr_table .globl isr_table
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
...@@ -82,8 +82,8 @@ _hdinterrupts: ...@@ -82,8 +82,8 @@ _hdinterrupts:
call *(%ebx) call *(%ebx)
call rt_interrupt_leave call rt_interrupt_leave
/* if rt_thread_switch_interrput_flag set, jump to _interrupt_thread_switch and don't return */ /* if rt_thread_switch_interrupt_flag set, jump to _interrupt_thread_switch and don't return */
movl $rt_thread_switch_interrput_flag, %eax movl $rt_thread_switch_interrupt_flag, %eax
movl (%eax), %ebx movl (%eax), %ebx
cmp $0x1, %ebx cmp $0x1, %ebx
jz _interrupt_thread_switch jz _interrupt_thread_switch
......
...@@ -20,7 +20,7 @@ extern rt_uint32_t rt_interrupt_nest; ...@@ -20,7 +20,7 @@ extern rt_uint32_t rt_interrupt_nest;
extern void rt_hw_idt_init(void); extern void rt_hw_idt_init(void);
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_isr_handler_t isr_table[MAX_HANDLERS]; rt_isr_handler_t isr_table[MAX_HANDLERS];
...@@ -61,7 +61,7 @@ void rt_hw_pic_init() ...@@ -61,7 +61,7 @@ void rt_hw_pic_init()
rt_interrupt_nest = 0; rt_interrupt_nest = 0;
rt_interrupt_from_thread = 0; rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0; rt_interrupt_to_thread = 0;
rt_thread_switch_interrput_flag = 0; rt_thread_switch_interrupt_flag = 0;
} }
void rt_hw_interrupt_handle(int vector) void rt_hw_interrupt_handle(int vector)
......
...@@ -60,17 +60,17 @@ rt_hw_context_switch_to: ...@@ -60,17 +60,17 @@ rt_hw_context_switch_to:
/* /*
* void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to)/* * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to)/*
*/ */
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
.globl rt_hw_context_switch_interrupt .globl rt_hw_context_switch_interrupt
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
la t0, rt_thread_switch_interrput_flag la t0, rt_thread_switch_interrupt_flag
lw t1, 0(t0) lw t1, 0(t0)
nop nop
bnez t1, _reswitch bnez t1, _reswitch
nop nop
li t1, 0x01 /* set rt_thread_switch_interrput_flag to 1 */ li t1, 0x01 /* set rt_thread_switch_interrupt_flag to 1 */
sw t1, 0(t0) sw t1, 0(t0)
la t0, rt_interrupt_from_thread /* set rt_interrupt_from_thread */ la t0, rt_interrupt_from_thread /* set rt_interrupt_from_thread */
sw a0, 0(t0) sw a0, 0(t0)
...@@ -115,10 +115,10 @@ mips_irq_handle: ...@@ -115,10 +115,10 @@ mips_irq_handle:
move sp, k0 move sp, k0
/* /*
* if rt_thread_switch_interrput_flag set, jump to * if rt_thread_switch_interrupt_flag set, jump to
* rt_hw_context_switch_interrupt_do and don't return * rt_hw_context_switch_interrupt_do and don't return
*/ */
la k0, rt_thread_switch_interrput_flag la k0, rt_thread_switch_interrupt_flag
lw k1, 0(k0) lw k1, 0(k0)
beqz k1, spurious_interrupt beqz k1, spurious_interrupt
nop nop
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
extern rt_uint32_t rt_interrupt_nest; extern rt_uint32_t rt_interrupt_nest;
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
static rt_isr_handler_t irq_handle_table[JZ47XX_MAX_INTR]; static rt_isr_handler_t irq_handle_table[JZ47XX_MAX_INTR];
...@@ -48,7 +48,7 @@ void rt_hw_interrupt_init() ...@@ -48,7 +48,7 @@ void rt_hw_interrupt_init()
rt_interrupt_nest = 0; rt_interrupt_nest = 0;
rt_interrupt_from_thread = 0; rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0; rt_interrupt_to_thread = 0;
rt_thread_switch_interrput_flag = 0; rt_thread_switch_interrupt_flag = 0;
} }
/** /**
......
...@@ -60,17 +60,17 @@ rt_hw_context_switch_to: ...@@ -60,17 +60,17 @@ rt_hw_context_switch_to:
/* /*
* void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to)/* * void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to)/*
*/ */
.globl rt_thread_switch_interrput_flag .globl rt_thread_switch_interrupt_flag
.globl rt_interrupt_from_thread .globl rt_interrupt_from_thread
.globl rt_interrupt_to_thread .globl rt_interrupt_to_thread
.globl rt_hw_context_switch_interrupt .globl rt_hw_context_switch_interrupt
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
la t0, rt_thread_switch_interrput_flag la t0, rt_thread_switch_interrupt_flag
lw t1, 0(t0) lw t1, 0(t0)
nop nop
bnez t1, _reswitch bnez t1, _reswitch
nop nop
li t1, 0x01 /* set rt_thread_switch_interrput_flag to 1 */ li t1, 0x01 /* set rt_thread_switch_interrupt_flag to 1 */
sw t1, 0(t0) sw t1, 0(t0)
la t0, rt_interrupt_from_thread /* set rt_interrupt_from_thread */ la t0, rt_interrupt_from_thread /* set rt_interrupt_from_thread */
sw a0, 0(t0) sw a0, 0(t0)
...@@ -110,10 +110,10 @@ mips_irq_handle: ...@@ -110,10 +110,10 @@ mips_irq_handle:
move sp, k0 move sp, k0
/* /*
* if rt_thread_switch_interrput_flag set, jump to * if rt_thread_switch_interrupt_flag set, jump to
* rt_hw_context_switch_interrupt_do and don't return * rt_hw_context_switch_interrupt_do and don't return
*/ */
la k0, rt_thread_switch_interrput_flag la k0, rt_thread_switch_interrupt_flag
lw k1, 0(k0) lw k1, 0(k0)
beqz k1, spurious_interrupt beqz k1, spurious_interrupt
nop nop
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
extern rt_uint32_t rt_interrupt_nest; extern rt_uint32_t rt_interrupt_nest;
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
static rt_isr_handler_t irq_handle_table[MAX_INTR]; static rt_isr_handler_t irq_handle_table[MAX_INTR];
void rt_interrupt_dispatch(void *ptreg); void rt_interrupt_dispatch(void *ptreg);
...@@ -50,7 +50,7 @@ void rt_hw_interrupt_init() ...@@ -50,7 +50,7 @@ void rt_hw_interrupt_init()
rt_interrupt_nest = 0; rt_interrupt_nest = 0;
rt_interrupt_from_thread = 0; rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0; rt_interrupt_to_thread = 0;
rt_thread_switch_interrput_flag = 0; rt_thread_switch_interrupt_flag = 0;
} }
/** /**
......
...@@ -85,9 +85,9 @@ rt_hw_context_switch_interrupt_do: ...@@ -85,9 +85,9 @@ rt_hw_context_switch_interrupt_do:
/* *r4(from_thread->sp) = sp */ /* *r4(from_thread->sp) = sp */
stw sp, (r4) stw sp, (r4)
/* clear rt_thread_switch_interrput_flag */ /* clear rt_thread_switch_interrupt_flag */
/* rt_thread_switch_interrput_flag = 0 */ /* rt_thread_switch_interrupt_flag = 0 */
stw zero,%gprel(rt_thread_switch_interrput_flag)(gp) stw zero,%gprel(rt_thread_switch_interrupt_flag)(gp)
/* load to thread sp */ /* load to thread sp */
/* r4 = rt_interrupt_to_thread(&to_thread->sp) */ /* r4 = rt_interrupt_to_thread(&to_thread->sp) */
...@@ -213,8 +213,8 @@ rt_hw_context_switch: ...@@ -213,8 +213,8 @@ rt_hw_context_switch:
.global rt_hw_context_switch_interrupt .global rt_hw_context_switch_interrupt
.type rt_hw_context_switch_interrupt, %function .type rt_hw_context_switch_interrupt, %function
rt_hw_context_switch_interrupt: rt_hw_context_switch_interrupt:
/* if( rt_thread_switch_interrput_flag != 0 ) _from_thread_not_change */ /* if( rt_thread_switch_interrupt_flag != 0 ) _from_thread_not_change */
ldw r2,%gprel(rt_thread_switch_interrput_flag)(gp) ldw r2,%gprel(rt_thread_switch_interrupt_flag)(gp)
bne r2,zero,_from_thread_not_change bne r2,zero,_from_thread_not_change
_from_thread_change: _from_thread_change:
...@@ -222,9 +222,9 @@ _from_thread_change: ...@@ -222,9 +222,9 @@ _from_thread_change:
addi ea,ea,-4 addi ea,ea,-4
stw ea,%gprel(rt_current_thread_entry)(gp) stw ea,%gprel(rt_current_thread_entry)(gp)
/* set rt_thread_switch_interrput_flag to 1 */ /* set rt_thread_switch_interrupt_flag to 1 */
movi r2, 1 movi r2, 1
stw r2,%gprel(rt_thread_switch_interrput_flag)(gp) stw r2,%gprel(rt_thread_switch_interrupt_flag)(gp)
/* update rt_interrupt_from_thread */ /* update rt_interrupt_from_thread */
stw r4,%gprel(rt_interrupt_from_thread)(gp) stw r4,%gprel(rt_interrupt_from_thread)(gp)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/* exception and interrupt handler table */ /* exception and interrupt handler table */
rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
rt_uint32_t rt_thread_switch_interrput_flag; rt_uint32_t rt_thread_switch_interrupt_flag;
rt_uint32_t rt_current_thread_entry; rt_uint32_t rt_current_thread_entry;
/*@}*/ /*@}*/
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
/* get exception back */ /* get exception back */
ldw ea, 72(sp) ldw ea, 72(sp)
/* if(rt_thread_switch_interrput_flag == 0) goto no_need_context */ /* if(rt_thread_switch_interrupt_flag == 0) goto no_need_context */
ldw r4,%gprel(rt_thread_switch_interrput_flag)(gp) ldw r4,%gprel(rt_thread_switch_interrupt_flag)(gp)
beq r4,zero,no_need_context beq r4,zero,no_need_context
need_context: need_context:
movia ea, rt_hw_context_switch_interrupt_do movia ea, rt_hw_context_switch_interrupt_do
/* disable interrput */ /* disable interrupt */
mov r5, zero mov r5, zero
no_need_context: no_need_context:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册