Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
kprobes-test.h File Reference

Go to the source code of this file.

Data Structures

struct  test_arg
 
struct  test_arg_regptr
 
struct  test_arg_mem
 
struct  test_arg_end
 

Macros

#define VERBOSE   0 /* Set to '1' for more logging of test cases */
 
#define NORMAL_ISA   "32"
 
#define TEST_FLAG_NO_ITBLOCK   (1<<0)
 
#define TEST_FLAG_FULL_ITBLOCK   (1<<1)
 
#define TEST_FLAG_NARROW_INSTR   (1<<2)
 
#define TEST_MEMORY_SIZE   256
 
#define ARG_TYPE_END   0
 
#define ARG_TYPE_REG   1
 
#define ARG_TYPE_PTR   2
 
#define ARG_TYPE_MEM   3
 
#define ARG_FLAG_UNSUPPORTED   0x01
 
#define ARG_FLAG_SUPPORTED   0x02
 
#define ARG_FLAG_THUMB   0x10 /* Must be 16 so TEST_ISA can be used */
 
#define ARG_FLAG_ARM   0x20 /* Must be 32 so TEST_ISA can be used */
 
#define verbose(fmt,...)
 
#define TEST_GROUP(title)
 
#define TESTCASE_START(title)
 
#define TEST_ARG_REG(reg, val)
 
#define TEST_ARG_PTR(reg, val)
 
#define TEST_ARG_MEM(index, val)
 
#define TEST_ARG_END(flags)
 
#define TEST_INSTRUCTION(instruction)
 
#define TEST_BRANCH_F(instruction)
 
#define TEST_BRANCH_B(instruction)
 
#define TEST_BRANCH_FX(instruction, codex)
 
#define TEST_BRANCH_BX(instruction, codex)
 
#define TESTCASE_END
 
#define TEST(code)
 
#define TEST_UNSUPPORTED(code)
 
#define TEST_SUPPORTED(code)
 
#define TEST_R(code1, reg, val, code2)
 
#define TEST_RR(code1, reg1, val1, code2, reg2, val2, code3)
 
#define TEST_RRR(code1, reg1, val1, code2, reg2, val2, code3, reg3, val3, code4)
 
#define TEST_RRRR(code1, reg1, val1, code2, reg2, val2, code3, reg3, val3, code4, reg4, val4)
 
#define TEST_P(code1, reg1, val1, code2)
 
#define TEST_PR(code1, reg1, val1, code2, reg2, val2, code3)
 
#define TEST_RP(code1, reg1, val1, code2, reg2, val2, code3)
 
#define TEST_PRR(code1, reg1, val1, code2, reg2, val2, code3, reg3, val3, code4)
 
#define TEST_RPR(code1, reg1, val1, code2, reg2, val2, code3, reg3, val3, code4)
 
#define TEST_RRP(code1, reg1, val1, code2, reg2, val2, code3, reg3, val3, code4)
 
#define TEST_BF_P(code1, reg1, val1, code2)
 
#define TEST_BF(code)
 
#define TEST_BB(code)
 
#define TEST_BF_R(code1, reg, val, code2)
 
#define TEST_BB_R(code1, reg, val, code2)
 
#define TEST_BF_RR(code1, reg1, val1, code2, reg2, val2, code3)
 
#define TEST_BF_X(code, codex)
 
#define TEST_BB_X(code, codex)
 
#define TEST_BF_RX(code1, reg, val, code2, codex)
 
#define TEST_X(code, codex)
 
#define TEST_RX(code1, reg, val, code2, codex)
 
#define TEST_RRX(code1, reg1, val1, code2, reg2, val2, code3, codex)
 
#define TWICE(x)   x x
 
#define SPACE_0x8   TWICE(".space 4\n\t")
 
#define SPACE_0x10   TWICE(SPACE_0x8)
 
#define SPACE_0x20   TWICE(SPACE_0x10)
 
#define SPACE_0x40   TWICE(SPACE_0x20)
 
#define SPACE_0x80   TWICE(SPACE_0x40)
 
#define SPACE_0x100   TWICE(SPACE_0x80)
 
#define SPACE_0x200   TWICE(SPACE_0x100)
 
#define SPACE_0x400   TWICE(SPACE_0x200)
 
#define SPACE_0x800   TWICE(SPACE_0x400)
 
#define SPACE_0x1000   TWICE(SPACE_0x800)
 
#define N(val)   (val ^ 0xffffffff)
 
#define VAL1   0x12345678
 
#define VAL2   N(VAL1)
 
#define VAL3   0xa5f801
 
#define VAL4   N(VAL3)
 
#define VALM   0x456789ab
 
#define VALR   0xdeaddead
 
#define HH1   0x0123fecb
 
#define HH2   0xa9874567
 

Functions

void kprobe_arm_test_cases (void)
 

Variables

int kprobe_test_flags
 
int kprobe_test_cc_position
 

Macro Definition Documentation

#define ARG_FLAG_ARM   0x20 /* Must be 32 so TEST_ISA can be used */

Definition at line 56 of file kprobes-test.h.

#define ARG_FLAG_SUPPORTED   0x02

Definition at line 54 of file kprobes-test.h.

#define ARG_FLAG_THUMB   0x10 /* Must be 16 so TEST_ISA can be used */

Definition at line 55 of file kprobes-test.h.

#define ARG_FLAG_UNSUPPORTED   0x01

Definition at line 53 of file kprobes-test.h.

#define ARG_TYPE_END   0

Definition at line 48 of file kprobes-test.h.

#define ARG_TYPE_MEM   3

Definition at line 51 of file kprobes-test.h.

#define ARG_TYPE_PTR   2

Definition at line 50 of file kprobes-test.h.

#define ARG_TYPE_REG   1

Definition at line 49 of file kprobes-test.h.

#define HH1   0x0123fecb

Definition at line 423 of file kprobes-test.h.

#define HH2   0xa9874567

Definition at line 424 of file kprobes-test.h.

#define N (   val)    (val ^ 0xffffffff)

Definition at line 416 of file kprobes-test.h.

#define NORMAL_ISA   "32"

Definition at line 16 of file kprobes-test.h.

#define SPACE_0x10   TWICE(SPACE_0x8)

Definition at line 404 of file kprobes-test.h.

#define SPACE_0x100   TWICE(SPACE_0x80)

Definition at line 408 of file kprobes-test.h.

#define SPACE_0x1000   TWICE(SPACE_0x800)

Definition at line 412 of file kprobes-test.h.

#define SPACE_0x20   TWICE(SPACE_0x10)

Definition at line 405 of file kprobes-test.h.

#define SPACE_0x200   TWICE(SPACE_0x100)

Definition at line 409 of file kprobes-test.h.

#define SPACE_0x40   TWICE(SPACE_0x20)

Definition at line 406 of file kprobes-test.h.

#define SPACE_0x400   TWICE(SPACE_0x200)

Definition at line 410 of file kprobes-test.h.

#define SPACE_0x8   TWICE(".space 4\n\t")

Definition at line 403 of file kprobes-test.h.

#define SPACE_0x80   TWICE(SPACE_0x40)

Definition at line 407 of file kprobes-test.h.

#define SPACE_0x800   TWICE(SPACE_0x400)

Definition at line 411 of file kprobes-test.h.

#define TEST (   code)
Value:
TEST_ARG_END("") \
TEST_INSTRUCTION(code) \
TESTCASE_END

Definition at line 206 of file kprobes-test.h.

#define TEST_ARG_END (   flags)
Value:
".byte "__stringify(ARG_TYPE_END)" \n\t" \
".byte "TEST_ISA flags" \n\t" \
".short 50f-0f \n\t" \
".short 2f-0f \n\t" \
".short 99f-0f \n\t" \
".code "TEST_ISA" \n\t" \
"0: \n\t"

Definition at line 138 of file kprobes-test.h.

#define TEST_ARG_MEM (   index,
  val 
)
Value:
".byte "__stringify(ARG_TYPE_MEM)" \n\t" \
".byte "#index" \n\t" \
".short 0 \n\t" \
".word "#val" \n\t"

Definition at line 132 of file kprobes-test.h.

#define TEST_ARG_PTR (   reg,
  val 
)
Value:
".byte "__stringify(ARG_TYPE_PTR)" \n\t" \
".byte "#reg" \n\t" \
".short 0 \n\t" \
".word "#val" \n\t"

Definition at line 126 of file kprobes-test.h.

#define TEST_ARG_REG (   reg,
  val 
)
Value:
".byte "__stringify(ARG_TYPE_REG)" \n\t" \
".byte "#reg" \n\t" \
".short 0 \n\t" \
".word "#val" \n\t"

Definition at line 120 of file kprobes-test.h.

#define TEST_BB (   code)
Value:
TEST_ARG_END("") \
TEST_BRANCH_B(code) \
TESTCASE_END

Definition at line 321 of file kprobes-test.h.

#define TEST_BB_R (   code1,
  reg,
  val,
  code2 
)
Value:
TESTCASE_START(code1 #reg code2) \
TEST_ARG_REG(reg, val) \
TEST_ARG_END("") \
TEST_BRANCH_B(code1 #reg code2) \
TESTCASE_END

Definition at line 334 of file kprobes-test.h.

#define TEST_BB_X (   code,
  codex 
)
Value:
TEST_ARG_END("") \
TEST_BRANCH_BX(code, codex) \
TESTCASE_END

Definition at line 355 of file kprobes-test.h.

#define TEST_BF (   code)
Value:
TEST_ARG_END("") \
TEST_BRANCH_F(code) \
TESTCASE_END

Definition at line 315 of file kprobes-test.h.

#define TEST_BF_P (   code1,
  reg1,
  val1,
  code2 
)
Value:
TESTCASE_START(code1 #reg1 code2) \
TEST_ARG_PTR(reg1, val1) \
TEST_ARG_END("") \
TEST_BRANCH_F(code1 #reg1 code2) \
TESTCASE_END

Definition at line 308 of file kprobes-test.h.

#define TEST_BF_R (   code1,
  reg,
  val,
  code2 
)
Value:
TESTCASE_START(code1 #reg code2) \
TEST_ARG_REG(reg, val) \
TEST_ARG_END("") \
TEST_BRANCH_F(code1 #reg code2) \
TESTCASE_END

Definition at line 327 of file kprobes-test.h.

#define TEST_BF_RR (   code1,
  reg1,
  val1,
  code2,
  reg2,
  val2,
  code3 
)
Value:
TESTCASE_START(code1 #reg1 code2 #reg2 code3) \
TEST_ARG_REG(reg1, val1) \
TEST_ARG_REG(reg2, val2) \
TEST_ARG_END("") \
TEST_BRANCH_F(code1 #reg1 code2 #reg2 code3) \
TESTCASE_END

Definition at line 341 of file kprobes-test.h.

#define TEST_BF_RX (   code1,
  reg,
  val,
  code2,
  codex 
)
Value:
TESTCASE_START(code1 #reg code2) \
TEST_ARG_REG(reg, val) \
TEST_ARG_END("") \
TEST_BRANCH_FX(code1 #reg code2, codex) \
TESTCASE_END

Definition at line 361 of file kprobes-test.h.

#define TEST_BF_X (   code,
  codex 
)
Value:
TEST_ARG_END("") \
TEST_BRANCH_FX(code, codex) \
TESTCASE_END

Definition at line 349 of file kprobes-test.h.

#define TEST_BRANCH_B (   instruction)
Value:
" b 50f \n\t" \
" b 99f \n\t" \
"2: nop \n\t" \
" b 99f \n\t" \
TEST_INSTRUCTION(instruction)

Definition at line 157 of file kprobes-test.h.

#define TEST_BRANCH_BX (   instruction,
  codex 
)
Value:
" b 50f \n\t" \
" b 99f \n\t" \
"2: nop \n\t" \
" b 99f \n\t" \
codex" \n\t" \
TEST_INSTRUCTION(instruction)

Definition at line 171 of file kprobes-test.h.

#define TEST_BRANCH_F (   instruction)
Value:
" b 99f \n\t" \
"2: nop \n\t"

Definition at line 152 of file kprobes-test.h.

#define TEST_BRANCH_FX (   instruction,
  codex 
)
Value:
" b 99f \n\t" \
codex" \n\t" \
" b 99f \n\t" \
"2: nop \n\t"

Definition at line 164 of file kprobes-test.h.

#define TEST_FLAG_FULL_ITBLOCK   (1<<1)

Definition at line 22 of file kprobes-test.h.

#define TEST_FLAG_NARROW_INSTR   (1<<2)

Definition at line 23 of file kprobes-test.h.

#define TEST_FLAG_NO_ITBLOCK   (1<<0)

Definition at line 21 of file kprobes-test.h.

#define TEST_GROUP (   title)
Value:
verbose("\n"); \
verbose(title"\n"); \
verbose("---------------------------------------------------------\n");

Definition at line 106 of file kprobes-test.h.

#define TEST_INSTRUCTION (   instruction)
Value:
"50: nop \n\t" \
"1: "instruction" \n\t" \
" nop \n\t"

Definition at line 147 of file kprobes-test.h.

#define TEST_MEMORY_SIZE   256

Definition at line 29 of file kprobes-test.h.

#define TEST_P (   code1,
  reg1,
  val1,
  code2 
)
Value:
TESTCASE_START(code1 #reg1 code2) \
TEST_ARG_PTR(reg1, val1) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 #reg1 code2) \
TESTCASE_END

Definition at line 258 of file kprobes-test.h.

#define TEST_PR (   code1,
  reg1,
  val1,
  code2,
  reg2,
  val2,
  code3 
)
Value:
TESTCASE_START(code1 #reg1 code2 #reg2 code3) \
TEST_ARG_PTR(reg1, val1) \
TEST_ARG_REG(reg2, val2) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 #reg1 code2 #reg2 code3) \
TESTCASE_END

Definition at line 265 of file kprobes-test.h.

#define TEST_PRR (   code1,
  reg1,
  val1,
  code2,
  reg2,
  val2,
  code3,
  reg3,
  val3,
  code4 
)
Value:
TESTCASE_START(code1 #reg1 code2 #reg2 code3 #reg3 code4) \
TEST_ARG_PTR(reg1, val1) \
TEST_ARG_REG(reg2, val2) \
TEST_ARG_REG(reg3, val3) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 #reg1 code2 #reg2 code3 #reg3 code4) \
TESTCASE_END

Definition at line 281 of file kprobes-test.h.

#define TEST_R (   code1,
  reg,
  val,
  code2 
)
Value:
TESTCASE_START(code1 #reg code2) \
TEST_ARG_REG(reg, val) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 #reg code2) \
TESTCASE_END

Definition at line 224 of file kprobes-test.h.

#define TEST_RP (   code1,
  reg1,
  val1,
  code2,
  reg2,
  val2,
  code3 
)
Value:
TESTCASE_START(code1 #reg1 code2 #reg2 code3) \
TEST_ARG_REG(reg1, val1) \
TEST_ARG_PTR(reg2, val2) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 #reg1 code2 #reg2 code3) \
TESTCASE_END

Definition at line 273 of file kprobes-test.h.

#define TEST_RPR (   code1,
  reg1,
  val1,
  code2,
  reg2,
  val2,
  code3,
  reg3,
  val3,
  code4 
)
Value:
TESTCASE_START(code1 #reg1 code2 #reg2 code3 #reg3 code4) \
TEST_ARG_REG(reg1, val1) \
TEST_ARG_PTR(reg2, val2) \
TEST_ARG_REG(reg3, val3) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 #reg1 code2 #reg2 code3 #reg3 code4) \
TESTCASE_END

Definition at line 290 of file kprobes-test.h.

#define TEST_RR (   code1,
  reg1,
  val1,
  code2,
  reg2,
  val2,
  code3 
)
Value:
TESTCASE_START(code1 #reg1 code2 #reg2 code3) \
TEST_ARG_REG(reg1, val1) \
TEST_ARG_REG(reg2, val2) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 #reg1 code2 #reg2 code3) \
TESTCASE_END

Definition at line 231 of file kprobes-test.h.

#define TEST_RRP (   code1,
  reg1,
  val1,
  code2,
  reg2,
  val2,
  code3,
  reg3,
  val3,
  code4 
)
Value:
TESTCASE_START(code1 #reg1 code2 #reg2 code3 #reg3 code4) \
TEST_ARG_REG(reg1, val1) \
TEST_ARG_REG(reg2, val2) \
TEST_ARG_PTR(reg3, val3) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 #reg1 code2 #reg2 code3 #reg3 code4) \
TESTCASE_END

Definition at line 299 of file kprobes-test.h.

#define TEST_RRR (   code1,
  reg1,
  val1,
  code2,
  reg2,
  val2,
  code3,
  reg3,
  val3,
  code4 
)
Value:
TESTCASE_START(code1 #reg1 code2 #reg2 code3 #reg3 code4) \
TEST_ARG_REG(reg1, val1) \
TEST_ARG_REG(reg2, val2) \
TEST_ARG_REG(reg3, val3) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 #reg1 code2 #reg2 code3 #reg3 code4) \
TESTCASE_END

Definition at line 239 of file kprobes-test.h.

#define TEST_RRRR (   code1,
  reg1,
  val1,
  code2,
  reg2,
  val2,
  code3,
  reg3,
  val3,
  code4,
  reg4,
  val4 
)
Value:
TESTCASE_START(code1 #reg1 code2 #reg2 code3 #reg3 code4 #reg4) \
TEST_ARG_REG(reg1, val1) \
TEST_ARG_REG(reg2, val2) \
TEST_ARG_REG(reg3, val3) \
TEST_ARG_REG(reg4, val4) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 #reg1 code2 #reg2 code3 #reg3 code4 #reg4) \
TESTCASE_END

Definition at line 248 of file kprobes-test.h.

#define TEST_RRX (   code1,
  reg1,
  val1,
  code2,
  reg2,
  val2,
  code3,
  codex 
)
Value:
TESTCASE_START(code1 #reg1 code2 #reg2 code3) \
TEST_ARG_REG(reg1, val1) \
TEST_ARG_REG(reg2, val2) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 __stringify(reg1) code2 __stringify(reg2) code3) \
" b 99f \n\t" \
" "codex" \n\t" \
TESTCASE_END

Definition at line 385 of file kprobes-test.h.

#define TEST_RX (   code1,
  reg,
  val,
  code2,
  codex 
)
Value:
TESTCASE_START(code1 #reg code2) \
TEST_ARG_REG(reg, val) \
TEST_ARG_END("") \
TEST_INSTRUCTION(code1 __stringify(reg) code2) \
" b 99f \n\t" \
" "codex" \n\t" \
TESTCASE_END

Definition at line 376 of file kprobes-test.h.

#define TEST_SUPPORTED (   code)
Value:
TEST_ARG_END("|"__stringify(ARG_FLAG_SUPPORTED)) \
TEST_INSTRUCTION(code) \
TESTCASE_END

Definition at line 218 of file kprobes-test.h.

#define TEST_UNSUPPORTED (   code)
Value:
TEST_ARG_END("|"__stringify(ARG_FLAG_UNSUPPORTED)) \
TEST_INSTRUCTION(code) \
TESTCASE_END

Definition at line 212 of file kprobes-test.h.

#define TEST_X (   code,
  codex 
)
Value:
TEST_ARG_END("") \
TEST_INSTRUCTION(code) \
" b 99f \n\t" \
" "codex" \n\t" \
TESTCASE_END

Definition at line 368 of file kprobes-test.h.

#define TESTCASE_END
Value:
"2: \n\t" \
"99: \n\t" \
" bl __kprobes_test_case_end_"TEST_ISA" \n\t" \
".code "NORMAL_ISA" \n\t" \
: : \
: "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc" \
);

Definition at line 179 of file kprobes-test.h.

#define TESTCASE_START (   title)
Value:
__asm__ __volatile__ ( \
"bl __kprobes_test_case_start \n\t" \
/* don't use .asciz here as 'title' may be */ \
/* multiple strings to be concatenated. */ \
".ascii "#title" \n\t" \
".byte 0 \n\t" \
".align 2 \n\t"

Definition at line 111 of file kprobes-test.h.

#define TWICE (   x)    x x

Definition at line 402 of file kprobes-test.h.

#define VAL1   0x12345678

Definition at line 417 of file kprobes-test.h.

#define VAL2   N(VAL1)

Definition at line 418 of file kprobes-test.h.

#define VAL3   0xa5f801

Definition at line 419 of file kprobes-test.h.

#define VAL4   N(VAL3)

Definition at line 420 of file kprobes-test.h.

#define VALM   0x456789ab

Definition at line 421 of file kprobes-test.h.

#define VALR   0xdeaddead

Definition at line 422 of file kprobes-test.h.

#define VERBOSE   0 /* Set to '1' for more logging of test cases */

Definition at line 11 of file kprobes-test.h.

#define verbose (   fmt,
  ... 
)

Definition at line 103 of file kprobes-test.h.

Function Documentation

void kprobe_arm_test_cases ( void  )

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

Variable Documentation

int kprobe_test_cc_position

Definition at line 1016 of file kprobes-test.c.

int kprobe_test_flags

Definition at line 1015 of file kprobes-test.c.