Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
8b75366c
Commit
8b75366c
authored
15 years ago
by
Russ Cox
Browse files
Options
Downloads
Patches
Plain Diff
s/IRQ_OFFSET/T_IRQ0/: it's a trap number, not an irq number.
move the SYSCALL number up, so does not overlap the IRQ traps.
parent
27ff8f0e
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
trap.c
+7
-7
7 additions, 7 deletions
trap.c
traps.h
+3
-2
3 additions, 2 deletions
traps.h
with
10 additions
and
9 deletions
trap.c
+
7
−
7
View file @
8b75366c
...
...
@@ -45,7 +45,7 @@ trap(struct trapframe *tf)
}
switch
(
tf
->
trapno
){
case
IRQ
_OFFSET
+
IRQ_TIMER
:
case
T_
IRQ
0
+
IRQ_TIMER
:
if
(
cpu
()
==
0
){
acquire
(
&
tickslock
);
ticks
++
;
...
...
@@ -54,20 +54,20 @@ trap(struct trapframe *tf)
}
lapiceoi
();
break
;
case
IRQ
_OFFSET
+
IRQ_IDE
:
case
T_
IRQ
0
+
IRQ_IDE
:
ideintr
();
lapiceoi
();
break
;
case
IRQ
_OFFSET
+
IRQ_KBD
:
case
T_
IRQ
0
+
IRQ_KBD
:
kbdintr
();
lapiceoi
();
break
;
case
IRQ
_OFFSET
+
IRQ_COM1
:
case
T_
IRQ
0
+
IRQ_COM1
:
uartintr
();
lapiceoi
();
break
;
case
IRQ
_OFFSET
+
7
:
case
IRQ
_OFFSET
+
IRQ_SPURIOUS
:
case
T_
IRQ
0
+
7
:
case
T_
IRQ
0
+
IRQ_SPURIOUS
:
cprintf
(
"cpu%d: spurious interrupt at %x:%x
\n
"
,
cpu
(),
tf
->
cs
,
tf
->
eip
);
lapiceoi
();
...
...
@@ -94,7 +94,7 @@ trap(struct trapframe *tf)
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.
if
(
cp
&&
cp
->
state
==
RUNNING
&&
tf
->
trapno
==
IRQ
_OFFSET
+
IRQ_TIMER
)
if
(
cp
&&
cp
->
state
==
RUNNING
&&
tf
->
trapno
==
T_
IRQ
0
+
IRQ_TIMER
)
yield
();
// Check if the process has been killed since we yielded
...
...
This diff is collapsed.
Click to expand it.
traps.h
+
3
−
2
View file @
8b75366c
...
...
@@ -24,10 +24,10 @@
// These are arbitrarily chosen, but with care not to overlap
// processor defined exceptions or interrupt vectors.
#define T_SYSCALL 4
8
// system call
#define T_SYSCALL
6
4 // system call
#define T_DEFAULT 500 // catchall
#define IRQ
_OFFSET
32 // IRQ 0 corresponds to int IRQ
_OFFSET
#define
T_
IRQ
0
32 // IRQ 0 corresponds to int
T_
IRQ
#define IRQ_TIMER 0
#define IRQ_KBD 1
...
...
@@ -35,3 +35,4 @@
#define IRQ_IDE 14
#define IRQ_ERROR 19
#define IRQ_SPURIOUS 31
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