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

Require float-save-restore in esp-wifi #2322

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Oct 9, 2024

For real this time...

@bugadani bugadani added the skip-changelog No changelog modification needed label Oct 9, 2024
@@ -22,7 +22,7 @@ pub fn allocate_main_task() -> *mut Context {
}

let ptr = malloc(size_of::<Context>() as u32) as *mut Context;
core::ptr::write_bytes(ptr, 0, 1);
core::ptr::write(ptr, Context::new());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This really should be Box::new but I'm not ready to go down that rabbit hole yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally we would do construct-in-place

@bjoernQ
Copy link
Contributor

bjoernQ commented Oct 10, 2024

This makes esp-wifi work on ESP32 for me again but I'm a bit concerned.

Tasks are created on main so we initialize cp-enable to enable floats but (as I learnt yesterday) the driver (for ESP32 at least) is using floats in the ppTask - so if there is a context switch between two tasks which are both using floats we won't save/restore the float-regs which might cause "interesting" effects?

Maybe the only sane and safe way to use esp-wifi (on ESP32 at least) is to require "float-save-restore"

@bugadani bugadani changed the title Floats Require float-save-restore in esp-wifi Oct 10, 2024
Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

Thanks!

@jessebraham jessebraham added this pull request to the merge queue Oct 10, 2024
Merged via the queue into esp-rs:main with commit ba8daaf Oct 10, 2024
28 checks passed
@bugadani bugadani deleted the floats branch October 10, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog modification needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants