swtch saves callee-saved registers
swtch idles on per-CPU stack, not on calling process's stack fix pipe bugs usertest.c tests pipes, fork, exit, close
This commit is contained in:
parent
f7cea12b38
commit
8b4e2a08fe
14 changed files with 220 additions and 63 deletions
5
kalloc.c
5
kalloc.c
|
@ -45,10 +45,15 @@ kfree(char *cp, int len)
|
|||
struct run **rr;
|
||||
struct run *p = (struct run *) cp;
|
||||
struct run *pend = (struct run *) (cp + len);
|
||||
int i;
|
||||
|
||||
if(len % PAGE)
|
||||
panic("kfree");
|
||||
|
||||
// XXX fill with junk to help debug
|
||||
for(i = 0; i < len; i++)
|
||||
cp[i] = 1;
|
||||
|
||||
rr = &freelist;
|
||||
while(*rr){
|
||||
struct run *rend = (struct run *) ((char *)(*rr) + (*rr)->len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue