Moved stack switch handling (large stack) to sysdeps.c