![]() ![]() |
![]() |
File: [OMI] / omi / base / sunsparc8_atomic.s
(download)
Revision: 1.1.1.1 (vendor branch), Wed May 30 21:47:49 2012 UTC (12 years, 1 month ago) by mike Branch: TOG CVS Tags: OMI_1_0_2_Branch, OMI_1_0_2, OMI_1_0_1_PRE, OMI_1_0_1, OMI_1_0_0 Changes since 1.1: +0 -0 lines Initial Import |
!------------------------------------------------------------------------------ ! Copyright (c) Microsoft Corporation. All rights reserved. ! ! Provides assembler funcions needed for SUN sparc atomic functions. ! Date 05-sep-08 .section ".text" .global AtomicIncrement .align 4 AtomicIncrement: 1: ld [%o0], %o1 ! load the current value add %o1, 1, %o2 ! perform required operation cas [%o0], %o1, %o2 ! try CAS cmp %o1, %o2 ! check if result is expected one bne 1b ! try again if not nop retl add %o2, 1, %o0 ! return new value .type AtomicIncrement,#function .size AtomicIncrement,.-AtomicIncrement .section ".text" .global AtomicDecrement .align 4 AtomicDecrement: 1: ld [%o0], %o1 ! load the current value sub %o1, 1, %o2 ! perform required operation cas [%o0], %o1, %o2 ! try CAS cmp %o1, %o2 ! check if result is expected one bne 1b ! try again if not nop retl sub %o2, 1, %o0 ! return new value .type AtomicDecrement,#function .size AtomicDecrement,.-AtomicDecrement
ViewCVS 0.9.2 |