This is implemented for gint only currently; on Vhex, _Exit() is likely
just going to be a syscall. For CASIOWIN, this is slightly more
difficult, as there is no native exit syscall.
SR.BL=1 could cause problems if setjmp or longjmp is loader over a page
boundary and the second page is not loaded when interrupts are masked.
SR.IMASK=15 is another option, but it seems unnecessary per #1.
Blocking interrupts in longjmp did not make too much sense because the
blocked SR was immediately replaced by the restored one.
This change provides an optimized hand-written strlen function for
SuperH targets. The original plan was to declare the C-based naive
version weak and just let the linker figure out the proper one to use,
but unfortunately static libraries don't work like that; ld
intentionally stops at the first version even if it's weak. Instead,
some #ifdef's are used in the C-based strlen to not compile it when
unneeded.
The optimized strlen uses 4-byte accesses and cmp/str.
The method is rather naive - digits read as an integer, then multipled
by a power of 10 or 2. This does not always give exact results, but it's
close enough for now. A stub support for long double larger than 64 bits
is provided.
The presumed bug where the value computed without the sign overflows
even though the negative result can be represented is not actually a
problem, because this only happens with signed results and the temporary
value is computed as unsigned (thus with extra range).
These macros cannot be tested properly until support for *printf and
*scanf is added (support for *printf currently exists but with a
temporary implementation), so this is LDEPS.
The size of the types has been checked though, so the definitions here
should be correct, the rest is printf/scanf logic.