_spinlock_stub.c revision 75368
134378Sjb/* 234378Sjb * Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>. 334378Sjb * All rights reserved. 434378Sjb * 534378Sjb * Redistribution and use in source and binary forms, with or without 634378Sjb * modification, are permitted provided that the following conditions 734378Sjb * are met: 834378Sjb * 1. Redistributions of source code must retain the above copyright 934378Sjb * notice, this list of conditions and the following disclaimer. 1034378Sjb * 2. Redistributions in binary form must reproduce the above copyright 1134378Sjb * notice, this list of conditions and the following disclaimer in the 1234378Sjb * documentation and/or other materials provided with the distribution. 1334378Sjb * 3. All advertising materials mentioning features or use of this software 1434378Sjb * must display the following acknowledgement: 1534378Sjb * This product includes software developed by John Birrell. 1634378Sjb * 4. Neither the name of the author nor the names of any co-contributors 1734378Sjb * may be used to endorse or promote products derived from this software 1834378Sjb * without specific prior written permission. 1934378Sjb * 2034378Sjb * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND 2134378Sjb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2234378Sjb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2334378Sjb * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2434378Sjb * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2534378Sjb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2634378Sjb * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2734378Sjb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2834378Sjb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2934378Sjb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3034378Sjb * SUCH DAMAGE. 3134378Sjb * 3250476Speter * $FreeBSD: head/lib/libc/gen/_spinlock_stub.c 75368 2001-04-10 04:11:50Z deischen $ 3334378Sjb * 3434378Sjb */ 3534378Sjb 3634378Sjb#include <stdio.h> 3735500Sjb 3834378Sjb#include "spinlock.h" 3934378Sjb 4034378Sjb/* 4171579Sdeischen * Declare weak definitions in case the application is not linked 4234378Sjb * with libpthread. 4334378Sjb */ 4475368Sdeischen__weak_reference(_atomic_lock_stub, _atomic_lock); 4575368Sdeischen__weak_reference(_spinlock_stub, _spinlock); 4675368Sdeischen__weak_reference(_spinlock_debug_stub, _spinlock_debug); 4734378Sjb 4875368Sdeischen 4934378Sjb/* 5071579Sdeischen * This function is a stub for the _atomic_lock function in libpthread. 5171579Sdeischen */ 5271579Sdeischenlong 5371579Sdeischen_atomic_lock_stub(volatile long *lck) 5471579Sdeischen{ 5571579Sdeischen return (0L); 5671579Sdeischen} 5771579Sdeischen 5871579Sdeischen 5971579Sdeischen/* 6034378Sjb * This function is a stub for the spinlock function in libpthread. 6134378Sjb */ 6234378Sjbvoid 6336805Sjb_spinlock_stub(spinlock_t *lck) 6434378Sjb{ 6534378Sjb} 6634378Sjb 6734378Sjb/* 6836805Sjb * This function is a stub for the debug spinlock function in libpthread. 6934378Sjb */ 7034378Sjbvoid 7136805Sjb_spinlock_debug_stub(spinlock_t *lck, char *fname, int lineno) 7234378Sjb{ 7334378Sjb} 74