Vectors.asm, RAM_THROW extension:
bcs.s \NotAFunctionCall
cmp.l #kernel::EndSharedLinker,a1 ; Compare the address. Is-it inside the PreOs kernel routine?
bhi.s \NotAFunctionCall
- btst.l #5,d1 ; Called in supervisor mode ?
+ btst.l #13,d1 ; Called in supervisor mode ?
beq.s \UserMode ; No
move.w d1,6*4(sp) ; Rewrite SR (need another return adress on the stack)
move.l a1,6*4+2(sp) ; Set the ramcall ptr as the return adress of the handler
I had writen '5' because I tested the bit in the upper byte of the SR inside the stack ... I didn't see that when you optimized this part of the routine. Sorry for not having catch that...
In my programs (man & eexec), this doesn't produce a bug, because the bit 5 of the SR is not used (so it's 0), and I always call the handler when in user mode.