Skip to content

shell: change XFA format for !20958#134

Merged
chrysn merged 1 commit intoRIOT-OS:mainfrom
maribu:fix-riot-pr20958
Nov 22, 2024
Merged

shell: change XFA format for !20958#134
chrysn merged 1 commit intoRIOT-OS:mainfrom
maribu:fix-riot-pr20958

Conversation

@maribu
Copy link
Copy Markdown
Member

@maribu maribu commented Nov 6, 2024

Comment thread src/shell/mod.rs Outdated
Comment on lines +436 to +437
#[link_section = ".roxfa.shell_commands_xfa.5"]
#[export_name = concat!("shell_commands_xfa_5_", stringify!($modname))]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this backward compatible would probably require some cooperation from RIOT. I guess changing the XFA section name (e.g. from .roxfa.shell_commands_xfa.5 to .roxfa.shell_commands_v2_xfa.5) and providing both ptr and element would work, assuming that the linker would garbage collect the ptr in the newer version.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems to indeed just work

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The garbage collection does not work here, so while this does allow adding shell commands in a way that works with both pre and post !20958 RIOT, it will not reduce the overhead.

I guess this is acceptable mid-term? We could drop the ptr for backward compatibility in the long run.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping this on the long run sounds fine. This is shell commands, and a shell is not what you do when you're starved for every single pointer in RAM.

@maribu maribu marked this pull request as ready for review November 7, 2024 12:44
@Teufelchen1
Copy link
Copy Markdown
Contributor

Whats the next move here?

@maribu maribu requested a review from chrysn November 20, 2024 09:37
@chrysn chrysn merged commit cdf3fc2 into RIOT-OS:main Nov 22, 2024
chrysn added a commit that referenced this pull request Nov 22, 2024
@maribu maribu deleted the fix-riot-pr20958 branch November 22, 2024 10:22
chrysn added a commit that referenced this pull request Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants