oxidecomputer / phbl

Pico Host Boot Loader
Mozilla Public License 2.0
101 stars 7 forks source link

Update Rust, deps, target def, IDT #42

Closed dancrossnyc closed 9 months ago

dancrossnyc commented 9 months ago

Clean up the "no static mut refs" code a tad, and update Rust and dependencies.

dancrossnyc commented 9 months ago

Testing on sn14.

dancrossnyc commented 9 months ago

This PR is the answer.

dancrossnyc commented 9 months ago

Testing on sn14 was successful; the draft/undraft thing was just me hitting the wrong thing. :-/

dancrossnyc commented 9 months ago

Ah, I think this is better. I've changed the code to use SyncUnsafeCell; the static mut is no more; it is now just a static.

dancrossnyc commented 9 months ago

(Note that this did involve adding another #![feature(sync_unsafe_cell)] to the code, but that's an acceptable price to pay, I think.

dancrossnyc commented 9 months ago

Latest patchset is tested and works. Given that it eliminates the static mut entirely, I think we should go with this.

dancrossnyc commented 9 months ago

Ok, with the introduction of SyncUnafeCell for the IDT, I think this is good to go. Eliza, do you have any other concerns here?

Looks good to me! Sorry for having been the bearer of bad news about upstream Rust folks' opinions...

No, it's ok. I honestly think we need to engage with them on this issue, even if this particular case is (IMHO) rather neatly solved by SyncUnsafeCell.