|  | @@ -335,3 +335,98 @@ struct test_arg_end {
 | 
	
		
			
				|  |  |  	TESTCASE_START(code1 #reg code2)	\
 | 
	
		
			
				|  |  |  	TEST_ARG_REG(reg, val)			\
 | 
	
		
			
				|  |  |  	TEST_ARG_END("")			\
 | 
	
		
			
				|  |  | +	TEST_BRANCH_B(code1 #reg code2)		\
 | 
	
		
			
				|  |  | +	TESTCASE_END
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define TEST_BF_RR(code1, reg1, val1, code2, reg2, val2, code3)	\
 | 
	
		
			
				|  |  | +	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
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define TEST_BF_X(code, codex)			\
 | 
	
		
			
				|  |  | +	TESTCASE_START(code)			\
 | 
	
		
			
				|  |  | +	TEST_ARG_END("")			\
 | 
	
		
			
				|  |  | +	TEST_BRANCH_FX(code, codex)		\
 | 
	
		
			
				|  |  | +	TESTCASE_END
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define TEST_BB_X(code, codex)			\
 | 
	
		
			
				|  |  | +	TESTCASE_START(code)			\
 | 
	
		
			
				|  |  | +	TEST_ARG_END("")			\
 | 
	
		
			
				|  |  | +	TEST_BRANCH_BX(code, codex)		\
 | 
	
		
			
				|  |  | +	TESTCASE_END
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define TEST_BF_RX(code1, reg, val, code2, codex)	\
 | 
	
		
			
				|  |  | +	TESTCASE_START(code1 #reg code2)		\
 | 
	
		
			
				|  |  | +	TEST_ARG_REG(reg, val)				\
 | 
	
		
			
				|  |  | +	TEST_ARG_END("")				\
 | 
	
		
			
				|  |  | +	TEST_BRANCH_FX(code1 #reg code2, codex)		\
 | 
	
		
			
				|  |  | +	TESTCASE_END
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define TEST_X(code, codex)			\
 | 
	
		
			
				|  |  | +	TESTCASE_START(code)			\
 | 
	
		
			
				|  |  | +	TEST_ARG_END("")			\
 | 
	
		
			
				|  |  | +	TEST_INSTRUCTION(code)			\
 | 
	
		
			
				|  |  | +	"	b	99f		\n\t"	\
 | 
	
		
			
				|  |  | +	"	"codex"			\n\t"	\
 | 
	
		
			
				|  |  | +	TESTCASE_END
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define TEST_RX(code1, reg, val, code2, codex)		\
 | 
	
		
			
				|  |  | +	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
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#define TEST_RRX(code1, reg1, val1, code2, reg2, val2, code3, codex)		\
 | 
	
		
			
				|  |  | +	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
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/*
 | 
	
		
			
				|  |  | + * Macros for defining space directives spread over multiple lines.
 | 
	
		
			
				|  |  | + * These are required so the compiler guesses better the length of inline asm
 | 
	
		
			
				|  |  | + * code and will spill the literal pool early enough to avoid generating PC
 | 
	
		
			
				|  |  | + * relative loads with out of range offsets.
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +#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)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* Various values used in test cases... */
 | 
	
		
			
				|  |  | +#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
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +#ifdef CONFIG_THUMB2_KERNEL
 | 
	
		
			
				|  |  | +void kprobe_thumb16_test_cases(void);
 | 
	
		
			
				|  |  | +void kprobe_thumb32_test_cases(void);
 | 
	
		
			
				|  |  | +#else
 | 
	
		
			
				|  |  | +void kprobe_arm_test_cases(void);
 | 
	
		
			
				|  |  | +#endif
 |