Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krishna Vinnakota
CSEP551
Commits
00d0f794
Commit
00d0f794
authored
17 years ago
by
rsc
Browse files
Options
Downloads
Patches
Plain Diff
fix various bugs
parent
bda5186c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
BUGS
+0
-12
0 additions, 12 deletions
BUGS
proc.c
+9
-2
9 additions, 2 deletions
proc.c
with
9 additions
and
14 deletions
BUGS
+
0
−
12
View file @
00d0f794
...
...
@@ -12,15 +12,6 @@ main.c:
cpus[0] -> cpus[bcpu]
proc.c:
comment at top of scheduler() should say
via longjmp back to the scheduler
not
via longjmp back to the top of scheduler
sched should panic if state == RUNNING.
forkret comment should say "Return" not "return"
as a consequence of the implementation of proc_kill,
any loop calling sleep should check for p->killed
and be able to break out with an error return.
...
...
@@ -28,9 +19,6 @@ proc.c:
can swap procdump up after proc_kill
and then have proc_exit and proc_wait on same sheet
proc_exit should wake up proc[1] if any
reparenting was done.
sched -> switch2scheduler? or just switch?
factor out switching and scheduling code from process code
...
...
This diff is collapsed.
Click to expand it.
proc.c
+
9
−
2
View file @
00d0f794
...
...
@@ -207,8 +207,10 @@ sched(void)
{
struct
proc
*
p
=
curproc
[
cpu
()];
if
(
p
->
state
==
RUNNING
)
panic
(
"sched running"
);
if
(
!
holding
(
&
proc_table_lock
))
panic
(
"sched"
);
panic
(
"sched
proc_table_lock
"
);
if
(
cpus
[
cpu
()].
nlock
!=
1
)
panic
(
"sched locks"
);
...
...
@@ -334,6 +336,9 @@ proc_exit(void)
struct
proc
*
cp
=
curproc
[
cpu
()];
int
fd
;
if
(
cp
->
pid
==
1
)
panic
(
"init exiting"
);
// Close all open files.
for
(
fd
=
0
;
fd
<
NOFILE
;
fd
++
){
if
(
cp
->
ofile
[
fd
]){
...
...
@@ -354,8 +359,10 @@ proc_exit(void)
// Reparent our children to process 1.
for
(
p
=
proc
;
p
<
&
proc
[
NPROC
];
p
++
)
if
(
p
->
ppid
==
cp
->
pid
)
if
(
p
->
ppid
==
cp
->
pid
)
{
p
->
ppid
=
1
;
wakeup1
(
&
proc
[
1
]);
// init
}
// Jump into the scheduler, never to return.
cp
->
killed
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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