/* RegisterSaveRestore.S * Save and restore all the global registers on a SPARC. * * Peter B. Kessler, November 15, 1989 5:42:14 pm PST */ #include #include "leaf_linkage.h" /* Caller must allocate double word aligned block of STATESIZE. * Then you call save_regs(&block) to save * and restore_regs(&block) to restore. * To find out how much space you need is to call state_size(). * * The address of the block is passed to save_regs and restore_regs * in %o0, and the return address for save_regs and restore_regs is * in %o7. The caller must save those registers before calling save_regs * and must restore them after returning from restore_regs. * You can save those registers and allocate the space by using * the SPARC's save instruction. */ ALTENTRY(save_regs_maxi) LEAF_SAVE_LOCALS(%o0) LEAF_SAVE_OUTS(%o0) ALTENTRY(save_regs) LEAF_SAVE_FLOATS(%o0) ALTENTRY(save_regs_mini) LEAF_SAVE_INS(%o0) ALTENTRY(save_regs_globals) LEAF_SAVE_GLOBALS(%o0) ENTRY(save_regs_none) retl nop ALTENTRY(restore_regs_maxi) LEAF_RESTORE_LOCALS(%o0) LEAF_RESTORE_OUTS(%o0) ALTENTRY(restore_regs) LEAF_RESTORE_FLOATS(%o0) ALTENTRY(restore_regs_mini) LEAF_RESTORE_INS(%o0) ALTENTRY(restore_regs_globals) LEAF_RESTORE_GLOBALS(%o0) ENTRY(restore_regs_none) retl nop ENTRY(reg_state_size) GET_STATESIZE() retl nop