diff --git a/apps/system/components/kata-os-common/src/sel4-sys/arch/riscv.rs b/apps/system/components/kata-os-common/src/sel4-sys/arch/riscv.rs index 6d5ff09..60addc3 100644 --- a/apps/system/components/kata-os-common/src/sel4-sys/arch/riscv.rs +++ b/apps/system/components/kata-os-common/src/sel4-sys/arch/riscv.rs @@ -94,9 +94,10 @@ pub enum seL4_ObjectType { #[inline(always)] pub unsafe fn seL4_GetIPCBuffer() -> *mut seL4_IPCBuffer { - // Magic external symbol setup by runtime once TLS is primed + // Use magic external symbol setup by runtime once TLS is primed enum c_void {} extern "C" { + #[thread_local] static __sel4_ipc_buffer: *const c_void; } __sel4_ipc_buffer as *mut seL4_IPCBuffer diff --git a/apps/system/components/kata-os-common/src/sel4-sys/lib.rs b/apps/system/components/kata-os-common/src/sel4-sys/lib.rs index 6bce49f..462330e 100644 --- a/apps/system/components/kata-os-common/src/sel4-sys/lib.rs +++ b/apps/system/components/kata-os-common/src/sel4-sys/lib.rs @@ -9,6 +9,7 @@ */ #![no_std] #![feature(asm)] +#![feature(thread_local)] #![allow(bad_style, unused_parens, unused_assignments)] // NB: this mimics the logic in build.rs @@ -151,7 +152,7 @@ pub const seL4_MsgMaxLength: usize = 120; pub const seL4_MsgExtraCapBits: usize = 2; pub const seL4_MsgMaxExtraCaps: usize = (1usize << seL4_MsgExtraCapBits) - 1; -#[derive(Copy)] +#[derive(Copy, Debug)] /// Buffer used to store received IPC messages pub struct seL4_IPCBuffer { /// Message tag