1 # $NetBSD: Makefile.inc,v 1.18 2014/10/13 08:59:41 martin 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 9 SPARC64DIR= ${.PARSEDIR}/../../sparc64/atomic 10 .PATH.c: ${SPARC64DIR} 11 .PATH.S: ${SPARC64DIR} 12 13 .include "${SPARC64DIR}/Makefile.inc" 14 15 .else 16 17 . if defined(LIB) 18 19 . if (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \ 20 || ${LIB} == "rump") 21 SRCS+= 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.S \ 25 atomic_cas_32_cas.c atomic_nand_32_cas.c atomic_sub_32_cas.c \ 26 atomic_xor_32_cas.c 27 . endif 28 29 . if ${LIB} == "c" 30 SRCS+= atomic_nand_16_cas.c atomic_nand_8_cas.c \ 31 atomic_and_16_cas.c atomic_and_8_cas.c \ 32 atomic_xor_16_cas.c atomic_xor_8_cas.c \ 33 atomic_add_16_cas.c atomic_add_8_cas.c \ 34 atomic_cas_16_cas.c atomic_cas_8_cas.c \ 35 atomic_sub_16_cas.c atomic_sub_8_cas.c \ 36 atomic_or_16_cas.c atomic_or_8_cas.c \ 37 atomic_swap_16_cas.c atomic_swap_8_cas.c \ 38 atomic_c11_compare_exchange_cas_32.c \ 39 atomic_c11_compare_exchange_cas_16.c \ 40 atomic_c11_compare_exchange_cas_8.c 41 . endif 42 43 . if (${LIB} == "kern" || ${LIB} == "rump") 44 SRCS+= atomic_cas.S 45 . endif 46 47 . if (${LIB} == "c" || ${LIB} == "pthread") 48 CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP -D__HAVE_ASM_ATOMIC_CAS_16_UP \ 49 -D__HAVE_ASM_ATOMIC_CAS_8_UP 50 SRCS+= atomic_init_testset.c atomic_cas_up.S 51 . endif 52 53 . endif 54 55 .endif 56