xref: /inferno-os/os/boot/pc/ilock.c (revision 74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a)
1 #include "u.h"
2 #include "lib.h"
3 #include "mem.h"
4 #include "dat.h"
5 #include "fns.h"
6 #include "io.h"
7 
8 void
ilock(Lock * lk)9 ilock(Lock *lk)
10 {
11 	if(lk->locked != 0)
12 		panic("ilock");
13 	lk->spl = splhi();
14 	lk->locked = 1;
15 }
16 
17 void
iunlock(Lock * lk)18 iunlock(Lock *lk)
19 {
20 	if(lk->locked != 1)
21 		panic("iunlock");
22 	lk->locked = 0;
23 	splx(lk->spl);
24 }
25