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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Tornax O7
relibc
Commits
c547f967
Commit
c547f967
authored
2 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Use GS for i686 thread pointer
parent
c96b3114
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ld_so/mod.rs
+14
-0
14 additions, 0 deletions
src/ld_so/mod.rs
src/ld_so/tcb.rs
+2
-2
2 additions, 2 deletions
src/ld_so/tcb.rs
with
16 additions
and
2 deletions
src/ld_so/mod.rs
+
14
−
0
View file @
c547f967
...
@@ -144,6 +144,20 @@ pub unsafe fn init(sp: &'static Stack) {
...
@@ -144,6 +144,20 @@ pub unsafe fn init(sp: &'static Stack) {
const
ARCH_GET_FS
:
usize
=
0x1003
;
const
ARCH_GET_FS
:
usize
=
0x1003
;
syscall!
(
ARCH_PRCTL
,
ARCH_GET_FS
,
&
mut
tp
as
*
mut
usize
);
syscall!
(
ARCH_PRCTL
,
ARCH_GET_FS
,
&
mut
tp
as
*
mut
usize
);
}
}
#[cfg(all(target_os
=
"redox"
,
target_arch
=
"x86"
))]
{
let
mut
env
=
syscall
::
EnvRegisters
::
default
();
let
file
=
syscall
::
open
(
"thisproc:current/regs/env"
,
syscall
::
O_CLOEXEC
|
syscall
::
O_RDONLY
)
.expect_notls
(
"failed to open handle for process registers"
);
let
_
=
syscall
::
read
(
file
,
&
mut
env
)
.expect_notls
(
"failed to read gsbase"
);
let
_
=
syscall
::
close
(
file
);
tp
=
env
.gsbase
as
usize
;
}
#[cfg(all(target_os
=
"redox"
,
target_arch
=
"x86_64"
))]
#[cfg(all(target_os
=
"redox"
,
target_arch
=
"x86_64"
))]
{
{
let
mut
env
=
syscall
::
EnvRegisters
::
default
();
let
mut
env
=
syscall
::
EnvRegisters
::
default
();
...
...
This diff is collapsed.
Click to expand it.
src/ld_so/tcb.rs
+
2
−
2
View file @
c547f967
...
@@ -260,12 +260,12 @@ impl Tcb {
...
@@ -260,12 +260,12 @@ impl Tcb {
.expect_notls
(
"failed to open handle for process registers"
);
.expect_notls
(
"failed to open handle for process registers"
);
let
_
=
syscall
::
read
(
file
,
&
mut
env
)
let
_
=
syscall
::
read
(
file
,
&
mut
env
)
.expect_notls
(
"failed to read
f
sbase"
);
.expect_notls
(
"failed to read
g
sbase"
);
env
.gsbase
=
tp
as
u32
;
env
.gsbase
=
tp
as
u32
;
let
_
=
syscall
::
write
(
file
,
&
env
)
let
_
=
syscall
::
write
(
file
,
&
env
)
.expect_notls
(
"failed to write
f
sbase"
);
.expect_notls
(
"failed to write
g
sbase"
);
let
_
=
syscall
::
close
(
file
);
let
_
=
syscall
::
close
(
file
);
}
}
...
...
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