_spinlock_stub.c revision 278751
1146773Ssam/*
2146773Ssam * Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>.
3146773Ssam * All rights reserved.
4146773Ssam *
5146773Ssam * Redistribution and use in source and binary forms, with or without
6146773Ssam * modification, are permitted provided that the following conditions
7146773Ssam * are met:
8146773Ssam * 1. Redistributions of source code must retain the above copyright
9146773Ssam *    notice, this list of conditions and the following disclaimer.
10146773Ssam * 2. Redistributions in binary form must reproduce the above copyright
11146773Ssam *    notice, this list of conditions and the following disclaimer in the
12146773Ssam *    documentation and/or other materials provided with the distribution.
13146773Ssam * 3. Neither the name of the author nor the names of any co-contributors
14146773Ssam *    may be used to endorse or promote products derived from this software
15146773Ssam *    without specific prior written permission.
16146773Ssam *
17146773Ssam * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
18146773Ssam * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19146773Ssam * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20146773Ssam * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21146773Ssam * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22146773Ssam * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23146773Ssam * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24146773Ssam * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25146773Ssam * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26146773Ssam * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27146773Ssam * SUCH DAMAGE.
28146773Ssam */
29146773Ssam
30146773Ssam#include <sys/cdefs.h>
31146773Ssam__FBSDID("$FreeBSD: head/lib/libc/gen/_spinlock_stub.c 278751 2015-02-14 11:47:40Z kib $");
32146773Ssam
33146773Ssam#include <stdio.h>
34146773Ssam
35146773Ssam#include "spinlock.h"
36146773Ssam#include "libc_private.h"
37146773Ssam
38146773Ssamlong _atomic_lock_stub(volatile long *);
39146773Ssamvoid _spinlock_stub(spinlock_t *);
40146773Ssamvoid _spinunlock_stub(spinlock_t *);
41235530Sdelphijvoid _spinlock_debug_stub(spinlock_t *, char *, int);
42146773Ssam
43146773Ssam__weak_reference(_atomic_lock_stub, _atomic_lock);
44146773Ssam
45146773Ssamlong
46146773Ssam_atomic_lock_stub(volatile long *lck __unused)
47146773Ssam{
48146773Ssam	return (0L);
49146773Ssam}
50146773Ssam
51146773Ssam__weak_reference(_spinlock, _spinlock_debug);
52146773Ssam#pragma weak _spinlock
53146773Ssamvoid
54146773Ssam_spinlock(spinlock_t *lck)
55146773Ssam{
56235530Sdelphij
57146773Ssam	((void (*)(spinlock_t *lck))__libc_interposing[INTERPOS_spinlock])
58146773Ssam	    (lck);
59146773Ssam
60146773Ssam}
61146773Ssam
62146773Ssam#pragma weak _spinlock
63146773Ssamvoid
64146773Ssam_spinunlock(spinlock_t *lck)
65146773Ssam{
66146773Ssam
67146773Ssam	((void (*)(spinlock_t *lck))__libc_interposing[INTERPOS_spinunlock])
68146773Ssam	    (lck);
69146773Ssam
70146773Ssam}
71146773Ssam
72146773Ssamvoid
73146773Ssam__libc_spinlock_stub(spinlock_t *lck __unused)
74146773Ssam{
75146773Ssam}
76146773Ssam
77146773Ssamvoid
78146773Ssam__libc_spinunlock_stub(spinlock_t *lck __unused)
79146773Ssam{
80146773Ssam}
81146773Ssam