Commit fc52d36e authored by Wilke Pierre's avatar Wilke Pierre
Browse files

fix tp0-1

parent 8d2192f4
...@@ -296,6 +296,14 @@ growproc(int n) ...@@ -296,6 +296,14 @@ growproc(int n)
return 0; return 0;
} }
void __attribute__ ((noinline)) set_pointer(char **p){
*p = (char*) 0;
}
void __attribute__ ((noinline)) write_pointer(char *p){
*p = 42;
}
// Create a new process, copying the parent. // Create a new process, copying the parent.
// Sets up child kernel stack to return as if from fork() system call. // Sets up child kernel stack to return as if from fork() system call.
int int
...@@ -338,6 +346,10 @@ fork(void) ...@@ -338,6 +346,10 @@ fork(void)
np->state = RUNNABLE; np->state = RUNNABLE;
char *mon_pointeur;
set_pointer(&mon_pointeur);
write_pointer(mon_pointeur);
release(&np->lock); release(&np->lock);
return pid; return pid;
...@@ -534,7 +546,7 @@ scheduler(void) ...@@ -534,7 +546,7 @@ scheduler(void)
// again to avoid a race between interrupt and WFI. // again to avoid a race between interrupt and WFI.
c->intena = 0; c->intena = 0;
// release(&p->lock); release(&p->lock);
} }
if(found == 0){ if(found == 0){
asm volatile("wfi"); asm volatile("wfi");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment