Merge branch 'sysepoll-dltls-cleanup' into 'master'

sys_epoll and dl-tls header cleanup

See merge request redox-os/relibc!919
This commit is contained in:
Jeremy Soller
2026-01-28 07:00:39 -07:00
4 changed files with 13 additions and 8 deletions
+4 -4
View File
@@ -10,7 +10,7 @@ use core::arch::global_asm;
use alloc::alloc::alloc;
use core::{alloc::Layout, ptr};
use crate::{ld_so::tcb::Tcb, platform::types::*};
use crate::{ld_so::tcb::Tcb, platform::types::c_void};
#[repr(C)]
#[allow(non_camel_case_types)]
@@ -40,7 +40,7 @@ pub unsafe extern "C" fn __tls_get_addr(ti: *mut dl_tls_index) -> *mut c_void {
tcb.setup_dtv(masters.len());
}
let dtv_index = ti.ti_module as usize - 1;
let dtv_index = ti.ti_module - 1;
if tcb.dtv_mut()[dtv_index].is_null() {
// Allocate TLS for module.
@@ -75,9 +75,9 @@ pub unsafe extern "C" fn __tls_get_addr(ti: *mut dl_tls_index) -> *mut c_void {
}
if cfg!(target_arch = "riscv64") {
ptr = unsafe { ptr.add(0x800 + ti.ti_offset as usize) }; // dynamic offsets are 0x800-based on risc-v
ptr = unsafe { ptr.add(0x800 + ti.ti_offset) }; // dynamic offsets are 0x800-based on risc-v
} else {
ptr = unsafe { ptr.add(ti.ti_offset as usize) };
ptr = unsafe { ptr.add(ti.ti_offset) };
}
ptr.cast::<c_void>()
+1 -1
View File
@@ -1,4 +1,4 @@
use crate::platform::types::*;
use crate::platform::types::{c_int, c_uint};
pub const EPOLL_CLOEXEC: c_int = 0x8_0000;
+7 -2
View File
@@ -1,11 +1,16 @@
//! sys/epoll.h implementation for Redox, following http://man7.org/linux/man-pages/man7/epoll.7.html
//! `sys/epoll.h` implementation.
//!
//! Non-POSIX, see: <http://man7.org/linux/man-pages/man7/epoll.7.html>.
use core::ptr;
use crate::{
error::ResultExt,
header::signal::sigset_t,
platform::{PalEpoll, Sys, types::*},
platform::{
PalEpoll, Sys,
types::{c_int, c_void},
},
};
pub use self::sys::*;
+1 -1
View File
@@ -1,4 +1,4 @@
use crate::platform::types::*;
use crate::platform::types::{c_int, c_uint};
pub const EPOLL_CLOEXEC: c_int = 0x0100_0000;