I don't know if there is anything standard, but this is what I use (for coldfire V2):
uint16
get_sr(void)
{
uint16 csr;
asm {
move.w sr,d0
move.w d0,csr
}
return csr;
}
void
set_sr(uint16 csr)
{
asm {
move.w csr,d0
move.w d0,sr
}
}
I don't know if there is anything standard, but this is what I use (for coldfire V2):
uint16
get_sr(void)
{
uint16 csr;
asm {
move.w sr,d0
move.w d0,csr
}
return csr;
}
void
set_sr(uint16 csr)
{
asm {
move.w csr,d0
move.w d0,sr
}
}