@@ -9,12 +9,10 @@
* This work is licensed under the terms of the GNU LGPL, version 2.
*/
+#include "const.h"
+
#define PAGE_SHIFT 12
-#ifndef __ASSEMBLY__
-#define PAGE_SIZE (1UL << PAGE_SHIFT)
-#else
-#define PAGE_SIZE (1 << PAGE_SHIFT)
-#endif
+#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#ifndef __ASSEMBLY__
new file mode 100644
@@ -0,0 +1,11 @@
+#ifndef _CONST_H_
+#define _CONST_H_
+#ifdef __ASSEMBLY__
+#define _AC(X,Y) X
+#define _AT(T,X) X
+#else
+#define __AC(X,Y) (X##Y)
+#define _AC(X,Y) __AC(X,Y)
+#define _AT(T,X) ((T)(X))
+#endif
+#endif
And apply it to /lib files. This prepares for the import of kernel headers that make use of the const.h macros. Signed-off-by: Andrew Jones <drjones@redhat.com> --- lib/asm-generic/page.h | 8 +++----- lib/const.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 lib/const.h