From 24e1225591bebde7e1a827c5a9f131154044da4a Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Fri, 22 Sep 2023 05:22:11 +0000 Subject: [PATCH] Rename sel4-reserve-tls-on-stack -> sel4-initialize-tls-on-stack Signed-off-by: Nick Spinale --- Cargo.lock | 20 +++++++++---------- Cargo.toml | 2 +- .../sel4-simple-task/runtime/Cargo.toml | 2 +- .../sel4-simple-task/runtime/src/lib.rs | 2 +- .../Cargo.toml | 2 +- .../src/lib.rs | 18 ++++++++--------- crates/sel4-microkit/src/entry.rs | 2 +- crates/sel4-root-task/src/lib.rs | 2 +- crates/sel4-runtime-common/Cargo.toml | 4 ++-- crates/sel4-runtime-common/src/phdrs/tls.rs | 2 +- .../sel4-simple-task/runtime/crate.nix | 2 +- .../crate.nix | 2 +- .../crates/sel4-runtime-common/crate.nix | 6 +++--- 13 files changed, 33 insertions(+), 33 deletions(-) rename crates/{sel4-reserve-tls-on-stack => sel4-initialize-tls-on-stack}/Cargo.toml (83%) rename crates/{sel4-reserve-tls-on-stack => sel4-initialize-tls-on-stack}/src/lib.rs (93%) rename hacking/cargo-manifest-sources/crates/{sel4-reserve-tls-on-stack => sel4-initialize-tls-on-stack}/crate.nix (79%) diff --git a/Cargo.lock b/Cargo.lock index 7b579e6c2..f55b7a0a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3000,6 +3000,14 @@ version = "0.1.0" name = "sel4-immutable-cell" version = "0.1.0" +[[package]] +name = "sel4-initialize-tls-on-stack" +version = "0.1.0" +dependencies = [ + "cfg-if", + "sel4", +] + [[package]] name = "sel4-kernel-loader" version = "0.1.0" @@ -3184,14 +3192,6 @@ dependencies = [ "object", ] -[[package]] -name = "sel4-reserve-tls-on-stack" -version = "0.1.0" -dependencies = [ - "cfg-if", - "sel4", -] - [[package]] name = "sel4-root-task" version = "0.1.0" @@ -3218,7 +3218,7 @@ version = "0.1.0" dependencies = [ "cfg-if", "sel4-dlmalloc", - "sel4-reserve-tls-on-stack", + "sel4-initialize-tls-on-stack", "sel4-sync", "unwinding", ] @@ -3303,9 +3303,9 @@ dependencies = [ "sel4-backtrace-simple", "sel4-dlmalloc", "sel4-immediate-sync-once-cell", + "sel4-initialize-tls-on-stack", "sel4-panicking", "sel4-panicking-env", - "sel4-reserve-tls-on-stack", "sel4-runtime-common", "sel4-simple-task-runtime-config-types", "sel4-simple-task-runtime-macros", diff --git a/Cargo.toml b/Cargo.toml index 03516d97e..77c21e3fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,6 +79,7 @@ members = [ "crates/sel4-generate-target-specs", "crates/sel4-immediate-sync-once-cell", "crates/sel4-immutable-cell", + "crates/sel4-initialize-tls-on-stack", "crates/sel4-kernel-loader", "crates/sel4-kernel-loader/add-payload", "crates/sel4-kernel-loader/config-types", @@ -96,7 +97,6 @@ members = [ "crates/sel4-platform-info", "crates/sel4-platform-info/types", "crates/sel4-render-elf-with-data", - "crates/sel4-reserve-tls-on-stack", "crates/sel4-root-task", "crates/sel4-root-task/macros", "crates/sel4-runtime-common", diff --git a/crates/private/support/sel4-simple-task/runtime/Cargo.toml b/crates/private/support/sel4-simple-task/runtime/Cargo.toml index 07189b295..9ed60fd46 100644 --- a/crates/private/support/sel4-simple-task/runtime/Cargo.toml +++ b/crates/private/support/sel4-simple-task/runtime/Cargo.toml @@ -22,9 +22,9 @@ sel4-backtrace = { path = "../../../../sel4-backtrace", features = ["unwinding", sel4-backtrace-simple = { path = "../../../../sel4-backtrace/simple" } sel4-dlmalloc = { path = "../../../../sel4-dlmalloc" } sel4-immediate-sync-once-cell = { path = "../../../../sel4-immediate-sync-once-cell" } +sel4-initialize-tls-on-stack = { path = "../../../../sel4-initialize-tls-on-stack" } sel4-panicking = { path = "../../../../sel4-panicking" } sel4-panicking-env = { path = "../../../../sel4-panicking/env" } -sel4-reserve-tls-on-stack = { path = "../../../../sel4-reserve-tls-on-stack" } sel4-runtime-common = { path = "../../../../sel4-runtime-common", features = ["tls", "unwinding"] } sel4-simple-task-runtime-config-types = { path = "./config/types" } sel4-simple-task-runtime-macros = { path = "./macros" } diff --git a/crates/private/support/sel4-simple-task/runtime/src/lib.rs b/crates/private/support/sel4-simple-task/runtime/src/lib.rs index fbc3898f6..b2130b87d 100644 --- a/crates/private/support/sel4-simple-task/runtime/src/lib.rs +++ b/crates/private/support/sel4-simple-task/runtime/src/lib.rs @@ -53,7 +53,7 @@ pub unsafe extern "C" fn _start(config: *const u8, config_size: usize, thread_in }; sel4_runtime_common::locate_tls_image() .unwrap() - .reserve_on_stack_and_continue( + .initialize_on_stack_and_continue( cont_fn, (&cont_arg as *const ContinueArg) .cast::() diff --git a/crates/sel4-reserve-tls-on-stack/Cargo.toml b/crates/sel4-initialize-tls-on-stack/Cargo.toml similarity index 83% rename from crates/sel4-reserve-tls-on-stack/Cargo.toml rename to crates/sel4-initialize-tls-on-stack/Cargo.toml index 95989942e..4d98ec24f 100644 --- a/crates/sel4-reserve-tls-on-stack/Cargo.toml +++ b/crates/sel4-initialize-tls-on-stack/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "sel4-reserve-tls-on-stack" +name = "sel4-initialize-tls-on-stack" version = "0.1.0" authors = ["Nick Spinale "] edition = "2021" diff --git a/crates/sel4-reserve-tls-on-stack/src/lib.rs b/crates/sel4-initialize-tls-on-stack/src/lib.rs similarity index 93% rename from crates/sel4-reserve-tls-on-stack/src/lib.rs rename to crates/sel4-initialize-tls-on-stack/src/lib.rs index 6921306be..96aabab8e 100644 --- a/crates/sel4-reserve-tls-on-stack/src/lib.rs +++ b/crates/sel4-initialize-tls-on-stack/src/lib.rs @@ -27,7 +27,7 @@ pub struct TlsImage { impl TlsImage { #[allow(clippy::missing_safety_doc)] - pub unsafe fn reserve_on_stack_and_continue(&self, cont_fn: ContFn, cont_arg: ContArg) -> ! { + pub unsafe fn initialize_on_stack_and_continue(&self, cont_fn: ContFn, cont_arg: ContArg) -> ! { let args = InternalContArgs { tls_image: self as *const TlsImage, cont_fn, @@ -37,7 +37,7 @@ impl TlsImage { let segment_align_down_mask = !(self.align - 1); let reserved_above_tp = RESERVED_ABOVE_TPIDR; let stack_align_down_mask = !(STACK_ALIGNMENT - 1); - __sel4_runtime_reserve_tls_and_continue( + __sel4_runtime_initialize_tls_and_continue( &args as *const InternalContArgs, segment_size, segment_align_down_mask, @@ -86,7 +86,7 @@ struct InternalContArgs { } extern "C" { - fn __sel4_runtime_reserve_tls_and_continue( + fn __sel4_runtime_initialize_tls_and_continue( args: *const InternalContArgs, segment_size: usize, segment_align_down_mask: usize, @@ -100,11 +100,11 @@ cfg_if::cfg_if! { if #[cfg(target_arch = "aarch64")] { global_asm! { r#" - .global __sel4_runtime_reserve_tls_and_continue + .global __sel4_runtime_initialize_tls_and_continue .section .text - __sel4_runtime_reserve_tls_and_continue: + __sel4_runtime_initialize_tls_and_continue: mov x9, sp sub x9, x9, x1 // x1: segment_size and x9, x9, x2 // x2: segment_align_down_mask @@ -120,11 +120,11 @@ cfg_if::cfg_if! { } else if #[cfg(any(target_arch = "riscv64", target_arch = "riscv32"))] { global_asm! { r#" - .global __sel4_runtime_reserve_tls_and_continue + .global __sel4_runtime_initialize_tls_and_continue .section .text - __sel4_runtime_reserve_tls_and_continue: + __sel4_runtime_initialize_tls_and_continue: mv s9, sp sub s9, s9, a1 // a1: segment_size and s9, s9, a2 // a2: segment_align_down_mask @@ -140,11 +140,11 @@ cfg_if::cfg_if! { } else if #[cfg(target_arch = "x86_64")] { global_asm! { r#" - .global __sel4_runtime_reserve_tls_and_continue + .global __sel4_runtime_initialize_tls_and_continue .section .text - __sel4_runtime_reserve_tls_and_continue: + __sel4_runtime_initialize_tls_and_continue: mov r10, rsp sub r10, 0x8 // space for thread structure and r10, rdx // rdx: segment_align_down_mask diff --git a/crates/sel4-microkit/src/entry.rs b/crates/sel4-microkit/src/entry.rs index 43450aa4a..2ef7c974a 100644 --- a/crates/sel4-microkit/src/entry.rs +++ b/crates/sel4-microkit/src/entry.rs @@ -19,7 +19,7 @@ unsafe extern "C" fn sel4_runtime_rust_entry() -> ! { sel4_runtime_common::locate_tls_image() .unwrap() - .reserve_on_stack_and_continue(cont_fn, cont_arg) + .initialize_on_stack_and_continue(cont_fn, cont_arg) } #[cfg(not(target_thread_local))] diff --git a/crates/sel4-root-task/src/lib.rs b/crates/sel4-root-task/src/lib.rs index 16663026e..b0c0bebbc 100644 --- a/crates/sel4-root-task/src/lib.rs +++ b/crates/sel4-root-task/src/lib.rs @@ -31,7 +31,7 @@ unsafe extern "C" fn sel4_runtime_rust_entry(bootinfo: *const sel4::sys::seL4_Bo sel4_runtime_common::locate_tls_image() .unwrap() - .reserve_on_stack_and_continue(cont_fn, cont_arg) + .initialize_on_stack_and_continue(cont_fn, cont_arg) } #[cfg(not(target_thread_local))] diff --git a/crates/sel4-runtime-common/Cargo.toml b/crates/sel4-runtime-common/Cargo.toml index 96d20600b..c43aeb846 100644 --- a/crates/sel4-runtime-common/Cargo.toml +++ b/crates/sel4-runtime-common/Cargo.toml @@ -8,12 +8,12 @@ license = "BSD-2-Clause" [features] start = [] static-heap = ["sel4-sync", "sel4-dlmalloc"] -tls = ["dep:sel4-reserve-tls-on-stack"] +tls = ["dep:sel4-initialize-tls-on-stack"] [dependencies] cfg-if = "1.0.0" sel4-dlmalloc = { path = "../sel4-dlmalloc", optional = true } -sel4-reserve-tls-on-stack = { path = "../sel4-reserve-tls-on-stack", optional = true } +sel4-initialize-tls-on-stack = { path = "../sel4-initialize-tls-on-stack", optional = true } sel4-sync = { path = "../sel4-sync", optional = true } [dependencies.unwinding] diff --git a/crates/sel4-runtime-common/src/phdrs/tls.rs b/crates/sel4-runtime-common/src/phdrs/tls.rs index ad6b13a3c..9e0174aaf 100644 --- a/crates/sel4-runtime-common/src/phdrs/tls.rs +++ b/crates/sel4-runtime-common/src/phdrs/tls.rs @@ -1,4 +1,4 @@ -use sel4_reserve_tls_on_stack::TlsImage; +use sel4_initialize_tls_on_stack::TlsImage; use crate::phdrs::{elf::PT_TLS, locate_phdrs}; diff --git a/hacking/cargo-manifest-sources/crates/private/support/sel4-simple-task/runtime/crate.nix b/hacking/cargo-manifest-sources/crates/private/support/sel4-simple-task/runtime/crate.nix index ab8b2b93f..f19098b4c 100644 --- a/hacking/cargo-manifest-sources/crates/private/support/sel4-simple-task/runtime/crate.nix +++ b/hacking/cargo-manifest-sources/crates/private/support/sel4-simple-task/runtime/crate.nix @@ -32,7 +32,7 @@ mk { sel4-immediate-sync-once-cell sel4-panicking sel4-panicking-env - sel4-reserve-tls-on-stack + sel4-initialize-tls-on-stack sel4-runtime-common sel4-simple-task-runtime-config-types sel4-simple-task-runtime-macros diff --git a/hacking/cargo-manifest-sources/crates/sel4-reserve-tls-on-stack/crate.nix b/hacking/cargo-manifest-sources/crates/sel4-initialize-tls-on-stack/crate.nix similarity index 79% rename from hacking/cargo-manifest-sources/crates/sel4-reserve-tls-on-stack/crate.nix rename to hacking/cargo-manifest-sources/crates/sel4-initialize-tls-on-stack/crate.nix index a9aa011f4..5be19533c 100644 --- a/hacking/cargo-manifest-sources/crates/sel4-reserve-tls-on-stack/crate.nix +++ b/hacking/cargo-manifest-sources/crates/sel4-initialize-tls-on-stack/crate.nix @@ -1,7 +1,7 @@ { mk, localCrates, versions }: mk { - package.name = "sel4-reserve-tls-on-stack"; + package.name = "sel4-initialize-tls-on-stack"; dependencies = { inherit (versions) cfg-if; }; diff --git a/hacking/cargo-manifest-sources/crates/sel4-runtime-common/crate.nix b/hacking/cargo-manifest-sources/crates/sel4-runtime-common/crate.nix index c3ca2c60c..b4c2ef8d5 100644 --- a/hacking/cargo-manifest-sources/crates/sel4-runtime-common/crate.nix +++ b/hacking/cargo-manifest-sources/crates/sel4-runtime-common/crate.nix @@ -5,17 +5,17 @@ mk { dependencies = { inherit (versions) cfg-if; unwinding = unwindingWith [] // { optional = true; }; - sel4-reserve-tls-on-stack.optional = true; + sel4-initialize-tls-on-stack.optional = true; sel4-sync.optional = true; sel4-dlmalloc.optional = true; }; features = { - tls = [ "dep:sel4-reserve-tls-on-stack" ]; + tls = [ "dep:sel4-initialize-tls-on-stack" ]; start = []; static-heap = [ "sel4-sync" "sel4-dlmalloc" ]; }; nix.local.dependencies = with localCrates; [ - sel4-reserve-tls-on-stack + sel4-initialize-tls-on-stack sel4-sync sel4-dlmalloc ];