aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2023-11-20 14:04:17 +0000
committerRichard Earnshaw <rearnsha@arm.com>2023-11-24 14:15:26 +0000
commit439779bacee869643c93a4710a29f89ad031ee4a (patch)
treeb9faa298fbbca9d01bee2c3b2322bc069e376040 /gcc
parent1802f64e674eeef0c0d7e8f6ca2846145ec16315 (diff)
downloadgcc-439779bacee869643c93a4710a29f89ad031ee4a.zip
gcc-439779bacee869643c93a4710a29f89ad031ee4a.tar.gz
gcc-439779bacee869643c93a4710a29f89ad031ee4a.tar.bz2
arm: libgcc: provide implementations of __sync_synchronize
Prior to Armv6 there was no architected method to synchronize data across processors. Armv6 saw the first introduction of multi-processor support, using a CP15 operation; but this was deprecated in Armv7 and is not supported on m-profile devices of any form. Armv7 (and armv6-m) and later support data synchronization via the DMB instruction. This all leads to difficulties when linking programs as the user generally needs to know which synchronization method is needed, but there seems no easy way around this, when there are no OS-related primitives available. I've addressed this by adding multiple variants of __sync_synchronize to libgcc, one for each of the above use cases. I've named these __sync_synchronize_none, __sync_synchronize_cp15dmb and __sync_synchronize_dmb. I've also added three specs files that can be used to direct the linker to pick the appropriate implementation. Using specs fragments for this is preferable to directing the user to directly use --defsym as the latter has to be placed at the correct position on the command line to be effective and the spec rule ensures this automatically. I've also added a default implementation of __sync_synchronize. The default implementation will use DMB if that is available in the target ISA, or fall back to a nul-implementation if it isn't. In the latter case it will cause the linker (GNU LD) to emit a warning that specifies how to pick a specific implementation. I've chosen not to permit this default to use the CP15 solution as that has been deprecated. libgcc: * config.host (arm*-*-eabi* | arm*-*-rtems*): Add arm/t-sync to the makefile rules. * config/arm/lib1funcs.S (__sync_synchronize_none) (__sync_synchronize_cp15dmb, __sync_synchronize_dmb) (__sync_synchronize): New functions. * config/arm/t-sync: New file. * config/arm/sync-none.specs: Likewise. * config/arm/sync-dmb.specs: Likewise. * config/arm/sync-cp15dmb.specs: Likewise.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions