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

Conversation

maribu
Copy link
Member

@maribu maribu commented Nov 6, 2024

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
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
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
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
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
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
81 checks passed
chrysn added a commit that referenced this pull request Nov 22, 2024
See-Also: RIOT-OS/RIOT#20958
See-Also: #134
@maribu maribu deleted the fix-riot-pr20958 branch November 22, 2024 10:22
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.

None yet

3 participants