1 /* 2 * splx.c - SYSV DDI/DKI ipl manipulation functions 3 * 4 * Internally, many unices use a range of different interrupt 5 * privilege levels, ie from "allow all interrupts" (7) to 6 * "allow no interrupts." (0) under SYSV. 7 * 8 * This a simple splx() function behaves as the SYSV DDI/DKI function does, 9 * although since Linux only implements the equivalent of level 0 (cli) and 10 * level 7 (sti), this implementation only implements those levels. 11 * 12 * Also, unlike the current Linux routines, splx() also returns the 13 * old privilege level so that it can be restored. 14 */ 15 16 #include <asm/system.h> 17 18 int splx (int new_level) { /* */ 19 register int old_level, tmp; 20 save_flags(tmp); 21 old_level = (tmp & 0x200) ? 7 : 0; 22 if (new_level) 23 sti(); 24 else 25 cli(); 26 return old_level; 27 }