mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
FreeBSD: make adjustments for the standalone environment
In FreeBSD, there are three compile environments that are supported: user land, the kernel and the bootloader / standalone. Adjust the headers to compile in the standalone environment. Limit kernel-only items from view when _STANDALONE is defined. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Warner Losh <imp@FreeBSD.org> Closes #10998
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#ifndef _OPENSOLARIS_SYS_KMEM_H_
|
||||
#define _OPENSOLARIS_SYS_KMEM_H_
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <sys/param.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/vmem.h>
|
||||
@@ -93,5 +94,14 @@ void *calloc(size_t n, size_t s);
|
||||
zfs_kmem_alloc((size), (kmflags) | M_ZERO)
|
||||
#define kmem_free(buf, size) zfs_kmem_free((buf), (size))
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#ifdef _STANDALONE
|
||||
/*
|
||||
* At the moment, we just need it for the type. We redirect the alloc/free
|
||||
* routines to the usual Free and Malloc in that environment.
|
||||
*/
|
||||
typedef int kmem_cache_t;
|
||||
#endif /* _STANDALONE */
|
||||
|
||||
#endif /* _OPENSOLARIS_SYS_KMEM_H_ */
|
||||
|
||||
Reference in New Issue
Block a user