summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-02-17 01:03:06 +0000
committerkib <kib@FreeBSD.org>2015-02-17 01:03:06 +0000
commit0cb0cb1b24a8ada17d71f3f1cad36e89d0c0ccfc (patch)
tree6c211c0db8606bd913bc7ca6b008edcddc8f1cd3 /lib/libc/gen
parentc30b890b0bb2a5cdb5c6bf8b1b31ac21d986f650 (diff)
downloadFreeBSD-src-0cb0cb1b24a8ada17d71f3f1cad36e89d0c0ccfc.zip
FreeBSD-src-0cb0cb1b24a8ada17d71f3f1cad36e89d0c0ccfc.tar.gz
MFC r278751:
Properly interpose libc spinlocks, was missed in r276630.
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/_spinlock_stub.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/lib/libc/gen/_spinlock_stub.c b/lib/libc/gen/_spinlock_stub.c
index 47bbfeb..fddfc1b 100644
--- a/lib/libc/gen/_spinlock_stub.c
+++ b/lib/libc/gen/_spinlock_stub.c
@@ -33,51 +33,48 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include "spinlock.h"
+#include "libc_private.h"
long _atomic_lock_stub(volatile long *);
void _spinlock_stub(spinlock_t *);
void _spinunlock_stub(spinlock_t *);
void _spinlock_debug_stub(spinlock_t *, char *, int);
-/*
- * Declare weak definitions in case the application is not linked
- * with libpthread.
- */
__weak_reference(_atomic_lock_stub, _atomic_lock);
-__weak_reference(_spinlock_stub, _spinlock);
-__weak_reference(_spinunlock_stub, _spinunlock);
-__weak_reference(_spinlock_debug_stub, _spinlock_debug);
-/*
- * This function is a stub for the _atomic_lock function in libpthread.
- */
long
_atomic_lock_stub(volatile long *lck __unused)
{
return (0L);
}
+__weak_reference(_spinlock, _spinlock_debug);
+#pragma weak _spinlock
+void
+_spinlock(spinlock_t *lck)
+{
-/*
- * This function is a stub for the spinlock function in libpthread.
- */
+ ((void (*)(spinlock_t *lck))__libc_interposing[INTERPOS_spinlock])
+ (lck);
+
+}
+
+#pragma weak _spinlock
void
-_spinlock_stub(spinlock_t *lck __unused)
+_spinunlock(spinlock_t *lck)
{
+
+ ((void (*)(spinlock_t *lck))__libc_interposing[INTERPOS_spinunlock])
+ (lck);
+
}
-/*
- * This function is a stub for the spinunlock function in libpthread.
- */
void
-_spinunlock_stub(spinlock_t *lck __unused)
+__libc_spinlock_stub(spinlock_t *lck __unused)
{
}
-/*
- * This function is a stub for the debug spinlock function in libpthread.
- */
void
-_spinlock_debug_stub(spinlock_t *lck __unused, char *fname __unused, int lineno __unused)
+__libc_spinunlock_stub(spinlock_t *lck __unused)
{
}
OpenPOWER on IntegriCloud