diff options
Diffstat (limited to 'os/boot/pc/ilock.c')
| -rw-r--r-- | os/boot/pc/ilock.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/os/boot/pc/ilock.c b/os/boot/pc/ilock.c new file mode 100644 index 00000000..977b9ad2 --- /dev/null +++ b/os/boot/pc/ilock.c @@ -0,0 +1,24 @@ +#include "u.h" +#include "lib.h" +#include "mem.h" +#include "dat.h" +#include "fns.h" +#include "io.h" + +void +ilock(Lock *lk) +{ + if(lk->locked != 0) + panic("ilock"); + lk->spl = splhi(); + lk->locked = 1; +} + +void +iunlock(Lock *lk) +{ + if(lk->locked != 1) + panic("iunlock"); + lk->locked = 0; + splx(lk->spl); +} |
