From df1d8b27df606c8fc3822265f59870969d0b7504 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 11 Apr 2005 15:59:44 +0000 Subject: [PATCH] Make assembly functions inline to prevent multiple definitions. Required to change from function level assembly to regular functions with statement level assembly. [SVN r28133] --- include/boost/detail/sp_counted_base_cw_ppc.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/include/boost/detail/sp_counted_base_cw_ppc.hpp b/include/boost/detail/sp_counted_base_cw_ppc.hpp index b6fc68a..3452c9d 100644 --- a/include/boost/detail/sp_counted_base_cw_ppc.hpp +++ b/include/boost/detail/sp_counted_base_cw_ppc.hpp @@ -32,18 +32,23 @@ namespace boost namespace detail { -asm void atomic_increment( register long * pw ) +inline void atomic_increment( register long * pw ) { + asm + { loop: lwarx r4, 0, r3 addi r4, r4, 1 stwcx. r4, 0, r3 bne- loop + } } -asm long atomic_decrement( register long * pw ) +inline long atomic_decrement( register long * pw ) { + asm + { sync loop: @@ -56,10 +61,13 @@ loop: mr r3, r4 isync + } } -asm long atomic_conditional_increment( register long * pw ) +inline long atomic_conditional_increment( register long * pw ) { + asm + { loop: lwarx r4, 0, r3 @@ -74,6 +82,7 @@ store: bne- loop mr r3, r4 + } } class sp_counted_base