Based on patch from joerg@, with tweaks by me to work with sbmips non-use of the CP0 count/compare registers for clock interrupts.