xref: /netbsd-src/sys/external/bsd/drm2/include/linux/nbsd-namespace.h (revision 994d3b2b81db23ed46336b78b3cf3e4d804d991e)
1*994d3b2bSriastradh /*	$NetBSD: nbsd-namespace.h,v 1.4 2021/12/19 12:22:03 riastradh Exp $	*/
21b46a69aSriastradh 
31b46a69aSriastradh /*-
41b46a69aSriastradh  * Copyright (c) 2020 The NetBSD Foundation, Inc.
51b46a69aSriastradh  * All rights reserved.
61b46a69aSriastradh  *
71b46a69aSriastradh  * Redistribution and use in source and binary forms, with or without
81b46a69aSriastradh  * modification, are permitted provided that the following conditions
91b46a69aSriastradh  * are met:
101b46a69aSriastradh  * 1. Redistributions of source code must retain the above copyright
111b46a69aSriastradh  *    notice, this list of conditions and the following disclaimer.
121b46a69aSriastradh  * 2. Redistributions in binary form must reproduce the above copyright
131b46a69aSriastradh  *    notice, this list of conditions and the following disclaimer in the
141b46a69aSriastradh  *    documentation and/or other materials provided with the distribution.
151b46a69aSriastradh  *
161b46a69aSriastradh  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
171b46a69aSriastradh  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
181b46a69aSriastradh  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
191b46a69aSriastradh  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
201b46a69aSriastradh  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
211b46a69aSriastradh  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
221b46a69aSriastradh  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
231b46a69aSriastradh  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
241b46a69aSriastradh  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
251b46a69aSriastradh  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
261b46a69aSriastradh  * POSSIBILITY OF SUCH DAMAGE.
271b46a69aSriastradh  */
281b46a69aSriastradh 
291b46a69aSriastradh #ifndef _LINUX_NBSD_NAMESPACE_H_
301b46a69aSriastradh #define _LINUX_NBSD_NAMESPACE_H_
311b46a69aSriastradh 
321b46a69aSriastradh /*
331b46a69aSriastradh  * WARNING: You MUST NOT include any other header files after you
341b46a69aSriastradh  * include this one.  DO NOT include this in a header file -- .c files
351b46a69aSriastradh  * only.
361b46a69aSriastradh  */
371b46a69aSriastradh 
381b46a69aSriastradh #undef	ALIGN
39eee0296cSriastradh #undef	LIST_HEAD
401b46a69aSriastradh 
411b46a69aSriastradh #define	ALIGN		round_up
42eee0296cSriastradh #define	LIST_HEAD	LINUX_LIST_HEAD
431b46a69aSriastradh #define	mutex_destroy	linux_mutex_destroy
441b46a69aSriastradh #define	mutex_init	linux_mutex_init
451b46a69aSriastradh 
46d9beab75Sriastradh /* Disable our historic malloc(9) compatibility macro.  */
47d9beab75Sriastradh #undef	free
48d9beab75Sriastradh 
49*994d3b2bSriastradh /* This should not appear in NetBSD code -- we do not sprintf!  */
50*994d3b2bSriastradh #define	sprintf(BUF, FMT, ARGS...)	snprintf(BUF, SIZE_MAX, FMT, ##ARGS)
51*994d3b2bSriastradh 
521b46a69aSriastradh #endif  /* _LINUX_NBSD_NAMESPACE_H_ */
53