Skip to content

Commit

Permalink
Rename sel4-reserve-tls-on-stack -> sel4-initialize-tls-on-stack
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <nick@nickspinale.com>
  • Loading branch information
nspin committed Sep 23, 2023
1 parent bd7380c commit 24e1225
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 33 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion crates/private/support/sel4-simple-task/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion crates/private/support/sel4-simple-task/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<c_void>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "sel4-reserve-tls-on-stack"
name = "sel4-initialize-tls-on-stack"
version = "0.1.0"
authors = ["Nick Spinale <nick.spinale@coliasgroup.com>"]
edition = "2021"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/sel4-microkit/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down
2 changes: 1 addition & 1 deletion crates/sel4-root-task/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down
4 changes: 2 additions & 2 deletions crates/sel4-runtime-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion crates/sel4-runtime-common/src/phdrs/tls.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
];
Expand Down

0 comments on commit 24e1225

Please sign in to comment.