linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / sh64 / mm / hugetlbpage.c
index 187cf01..ed6a505 100644 (file)
@@ -8,6 +8,7 @@
  * Copyright (C) 2002, 2003 David S. Miller (davem@redhat.com)
  */
 
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
@@ -83,6 +84,18 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
        return entry;
 }
 
+/*
+ * This function checks for proper alignment of input addr and len parameters.
+ */
+int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
+{
+       if (len & ~HPAGE_MASK)
+               return -EINVAL;
+       if (addr & ~HPAGE_MASK)
+               return -EINVAL;
+       return 0;
+}
+
 struct page *follow_huge_addr(struct mm_struct *mm,
                              unsigned long address, int write)
 {