update hdisr_gcc.S: push argument for ISR.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2341 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
66c2e88566
commit
0057604ad2
|
@ -28,7 +28,7 @@
|
||||||
jmp _hdinterrupts;\
|
jmp _hdinterrupts;\
|
||||||
.data;\
|
.data;\
|
||||||
.long name;\
|
.long name;\
|
||||||
.text
|
.text
|
||||||
|
|
||||||
.globl hdinterrupt_func
|
.globl hdinterrupt_func
|
||||||
.data
|
.data
|
||||||
|
@ -59,7 +59,7 @@ HDINTERRUPTFNC(irq15, 15)
|
||||||
.globl _hdinterrupts
|
.globl _hdinterrupts
|
||||||
.type _hdinterrupts,@function
|
.type _hdinterrupts,@function
|
||||||
.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_interrupt_flag
|
.globl rt_thread_switch_interrupt_flag
|
||||||
.globl rt_interrupt_from_thread
|
.globl rt_interrupt_from_thread
|
||||||
|
@ -73,14 +73,20 @@ _hdinterrupts:
|
||||||
movw %ax, %ds
|
movw %ax, %ds
|
||||||
movw %ax, %es
|
movw %ax, %es
|
||||||
pushl %esp
|
pushl %esp
|
||||||
|
|
||||||
call rt_interrupt_enter
|
call rt_interrupt_enter
|
||||||
movl %esp, %eax /* get irqno */
|
|
||||||
addl $0x2c, %eax
|
movl %esp, %eax /* copy esp to eax */
|
||||||
movl (%eax), %eax /* each item takes up 4bytes in isr_table,equl to isr_table[irqno] */
|
addl $0x2c, %eax /* move to vector address */
|
||||||
shll $0x2, %eax
|
movl (%eax), %eax /* vector(eax) = *eax */
|
||||||
movl $isr_table, %ebx
|
|
||||||
addl %eax,%ebx
|
pushl %eax /* push argument : int vector */
|
||||||
|
shll $0x2, %eax /* each item takes up 4bytes in isr_table. */
|
||||||
|
movl $isr_table, %ebx /* ebx = &isr_table[0] */
|
||||||
|
addl %eax, %ebx /* eax = &isr_table[vector] */
|
||||||
call *(%ebx)
|
call *(%ebx)
|
||||||
|
add $4, %esp /* restore argument */
|
||||||
|
|
||||||
call rt_interrupt_leave
|
call rt_interrupt_leave
|
||||||
|
|
||||||
/* if rt_thread_switch_interrupt_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 */
|
||||||
|
@ -88,7 +94,7 @@ _hdinterrupts:
|
||||||
movl (%eax), %ebx
|
movl (%eax), %ebx
|
||||||
cmp $0x1, %ebx
|
cmp $0x1, %ebx
|
||||||
jz _interrupt_thread_switch
|
jz _interrupt_thread_switch
|
||||||
|
|
||||||
popl %esp
|
popl %esp
|
||||||
popal
|
popal
|
||||||
pop %es
|
pop %es
|
||||||
|
@ -98,7 +104,7 @@ _hdinterrupts:
|
||||||
|
|
||||||
_interrupt_thread_switch:
|
_interrupt_thread_switch:
|
||||||
popl %esp
|
popl %esp
|
||||||
|
|
||||||
movl $0x0, %ebx
|
movl $0x0, %ebx
|
||||||
movl %ebx, (%eax)
|
movl %ebx, (%eax)
|
||||||
|
|
||||||
|
@ -109,7 +115,7 @@ _interrupt_thread_switch:
|
||||||
movl $rt_interrupt_to_thread, %ecx
|
movl $rt_interrupt_to_thread, %ecx
|
||||||
movl (%ecx), %edx
|
movl (%ecx), %edx
|
||||||
movl (%edx), %esp
|
movl (%edx), %esp
|
||||||
|
|
||||||
popal
|
popal
|
||||||
pop %es
|
pop %es
|
||||||
pop %ds
|
pop %ds
|
||||||
|
|
Loading…
Reference in New Issue