diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_impl.h | 4 | ||||
-rw-r--r-- | usr/src/uts/common/sys/sysmacros.h | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_impl.h b/usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_impl.h index 84eb2074df..c1407bfe00 100644 --- a/usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_impl.h +++ b/usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_impl.h @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #ifndef _RDSV3_IMPL_H @@ -120,9 +121,6 @@ uint_t rdsv3_one_sec_in_hz; #define jiffies 100 #define HZ (drv_hztousec(1)) -#define container_of(m, s, name) \ - (void *)((uintptr_t)(m) - (uintptr_t)offsetof(s, name)) -#define ARRAY_SIZE(x) (sizeof (x) / sizeof (x[0])) /* setting this to PAGESIZE throws build errors */ #define PAGE_SIZE 4096 /* xxx - fix this */ #define BITS_PER_LONG (sizeof (unsigned long) * 8) diff --git a/usr/src/uts/common/sys/sysmacros.h b/usr/src/uts/common/sys/sysmacros.h index 89a672db2f..71042eba85 100644 --- a/usr/src/uts/common/sys/sysmacros.h +++ b/usr/src/uts/common/sys/sysmacros.h @@ -25,6 +25,8 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2011, 2012 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SYS_SYSMACROS_H @@ -364,12 +366,18 @@ extern unsigned char bcd_to_byte[256]; #error One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined #endif /* _BIT_FIELDS_LTOH */ -#if defined(_KERNEL) && !defined(_KMEMUSER) && !defined(offsetof) - /* avoid any possibility of clashing with <stddef.h> version */ +#if defined(_KERNEL) && !defined(_KMEMUSER) +#if !defined(offsetof) #define offsetof(s, m) ((size_t)(&(((s *)0)->m))) -#endif +#endif /* !offsetof */ + +#define container_of(m, s, name) \ + (void *)((uintptr_t)(m) - (uintptr_t)offsetof(s, name)) + +#define ARRAY_SIZE(x) (sizeof (x) / sizeof (x[0])) +#endif /* _KERNEL, !_KMEMUSER */ #ifdef __cplusplus } |