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
da942337
Commit
da942337
authored
17 years ago
by
rsc
Browse files
Options
Downloads
Patches
Plain Diff
nits
parent
3ce16470
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
mp.c
+13
-17
13 additions, 17 deletions
mp.c
with
13 additions
and
17 deletions
mp.c
+
13
−
17
View file @
da942337
...
...
@@ -72,8 +72,7 @@ mp_search(void)
if
((
p
=
(
bda
[
0x0F
]
<<
8
)
|
bda
[
0x0E
])){
if
((
mp
=
mp_scan
((
uchar
*
)
p
,
1024
)))
return
mp
;
}
else
{
}
else
{
p
=
((
bda
[
0x14
]
<<
8
)
|
bda
[
0x13
])
*
1024
;
if
((
mp
=
mp_scan
((
uchar
*
)
p
-
1024
,
1024
)))
return
mp
;
...
...
@@ -94,19 +93,20 @@ mp_detect(void)
uint
length
;
if
((
mp
=
mp_search
())
==
0
||
mp
->
physaddr
==
0
)
return
1
;
return
-
1
;
pcmp
=
(
struct
mpctb
*
)
mp
->
physaddr
;
if
(
memcmp
(
pcmp
,
"PCMP"
,
4
))
return
2
;
if
(
memcmp
(
pcmp
,
"PCMP"
,
4
)
!=
0
)
return
-
1
;
if
(
pcmp
->
version
!=
1
&&
pcmp
->
version
!=
4
)
return
-
1
;
length
=
pcmp
->
length
;
sum
=
0
;
for
(
p
=
(
uchar
*
)
pcmp
;
length
;
length
--
)
sum
+=
*
p
++
;
if
(
sum
||
(
pcmp
->
version
!=
1
&&
pcmp
->
version
!=
4
))
return
3
;
if
(
sum
!=
0
)
return
-
1
;
return
0
;
}
...
...
@@ -114,20 +114,17 @@ mp_detect(void)
void
mp_init
(
void
)
{
int
r
;
int
i
,
r
;
uchar
*
p
,
*
e
;
struct
mpctb
*
mpctb
;
struct
mppe
*
proc
;
struct
mpbe
*
bus
;
struct
mpioapic
*
ioapic
;
struct
mpie
*
intr
;
int
i
;
uchar
byte
;
ncpu
=
0
;
if
(
(
r
=
mp_detect
()
)
!=
0
)
{
if
(
mp_detect
()
<
0
)
return
;
}
ismp
=
1
;
...
...
@@ -179,11 +176,10 @@ mp_init(void)
}
if
(
mp
->
imcrp
)
{
// It appears that Bochs doesn't support IMCR, so code won't run.
// Bochs doesn't support IMCR, so this doesn't run on Bochs.
// But it would on real hardware.
outb
(
0x22
,
0x70
);
// Select IMCR
byte
=
inb
(
0x23
);
// Current contents
byte
|=
0x01
;
// Mask external INTR
outb
(
0x23
,
byte
);
// Disconnect 8259s/NMI
outb
(
0x23
,
inb
(
0x23
)
|
1
);
// Mask external interrupts.
}
}
...
...
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