/* * arch/arm/kernel/kprobes-thumb.c * * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */#include<linux/kernel.h>#include<linux/kprobes.h>#include"kprobes.h"/* * True if current instruction is in an IT block. */#define in_it_block(cpsr) ((cpsr & 0x06000c00) != 0x00000000)/* * Return the condition code to check for the currently executing instruction. * This is in ITSTATE<7:4> which is in CPSR<15:12> but is only valid if * in_it_block returns true. */#define current_cond(cpsr) ((cpsr >> 12) & 0xf)/* * Return the PC value for a probe in thumb code. * This is the address of the probed instruction plus 4. * We subtract one because the address will have bit zero set to indicate * a pointer to thumb code. */staticinlineunsignedlong__kprobesthumb_probe_pc(structkprobe*p){return(unsignedlong)p->addr-1+4;}staticvoid__kprobest32_simulate_table_branch(structkprobe*p,structpt_regs*regs){kprobe_opcode_tinsn=p->opcode;unsignedlongpc=thumb_probe_pc(p);intrn=(insn>>16)&0xf;intrm=insn&0xf;unsignedlongrnv=(rn==15)?pc:regs->uregs[rn];unsignedlongrmv=regs->uregs[<