Commit c3b91807 authored by Gleb Natapov's avatar Gleb Natapov Committed by Avi Kivity
Browse files

Fix exception handling on i386 arch

Pass parameter to exception handler in correct register.

Signed-off-by: default avatarGleb Natapov <>
Signed-off-by: default avatarAvi Kivity <>
parent 97011120
......@@ -111,6 +111,9 @@ struct ex_record {
extern struct ex_record exception_table_start, exception_table_end;
#ifndef __x86_64__
void do_handle_exception(struct ex_regs *regs)
struct ex_record *ex;
......@@ -162,7 +165,11 @@ asm (".pushsection .text \n\t"
"push %"R"di; push %"R"si; push %"R"bp; sub $"S", %"R"sp \n\t"
"push %"R"bx; push %"R"dx; push %"R"cx; push %"R"ax \n\t"
#ifdef __x86_64__
"mov %"R"sp, %"R"di \n\t"
"mov %"R"sp, %"R"ax \n\t"
"call do_handle_exception \n\t"
"pop %"R"ax; pop %"R"cx; pop %"R"dx; pop %"R"bx \n\t"
"add $"S", %"R"sp; pop %"R"bp; pop %"R"si; pop %"R"di \n\t"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment