Always enable memory barriers in userspace, otherwise libpthread won't
work correctly on MP systems.
This commit is contained in:
parent
b86eac67c4
commit
2d0314d313
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: membar_ops.S,v 1.3 2008/02/12 07:35:04 matt Exp $ */
|
||||
/* $NetBSD: membar_ops.S,v 1.4 2008/02/12 18:40:28 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
|
||||
@ -40,6 +40,8 @@
|
||||
|
||||
.text
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
/*
|
||||
* We start out with no-op versions that do nothing. We hot-patch when
|
||||
* we detect a MP system.
|
||||
@ -49,22 +51,12 @@ LEAF_NOPROFILE(_membar_producer, 0)
|
||||
nop
|
||||
END(_membar_producer)
|
||||
EXPORT(_membar_producer_end)
|
||||
ATOMIC_OP_ALIAS(membar_producer,_membar_producer)
|
||||
|
||||
LEAF_NOPROFILE(_membar_sync, 0)
|
||||
RET
|
||||
nop
|
||||
END(_membar_sync)
|
||||
EXPORT(_membar_sync_end)
|
||||
ATOMIC_OP_ALIAS(membar_sync,_membar_sync)
|
||||
ATOMIC_OP_ALIAS(membar_enter,_membar_sync)
|
||||
STRONG_ALIAS(_membar_enter,_membar_sync)
|
||||
ATOMIC_OP_ALIAS(membar_exit,_membar_sync)
|
||||
STRONG_ALIAS(_membar_exit,_membar_sync)
|
||||
ATOMIC_OP_ALIAS(membar_consumer,_membar_sync)
|
||||
STRONG_ALIAS(_membar_consumer,_membar_sync)
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
LEAF_NOPROFILE(_membar_producer_mp, 0)
|
||||
wmb
|
||||
@ -78,4 +70,27 @@ LEAF_NOPROFILE(_membar_sync_mp, 0)
|
||||
END(_membar_sync_mp)
|
||||
EXPORT(_membar_sync_mp_end)
|
||||
|
||||
#endif /* _KERNEL */
|
||||
#else /* _KERNEL */
|
||||
|
||||
LEAF_NOPROFILE(_membar_producer, 0)
|
||||
mb
|
||||
RET
|
||||
END(_membar_producer)
|
||||
EXPORT(_membar_producer_end)
|
||||
|
||||
LEAF_NOPROFILE(_membar_sync, 0)
|
||||
mb
|
||||
RET
|
||||
END(_membar_sync)
|
||||
EXPORT(_membar_sync_end)
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
ATOMIC_OP_ALIAS(membar_producer,_membar_producer)
|
||||
ATOMIC_OP_ALIAS(membar_sync,_membar_sync)
|
||||
ATOMIC_OP_ALIAS(membar_enter,_membar_sync)
|
||||
STRONG_ALIAS(_membar_enter,_membar_sync)
|
||||
ATOMIC_OP_ALIAS(membar_exit,_membar_sync)
|
||||
STRONG_ALIAS(_membar_exit,_membar_sync)
|
||||
ATOMIC_OP_ALIAS(membar_consumer,_membar_sync)
|
||||
STRONG_ALIAS(_membar_consumer,_membar_sync)
|
||||
|
Loading…
Reference in New Issue
Block a user