Skip to content

Commit

Permalink
Merge pull request #1465 from hermit-os/unaligned-tls
Browse files Browse the repository at this point in the history
fix(x86_64): use unaligned write for TLS pointer
  • Loading branch information
mkroening authored Nov 20, 2024
2 parents 021c15d + 55f3e4a commit 430da84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/arch/x86_64/kernel/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ impl TaskTLS {
// thread_ptr = block_ptr + tls_offset
let thread_ptr = block[tls_offset..].as_mut_ptr().cast::<()>();
unsafe {
thread_ptr.cast::<*mut ()>().write(thread_ptr);
thread_ptr.cast::<*mut ()>().write_unaligned(thread_ptr);
}

let this = Self {
Expand Down

0 comments on commit 430da84

Please sign in to comment.