diff options
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/include/asm/futex.h | 9 | ||||
-rw-r--r-- | arch/ia64/kernel/perfmon.c | 18 |
2 files changed, 9 insertions, 18 deletions
diff --git a/arch/ia64/include/asm/futex.h b/arch/ia64/include/asm/futex.h index 0ab82cc2dc8f..d2bf1fd5e44f 100644 --- a/arch/ia64/include/asm/futex.h +++ b/arch/ia64/include/asm/futex.h | |||
@@ -106,15 +106,16 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, | |||
106 | return -EFAULT; | 106 | return -EFAULT; |
107 | 107 | ||
108 | { | 108 | { |
109 | register unsigned long r8 __asm ("r8") = 0; | 109 | register unsigned long r8 __asm ("r8"); |
110 | unsigned long prev; | 110 | unsigned long prev; |
111 | __asm__ __volatile__( | 111 | __asm__ __volatile__( |
112 | " mf;; \n" | 112 | " mf;; \n" |
113 | " mov ar.ccv=%3;; \n" | 113 | " mov %0=r0 \n" |
114 | "[1:] cmpxchg4.acq %0=[%1],%2,ar.ccv \n" | 114 | " mov ar.ccv=%4;; \n" |
115 | "[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n" | ||
115 | " .xdata4 \"__ex_table\", 1b-., 2f-. \n" | 116 | " .xdata4 \"__ex_table\", 1b-., 2f-. \n" |
116 | "[2:]" | 117 | "[2:]" |
117 | : "=r" (prev) | 118 | : "=r" (r8), "=r" (prev) |
118 | : "r" (uaddr), "r" (newval), | 119 | : "r" (uaddr), "r" (newval), |
119 | "rO" ((long) (unsigned) oldval) | 120 | "rO" ((long) (unsigned) oldval) |
120 | : "memory"); | 121 | : "memory"); |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 9d0fd7d5bb82..f00ba025375d 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -604,12 +604,6 @@ pfm_unprotect_ctx_ctxsw(pfm_context_t *x, unsigned long f) | |||
604 | spin_unlock(&(x)->ctx_lock); | 604 | spin_unlock(&(x)->ctx_lock); |
605 | } | 605 | } |
606 | 606 | ||
607 | static inline unsigned int | ||
608 | pfm_do_munmap(struct mm_struct *mm, unsigned long addr, size_t len, int acct) | ||
609 | { | ||
610 | return do_munmap(mm, addr, len); | ||
611 | } | ||
612 | |||
613 | static inline unsigned long | 607 | static inline unsigned long |
614 | pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags, unsigned long exec) | 608 | pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags, unsigned long exec) |
615 | { | 609 | { |
@@ -1458,8 +1452,9 @@ pfm_unreserve_session(pfm_context_t *ctx, int is_syswide, unsigned int cpu) | |||
1458 | * a PROTECT_CTX() section. | 1452 | * a PROTECT_CTX() section. |
1459 | */ | 1453 | */ |
1460 | static int | 1454 | static int |
1461 | pfm_remove_smpl_mapping(struct task_struct *task, void *vaddr, unsigned long size) | 1455 | pfm_remove_smpl_mapping(void *vaddr, unsigned long size) |
1462 | { | 1456 | { |
1457 | struct task_struct *task = current; | ||
1463 | int r; | 1458 | int r; |
1464 | 1459 | ||
1465 | /* sanity checks */ | 1460 | /* sanity checks */ |
@@ -1473,13 +1468,8 @@ pfm_remove_smpl_mapping(struct task_struct *task, void *vaddr, unsigned long siz | |||
1473 | /* | 1468 | /* |
1474 | * does the actual unmapping | 1469 | * does the actual unmapping |
1475 | */ | 1470 | */ |
1476 | down_write(&task->mm->mmap_sem); | 1471 | r = vm_munmap((unsigned long)vaddr, size); |
1477 | 1472 | ||
1478 | DPRINT(("down_write done smpl_vaddr=%p size=%lu\n", vaddr, size)); | ||
1479 | |||
1480 | r = pfm_do_munmap(task->mm, (unsigned long)vaddr, size, 0); | ||
1481 | |||
1482 | up_write(&task->mm->mmap_sem); | ||
1483 | if (r !=0) { | 1473 | if (r !=0) { |
1484 | printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size); | 1474 | printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size); |
1485 | } | 1475 | } |
@@ -1945,7 +1935,7 @@ pfm_flush(struct file *filp, fl_owner_t id) | |||
1945 | * because some VM function reenables interrupts. | 1935 | * because some VM function reenables interrupts. |
1946 | * | 1936 | * |
1947 | */ | 1937 | */ |
1948 | if (smpl_buf_vaddr) pfm_remove_smpl_mapping(current, smpl_buf_vaddr, smpl_buf_size); | 1938 | if (smpl_buf_vaddr) pfm_remove_smpl_mapping(smpl_buf_vaddr, smpl_buf_size); |
1949 | 1939 | ||
1950 | return 0; | 1940 | return 0; |
1951 | } | 1941 | } |