Makefile.inc revision 1.27
11.27Sjustin#	$NetBSD: Makefile.inc,v 1.27 2015/05/17 22:08:24 justin Exp $
21.9Smatt
31.19Smatt.ifnmake obj
41.19Smatt.include "${NETBSDSRCDIR}/common/lib/libc/arch/arm/features.mk"
51.12Smatt.endif
61.5Sad
71.8Spooka.if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
81.8Spooka	|| ${LIB} == "rump")
91.2Sad
101.19Smatt.if "${FEAT_LDREX}" == "no"
111.9SmattSRCS.atomic+=	atomic_add_32_cas.c atomic_add_32_nv_cas.c \
121.9Smatt		atomic_and_32_cas.c atomic_and_32_nv_cas.c \
131.9Smatt		atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \
141.9Smatt		atomic_inc_32_cas.c atomic_inc_32_nv_cas.c \
151.9Smatt		atomic_or_32_cas.c atomic_or_32_nv_cas.c \
161.25Smartin		atomic_swap_32_cas.c membar_ops_nop.c
171.17Smartin
181.17Smartin.if ${LIB} == "c"
191.17SmartinSRCS.atomic+=	atomic_xor_32_cas.c atomic_xor_16_cas.c atomic_xor_8_cas.c \
201.16Smartin		atomic_sub_32_cas.c atomic_sub_16_cas.c atomic_sub_8_cas.c \
211.16Smartin		atomic_nand_32_cas.c atomic_nand_16_cas.c atomic_nand_8_cas.c \
221.16Smartin		atomic_or_16_cas.c atomic_or_8_cas.c \
231.16Smartin		atomic_and_16_cas.c atomic_and_8_cas.c \
241.16Smartin		atomic_add_16_cas.c atomic_add_8_cas.c \
251.18Smartin		atomic_swap_16_cas.c atomic_swap_8_cas.c \
261.23Sjoerg		atomic_cas_32_cas.c atomic_cas_16_cas.c atomic_cas_8_cas.c \
271.25Smartin		atomic_load.c atomic_store.c \
281.26Smartin		atomic_and_16_nv_cas.c atomic_and_8_nv_cas.c	\
291.26Smartin		atomic_c11_compare_exchange_cas_32.c	\
301.26Smartin		atomic_c11_compare_exchange_cas_16.c	\
311.26Smartin		atomic_c11_compare_exchange_cas_8.c
321.17Smartin.endif
331.17Smartin
341.9Smatt.else
351.14Smatt.for op in add and cas nand or xor
361.14Smatt.for sz in 8 16 32 64
371.14SmattSRCS.atomic+=	atomic_${op}_${sz}.S
381.14Smatt.endfor
391.14Smatt.endfor
401.14SmattSRCS.atomic+=	atomic_dec_32.S atomic_dec_64.S
411.14SmattSRCS.atomic+=	atomic_inc_32.S atomic_inc_64.S
421.21SmattSRCS.atomic+=	atomic_sub_64.S
431.14SmattSRCS.atomic+=	atomic_swap.S atomic_swap_16.S atomic_swap_64.S
441.14SmattSRCS.atomic+=	membar_ops.S
451.27Sjustin.if defined(LIB) && ${LIB} != "kern" && ${LIB} != "rump"
461.14Smatt.for op in add and nand or sub xor
471.14SmattSRCS.atomic+=	sync_fetch_and_${op}_8.S
481.14Smatt.endfor
491.14Smatt.for sz in 1 2 4 8
501.14SmattSRCS.atomic+=	sync_bool_compare_and_swap_${sz}.S
511.14Smatt.endfor
521.9Smatt.endif
531.22Smatt.endif
541.2Sad
551.5Sad.endif
561.5Sad
571.13Smatt.if defined(LIB) && (${LIB} == "c" || ${LIB} == "pthread" || ${LIB} == "rump")
581.13Smatt
591.13SmattSRCS.atomic+=	atomic_simplelock.c
601.19Smatt.if "${FEAT_THUMB2}" == "no"
611.13SmattCPUFLAGS.atomic_simplelock.c+=	-marm
621.13Smatt.endif
631.13Smatt
641.13Smatt.endif
651.13Smatt
661.7Sad.if defined(LIB) && (${LIB} == "c" || ${LIB} == "pthread")
671.4Sad
681.19Smatt.if "${FEAT_LDREX}" == "no"
691.9SmattSRCS.atomic+=	atomic_init_testset.c
701.9SmattSRCS.atomic+=	atomic_cas_up.S
711.6SscwCPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP
721.15SmattCPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_16_UP
731.15SmattCPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_8_UP
741.19Smatt.if "${FEAT_EABI}" == "yes" && "${FEAT_LDRD}" == "yes"
751.19SmattCPPFLAGS+= -D__HAVE_ATOMIC_CAS_64_UP -D__HAVE_ASM_ATOMIC_CAS_64_UP
761.19Smatt.endif
771.9Smatt.else
781.9SmattSRCS.atomic+=	atomic_init_cas.c
791.19Smatt.endif #FEAT_LDREX
801.4Sad
811.19Smatt.endif #LIB
821.9Smatt
831.19Smatt.if "${FEAT_THUMB2}" == "no"
841.13Smatt.for f in ${SRCS.atomic:M*.S}
851.13SmattCPUFLAGS.$f+=	-marm
861.13Smatt.endfor
871.13Smatt.endif
881.13Smatt
891.9SmattSRCS+=	${SRCS.atomic}
90