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
7a77375d
Commit
7a77375d
authored
8 years ago
by
Frans Kaashoek
Browse files
Options
Downloads
Patches
Plain Diff
x
parent
1fc87f36
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lapic.c
+6
-6
6 additions, 6 deletions
lapic.c
with
6 additions
and
6 deletions
lapic.c
+
6
−
6
View file @
7a77375d
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#define DEASSERT 0x00000000
#define DEASSERT 0x00000000
#define LEVEL 0x00008000 // Level triggered
#define LEVEL 0x00008000 // Level triggered
#define BCAST 0x00080000 // Send to all APICs, including self.
#define BCAST 0x00080000 // Send to all APICs, including self.
/
#
define
BUSY
0x00001000
#define BUSY 0x00001000
#define FIXED 0x00000000
#define FIXED 0x00000000
#define ICRHI (0x0310/4) // Interrupt Command [63:32]
#define ICRHI (0x0310/4) // Interrupt Command [63:32]
#define TIMER (0x0320/4) // Local Vector Table 0 (TIMER)
#define TIMER (0x0320/4) // Local Vector Table 0 (TIMER)
...
@@ -53,19 +53,19 @@ lapicw(int index, int value)
...
@@ -53,19 +53,19 @@ lapicw(int index, int value)
void
void
lapicinit
(
void
)
lapicinit
(
void
)
{
{
if
(
!
lapic
)
if
(
!
lapic
)
return
;
return
;
// Enable local APIC; set spurious interrupt vector.
// Enable local APIC; set spurious interrupt vector.
lapicw
(
SVR
,
ENABLE
|
(
T_IRQ0
+
IRQ_SPURIOUS
));
lapicw
(
SVR
,
ENABLE
|
(
T_IRQ0
+
IRQ_SPURIOUS
));
// The timer repeatedly counts down at bus frequency
// The timer repeatedly counts down at bus frequency
// from lapic[TICR] and then issues an interrupt.
// from lapic[TICR] and then issues an interrupt.
// If xv6 cared more about precise timekeeping,
// If xv6 cared more about precise timekeeping,
// TICR would be calibrated using an external time source.
// TICR would be calibrated using an external time source.
lapicw
(
TDCR
,
X1
);
lapicw
(
TDCR
,
X1
);
lapicw
(
TIMER
,
PERIODIC
|
(
T_IRQ0
+
IRQ_TIMER
));
lapicw
(
TIMER
,
PERIODIC
|
(
T_IRQ0
+
IRQ_TIMER
));
lapicw
(
TICR
,
10000000
);
lapicw
(
TICR
,
10000000
);
// Disable logical interrupt lines.
// Disable logical interrupt lines.
lapicw
(
LINT0
,
MASKED
);
lapicw
(
LINT0
,
MASKED
);
...
@@ -141,7 +141,7 @@ lapicstartap(uchar apicid, uint addr)
...
@@ -141,7 +141,7 @@ lapicstartap(uchar apicid, uint addr)
{
{
int
i
;
int
i
;
ushort
*
wrv
;
ushort
*
wrv
;
// "The BSP must initialize CMOS shutdown code to 0AH
// "The BSP must initialize CMOS shutdown code to 0AH
// and the warm reset vector (DWORD based at 40:67) to point at
// and the warm reset vector (DWORD based at 40:67) to point at
// the AP startup code prior to the [universal startup algorithm]."
// the AP startup code prior to the [universal startup algorithm]."
...
@@ -158,7 +158,7 @@ lapicstartap(uchar apicid, uint addr)
...
@@ -158,7 +158,7 @@ lapicstartap(uchar apicid, uint addr)
microdelay
(
200
);
microdelay
(
200
);
lapicw
(
ICRLO
,
INIT
|
LEVEL
);
lapicw
(
ICRLO
,
INIT
|
LEVEL
);
microdelay
(
100
);
// should be 10ms, but too slow in Bochs!
microdelay
(
100
);
// should be 10ms, but too slow in Bochs!
// Send startup IPI (twice!) to enter code.
// Send startup IPI (twice!) to enter code.
// Regular hardware is supposed to only accept a STARTUP
// Regular hardware is supposed to only accept a STARTUP
// when it is in the halted state due to an INIT. So the second
// when it is in the halted state due to an INIT. So the second
...
...
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