Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shell: change XFA format for !20958 #134

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,17 @@ macro_rules! static_command {
// thus static, and the_function is static by construction as well)
unsafe impl Sync for StaticCommand {}

// Starting with https://github.com/RIOT-OS/RIOT/pull/20958 shell commands will be an
// array of the struct
#[link_section = ".roxfa.shell_commands_xfa_v2.5"]
#[export_name = concat!("shell_commands_xfa_v2_5_", stringify!($modname))]
static THE_STRUCT: StaticCommand = StaticCommand($crate::riot_sys::shell_command_t {
name: $crate::cstr::cstr!($name).as_ptr() as _,
desc: $crate::cstr::cstr!($descr).as_ptr() as _,
handler: Some(the_function),
});
// Before https://github.com/RIOT-OS/RIOT/pull/20958 shell commands was an array of
// pointers. We provide both and let the linker perform garbage collection.
#[link_section = ".roxfa.shell_commands_xfa.5"]
#[export_name = concat!("shell_commands_xfa_5_", stringify!($modname))]
static THE_POINTER: &StaticCommand = &THE_STRUCT;
Expand Down
Loading