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
66432474
Commit
66432474
authored
18 years ago
by
rtm
Browse files
Options
Downloads
Patches
Plain Diff
cvs add spinlock.h
fix race in schedule()
parent
4e8f237b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Notes
+7
-0
7 additions, 0 deletions
Notes
proc.c
+2
-1
2 additions, 1 deletion
proc.c
spinlock.h
+6
-0
6 additions, 0 deletions
spinlock.h
usertests.c
+2
-2
2 additions, 2 deletions
usertests.c
with
17 additions
and
3 deletions
Notes
+
7
−
0
View file @
66432474
...
...
@@ -126,3 +126,10 @@ in general, the table locks protect both free-ness and
why can't i get a lock in console code?
always triple fault
lock code shouldn't call cprintf...
ide_init doesn't work now?
and IOAPIC: read from unsupported address
when running pre-empt user test
so maybe something wrong with clock interrupts
no! if one cpu holds lock w/ curproc0=,
then another cpu can take it, it looks like
a recursive acquire()
This diff is collapsed.
Click to expand it.
proc.c
+
2
−
1
View file @
66432474
...
...
@@ -148,7 +148,6 @@ scheduler(void)
if
(
i
<
NPROC
){
np
->
state
=
RUNNING
;
release
(
&
proc_table_lock
);
break
;
}
...
...
@@ -159,6 +158,8 @@ scheduler(void)
cpus
[
cpu
()].
lastproc
=
np
;
curproc
[
cpu
()]
=
np
;
release
(
&
proc_table_lock
);
// h/w sets busy bit in TSS descriptor sometimes, and faults
// if it's set in LTR. so clear tss descriptor busy bit.
np
->
gdt
[
SEG_TSS
].
sd_type
=
STS_T32A
;
...
...
This diff is collapsed.
Click to expand it.
spinlock.h
0 → 100644
+
6
−
0
View file @
66432474
struct
spinlock
{
unsigned
int
locked
;
struct
proc
*
p
;
int
count
;
unsigned
locker_pc
;
};
This diff is collapsed.
Click to expand it.
usertests.c
+
2
−
2
View file @
66432474
...
...
@@ -93,8 +93,8 @@ preempt()
main
()
{
puts
(
"usertests starting
\n
"
);
pipe1
();
//
preempt();
//
pipe1();
preempt
();
while
(
1
)
;
...
...
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