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,8 @@
|
||||
#ifndef _OPENSOLARIS_SYS_ATOMIC_H_
|
||||
#define _OPENSOLARIS_SYS_ATOMIC_H_
|
||||
|
||||
#ifndef _STANDALONE
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <machine/atomic.h>
|
||||
|
||||
@@ -179,4 +181,13 @@ atomic_cas_ptr(volatile void *target, void *cmp, void *newval)
|
||||
}
|
||||
#endif /* !defined(COMPAT_32BIT) && defined(__LP64__) */
|
||||
|
||||
#else /* _STANDALONE */
|
||||
/*
|
||||
* sometimes atomic_add_64 is defined, sometimes not, but the
|
||||
* following is always right for the boot loader.
|
||||
*/
|
||||
#undef atomic_add_64
|
||||
#define atomic_add_64(ptr, val) *(ptr) += val
|
||||
#endif /* !_STANDALONE */
|
||||
|
||||
#endif /* !_OPENSOLARIS_SYS_ATOMIC_H_ */
|
||||
|
||||
Reference in New Issue
Block a user