=================================================================== RCS file: /cvs/funnyos/arch/testarm/boot/loader.S,v retrieving revision 1.3 retrieving revision 1.5 diff -u -r1.3 -r1.5 --- funnyos/arch/testarm/boot/loader.S 2007/11/04 22:39:27 1.3 +++ funnyos/arch/testarm/boot/loader.S 2007/11/23 13:37:42 1.5 @@ -1,5 +1,5 @@ /* - * $Id: loader.S,v 1.3 2007/11/04 22:39:27 init Exp $ + * $Id: loader.S,v 1.5 2007/11/23 13:37:42 nbrk Exp $ */ /* * FunnyOS loader @@ -61,13 +61,25 @@ nop _vector_irq: + /* decrement pc by one insn */ + sub lr, lr, #4 - bl irq_trampoline + /* store all system mode registers */ + stmdb sp!, {r0-r12, lr} - mrs r0, spsr - msr cpsr, r0 + /* store sys_mode's cpsr */ +// mrs r1, spsr +// stmdb sp!, {r1} - subs pc, r14, #4 + /* pass sp (which now contains struct pcb of interrupted task) to irq_trampoline */ + mov r0, sp + + bl irq_trampoline + + /* load r0-r12 and pc from the stack */ + /* note ^ that copies SPSR into CPSR */ + /** here we may return to different task (if pcb was changed in the stack memory) **/ + ldmia sp!, {r0-r12, pc}^ _vector_fiq: nop