sdk-ng icon indicating copy to clipboard operation
sdk-ng copied to clipboard

microblaze: atomic compare-and-swap returns incorrect value

Open alpsayin opened this issue 2 years ago • 2 comments
trafficstars

Microblaze toolchain's atomic compare-and-swap returns the inverse boolean value causing at least ungetc implementation in picolibc to hang. The issue was fixed in Xilinx's gcc via the below patch but this has not made it to upstream and thus not to zephyr-sdk. https://github.com/Xilinx/meta-xilinx/blob/master/meta-microblaze/recipes-devtools/gcc/gcc-12/0009-Patch-microblaze-Fix-atomic-boolean-return-value.patch CC @keith-packard

alpsayin avatar Mar 13 '23 17:03 alpsayin

I'm still seeing problems with atomic_exchange use in getc -- it fails to return the previously stored value as it should. Picolibc now has a stand-alone atomics test case that can be used to verify that atomics work as needed for picolibc.

keith-packard avatar Mar 13 '23 21:03 keith-packard

Will be fixed with https://github.com/zephyrproject-rtos/gcc/pull/24

alpsayin avatar Oct 01 '23 21:10 alpsayin