|
@@ -4,6 +4,8 @@
|
|
/*
|
|
/*
|
|
* 'kernel.h' contains some often-used function prototypes etc
|
|
* 'kernel.h' contains some often-used function prototypes etc
|
|
*/
|
|
*/
|
|
|
|
+#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
|
|
|
|
+#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
|
|
|
|
|
|
#ifdef __KERNEL__
|
|
#ifdef __KERNEL__
|
|
|
|
|
|
@@ -37,8 +39,7 @@ extern const char linux_proc_banner[];
|
|
|
|
|
|
#define STACK_MAGIC 0xdeadbeef
|
|
#define STACK_MAGIC 0xdeadbeef
|
|
|
|
|
|
-#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
|
|
|
|
-#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
|
|
|
|
|
|
+#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
|
|
#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
|
|
#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
|
|
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
|
|
#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
|
|
|
|
|