OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [arch/] [sparc64/] [lib/] [atomic.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/* $Id: atomic.S,v 1.1.1.1 2004-04-15 01:33:42 phoenix Exp $
2
 * atomic.S: These things are too big to do inline.
3
 *
4
 * Copyright (C) 1999 David S. Miller (davem@redhat.com)
5
 */
6
 
7
#include 
8
 
9
        .text
10
        .align  64
11
 
12
        .globl  atomic_impl_begin, atomic_impl_end
13
 
14
        .globl  __atomic_add
15
atomic_impl_begin:
16
__atomic_add: /* %o0 = increment, %o1 = atomic_ptr */
17
        lduw    [%o1], %g5
18
        add     %g5, %o0, %g7
19
        cas     [%o1], %g5, %g7
20
        cmp     %g5, %g7
21
        bne,pn  %icc, __atomic_add
22
         membar #StoreLoad | #StoreStore
23
        retl
24
         add    %g7, %o0, %o0
25
 
26
        .globl  __atomic_sub
27
__atomic_sub: /* %o0 = increment, %o1 = atomic_ptr */
28
        lduw    [%o1], %g5
29
        sub     %g5, %o0, %g7
30
        cas     [%o1], %g5, %g7
31
        cmp     %g5, %g7
32
        bne,pn  %icc, __atomic_sub
33
         membar #StoreLoad | #StoreStore
34
        retl
35
         sub    %g7, %o0, %o0
36
atomic_impl_end:

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.