Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279794
b: refs/heads/master
c: c245dcd
h: refs/heads/master
v: v3
  • Loading branch information
Leif Lindholm authored and Russell King committed Dec 13, 2011
1 parent 20f9f29 commit c7ea25c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e7f626db83689f55089717a6d771c57afe1adc1a
refs/heads/master: c245dcd326fb9f8cca4b396796f0d2e54171b5c9
16 changes: 16 additions & 0 deletions trunk/arch/arm/kernel/swp_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/syscalls.h>
#include <linux/perf_event.h>

#include <asm/opcodes.h>
#include <asm/traps.h>
#include <asm/uaccess.h>

Expand Down Expand Up @@ -185,6 +186,21 @@ static int swp_handler(struct pt_regs *regs, unsigned int instr)

perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->ARM_pc);

res = arm_check_condition(instr, regs->ARM_cpsr);
switch (res) {
case ARM_OPCODE_CONDTEST_PASS:
break;
case ARM_OPCODE_CONDTEST_FAIL:
/* Condition failed - return to next instruction */
regs->ARM_pc += 4;
return 0;
case ARM_OPCODE_CONDTEST_UNCOND:
/* If unconditional encoding - not a SWP, undef */
return -EFAULT;
default:
return -EINVAL;
}

if (current->pid != previous_pid) {
pr_debug("\"%s\" (%ld) uses deprecated SWP{B} instruction\n",
current->comm, (unsigned long)current->pid);
Expand Down

0 comments on commit c7ea25c

Please sign in to comment.