Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/include/os/freebsd/spl/sys/sysmacros.h
Show All 25 Lines | |||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved. | * Copyright 2008 Sun Microsystems, Inc. All rights reserved. | ||||
* Use is subject to license terms. | * Use is subject to license terms. | ||||
*/ | */ | ||||
#ifndef _SYS_SYSMACROS_H | #ifndef _SYS_SYSMACROS_H | ||||
#define _SYS_SYSMACROS_H | #define _SYS_SYSMACROS_H | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | |||||
#include <sys/isa_defs.h> | #include <sys/isa_defs.h> | ||||
#include <sys/libkern.h> | #include <sys/libkern.h> | ||||
#include <sys/zone.h> | #include <sys/zone.h> | ||||
#include <sys/condvar.h> | #include <sys/condvar.h> | ||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 272 Lines • ▼ Show 20 Lines | |||||
#else | #else | ||||
#error One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined | #error One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined | ||||
#endif /* _BIT_FIELDS_LTOH */ | #endif /* _BIT_FIELDS_LTOH */ | ||||
#if !defined(_KMEMUSER) && !defined(offsetof) | #if !defined(_KMEMUSER) && !defined(offsetof) | ||||
/* avoid any possibility of clashing with <stddef.h> version */ | /* avoid any possibility of clashing with <stddef.h> version */ | ||||
#define offsetof(s, m) ((size_t)(&(((s *)0)->m))) | #define offsetof(type, field) __offsetof(type, field) | ||||
#endif | #endif | ||||
/* | /* | ||||
* Find highest one bit set. | * Find highest one bit set. | ||||
* Returns bit number + 1 of highest bit that is set, otherwise returns 0. | * Returns bit number + 1 of highest bit that is set, otherwise returns 0. | ||||
* High order bit is 31 (or 63 in _LP64 kernel). | * High order bit is 31 (or 63 in _LP64 kernel). | ||||
*/ | */ | ||||
static __inline int | static __inline int | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |