-
Notifications
You must be signed in to change notification settings - Fork 21
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
bugfix(broken atomic): atomic removal #61
Conversation
Checks are broken until new qingke is published |
96f47ec
to
144a644
Compare
"data-layout": "e-m:e-p:32:32-i64:64-n32-S128", | ||
"eh-frame-header": false, | ||
"emit-debug-gdb-scripts": false, | ||
"features": "+m,+f,+c,+forced-atomics", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+forced-atomics
is actually in every single none
target. Which means core::atomic::*
actually exists.
@@ -0,0 +1,19 @@ | |||
{ | |||
"arch": "riscv32", | |||
"atomic-cas": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what disables compare_and_swap
9ee0488
to
a2aa82e
Compare
This change remvoes all use of atomic (CAS) from ch32-hal As discovered in ch32-rs#59, the QingKeV4 atomic implementation is likely broken. As a result we added a compiler check to make sure the atomic exetnsion is disabled in ch32-rs/qingke#8. This change updates the dependency to use the new qingke as well as remove any reference to `core::atomic` in ch32-hal.
This is a follow-up change to the `bugfix(broken atomics)` where we removed all use of atomics. This update the qingke version and examples' target setting to not include the atomic extension
a2aa82e
to
83c9f4e
Compare
If you want a quick / easy review experience, only look at the |
@@ -130,20 +127,21 @@ impl Driver for SystickDriver { | |||
let period = self.period.load(Ordering::Relaxed) as u64; | |||
rb.cnt().read() / period | |||
} | |||
|
|||
unsafe fn allocate_alarm(&self) -> Option<AlarmHandle> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take an extra look make sure this is equivalent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @andelf please take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
non-blocking(todo later): Better add documentation in README to clarify target change.
This is another BREAKING CHANGE. CC @romainreignier |
As discovered in #59, the QingKeV4 atomic implementation is likely broken. As a result we added a compiler check to make sure the atomic exetnsion is disabled in ch32-rs/qingke#8. This change updates the dependency to use the new qingke as well as remove any reference to
core::atomic
in ch32-hal.