3 * Copyright 2004 Develer S.r.l. (http://www.develer.com/)
8 * \author Giovanni Bajo <rasky@develer.com>
10 * \brief DSP5680x task switching support
15 * Revision 1.1 2004/05/23 17:27:00 bernie
16 * Import kern/ subdirectory.
20 void asm_switch_context(void ** new_sp/*R2*/, void ** save_sp/*R3*/);
21 asm void asm_switch_context(void ** new_sp, void ** save_sp)
51 ; The compiler uses page 0 address locations X: 0x0030 - 0x003F as register
52 ; variables. Frequently accessed local variables are assigned to the page 0
53 ; registers instead of to stack locations so that load and store instructions
54 ; are shortened. Addresses X: 0x0030 - 0x0037 (page 0 registers MR0-MR7) are
55 ; volatile registers and can be overwritten. The remaining registers (page 0
56 ; registers MR8-MR15) are treated as non-volatile and, if used by a routine,
57 ; must be saved on entry and restored on exit.
59 ; So, register 0x30-0x37 are caller-save, while 0x38-0x3F are callee-save.
78 ; 28 words have been pushed on the stack.
103 ; restore hardware stack
105 move hws,la ; Clear HWS to ensure proper reload
111 ; restore all saved registers