From a60710c59732f43a66ccb0ca5ca3f160ec765dbe Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Thu, 20 Jun 2024 22:43:25 +0200 Subject: [PATCH] Add missing signal arch offsets. --- redox-rt/src/arch/x86_64.rs | 6 +++--- redox-rt/src/lib.rs | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/redox-rt/src/arch/x86_64.rs b/redox-rt/src/arch/x86_64.rs index 580fb946..de946854 100644 --- a/redox-rt/src/arch/x86_64.rs +++ b/redox-rt/src/arch/x86_64.rs @@ -5,7 +5,7 @@ use syscall::data::Sigcontrol; use syscall::error::*; use crate::proc::{fork_inner, FdGuard}; -use crate::signal::inner_c; +use crate::signal::{inner_c, RtSigarea}; // Setup a stack starting from the very end of the address space, and then growing downwards. pub(crate) const STACK_TOP: usize = 1 << 47; @@ -231,8 +231,8 @@ asmfunction!(__relibc_internal_sigentry: [" sc_saved_rflags = const offset_of!(Sigcontrol, saved_flags), sc_saved_rip = const offset_of!(Sigcontrol, saved_ip), sc_saved_rsp = const offset_of!(Sigcontrol, saved_sp), - tcb_sa_off = const 0, // FIXME - tcb_sc_off = const 0, // FIXME + tcb_sa_off = const offset_of!(crate::Tcb, os_specific) + offset_of!(RtSigarea, arch), + tcb_sc_off = const offset_of!(crate::Tcb, os_specific) + offset_of!(RtSigarea, control), supports_xsave = sym SUPPORTS_XSAVE, ]); diff --git a/redox-rt/src/lib.rs b/redox-rt/src/lib.rs index 257ea431..84c7eac9 100644 --- a/redox-rt/src/lib.rs +++ b/redox-rt/src/lib.rs @@ -2,6 +2,10 @@ #![feature(asm_const, array_chunks, int_roundings, let_chains, slice_ptr_get, sync_unsafe_cell, thread_local)] #![forbid(unreachable_patterns)] +use generic_rt::GenericTcb; + +use self::signal::RtSigarea; + extern crate alloc; #[macro_export] @@ -33,3 +37,5 @@ pub mod auxv_defs; pub mod signal; pub mod sync; pub mod thread; + +pub type Tcb = GenericTcb<RtSigarea>; -- GitLab