Add push es instruction test in test harness
PATCH 1/1 Add push es instruction test in test harness
Signed-off-by Mohammed Gamal <[email protected]>
--- kvm/user/test/x86/realmode.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
kvm/user/test/x86/realmode.c +16 -0
@@ -468,6 +468,21 @@ void test_long_jmp()print_serial ("Long JMP Test: FAIL\n" ); } +void test_push_es () +{ +struct regs inregs = {0 }, outregs; + +MK_INSN (push_es,"mov $0x1234, %ax\n\t" +"mov %ax, %es\n\t" +"push %es\n\t" +"movw (%esp), %bx \n\t" ); +exec_in_big_real_mode (&inregs, &outregs, + insn_push_es, + insn_push_es_end - insn_push_es); +if (!regs_equal (&inregs, &outregs,R_AX |R_BX |R_SP ) || outregs.eax !=0x1234 ) +print_serial ("Push ES Test: FAIL\n" ); +} +void test_null (void ) {struct regs inregs = {0 }, outregs;
@@ -492,6 +507,7 @@ void start(void)test_call ();/* long jmp test uses call near so test it after testing call */ test_long_jmp (); +test_push_es ();exit (0 ); }
Signature · 1 line
1.6.0.4
Quoted 16 lines · Mohammed Gamal
Signed-off-by Mohammed Gamal<[email protected]>--- kvm/user/test/x86/realmode.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)kvm/user/test/x86/realmode.c +3
-0@@ -468,6 +468,21 @@ void test_long_jmp()print_serial ("Long JMP Test: FAIL\n" ); } +void test_push_es () +{ +struct regs inregs = {0 }, outregs;
kvm/user/test/x86/realmode.c void test_long_jmp() · line 483
Quoted 10 lines
kvm/user/test/x86/realmode.c +9
-0+ +MK_INSN (push_es,"mov $0x1234, %ax\n\t" +"mov %ax, %es\n\t" +"push %es\n\t" +"movw (%esp), %bx \n\t" ); +exec_in_big_real_mode (&inregs,&outregs, + insn_push_es, + insn_push_es_end - insn_push_es); +if (!regs_equal (&inregs,&outregs,R_AX |R_BX |R_SP ) || outregs.eax !=0x1234 )
You need to check bx here, otherwise the test will always succeed.
kvm/user/test/x86/realmode.c void test_long_jmp()
Quoted 4 lines
kvm/user/test/x86/realmode.c +3
-0+print_serial ("Push ES Test: FAIL\n" ); +} +
error compiling committee.c: too many arguments to function