Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
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
Peter Limkilde Svendsen
relibc
Commits
618643b2
Verified
Commit
618643b2
authored
8 months ago
by
Jacob Lorentzon
Browse files
Options
Downloads
Patches
Plain Diff
Work around aarch64 bootstrap crash.
parent
5277f2f6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
redox-rt/src/lib.rs
+10
-0
10 additions, 0 deletions
redox-rt/src/lib.rs
with
10 additions
and
0 deletions
redox-rt/src/lib.rs
+
10
−
0
View file @
618643b2
...
@@ -95,6 +95,10 @@ pub unsafe fn tcb_activate(tls_end_and_tcb_start: usize, _tls_len: usize) {
...
@@ -95,6 +95,10 @@ pub unsafe fn tcb_activate(tls_end_and_tcb_start: usize, _tls_len: usize) {
/// Initialize redox-rt in situations where relibc is not used
/// Initialize redox-rt in situations where relibc is not used
pub
fn
initialize_freestanding
()
{
pub
fn
initialize_freestanding
()
{
// TODO: This code is a hack! Integrate the ld_so TCB code into generic-rt, and then use that
// (this function will need pointers to the ELF structs normally passed in auxvs), so the TCB
// is initialized properly.
// TODO: TLS
// TODO: TLS
let
page
=
unsafe
{
let
page
=
unsafe
{
&
mut
*
(
syscall
::
fmap
(
!
0
,
&
syscall
::
Map
{
&
mut
*
(
syscall
::
fmap
(
!
0
,
&
syscall
::
Map
{
...
@@ -108,7 +112,13 @@ pub fn initialize_freestanding() {
...
@@ -108,7 +112,13 @@ pub fn initialize_freestanding() {
page
.tcb_len
=
syscall
::
PAGE_SIZE
;
page
.tcb_len
=
syscall
::
PAGE_SIZE
;
page
.tls_end
=
(
page
as
*
mut
Tcb
)
.cast
();
page
.tls_end
=
(
page
as
*
mut
Tcb
)
.cast
();
#[cfg(not(target_arch
=
"aarch64"
))]
unsafe
{
unsafe
{
tcb_activate
(
page
as
*
mut
Tcb
as
usize
,
0
)
tcb_activate
(
page
as
*
mut
Tcb
as
usize
,
0
)
}
}
#[cfg(target_arch
=
"aarch64"
)]
unsafe
{
let
abi_ptr
=
core
::
ptr
::
addr_of_mut!
(
page
.tcb_ptr
);
core
::
arch
::
asm!
(
"msr tpidr_el0, {}"
,
in
(
reg
)
abi_ptr
);
}
}
}
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