2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: SetSR() - Modify the CPU status register.
9 #include <exec/types.h>
10 #include <exec/ptrace.h>
12 #include <aros/debug.h>
14 /*****************************************************************************
17 #include <proto/exec.h>
19 AROS_LH2(ULONG
, SetSR
,
22 AROS_LHA(ULONG
, newSR
, D0
),
23 AROS_LHA(ULONG
, mask
, D1
),
26 struct ExecBase
*, SysBase
, 24, Exec
)
29 Read/Modify the CPU status register in an easy way. Only the bits
30 set it the mask parameter will be changed.
32 The bits in the register mapped to those of the Motorola MC680x0
33 family of microprocessors.
36 newSR - The new contents of the status register.
37 mask - Mask of bits to change.
40 The old contents of the status register or ~0UL if this function
44 This function is of limited use.
47 You can read the status register by calling SetSR(0,0).
50 This function may do nothing on non-mc680x0 systems.
58 ******************************************************************************/
63 __asm__
__volatile__ ("swi #1");
70 void _sys_SetSR(struct pt_regs
* regs
, LONG adjust
)
73 ULONG mask
= regs
->r1
;
74 regs
->r0
= regs
->cpsr
;
75 regs
->cpsr
= (regs
->cpsr
& ~mask
) | (new & mask
);
76 // D(bug("in _sys_SetSR! new cpsr = %x\n",regs->cpsr));