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
d6588668
Verified
Commit
d6588668
authored
9 months ago
by
Jacob Lorentzon
Browse files
Options
Downloads
Patches
Plain Diff
Fix pre-Rust part of trampoline!.
parent
a1e1a159
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
redox-rt/src/arch/x86_64.rs
+24
-17
24 additions, 17 deletions
redox-rt/src/arch/x86_64.rs
with
24 additions
and
17 deletions
redox-rt/src/arch/x86_64.rs
+
24
−
17
View file @
d6588668
...
...
@@ -135,30 +135,37 @@ asmfunction!(__relibc_internal_sigentry: ["
// First, select signal, always pick first available bit
// Read first signal word
mov r
d
x, fs:[{tcb_sc_off} + {sc_word}]
mov rcx, r
d
x
mov r
a
x, fs:[{tcb_sc_off} + {sc_word}]
mov rcx, r
a
x
shr rcx, 32
and e
d
x, ecx
and e
d
x, {SIGW0_PENDING_MASK}
bsf e
d
x, e
d
x
and e
a
x, ecx
and e
a
x, {SIGW0_PENDING_MASK}
bsf e
a
x, e
a
x
jnz 2f
// Read second signal word
mov r
d
x, fs:[{tcb_sc_off} + {sc_word} + 8]
mov rcx, r
d
x
mov r
a
x, fs:[{tcb_sc_off} + {sc_word} + 8]
mov rcx, r
a
x
shr rcx, 32
and e
d
x, ecx
and e
d
x, {SIGW1_PENDING_MASK}
bsf e
d
x, e
d
x
and e
a
x, ecx
and e
a
x, {SIGW1_PENDING_MASK}
bsf e
a
x, e
a
x
jnz 4f
add e
d
x, 32
add e
a
x, 32
2:
// By now we have selected a signal, stored in e
d
x (6-bit). We now need to choose whether or
// By now we have selected a signal, stored in e
a
x (6-bit). We now need to choose whether or
// not to switch to the alternate signal stack. If SA_ONSTACK is clear for this signal, then
// skip the sigaltstack logic.
bt fs:[{tcb_sa_off} + {sa_onstack}], edx
jc 3f
// Otherwise, the altstack is already active. The sigaltstack being disabled, is equivalent
// to setting 'top' to usize::MAX and 'bottom' to 0.
sub rsp, {REDZONE_SIZE}
and rsp, -{STACK_ALIGN}
jmp 4f
3:
// If current RSP is above altstack region, switch to altstack
mov rdx, fs:[{tcb_sa_off} + {sa_altstack_top}]
cmp rdx, rsp
...
...
@@ -168,11 +175,9 @@ asmfunction!(__relibc_internal_sigentry: ["
mov rdx, fs:[{tcb_sa_off} + {sa_altstack_bottom}]
cmp rdx, rsp
cmovbe rsp, rdx
3:
// Otherwise, the altstack is already active. The sigaltstack being disabled, is equivalent
// to setting 'top' to usize::MAX and 'bottom' to 0.
//
.p2align 4
4:
// Now that we have a stack, we can finally start initializing the signal stack!
push 0 // SS
...
...
@@ -274,6 +279,8 @@ asmfunction!(__relibc_internal_sigentry: ["
SIGW0_TSTP_IS_STOP_BIT
|
SIGW0_TTIN_IS_STOP_BIT
|
SIGW0_TTOU_IS_STOP_BIT
|
SIGW0_NOCLDSTOP_BIT
|
SIGW0_UNUSED1
|
SIGW0_UNUSED2
),
SIGW1_PENDING_MASK
=
const
!
0
,
REDZONE_SIZE
=
const
128
,
STACK_ALIGN
=
const
64
,
// if xsave is used
]);
static
SUPPORTS_XSAVE
:
AtomicU8
=
AtomicU8
::
new
(
0
);
// FIXME
static
SUPPORTS_XSAVE
:
AtomicU8
=
AtomicU8
::
new
(
1
);
// FIXME
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