xref: /freebsd/lib/libc/gen/_spinlock_stub.c (revision cc3521d66055ed9c5cc720613a3f0e84589a4abe)
11b5fef40SJohn Birrell /*
21b5fef40SJohn Birrell  * Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>.
31b5fef40SJohn Birrell  * All rights reserved.
41b5fef40SJohn Birrell  *
51b5fef40SJohn Birrell  * Redistribution and use in source and binary forms, with or without
61b5fef40SJohn Birrell  * modification, are permitted provided that the following conditions
71b5fef40SJohn Birrell  * are met:
81b5fef40SJohn Birrell  * 1. Redistributions of source code must retain the above copyright
91b5fef40SJohn Birrell  *    notice, this list of conditions and the following disclaimer.
101b5fef40SJohn Birrell  * 2. Redistributions in binary form must reproduce the above copyright
111b5fef40SJohn Birrell  *    notice, this list of conditions and the following disclaimer in the
121b5fef40SJohn Birrell  *    documentation and/or other materials provided with the distribution.
131b5fef40SJohn Birrell  * 3. All advertising materials mentioning features or use of this software
141b5fef40SJohn Birrell  *    must display the following acknowledgement:
151b5fef40SJohn Birrell  *	This product includes software developed by John Birrell.
161b5fef40SJohn Birrell  * 4. Neither the name of the author nor the names of any co-contributors
171b5fef40SJohn Birrell  *    may be used to endorse or promote products derived from this software
181b5fef40SJohn Birrell  *    without specific prior written permission.
191b5fef40SJohn Birrell  *
201b5fef40SJohn Birrell  * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
211b5fef40SJohn Birrell  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
221b5fef40SJohn Birrell  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
231b5fef40SJohn Birrell  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
241b5fef40SJohn Birrell  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
251b5fef40SJohn Birrell  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
261b5fef40SJohn Birrell  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
271b5fef40SJohn Birrell  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
281b5fef40SJohn Birrell  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
291b5fef40SJohn Birrell  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
301b5fef40SJohn Birrell  * SUCH DAMAGE.
311b5fef40SJohn Birrell  */
321b5fef40SJohn Birrell 
33ea8d448aSDavid E. O'Brien #include <sys/cdefs.h>
34ea8d448aSDavid E. O'Brien __FBSDID("$FreeBSD$");
35ea8d448aSDavid E. O'Brien 
361b5fef40SJohn Birrell #include <stdio.h>
37f0f62729SJohn Birrell 
381b5fef40SJohn Birrell #include "spinlock.h"
391b5fef40SJohn Birrell 
401b5fef40SJohn Birrell /*
41d201fe46SDaniel Eischen  * Declare weak definitions in case the application is not linked
421b5fef40SJohn Birrell  * with libpthread.
431b5fef40SJohn Birrell  */
4454fd7f68SDaniel Eischen __weak_reference(_atomic_lock_stub, _atomic_lock);
4554fd7f68SDaniel Eischen __weak_reference(_spinlock_stub, _spinlock);
46cc3521d6SJeff Roberson __weak_reference(_spinlock_stub, _spinunlock);
4754fd7f68SDaniel Eischen __weak_reference(_spinlock_debug_stub, _spinlock_debug);
4854fd7f68SDaniel Eischen 
491b5fef40SJohn Birrell 
501b5fef40SJohn Birrell /*
51d201fe46SDaniel Eischen  * This function is a stub for the _atomic_lock function in libpthread.
52d201fe46SDaniel Eischen  */
53d201fe46SDaniel Eischen long
54d201fe46SDaniel Eischen _atomic_lock_stub(volatile long *lck)
55d201fe46SDaniel Eischen {
56d201fe46SDaniel Eischen 	return (0L);
57d201fe46SDaniel Eischen }
58d201fe46SDaniel Eischen 
59d201fe46SDaniel Eischen 
60d201fe46SDaniel Eischen /*
611b5fef40SJohn Birrell  * This function is a stub for the spinlock function in libpthread.
621b5fef40SJohn Birrell  */
631b5fef40SJohn Birrell void
6486af3ff9SJohn Birrell _spinlock_stub(spinlock_t *lck)
651b5fef40SJohn Birrell {
661b5fef40SJohn Birrell }
671b5fef40SJohn Birrell 
681b5fef40SJohn Birrell /*
69cc3521d6SJeff Roberson  * This function is a stub for the spinunlock function in libpthread.
70cc3521d6SJeff Roberson  */
71cc3521d6SJeff Roberson void
72cc3521d6SJeff Roberson _spinunlock_stub(spinlock_t *lck)
73cc3521d6SJeff Roberson {
74cc3521d6SJeff Roberson }
75cc3521d6SJeff Roberson 
76cc3521d6SJeff Roberson /*
7786af3ff9SJohn Birrell  * This function is a stub for the debug spinlock function in libpthread.
781b5fef40SJohn Birrell  */
791b5fef40SJohn Birrell void
8086af3ff9SJohn Birrell _spinlock_debug_stub(spinlock_t *lck, char *fname, int lineno)
811b5fef40SJohn Birrell {
821b5fef40SJohn Birrell }
83