kernel.h (279737) | kernel.h (282513) |
---|---|
1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 15 unchanged lines hidden (view full) --- 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29#ifndef _LINUX_KERNEL_H_ 30#define _LINUX_KERNEL_H_ 31 | 1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 15 unchanged lines hidden (view full) --- 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29#ifndef _LINUX_KERNEL_H_ 30#define _LINUX_KERNEL_H_ 31 |
32#include <sys/cdefs.h> 33#include <sys/types.h> |
|
32#include <sys/systm.h> 33#include <sys/param.h> 34#include <sys/libkern.h> 35#include <sys/stat.h> 36#include <sys/smp.h> 37#include <sys/stddef.h> 38#include <sys/syslog.h> 39 --- 12 unchanged lines hidden (view full) --- 52#define KERN_ALERT "<1>" 53#define KERN_CRIT "<2>" 54#define KERN_ERR "<3>" 55#define KERN_WARNING "<4>" 56#define KERN_NOTICE "<5>" 57#define KERN_INFO "<6>" 58#define KERN_DEBUG "<7>" 59 | 34#include <sys/systm.h> 35#include <sys/param.h> 36#include <sys/libkern.h> 37#include <sys/stat.h> 38#include <sys/smp.h> 39#include <sys/stddef.h> 40#include <sys/syslog.h> 41 --- 12 unchanged lines hidden (view full) --- 54#define KERN_ALERT "<1>" 55#define KERN_CRIT "<2>" 56#define KERN_ERR "<3>" 57#define KERN_WARNING "<4>" 58#define KERN_NOTICE "<5>" 59#define KERN_INFO "<6>" 60#define KERN_DEBUG "<7>" 61 |
62#define BUILD_BUG_ON(x) CTASSERT(!(x)) 63 |
|
60#define BUG() panic("BUG") 61#define BUG_ON(condition) do { if (condition) BUG(); } while(0) 62#define WARN_ON BUG_ON 63 64#undef ALIGN 65#define ALIGN(x, y) roundup2((x), (y)) 66#undef PTR_ALIGN 67#define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) 68#define DIV_ROUND_UP howmany | 64#define BUG() panic("BUG") 65#define BUG_ON(condition) do { if (condition) BUG(); } while(0) 66#define WARN_ON BUG_ON 67 68#undef ALIGN 69#define ALIGN(x, y) roundup2((x), (y)) 70#undef PTR_ALIGN 71#define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) 72#define DIV_ROUND_UP howmany |
73#define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) |
|
69 70#define printk(X...) printf(X) 71 72/* 73 * The "pr_debug()" and "pr_devel()" macros should produce zero code 74 * unless DEBUG is defined: 75 */ 76#ifdef DEBUG --- 4 unchanged lines hidden (view full) --- 81#else 82#define pr_debug(fmt, ...) \ 83 ({ if (0) log(LOG_DEBUG, fmt, ##__VA_ARGS__); 0; }) 84#define pr_devel(fmt, ...) \ 85 ({ if (0) log(LOG_DEBUG, pr_fmt(fmt), ##__VA_ARGS__); 0; }) 86#endif 87 88#define udelay(t) DELAY(t) | 74 75#define printk(X...) printf(X) 76 77/* 78 * The "pr_debug()" and "pr_devel()" macros should produce zero code 79 * unless DEBUG is defined: 80 */ 81#ifdef DEBUG --- 4 unchanged lines hidden (view full) --- 86#else 87#define pr_debug(fmt, ...) \ 88 ({ if (0) log(LOG_DEBUG, fmt, ##__VA_ARGS__); 0; }) 89#define pr_devel(fmt, ...) \ 90 ({ if (0) log(LOG_DEBUG, pr_fmt(fmt), ##__VA_ARGS__); 0; }) 91#endif 92 93#define udelay(t) DELAY(t) |
94#define usleep_range(min,max) DELAY(min) |
|
89 90#ifndef pr_fmt 91#define pr_fmt(fmt) fmt 92#endif 93 94/* 95 * Print a one-time message (analogous to WARN_ONCE() et al): 96 */ --- 70 unchanged lines hidden (view full) --- 167 * as wide as the result!), and we want to evaluate the macro 168 * arguments just once each. 169 */ 170#define __round_mask(x, y) ((__typeof__(x))((y)-1)) 171#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) 172#define round_down(x, y) ((x) & ~__round_mask(x, y)) 173 174#define num_possible_cpus() mp_ncpus | 95 96#ifndef pr_fmt 97#define pr_fmt(fmt) fmt 98#endif 99 100/* 101 * Print a one-time message (analogous to WARN_ONCE() et al): 102 */ --- 70 unchanged lines hidden (view full) --- 173 * as wide as the result!), and we want to evaluate the macro 174 * arguments just once each. 175 */ 176#define __round_mask(x, y) ((__typeof__(x))((y)-1)) 177#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) 178#define round_down(x, y) ((x) & ~__round_mask(x, y)) 179 180#define num_possible_cpus() mp_ncpus |
181#define num_online_cpus() mp_ncpus |
|
175 176typedef struct pm_message { 177 int event; 178} pm_message_t; 179 180#endif /* _LINUX_KERNEL_H_ */ | 182 183typedef struct pm_message { 184 int event; 185} pm_message_t; 186 187#endif /* _LINUX_KERNEL_H_ */ |