aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index bc6ed52a39b9..56aec84237ad 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -45,11 +45,16 @@
45 45
46#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) 46#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
47 47
48/* @a is a power of 2 value */
48#define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) 49#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
49#define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask)) 50#define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
50#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) 51#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
51#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) 52#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
52 53
54/* generic data direction definitions */
55#define READ 0
56#define WRITE 1
57
53#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) 58#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
54 59
55#define u64_to_user_ptr(x) ( \ 60#define u64_to_user_ptr(x) ( \
@@ -506,6 +511,15 @@ extern enum system_states {
506#define TAINT_UNSIGNED_MODULE 13 511#define TAINT_UNSIGNED_MODULE 13
507#define TAINT_SOFTLOCKUP 14 512#define TAINT_SOFTLOCKUP 14
508#define TAINT_LIVEPATCH 15 513#define TAINT_LIVEPATCH 15
514#define TAINT_FLAGS_COUNT 16
515
516struct taint_flag {
517 char true; /* character printed when tainted */
518 char false; /* character printed when not tainted */
519 bool module; /* also show as a per-module taint flag */
520};
521
522extern const struct taint_flag taint_flags[TAINT_FLAGS_COUNT];
509 523
510extern const char hex_asc[]; 524extern const char hex_asc[];
511#define hex_asc_lo(x) hex_asc[((x) & 0x0f)] 525#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]