Mercurial > ecos-v2_0-branch
comparison packages/hal/mips/arch/current/src/vectors.S @ 10:d3fbcdfa1b2f ecos-sw-1999-05-29
Merge from eCos master repository on 1999-05-29-00:13:11-BST
| author | jlarmour |
|---|---|
| date | Fri, 28 May 1999 16:43:09 +0000 |
| parents | ece80412419a |
| children | 01ce82f3e11a |
comparison
equal
deleted
inserted
replaced
| 9:95cc44ea0068 | 10:d3fbcdfa1b2f |
|---|---|
| 162 # Call constructors | 162 # Call constructors |
| 163 .extern cyg_hal_invoke_constructors | 163 .extern cyg_hal_invoke_constructors |
| 164 jal cyg_hal_invoke_constructors | 164 jal cyg_hal_invoke_constructors |
| 165 nop | 165 nop |
| 166 | 166 |
| 167 #if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) && !defined(CYG_HAL_STARTUP_STUBS) | 167 #if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) |
| 168 .extern initialize_stub | 168 .extern initialize_stub |
| 169 jal initialize_stub | 169 jal initialize_stub |
| 170 nop | 170 nop |
| 171 #endif | 171 #endif |
| 172 | 172 |
| 190 # We enter here with all of the CPU state still | 190 # We enter here with all of the CPU state still |
| 191 # in its registers except: | 191 # in its registers except: |
| 192 # K0 = vector index | 192 # K0 = vector index |
| 193 # K1 = address of this function | 193 # K1 = address of this function |
| 194 | 194 |
| 195 | |
| 196 move k1,sp # K1 = original SP | 195 move k1,sp # K1 = original SP |
| 197 | 196 |
| 198 #ifdef CYG_HAL_ROM_MONITOR | 197 #ifdef CYG_HAL_ROM_MONITOR |
| 199 # Switch to interrupt stack to handle exception | 198 # Switch to interrupt stack to handle exception |
| 200 la sp,__interrupt_stack | 199 la sp,__interrupt_stack |
| 370 | 369 |
| 371 hal_fpu_save sp | 370 hal_fpu_save sp |
| 372 | 371 |
| 373 # The machine state is now all saved on the stack. | 372 # The machine state is now all saved on the stack. |
| 374 | 373 |
| 375 hal_diag_intr_start | |
| 376 | |
| 377 # Load Global Pointer register. | 374 # Load Global Pointer register. |
| 378 la gp,_gp | 375 la gp,_gp |
| 379 | 376 |
| 380 #ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT | 377 #ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT |
| 381 .extern cyg_scheduler_sched_lock | 378 .extern cyg_scheduler_sched_lock |
| 419 move s1,s2 # Vector == interrupt number | 416 move s1,s2 # Vector == interrupt number |
| 420 #endif | 417 #endif |
| 421 | 418 |
| 422 # Here s1 is the number of the vector to be called and s2 is | 419 # Here s1 is the number of the vector to be called and s2 is |
| 423 # the number of the interrupt being serviced. | 420 # the number of the interrupt being serviced. |
| 424 | 421 |
| 422 hal_diag_intr_start | |
| 423 | |
| 425 #if defined(CYGPKG_KERNEL_INSTRUMENT) && defined(CYGDBG_KERNEL_INSTRUMENT_INTR) | 424 #if defined(CYGPKG_KERNEL_INSTRUMENT) && defined(CYGDBG_KERNEL_INSTRUMENT_INTR) |
| 426 | 425 |
| 427 # Call cyg_instrument to record that this interrupt is being raised. | 426 # Call cyg_instrument to record that this interrupt is being raised. |
| 428 | 427 |
| 429 li a0,0x0301 # a0 = type = INTR,RAISE | 428 li a0,0x0301 # a0 = type = INTR,RAISE |
| 430 move a1,s1 # a1 = vector number | 429 move a1,s1 # a1 = vector number |
| 431 jal cyg_instrument # call instrument function | 430 jal cyg_instrument # call instrument function |
| 432 xor a2,a2,a2 # arg2 = 0 (delay slot) | 431 xor a2,a2,a2 # arg2 = 0 (delay slot) |
| 433 #endif | 432 #endif |
| 434 | 433 |
| 434 #if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) | |
| 435 # If we are supporting Ctrl-C interrupts from GDB, we must squirrel | |
| 436 # away a pointer to the save interrupt state here so that we can | |
| 437 # plant a breakpoint at some later time. | |
| 438 | |
| 439 .extern hal_saved_interrupt_state | |
| 440 la v0,hal_saved_interrupt_state | |
| 441 sw s0,0(v0) | |
| 442 | |
| 443 #endif | |
| 444 | |
| 435 sll s1,s1,2 # s1 = byte offset of vector | 445 sll s1,s1,2 # s1 = byte offset of vector |
| 436 | 446 |
| 447 hal_cpu_except_enable # reenable exceptions | |
| 448 | |
| 437 la t2,hal_interrupt_handlers # handler table | 449 la t2,hal_interrupt_handlers # handler table |
| 438 add t2,t2,s1 # address of ISR ptr | 450 add t2,t2,s1 # address of ISR ptr |
| 439 lw t2,0(t2) # ISR pointer | 451 lw t2,0(t2) # ISR pointer |
| 440 | 452 |
| 441 la a1,hal_interrupt_data # data table | 453 la a1,hal_interrupt_data # data table |
| 442 add a1,a1,s1 # address of data ptr | 454 add a1,a1,s1 # address of data ptr |
| 443 lw a1,0(a1) # Data pointer | 455 lw a1,0(a1) # Data pointer |
| 444 | 456 |
| 445 move a0,s2 # pass interrupt number | 457 move a0,s2 # pass interrupt number |
| 446 | 458 |
| 447 move a2,s0 # arg3 = saved register dump | |
| 448 | |
| 449 jalr t2 # call ISR via t2 | 459 jalr t2 # call ISR via t2 |
| 450 nop # (delay slot) | 460 nop # (delay slot) |
| 451 | 461 |
| 452 #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK | 462 #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK |
| 453 | 463 |
