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
5cb7877e
Commit
5cb7877e
authored
18 years ago
by
kaashoek
Browse files
Options
Downloads
Patches
Plain Diff
use bootstrap processor as specified by MP table. typically 0, but not
guaranteed.
parent
f80873e6
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
main.c
+7
-5
7 additions, 5 deletions
main.c
mp.c
+2
-1
2 additions, 1 deletion
mp.c
with
9 additions
and
6 deletions
main.c
+
7
−
5
View file @
5cb7877e
...
...
@@ -23,22 +23,24 @@ void
main0
(
void
)
{
int
i
;
int
bcpu
;
struct
proc
*
p
;
// clear BSS
memset
(
edata
,
0
,
end
-
edata
);
// switch to bootstrap processor's stack
asm
volatile
(
"movl %0, %%esp"
:
:
"r"
(
cpus
[
0
].
mpstack
+
MPSTACK
-
32
));
asm
volatile
(
"movl %0, %%ebp"
:
:
"r"
(
cpus
[
0
].
mpstack
+
MPSTACK
));
// Prevent release() from enabling interrupts.
for
(
i
=
0
;
i
<
NCPU
;
i
++
)
cpus
[
i
].
nlock
=
1
;
mp_init
();
// collect info about this machine
bcpu
=
mp_bcpu
();
// switch to bootstrap processor's stack
asm
volatile
(
"movl %0, %%esp"
:
:
"r"
(
cpus
[
0
].
mpstack
+
MPSTACK
-
32
));
asm
volatile
(
"movl %0, %%ebp"
:
:
"r"
(
cpus
[
0
].
mpstack
+
MPSTACK
));
lapic_init
(
mp_
bcpu
()
);
lapic_init
(
bcpu
);
cprintf
(
"
\n
cpu%d: starting xv6
\n\n
"
,
cpu
());
...
...
This diff is collapsed.
Click to expand it.
mp.c
+
2
−
1
View file @
5cb7877e
...
...
@@ -191,7 +191,8 @@ mp_init(void)
int
mp_bcpu
(
void
)
{
return
bcpu
-
cpus
;
if
(
ismp
)
return
bcpu
-
cpus
;
else
return
0
;
}
extern
void
mpmain
(
void
);
...
...
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