Mercurial > flash_v2
comparison packages/hal/arm/arch/current/src/context.S @ 38:e7ba79f6d3a8 ecos-sw-1999-09-23
Merge from eCos master repository on 1999-09-23-20:10:25-BST
| author | jlarmour |
|---|---|
| date | Thu, 23 Sep 1999 19:52:27 +0000 |
| parents | 5f5102441818 |
| children | c38311975d4f |
comparison
equal
deleted
inserted
replaced
| 37:0b25345c9c69 | 38:e7ba79f6d3a8 |
|---|---|
| 65 // Note: this is a little wasteful since r0..r3 don't need to be saved. | 65 // Note: this is a little wasteful since r0..r3 don't need to be saved. |
| 66 // They are saved here though so that the information can match the HAL_SavedRegisters | 66 // They are saved here though so that the information can match the HAL_SavedRegisters |
| 67 | 67 |
| 68 FUNC_START(hal_thread_switch_context) | 68 FUNC_START(hal_thread_switch_context) |
| 69 mov ip,sp // saved stack pointer | 69 mov ip,sp // saved stack pointer |
| 70 sub sp,sp,#ARMREG_SIZE // make space for saved registers | 70 stmfd sp!,{fp,ip,lr,pc} // filler |
| 71 stmea sp,{r0-r10,fp,ip,lr,pc} | 71 stmfd sp!,{r0-r10,fp,ip,lr,pc} |
| 72 mrs r2,cpsr | 72 mrs r2,cpsr |
| 73 str r2,[sp,#armreg_cpsr] | 73 str r2,[sp,#armreg_cpsr] |
| 74 str sp,[r1] // return new stack pointer | 74 str sp,[r1] // return new stack pointer |
| 75 | 75 |
| 76 # Now load the destination thread by dropping through | 76 # Now load the destination thread by dropping through |
| 88 mrs r0,cpsr // disable IRQ's | 88 mrs r0,cpsr // disable IRQ's |
| 89 orr r0,r0,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE | 89 orr r0,r0,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE |
| 90 msr cpsr,r0 | 90 msr cpsr,r0 |
| 91 ldr r0,[fp,#armreg_cpsr] | 91 ldr r0,[fp,#armreg_cpsr] |
| 92 msr spsr,r0 | 92 msr spsr,r0 |
| 93 ldmfd fp,{r0-r10,fp,sp,lr} // also restores saved PSR | 93 ldmfd fp,{r0-r10,fp,sp,lr} |
| 94 movs pc,lr | 94 movs pc,lr // also restores saved PSR |
| 95 | 95 |
| 96 // ------------------------------------------------------------------------------ | 96 // ------------------------------------------------------------------------------ |
| 97 // HAL longjmp, setjmp implementations | 97 // HAL longjmp, setjmp implementations |
| 98 // hal_setjmp saves only to callee save registers 4-14 | 98 // hal_setjmp saves only to callee save registers 4-14 |
| 99 // and lr into buffer supplied in r0[arg0] | 99 // and lr into buffer supplied in r0[arg0] |
