Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Jul 2009 18:46:30 +0000 (11:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Jul 2009 18:46:30 +0000 (11:46 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: LCDC dcache flush for deferred io
  sh: Fix compiler error and include the definition of IS_ERR_VALUE
  sh: re-add LCDC fbdev support to the Migo-R defconfig
  sh: fix se7724 ceu names
  sh: ms7724se: Enable sh_eth in defconfig.
  arch/sh/boards/mach-se/7206/io.c: Remove unnecessary semicolons
  sh: ms7724se: Add sh_eth support
  nommu: provide follow_pfn().
  sh: Kill off unused DEBUG_BOOTMEM symbol.
  perf_counter tools: add cpu_relax()/rmb() definitions for sh.
  sh64: Hook up page fault events for software perf counters.
  sh: Hook up page fault events for software perf counters.
  sh: make set_perf_counter_pending() static inline.
  clocksource: sh_tmu: Make undefined TCOR behaviour less undefined.

1  2 
mm/nommu.c
tools/perf/perf.h

diff --combined mm/nommu.c
@@@ -173,8 -173,8 +173,8 @@@ unsigned int kobjsize(const void *objp
  }
  
  int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
 -                   unsigned long start, int len, int flags,
 -              struct page **pages, struct vm_area_struct **vmas)
 +                   unsigned long start, int nr_pages, int flags,
 +                   struct page **pages, struct vm_area_struct **vmas)
  {
        struct vm_area_struct *vma;
        unsigned long vm_flags;
        vm_flags  = write ? (VM_WRITE | VM_MAYWRITE) : (VM_READ | VM_MAYREAD);
        vm_flags &= force ? (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE);
  
 -      for (i = 0; i < len; i++) {
 +      for (i = 0; i < nr_pages; i++) {
                vma = find_vma(mm, start);
                if (!vma)
                        goto finish_or_fault;
@@@ -224,7 -224,7 +224,7 @@@ finish_or_fault
   * - don't permit access to VMAs that don't support it, such as I/O mappings
   */
  int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
 -      unsigned long start, int len, int write, int force,
 +      unsigned long start, int nr_pages, int write, int force,
        struct page **pages, struct vm_area_struct **vmas)
  {
        int flags = 0;
        if (force)
                flags |= GUP_FLAGS_FORCE;
  
 -      return __get_user_pages(tsk, mm,
 -                              start, len, flags,
 -                              pages, vmas);
 +      return __get_user_pages(tsk, mm, start, nr_pages, flags, pages, vmas);
  }
  EXPORT_SYMBOL(get_user_pages);
  
+ /**
+  * follow_pfn - look up PFN at a user virtual address
+  * @vma: memory mapping
+  * @address: user virtual address
+  * @pfn: location to store found PFN
+  *
+  * Only IO mappings and raw PFN mappings are allowed.
+  *
+  * Returns zero and the pfn at @pfn on success, -ve otherwise.
+  */
+ int follow_pfn(struct vm_area_struct *vma, unsigned long address,
+       unsigned long *pfn)
+ {
+       if (!(vma->vm_flags & (VM_IO | VM_PFNMAP)))
+               return -EINVAL;
+       *pfn = address >> PAGE_SHIFT;
+       return 0;
+ }
+ EXPORT_SYMBOL(follow_pfn);
  DEFINE_RWLOCK(vmlist_lock);
  struct vm_struct *vmlist;
  
diff --combined tools/perf/perf.h
  #define cpu_relax()   asm volatile("" ::: "memory");
  #endif
  
+ #ifdef __sh__
+ #include "../../arch/sh/include/asm/unistd.h"
+ #if defined(__SH4A__) || defined(__SH5__)
+ # define rmb()                asm volatile("synco" ::: "memory")
+ #else
+ # define rmb()                asm volatile("" ::: "memory")
+ #endif
+ #define cpu_relax()   asm volatile("" ::: "memory")
+ #endif
  #include <time.h>
  #include <unistd.h>
  #include <sys/types.h>
  #include <sys/syscall.h>
  
  #include "../../include/linux/perf_counter.h"
 -#include "types.h"
 +#include "util/types.h"
  
  /*
   * prctl(PR_TASK_PERF_COUNTERS_DISABLE) will (cheaply) disable all
@@@ -72,9 -82,10 +82,9 @@@ sys_perf_counter_open(struct perf_count
  #define MAX_COUNTERS                  256
  #define MAX_NR_CPUS                   256
  
 -struct perf_file_header {
 -      u64     version;
 -      u64     sample_type;
 -      u64     data_size;
 +struct ip_callchain {
 +      u64 nr;
 +      u64 ips[0];
  };
  
  #endif