]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sh/kernel/machvec.c
sh: fixup many sparse errors.
[linux-2.6-omap-h63xx.git] / arch / sh / kernel / machvec.c
index 23c5948f0124675862511d4e7fcb995399ce2a86..8bfdd275e94004845cd3f178701dff4a8e9bd5b6 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/string.h>
 #include <asm/machvec.h>
 #include <asm/sections.h>
+#include <asm/setup.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 
@@ -90,6 +91,13 @@ void __init sh_mv_setup(void)
                machvec_size = ((unsigned long)&__machvec_end -
                                (unsigned long)&__machvec_start);
 
+               /*
+                * Sanity check for machvec section alignment. Ensure
+                * __initmv hasn't been misused.
+                */
+               if (machvec_size % sizeof(struct sh_machine_vector))
+                       panic("machvec misaligned, invalid __initmv use?");
+
                /*
                 * If the machvec hasn't been preselected, use the first
                 * vector (usually the only one) from .machvec.init.