On 15/07/16 07:50, Corneliu ZUZU wrote:
Create a common-side <xen/atomic.h> to establish, among others, prototypes of atomic functions called from common-code. Done to avoid introducing inconsistencies between arch-side <asm/atomic.h> headers when we make subtle changes to one of them. Some arm-side macros had to be turned into inline functions in the process (also updated README.LinuxPrimitives file). Removed outdated comment ("NB. I've [...]"). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Suggested-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> --- Changed since v3: * update README.LinuxPrimitives file --- xen/arch/arm/README.LinuxPrimitives | 14 +-- xen/include/asm-arm/atomic.h | 45 ++++++---- xen/include/asm-x86/atomic.h | 103 +--------------------- xen/include/xen/atomic.h | 171 ++++++++++++++++++++++++++++++++++++ 4 files changed, 210 insertions(+), 123 deletions(-) create mode 100644 xen/include/xen/atomic.h diff --git a/xen/arch/arm/README.LinuxPrimitives b/xen/arch/arm/README.LinuxPrimitives index 4906593..2fcdfa4 100644 --- a/xen/arch/arm/README.LinuxPrimitives +++ b/xen/arch/arm/README.LinuxPrimitives @@ -27,10 +27,11 @@ The following functions were taken from Linux: atomic_add(), atomic_add_return(), atomic_sub(), atomic_sub_return(), atomic_cmpxchg(), __atomic_add_unless() -Also, the following macros which were in the meantime moved to asm-arm/atomic.h: - atomic_xchg(v, new), atomic_inc(v), atomic_dec(v), +Also, the following macros which were in the meantime moved to asm-arm/atomic.h +and most of them turned to inline functions: + atomic_xchg(v, new) [still macro], atomic_inc(v), atomic_dec(v), atomic_inc_and_test(v), atomic_dec_and_test(v), - atomic_inc_return(v), atomic_dec_return(v), + atomic_inc_return(v) [still macro], atomic_dec_return(v) [still macro], atomic_sub_and_test(i, v), atomic_add_negative(i,v)
As mentioned in patch #1, those functions are not easily sync-able after this patch. Please drop them from README.LinuxPrimitives.
--------------------------------------------------------------------- @@ -105,10 +106,11 @@ The following functions were taken from Linux: atomic_add(), atomic_add_return(), atomic_sub(), atomic_sub_return(), atomic_cmpxchg(), __atomic_add_unless() -Also, the following macros which were in the meantime moved to asm-arm/atomic.h: - atomic_xchg(v, new), atomic_inc(v), atomic_dec(v), +Also, the following macros which were in the meantime moved to asm-arm/atomic.h +and most of them turned to inline functions: + atomic_xchg(v, new) [still macro], atomic_inc(v), atomic_dec(v), atomic_inc_and_test(v), atomic_dec_and_test(v), - atomic_inc_return(v), atomic_dec_return(v), + atomic_inc_return(v) [still macro], atomic_dec_return(v) [still macro], atomic_sub_and_test(i, v), atomic_add_negative(i,v)
Ditto. With that: Acked-by: Julien Grall <julien.gr...@arm.com> Regards, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel