X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=misc%2Ftest_vm%2Fsrc%2Fgeekos%2Fint.c;h=4d32039ad9146d51197075926a886ab4036e32af;hp=2c59a5fea091b94aa2b4088526f2c2d7ee60a137;hb=b86b717be870723228190fcc9c8233a511d95073;hpb=bc98195a63d8cb1d109eeaa72f57f468c6c9581e diff --git a/misc/test_vm/src/geekos/int.c b/misc/test_vm/src/geekos/int.c index 2c59a5f..4d32039 100644 --- a/misc/test_vm/src/geekos/int.c +++ b/misc/test_vm/src/geekos/int.c @@ -11,7 +11,8 @@ #include #include #include -#include +#include +#include #include @@ -33,8 +34,7 @@ static void Dummy_Interrupt_Handler(struct Interrupt_State* state) { Begin_IRQ(state); - Print("Unexpected Interrupt! Ignoring!\n"); - SerialPrint("*** Unexpected interrupt! *** Ignoring!\n"); + PrintBoth("*** Unexpected interrupt! *** Ignoring!\n"); Dump_Interrupt_State(state); End_IRQ(state); @@ -42,19 +42,14 @@ static void Dummy_Interrupt_Handler(struct Interrupt_State* state) // STOP(); } -#if 0 + static void Print_Selector(const char* regName, uint_t value) { - Print("%s: index=%d, ti=%d, rpl=%d\n", + PrintBoth("%s: index=%d, ti=%d, rpl=%d\n", regName, value >> 3, (value >> 2) & 1, value & 3); } -#endif -static void SerialPrint_Selector(const char* regName, uint_t value) -{ - SerialPrint("%s: index=%d, ti=%d, rpl=%d\n", - regName, value >> 3, (value >> 2) & 1, value & 3); -} + /* ---------------------------------------------------------------------- * Public functions @@ -100,7 +95,7 @@ void Dump_Interrupt_State(struct Interrupt_State* state) { uint_t errorCode = state->errorCode; - SerialPrint("eax=%08x ebx=%08x ecx=%08x edx=%08x\n" + PrintBoth("eax=%08x ebx=%08x ecx=%08x edx=%08x\n" "esi=%08x edi=%08x ebp=%08x\n" "eip=%08x cs=%08x eflags=%08x\n" "Interrupt number=%d, error code=%d\n" @@ -113,11 +108,11 @@ void Dump_Interrupt_State(struct Interrupt_State* state) ); if (Is_User_Interrupt(state)) { struct User_Interrupt_State *ustate = (struct User_Interrupt_State*) state; - SerialPrint("user esp=%08x, user ss=%08x\n", ustate->espUser, ustate->ssUser); + PrintBoth("user esp=%08x, user ss=%08x\n", ustate->espUser, ustate->ssUser); } - SerialPrint_Selector("cs", state->cs); - SerialPrint_Selector("ds", state->ds); - SerialPrint_Selector("es", state->es); - SerialPrint_Selector("fs", state->fs); - SerialPrint_Selector("gs", state->gs); + Print_Selector("cs", state->cs); + Print_Selector("ds", state->ds); + Print_Selector("es", state->es); + Print_Selector("fs", state->fs); + Print_Selector("gs", state->gs); }