11
12 /*
13 * Copyright (c) 2013 Joyent, Inc. All rights reserved.
14 */
15
16 .file "atomic.s"
17
18 /*
19 * Atomic Operatoins for 32-bit ARM. Note, that these require at least ARMv6K so
20 * as to have access to the non-word size LDREX and STREX.
21 */
22
23 #include <sys/asm_linkage.h>
24 #include <sys/atomic_impl.h>
25
26 /*
27 * XXX We probably want some kind of backoff built in to these routines at some
28 * point.
29 */
30
31 #if defined(_KERNEL)
32 /*
33 * Legacy kernel interfaces; they will go away (eventually).
34 */
35 ANSI_PRAGMA_WEAK2(cas8,atomic_cas_8,function)
36 ANSI_PRAGMA_WEAK2(cas32,atomic_cas_32,function)
37 ANSI_PRAGMA_WEAK2(cas64,atomic_cas_64,function)
38 ANSI_PRAGMA_WEAK2(caslong,atomic_cas_ulong,function)
39 ANSI_PRAGMA_WEAK2(casptr,atomic_cas_ptr,function)
40 ANSI_PRAGMA_WEAK2(atomic_and_long,atomic_and_ulong,function)
41 ANSI_PRAGMA_WEAK2(atomic_or_long,atomic_or_ulong,function)
42 ANSI_PRAGMA_WEAK2(swapl,atomic_swap_32,function)
43 #endif
44
45 /*
46 * NOTE: If atomic_inc_8 and atomic_inc_8_nv are ever
47 * separated, you need to also edit the libc arm platform
48 * specific mapfile and remove the NODYNSORT attribute
49 * from atomic_inc_8_nv.
50 */
51 ENTRY(atomic_inc_8)
52 ALTENTRY(atomic_inc_8_nv)
53 ALTENTRY(atomic_inc_uchar)
54 ALTENTRY(atomic_inc_uchar_nv)
55 mov r1, #1
56 b atomic_add_8
57 SET_SIZE(atomic_inc_uchar_nv)
58 SET_SIZE(atomic_inc_uchar)
59 SET_SIZE(atomic_inc_8_nv)
60 SET_SIZE(atomic_inc_8)
61
62 /*
63 * NOTE: If atomic_dec_8 and atomic_dec_8_nv are ever
64 * separated, you need to also edit the libc arm platform
|
11
12 /*
13 * Copyright (c) 2013 Joyent, Inc. All rights reserved.
14 */
15
16 .file "atomic.s"
17
18 /*
19 * Atomic Operatoins for 32-bit ARM. Note, that these require at least ARMv6K so
20 * as to have access to the non-word size LDREX and STREX.
21 */
22
23 #include <sys/asm_linkage.h>
24 #include <sys/atomic_impl.h>
25
26 /*
27 * XXX We probably want some kind of backoff built in to these routines at some
28 * point.
29 */
30
31 /*
32 * NOTE: If atomic_inc_8 and atomic_inc_8_nv are ever
33 * separated, you need to also edit the libc arm platform
34 * specific mapfile and remove the NODYNSORT attribute
35 * from atomic_inc_8_nv.
36 */
37 ENTRY(atomic_inc_8)
38 ALTENTRY(atomic_inc_8_nv)
39 ALTENTRY(atomic_inc_uchar)
40 ALTENTRY(atomic_inc_uchar_nv)
41 mov r1, #1
42 b atomic_add_8
43 SET_SIZE(atomic_inc_uchar_nv)
44 SET_SIZE(atomic_inc_uchar)
45 SET_SIZE(atomic_inc_8_nv)
46 SET_SIZE(atomic_inc_8)
47
48 /*
49 * NOTE: If atomic_dec_8 and atomic_dec_8_nv are ever
50 * separated, you need to also edit the libc arm platform
|