Bug 10601 - Depreciated and no longer supported swpb instruction for ARM
Summary: Depreciated and no longer supported swpb instruction for ARM
Status: NEW
Alias: None
Product: uClibc
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 0.9.33.2
Hardware: Other Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-18 04:55 UTC by D337z
Modified: 2017-12-18 05:09 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description D337z 2017-12-18 04:55:36 UTC
Hello, the ldso thumb_atomics.S file contains a greatly depreciated swpb instruction that has not been supported by ARM processors since V7.  This means that RPi units and other ARM based hardware will not work with it.
To correct this problem, I propose that swpb be replaced with ldrexb and strexb which will read the register and memory address and byte-swap into the specified register similarly to swpb.  It's extremely important to be certain that this is implemented correctly as it may not be as simple as just changing the command.

This should also make it thumb compatible so the .hidden swpb_thumb shouldn't be required anymore.

Problems that may arise from this are the variations of ldrex and strex that will work.  Also ensuring that having exclusive access won't affect future accesses to the same register.

I'll leave it in your capable hands, but it's broke and getting more broken as time goes on and newer processors come to light.
Comment 1 D337z 2017-12-18 05:09:51 UTC
I suggest having a look at this page for help in changing this as my suggestion may not be the best or up-to-date method.  It seems that using sync or atomic may be better.
https://github.com/ARMmbed/core-util/issues/76