Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
kprobes-test-arm.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include "kprobes-test.h"

Go to the source code of this file.

Macros

#define TEST_ISA   "32"
 
#define TEST_ARM_TO_THUMB_INTERWORK_R(code1, reg, val, code2)
 
#define TEST_ARM_TO_THUMB_INTERWORK_P(code1, reg, val, code2)
 
#define _DATA_PROCESSING_DNM(op, s, val)
 
#define DATA_PROCESSING_DNM(op, val)
 
#define DATA_PROCESSING_NM(op, val)
 
#define _DATA_PROCESSING_DM(op, s, val)
 
#define DATA_PROCESSING_DM(op, val)
 
#define LOAD_STORE(byte)
 
#define TEST_COPROCESSOR(code)   TEST_UNSUPPORTED(code)
 
#define COPROCESSOR_INSTRUCTIONS_ST_LD(two, cc)
 
#define COPROCESSOR_INSTRUCTIONS_MC_MR(two, cc)
 

Functions

void kprobe_arm_test_cases (void)
 

Macro Definition Documentation

#define _DATA_PROCESSING_DM (   op,
  s,
  val 
)
Value:
TEST_R( op "eq" s " r0, r",1, val, "") \
TEST_R( op "ne" s " r1, r",1, val, ", lsl #3") \
TEST_R( op "cs" s " r2, r",3, val, ", lsr #4") \
TEST_R( op "cc" s " r3, r",3, val, ", asr #5") \
TEST_R( op "mi" s " r4, r",5, N(val),", asr #6") \
TEST_R( op "pl" s " r5, r",5, val, ", ror #7") \
TEST_R( op "vs" s " r6, r",10,val, ", rrx") \
TEST( op "vs" s " r7, pc, lsl #3") \
TEST( op "vs" s " r7, sp, lsr #4") \
TEST_RR( op "vc" s " r8, r",7, val, ", lsl r",0, 3,"") \
TEST_RR( op "hi" s " r9, r",9, val, ", lsr r",7, 4,"") \
TEST_RR( op "ls" s " r10, r",9, val, ", asr r",7, 5,"") \
TEST_RR( op "ge" s " r11, r",11,N(val),", asr r",7, 6,"") \
TEST_RR( op "lt" s " r12, r",11,val, ", ror r",14,7,"") \
TEST_R( op "gt" s " r14, r13" ", lsl r",14,8,"") \
TEST_R( op "le" s " r14, pc" ", lsl r",14,8,"") \
TEST( op "eq" s " r0, #0xf5") \
TEST( op "ne" s " r11, #0xf5000000") \
TEST( op s " r7, #0x000af000") \
TEST( op s " r4, #0x00005a00")
#define _DATA_PROCESSING_DNM (   op,
  s,
  val 
)
Value:
TEST_RR( op "eq" s " r0, r",1, VAL1,", r",2, val, "") \
TEST_RR( op "ne" s " r1, r",1, VAL1,", r",2, val, ", lsl #3") \
TEST_RR( op "cs" s " r2, r",3, VAL1,", r",2, val, ", lsr #4") \
TEST_RR( op "cc" s " r3, r",3, VAL1,", r",2, val, ", asr #5") \
TEST_RR( op "mi" s " r4, r",5, VAL1,", r",2, N(val),", asr #6") \
TEST_RR( op "pl" s " r5, r",5, VAL1,", r",2, val, ", ror #7") \
TEST_RR( op "vs" s " r6, r",7, VAL1,", r",2, val, ", rrx") \
TEST_R( op "vc" s " r6, r",7, VAL1,", pc, lsl #3") \
TEST_R( op "vc" s " r6, r",7, VAL1,", sp, lsr #4") \
TEST_R( op "vc" s " r6, pc, r",7, VAL1,", asr #5") \
TEST_R( op "vc" s " r6, sp, r",7, VAL1,", ror #6") \
TEST_RRR( op "hi" s " r8, r",9, VAL1,", r",14,val, ", lsl r",0, 3,"")\
TEST_RRR( op "ls" s " r9, r",9, VAL1,", r",14,val, ", lsr r",7, 4,"")\
TEST_RRR( op "ge" s " r10, r",11,VAL1,", r",14,val, ", asr r",7, 5,"")\
TEST_RRR( op "lt" s " r11, r",11,VAL1,", r",14,N(val),", asr r",7, 6,"")\
TEST_RR( op "gt" s " r12, r13" ", r",14,val, ", ror r",14,7,"")\
TEST_RR( op "le" s " r14, r",0, val, ", r13" ", lsl r",14,8,"")\
TEST_RR( op s " r12, pc" ", r",14,val, ", ror r",14,7,"")\
TEST_RR( op s " r14, r",0, val, ", pc" ", lsl r",14,8,"")\
TEST_R( op "eq" s " r0, r",11,VAL1,", #0xf5") \
TEST_R( op "ne" s " r11, r",0, VAL1,", #0xf5000000") \
TEST_R( op s " r7, r",8, VAL2,", #0x000af000") \
TEST( op s " r4, pc" ", #0x00005a00")
#define COPROCESSOR_INSTRUCTIONS_MC_MR (   two,
  cc 
)
Value:
\
TEST_COPROCESSOR( "mcrr"two" 0, 15, r0, r14, cr0") \
TEST_COPROCESSOR( "mcrr"two" 15, 0, r14, r0, cr15") \
TEST_UNSUPPORTED(".word 0x"cc"c4f00f0 @ mcrr"two" 0, 15, r0, r15, cr0") \
TEST_UNSUPPORTED(".word 0x"cc"c40ff0f @ mcrr"two" 15, 0, r15, r0, cr15") \
TEST_COPROCESSOR( "mrrc"two" 0, 15, r0, r14, cr0") \
TEST_COPROCESSOR( "mrrc"two" 15, 0, r14, r0, cr15") \
TEST_UNSUPPORTED(".word 0x"cc"c5f00f0 @ mrrc"two" 0, 15, r0, r15, cr0") \
TEST_UNSUPPORTED(".word 0x"cc"c50ff0f @ mrrc"two" 15, 0, r15, r0, cr15") \
TEST_COPROCESSOR( "cdp"two" 15, 15, cr15, cr15, cr15, 7") \
TEST_COPROCESSOR( "cdp"two" 0, 0, cr0, cr0, cr0, 0") \
TEST_COPROCESSOR( "mcr"two" 15, 7, r15, cr15, cr15, 7") \
TEST_COPROCESSOR( "mcr"two" 0, 0, r0, cr0, cr0, 0") \
TEST_COPROCESSOR( "mrc"two" 15, 7, r15, cr15, cr15, 7") \
TEST_COPROCESSOR( "mrc"two" 0, 0, r0, cr0, cr0, 0")
#define COPROCESSOR_INSTRUCTIONS_ST_LD (   two,
  cc 
)
#define DATA_PROCESSING_DM (   op,
  val 
)
Value:
_DATA_PROCESSING_DM(op,"s",val)
#define DATA_PROCESSING_DNM (   op,
  val 
)
Value:
_DATA_PROCESSING_DNM(op,"s",val)
#define DATA_PROCESSING_NM (   op,
  val 
)
Value:
TEST_RR( op "ne r",1, VAL1,", r",2, val, "") \
TEST_RR( op "eq r",1, VAL1,", r",2, val, ", lsl #3") \
TEST_RR( op "cc r",3, VAL1,", r",2, val, ", lsr #4") \
TEST_RR( op "cs r",3, VAL1,", r",2, val, ", asr #5") \
TEST_RR( op "pl r",5, VAL1,", r",2, N(val),", asr #6") \
TEST_RR( op "mi r",5, VAL1,", r",2, val, ", ror #7") \
TEST_RR( op "vc r",7, VAL1,", r",2, val, ", rrx") \
TEST_R ( op "vs r",7, VAL1,", pc, lsl #3") \
TEST_R ( op "vs r",7, VAL1,", sp, lsr #4") \
TEST_R( op "vs pc, r",7, VAL1,", asr #5") \
TEST_R( op "vs sp, r",7, VAL1,", ror #6") \
TEST_RRR( op "ls r",9, VAL1,", r",14,val, ", lsl r",0, 3,"") \
TEST_RRR( op "hi r",9, VAL1,", r",14,val, ", lsr r",7, 4,"") \
TEST_RRR( op "lt r",11,VAL1,", r",14,val, ", asr r",7, 5,"") \
TEST_RRR( op "ge r",11,VAL1,", r",14,N(val),", asr r",7, 6,"") \
TEST_RR( op "le r13" ", r",14,val, ", ror r",14,7,"") \
TEST_RR( op "gt r",0, val, ", r13" ", lsl r",14,8,"") \
TEST_RR( op " pc" ", r",14,val, ", ror r",14,7,"") \
TEST_RR( op " r",0, val, ", pc" ", lsl r",14,8,"") \
TEST_R( op "eq r",11,VAL1,", #0xf5") \
TEST_R( op "ne r",0, VAL1,", #0xf5000000") \
TEST_R( op " r",8, VAL2,", #0x000af000")
#define LOAD_STORE (   byte)
#define TEST_ARM_TO_THUMB_INTERWORK_P (   code1,
  reg,
  val,
  code2 
)
Value:
TESTCASE_START(code1 #reg code2) \
TEST_ARG_PTR(reg, val) \
TEST_ARG_REG(14, 99f) \
TEST_ARG_MEM(15, 3f+1) \
TEST_ARG_END("") \
"50: nop \n\t" \
"1: "code1 #reg code2" \n\t" \
" bx lr \n\t" \
".thumb \n\t" \
"3: adr lr, 2f \n\t" \
" bx lr \n\t" \
".arm \n\t" \
"2: nop \n\t" \
TESTCASE_END

Definition at line 34 of file kprobes-test-arm.c.

#define TEST_ARM_TO_THUMB_INTERWORK_R (   code1,
  reg,
  val,
  code2 
)
Value:
TESTCASE_START(code1 #reg code2) \
TEST_ARG_REG(reg, val) \
TEST_ARG_REG(14, 99f) \
TEST_ARG_END("") \
"50: nop \n\t" \
"1: "code1 #reg code2" \n\t" \
" bx lr \n\t" \
".thumb \n\t" \
"3: adr lr, 2f \n\t" \
" bx lr \n\t" \
".arm \n\t" \
"2: nop \n\t" \
TESTCASE_END

Definition at line 19 of file kprobes-test-arm.c.

#define TEST_COPROCESSOR (   code)    TEST_UNSUPPORTED(code)
#define TEST_ISA   "32"

Definition at line 17 of file kprobes-test-arm.c.

Function Documentation

void kprobe_arm_test_cases ( void  )

Definition at line 51 of file kprobes-test-arm.c.