From 61b1e75f7d8004461f2e18f171c26c2f545eed32 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 21 Jan 2016 19:28:15 +0000 Subject: overhaul sh atomics for new atomics framework, add j-core cas.l backend sh needs runtime-selected atomic backends since there are a number of supported models that use non-forwards-compatible (non-smp-compatible) atomic mechanisms. previously, the code paths for this were highly inefficient since they involved C function calls with multiple branches in the callee and heavy spills in the caller. the new code performs calls the runtime-selected asm fragment from inline asm with extremely minimal clobbers, rather than using a function call. for the sh4a case where the atomic mechanism is known and there is no forward-compatibility issue, the movli.l and movco.l instructions are provided as a_ll and a_sc, allowing the new shared atomic.h to generate efficient inline versions of all the basic atomic operations without needing a cas loop. --- arch/sh/src/sh_atomic.h | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 arch/sh/src/sh_atomic.h (limited to 'arch/sh/src/sh_atomic.h') diff --git a/arch/sh/src/sh_atomic.h b/arch/sh/src/sh_atomic.h deleted file mode 100644 index 054c2a32..00000000 --- a/arch/sh/src/sh_atomic.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _SH_ATOMIC_H -#define _SH_ATOMIC_H - -#define SH_A_GUSA 0 -#define SH_A_LLSC 1 -#define SH_A_CAS 2 -#if !defined(__SH3__) && !defined(__SH4__) -#define SH_A_IMASK 3 -#else -#define SH_A_IMASK -1LL /* unmatchable by unsigned int */ -#endif - -extern __attribute__((__visibility__("hidden"))) unsigned __sh_atomic_model; - -#endif -- cgit v1.2.1