Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
redox-os
kernel
Commits
f4bdb538
Verified
Commit
f4bdb538
authored
1 year ago
by
Jacob Lorentzon
Browse files
Options
Downloads
Patches
Plain Diff
Remove AtomicU64 requirement for starting APs.
parent
885f88b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!238
Demand paging
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/acpi/madt.rs
+17
-17
17 additions, 17 deletions
src/acpi/madt.rs
with
17 additions
and
17 deletions
src/acpi/madt.rs
+
17
−
17
View file @
f4bdb538
...
...
@@ -6,7 +6,7 @@ use crate::paging::{KernelMapper, Page, PageFlags, PhysicalAddress, RmmA, RmmArc
use
super
::
sdt
::
Sdt
;
use
super
::
find_sdt
;
use
core
::
sync
::
atomic
::{
AtomicU8
,
AtomicU64
,
Ordering
};
use
core
::
sync
::
atomic
::{
AtomicU8
,
Ordering
};
use
crate
::
device
::
local_apic
::
LOCAL_APIC
;
use
crate
::
interrupt
;
...
...
@@ -91,24 +91,24 @@ impl Madt {
let
stack_start
=
allocate_frames
(
64
)
.expect
(
"no more frames in acpi stack_start"
)
.start_address
()
.data
()
+
crate
::
PHYS_OFFSET
;
let
stack_end
=
stack_start
+
64
*
4096
;
let
ap_ready
=
(
TRAMPOLINE
+
8
)
as
*
const
AtomicU
64
;
let
ap_cpu_id
=
unsafe
{
ap_ready
.
offset
(
1
)
};
let
ap_page_table
=
unsafe
{
ap_ready
.
offset
(
2
)
};
let
ap_stack_start
=
unsafe
{
ap_ready
.
offset
(
3
)
};
let
ap_stack_end
=
unsafe
{
ap_ready
.
offset
(
4
)
};
let
ap_code
=
unsafe
{
ap_ready
.
offset
(
5
)
};
let
ap_ready
=
(
TRAMPOLINE
+
8
)
as
*
mut
u
64
;
let
ap_cpu_id
=
unsafe
{
ap_ready
.
add
(
1
)
};
let
ap_page_table
=
unsafe
{
ap_ready
.
add
(
2
)
};
let
ap_stack_start
=
unsafe
{
ap_ready
.
add
(
3
)
};
let
ap_stack_end
=
unsafe
{
ap_ready
.
add
(
4
)
};
let
ap_code
=
unsafe
{
ap_ready
.
add
(
5
)
};
// Set the ap_ready to 0, volatile
unsafe
{
(
*
ap_ready
)
.store
(
0
,
Ordering
::
SeqCst
);
(
*
ap_cpu_id
)
.store
(
ap_local_apic
.id
as
u64
,
Ordering
::
SeqCst
);
(
*
ap_
page_table
)
.store
(
page_table_physaddr
as
u64
,
Ordering
::
SeqCst
);
(
*
ap_
stack_start
)
.store
(
stack_start
as
u64
,
Ordering
::
SeqCst
);
(
*
ap_stack_end
)
.store
(
stack_end
as
u64
,
Ordering
::
SeqCst
);
(
*
ap_code
)
.store
(
kstart_ap
as
u64
,
Ordering
::
SeqCst
);
ap_ready
.write
(
0
);
ap_cpu_id
.write
(
ap_local_apic
.id
.into
());
ap_page_table
.write
(
page_table_physaddr
as
u64
);
ap_
stack_start
.write
(
stack_start
as
u64
);
ap_stack_end
.write
(
stack_end
as
u64
);
ap_
code
.write
(
kstart_ap
as
u64
);
// TODO: Is this necessary (this fence)?
core
::
arch
::
asm!
(
""
);
};
AP_READY
.store
(
false
,
Ordering
::
SeqCst
);
...
...
@@ -144,7 +144,7 @@ impl Madt {
// Wait for trampoline ready
print!
(
" Wait..."
);
while
unsafe
{
(
*
ap_ready
)
.load
(
Ordering
::
SeqCst
)
}
==
0
{
while
unsafe
{
(
*
ap_ready
.cast
::
<
AtomicU8
>
()
)
.load
(
Ordering
::
SeqCst
)
}
==
0
{
interrupt
::
pause
();
}
print!
(
" Trampoline..."
);
...
...
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