2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
6 /*****************************************************************************
10 AROS_LH1(ULONG, SetSR,
13 AROS_LHA(ULONG, new , D0),
14 AROS_LHA(ULONG, mask, D1),
17 struct ExecBase *, SysBase, 24, Exec)
26 This function is CPU dependant.
38 ******************************************************************************/
40 #include "aros/m68k/asm.h"
44 .globl AROS_SLIB_ENTRY(SetSR,Exec)
46 AROS_SLIB_ENTRY(SetSR,Exec):
49 * Switch to Supervisor Mode by calling a trap function
51 #ifndef DoRegisterCalls
56 move.l #4,%d7 // #4 => call _sys_trap1_SetSR
58 move.l (%sp)+,%d7 // d0 holds old value of SR.
61 .globl _sys_trap1_SetSR
64 * Stack layout in this function
66 * SR 4(%sp) from trap call
70 and.w %d1,%d0 // isolate the flags to be changed
71 not.w %d1 // invert the mask
72 move.w 4(%sp),%d2 // target for sr is register d2
73 and.w %d1,%d2 // isolate the flags to remain untouched
74 or.w %d0,%d2 // generate new sr
75 move.w 4(%sp),%d0 // old value of sr goes into d0
76 move.w %d2,4(%sp) // save the modified target
77 not.w %d1 // revert the change