common/libc: build for ARM

This commit is contained in:
Arun Thomas 2012-08-11 17:44:21 +02:00
parent ed9152a1a3
commit cdfb5ab81f
2 changed files with 5 additions and 1 deletions

View file

@ -1,7 +1,7 @@
# $NetBSD: Makefile.inc,v 1.8 2009/01/04 17:54:29 pooka Exp $ # $NetBSD: Makefile.inc,v 1.8 2009/01/04 17:54:29 pooka Exp $
.if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \ .if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
|| ${LIB} == "rump") || ${LIB} == "rump" || (defined(__MINIX) && ${LIB} == "sys"))
SRCS+= atomic_add_32_cas.c atomic_add_32_nv_cas.c atomic_and_32_cas.c \ SRCS+= atomic_add_32_cas.c atomic_add_32_nv_cas.c atomic_and_32_cas.c \
atomic_and_32_nv_cas.c atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \ atomic_and_32_nv_cas.c atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \

View file

@ -112,11 +112,14 @@ _atomic_cas_32(volatile uint32_t *ptr, uint32_t old, uint32_t new)
void void
__libc_atomic_init(void) __libc_atomic_init(void)
{ {
#if !defined(__minix)
int ncpu, mib[2]; int ncpu, mib[2];
size_t len; size_t len;
#endif
_atomic_cas_fn = _atomic_cas_mp; _atomic_cas_fn = _atomic_cas_mp;
#if !defined(__minix)
mib[0] = CTL_HW; mib[0] = CTL_HW;
mib[1] = HW_NCPU; mib[1] = HW_NCPU;
len = sizeof(ncpu); len = sizeof(ncpu);
@ -129,6 +132,7 @@ __libc_atomic_init(void)
_atomic_cas_fn = _atomic_cas_up; _atomic_cas_fn = _atomic_cas_up;
return; return;
} }
#endif
} }
#undef atomic_cas_32 #undef atomic_cas_32