Home | History | Annotate | Line # | Download | only in atomic
Makefile.inc revision 1.24
      1 #	$NetBSD: Makefile.inc,v 1.24 2023/03/30 15:03:36 riastradh Exp $
      2 
      3 .include <bsd.own.mk>
      4 
      5 # This is called with MACHINE=sparc64 && MACHINE_ARCH=sparc when building
      6 # 32 bit kernels for ultrasparc hardware
      7 .if ${MACHINE} == "sparc64" && \
      8 	(${HAVE_LLVM:Uno} == "no" || (defined(LIB) && ${LIB} == "kern"))
      9 
     10 SPARC64DIR=	${.PARSEDIR}/../../sparc64/atomic
     11 .PATH.c: ${SPARC64DIR}
     12 .PATH.S: ${SPARC64DIR}
     13 
     14 .include "${SPARC64DIR}/Makefile.inc"
     15 
     16 .if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
     17 	|| ${LIB} == "rump")
     18 SRCS+=	atomic_nand_64_cas.c atomic_xor_64_cas.c atomic_sub_64_cas.c \
     19 	atomic_cas_64_cas.c
     20 .endif
     21 
     22 .else
     23 
     24 . if defined(LIB)
     25 
     26 .  if (${LIB} == "kern" || ${LIB} == "c"  || ${LIB} == "pthread"	\
     27     || ${LIB} == "rump")
     28 SRCS+=	atomic_add_32_cas.c atomic_add_32_nv_cas.c atomic_and_32_cas.c \
     29 	atomic_and_32_nv_cas.c atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \
     30 	atomic_inc_32_cas.c atomic_inc_32_nv_cas.c atomic_or_32_cas.c \
     31 	atomic_or_32_nv_cas.c atomic_swap_32_cas.c membar_ops.S	\
     32 	atomic_cas_32_cas.c atomic_nand_32_cas.c atomic_sub_32_cas.c	\
     33 	atomic_xor_32_cas.c
     34 .  endif
     35 
     36 .  if ${LIB} == "c"
     37 SRCS+=	atomic_nand_16_cas.c atomic_nand_8_cas.c	\
     38 	atomic_and_16_cas.c atomic_and_8_cas.c		\
     39 	atomic_and_16_nv_cas.c atomic_and_8_nv_cas.c	\
     40 	atomic_xor_16_cas.c atomic_xor_8_cas.c		\
     41 	atomic_add_16_cas.c atomic_add_8_cas.c		\
     42 	atomic_cas_16_cas.c atomic_cas_8_cas.c		\
     43 	atomic_sub_16_cas.c atomic_sub_8_cas.c		\
     44 	atomic_or_16_cas.c atomic_or_8_cas.c		\
     45 	atomic_swap_16_cas.c atomic_swap_8_cas.c	\
     46 	atomic_c11_compare_exchange_cas_32.c		\
     47 	atomic_c11_compare_exchange_cas_16.c		\
     48 	atomic_c11_compare_exchange_cas_8.c \
     49 	atomic_load.c atomic_store.c \
     50 	atomic_is_lock_free.c
     51 .  endif
     52 
     53 .  if (${LIB} == "kern" || ${LIB} == "rump")
     54 SRCS+=	atomic_cas.S
     55 .  endif
     56 
     57 .  if (${LIB} == "c" || ${LIB} == "pthread")
     58 CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP -D__HAVE_ASM_ATOMIC_CAS_16_UP	\
     59 	-D__HAVE_ASM_ATOMIC_CAS_8_UP
     60 SRCS+=	atomic_init_testset.c atomic_cas_up.S
     61 .  endif
     62 
     63 . endif
     64 
     65 .endif
     66