xref: /dflybsd-src/sys/dev/drm/include/linux/vmalloc.h (revision 1382b9d01ca490a8b6800a3693a80e3b35744ebe)
13779d0eaSFrançois Tigeot /*
2*1382b9d0SFrançois Tigeot  * Copyright (c) 2015-2020 François Tigeot <ftigeot@wolfpond.org>
33779d0eaSFrançois Tigeot  * All rights reserved.
43779d0eaSFrançois Tigeot  *
53779d0eaSFrançois Tigeot  * Redistribution and use in source and binary forms, with or without
63779d0eaSFrançois Tigeot  * modification, are permitted provided that the following conditions
73779d0eaSFrançois Tigeot  * are met:
83779d0eaSFrançois Tigeot  * 1. Redistributions of source code must retain the above copyright
93779d0eaSFrançois Tigeot  *    notice unmodified, this list of conditions, and the following
103779d0eaSFrançois Tigeot  *    disclaimer.
113779d0eaSFrançois Tigeot  * 2. Redistributions in binary form must reproduce the above copyright
123779d0eaSFrançois Tigeot  *    notice, this list of conditions and the following disclaimer in the
133779d0eaSFrançois Tigeot  *    documentation and/or other materials provided with the distribution.
143779d0eaSFrançois Tigeot  *
153779d0eaSFrançois Tigeot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
163779d0eaSFrançois Tigeot  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
173779d0eaSFrançois Tigeot  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
183779d0eaSFrançois Tigeot  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
193779d0eaSFrançois Tigeot  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
203779d0eaSFrançois Tigeot  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
213779d0eaSFrançois Tigeot  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
223779d0eaSFrançois Tigeot  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
233779d0eaSFrançois Tigeot  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
243779d0eaSFrançois Tigeot  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
253779d0eaSFrançois Tigeot  */
263779d0eaSFrançois Tigeot 
273779d0eaSFrançois Tigeot #ifndef _LINUX_VMALLOC_H_
283779d0eaSFrançois Tigeot #define _LINUX_VMALLOC_H_
293779d0eaSFrançois Tigeot 
302cce721cSFrançois Tigeot #include <linux/spinlock.h>
312cce721cSFrançois Tigeot #include <linux/init.h>
322cce721cSFrançois Tigeot #include <linux/list.h>
33*1382b9d0SFrançois Tigeot #include <linux/llist.h>
342cce721cSFrançois Tigeot #include <asm/page.h>		/* pgprot_t */
352cce721cSFrançois Tigeot #include <linux/rbtree.h>
36d11dcf6aSFrançois Tigeot 
37f0bba3d1SFrançois Tigeot void *vmap(struct page **pages, unsigned int count,
38b3816793SFrançois Tigeot 	   unsigned long flags, pgprot_t prot);
39d11dcf6aSFrançois Tigeot 
40646a8671SFrançois Tigeot void vunmap(const void *addr);
413779d0eaSFrançois Tigeot 
42106adca4SFrançois Tigeot void *vmalloc(unsigned long size);
43106adca4SFrançois Tigeot void *vzalloc(unsigned long size);
442cce721cSFrançois Tigeot void *vmalloc_user(unsigned long size);
452cce721cSFrançois Tigeot 
462cce721cSFrançois Tigeot void vfree(const void *addr);
472cce721cSFrançois Tigeot 
483779d0eaSFrançois Tigeot #endif	/* _LINUX_VMALLOC_H_ */
49