]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 2 Nov 2008 18:16:44 +0000 (10:16 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 2 Nov 2008 18:16:44 +0000 (10:16 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: Fix PCI resource mapping on sparc64
  sparc64: Kill annoying warning when building compat_binfmt_elf.o
  sparc32: kernel/trace/trace.c wants DIE_OOPS
  sparc64: Fix __copy_{to,from}_user_inatomic defines.

arch/sparc/include/asm/processor_64.h
arch/sparc/include/asm/uaccess_64.h
arch/sparc64/kernel/pci.c

index 137a6bd72fc805f9ddfd4f4a12acd3fdf7199c78..59fcebb8f4405917ef60858251c5f81fd11c6b35 100644 (file)
 #define VPTE_SIZE      (1 << (VA_BITS - PAGE_SHIFT + 3))
 #endif
 
-#define TASK_SIZE      ((unsigned long)-VPTE_SIZE)
 #define TASK_SIZE_OF(tsk) \
        (test_tsk_thread_flag(tsk,TIF_32BIT) ? \
-        (1UL << 32UL) : TASK_SIZE)
+        (1UL << 32UL) : ((unsigned long)-VPTE_SIZE))
+#define TASK_SIZE      TASK_SIZE_OF(current)
 #ifdef __KERNEL__
 
 #define STACK_TOP32    ((1UL << 32UL) - PAGE_SIZE)
index 296ef30e05c80d4f89b0e2dea8cc806940a58bb8..c64e767a3e4b3821fd906a3132db4cdc579d8f30 100644 (file)
@@ -265,8 +265,8 @@ extern long __strnlen_user(const char __user *, long len);
 
 #define strlen_user __strlen_user
 #define strnlen_user __strnlen_user
-#define __copy_to_user_inatomic __copy_to_user
-#define __copy_from_user_inatomic __copy_from_user
+#define __copy_to_user_inatomic ___copy_to_user
+#define __copy_from_user_inatomic ___copy_from_user
 
 #endif  /* __ASSEMBLY__ */
 
index 242ac1ccae7d5866b3beac630780cf501cb26f45..bdb7c0a6d83ddaf57cf01d78dde54887c827e982 100644 (file)
@@ -889,6 +889,7 @@ static int __pci_mmap_make_offset(struct pci_dev *pdev,
 
        for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
                struct resource *rp = &pdev->resource[i];
+               resource_size_t aligned_end;
 
                /* Active? */
                if (!rp->flags)
@@ -906,8 +907,15 @@ static int __pci_mmap_make_offset(struct pci_dev *pdev,
                                continue;
                }
 
+               /* Align the resource end to the next page address.
+                * PAGE_SIZE intentionally added instead of (PAGE_SIZE - 1),
+                * because actually we need the address of the next byte
+                * after rp->end.
+                */
+               aligned_end = (rp->end + PAGE_SIZE) & PAGE_MASK;
+
                if ((rp->start <= user_paddr) &&
-                   (user_paddr + user_size) <= (rp->end + 1UL))
+                   (user_paddr + user_size) <= aligned_end)
                        break;
        }