xref: /minix/common/lib/libc/arch/m68k/atomic/Makefile.inc (revision 84d9c625)
1#	$NetBSD: Makefile.inc,v 1.10 2013/07/18 19:49:00 matt Exp $
2
3#
4# Note: The atomic operations here in these assembly files are atomic
5# only with respect to regular memory on uniprocessor systems.  Since
6# we don't support any MP m68k systems, this is just fine.  If we ever
7# do, then these routines will probably need to be replaced with CAS-
8# based routines (CAS generates an atomic bus cycle, whereas these
9# others are merely single-instruction).
10#
11
12.if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
13	|| ${LIB} == "rump")
14.if ${MACHINE_ARCH} == "m68k"
15
16SRCS+=	atomic_add.S atomic_and.S atomic_cas.S atomic_dec.S \
17	atomic_inc.S atomic_or.S atomic_swap.S membar_ops_nop.c
18
19.else
20
21SRCS+=  atomic_add_32_cas.c atomic_add_32_nv_cas.c atomic_and_32_cas.c \
22	atomic_and_32_nv_cas.c atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \
23	atomic_inc_32_cas.c atomic_inc_32_nv_cas.c atomic_or_32_cas.c \
24	atomic_or_32_nv_cas.c atomic_swap_32_cas.c membar_ops_nop.c
25
26.endif
27.endif
28
29.if defined(LIB) && (${LIB} == "c" || ${LIB} == "pthread")
30.if ${MACHINE_ARCH} == "m68k"
31
32SRCS+=	atomic_init_cas.c
33
34.else
35
36SRCS+=	atomic_init_testset.c
37SRCS+=	atomic_cas_68000.S
38CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP
39
40.endif
41.endif
42