Index: kernel/generic/include/align.h
===================================================================
--- kernel/generic/include/align.h	(revision af3235d07726dfc8b146c760a25544ea3ac29f9d)
+++ kernel/generic/include/align.h	(revision 1bbc6dc64db723b798344b36c45a156bdd6ccc13)
@@ -39,4 +39,9 @@
 #define KERN_ALIGN_H_
 
+#ifdef __ASSEMBLER__
+#define ALIGN_DOWN(s, a)  ((s) & ~((a) - 1))
+#define ALIGN_UP(s, a)    (((s) + ((a) - 1)) & ~((a) - 1))
+#else
+
 /** Align to the nearest lower address.
  *
@@ -44,5 +49,5 @@
  * @param a Size of alignment, must be a power of 2.
  */
-#define ALIGN_DOWN(s, a)  ((s) & ~((a) - 1))
+#define ALIGN_DOWN(s, a)  ((s) & ~((typeof(s))(a) - 1))
 
 /** Align to the nearest higher address.
@@ -51,5 +56,7 @@
  * @param a Size of alignment, must be a power of 2.
  */
-#define ALIGN_UP(s, a)  (((s) + ((a) - 1)) & ~((a) - 1))
+#define ALIGN_UP(s, a)  (((s) + ((a) - 1)) & ~((typeof(s))(a) - 1))
+
+#endif
 
 /** Check alignment.
