Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
git_push
OSKernel2023-git_push
Commits
9f621b8a
Commit
9f621b8a
authored
1 year ago
by
hthyyds
Browse files
Options
Download
Patches
Plain Diff
modify trap.c of proc time update
parent
fb2573e3
main
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/trap.c
+4
-1
kernel/trap.c
with
4 additions
and
1 deletion
+4
-1
kernel/trap.c
+
4
−
1
View file @
9f621b8a
...
...
@@ -92,8 +92,10 @@ usertrap(void)
exit
(
-
1
);
// give up the CPU if this is a timer interrupt.
if
(
which_dev
==
2
)
if
(
which_dev
==
2
){
p
->
utime
++
;
yield
();
}
usertrapret
();
}
...
...
@@ -171,6 +173,7 @@ kerneltrap() {
// give up the CPU if this is a timer interrupt.
if
(
which_dev
==
2
&&
myproc
()
!=
0
&&
myproc
()
->
state
==
RUNNING
)
{
myproc
()
->
stime
++
;
yield
();
}
// the yield() may have caused some traps to occur,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets