Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cidre-public
Systemes d exploitation
xv6-riscv-tp
Commits
fc52d36e
Commit
fc52d36e
authored
Dec 13, 2020
by
Wilke Pierre
Browse files
fix tp0-1
parent
8d2192f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
kernel/proc.c
View file @
fc52d36e
...
...
@@ -296,6 +296,14 @@ growproc(int n)
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.
// Sets up child kernel stack to return as if from fork() system call.
int
...
...
@@ -338,6 +346,10 @@ fork(void)
np
->
state
=
RUNNABLE
;
char
*
mon_pointeur
;
set_pointer
(
&
mon_pointeur
);
write_pointer
(
mon_pointeur
);
release
(
&
np
->
lock
);
return
pid
;
...
...
@@ -534,7 +546,7 @@ scheduler(void)
// again to avoid a race between interrupt and WFI.
c
->
intena
=
0
;
//
release(&p->lock);
release
(
&
p
->
lock
);
}
if
(
found
==
0
){
asm
volatile
(
"wfi"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment