[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [PATCH] vmxassist-cleanup.patch



ChangeSet 1.1721, 2005/06/21 08:06:04+01:00, leendert@xxxxxxxxxxxxxx

        [PATCH] vmxassist-cleanup.patch
        Some minor fixups and improved debug output.
        
        Signed-Off-By: Leendert van Doorn <leendert@xxxxxxxxxxxxxx>



 Makefile |    4 ++--
 setup.c  |    6 ++----
 vm86.c   |   11 ++++++++---
 3 files changed, 12 insertions(+), 9 deletions(-)


diff -Nru a/tools/firmware/vmxassist/Makefile 
b/tools/firmware/vmxassist/Makefile
--- a/tools/firmware/vmxassist/Makefile 2005-06-21 04:04:55 -04:00
+++ b/tools/firmware/vmxassist/Makefile 2005-06-21 04:04:55 -04:00
@@ -23,9 +23,9 @@
 
 # The emulator code lives in ROM space
 TEXTADDR=0x000D0000
+
 DEFINES=-DDEBUG -DTEXTADDR=${TEXTADDR}
-XENINC=-I../../../xen/include
-#TEXTADDR=0x000E0000
+XENINC=-I$(XEN_ROOT)/xen/include
 #DEFINES=-DDEBUG -DTEST -DTEXTADDR=${TEXTADDR}
 #XENINC=-I/home/leendert/xen/xeno-unstable.bk/xen/include
 
diff -Nru a/tools/firmware/vmxassist/setup.c b/tools/firmware/vmxassist/setup.c
--- a/tools/firmware/vmxassist/setup.c  2005-06-21 04:04:55 -04:00
+++ b/tools/firmware/vmxassist/setup.c  2005-06-21 04:04:55 -04:00
@@ -21,11 +21,9 @@
 #include "util.h"
 #include "machine.h"
 
-#ifndef TEST
 #if (VMXASSIST_BASE != TEXTADDR)
 #error VMXAssist base mismatch
 #endif
-#endif
 
 #define        NR_PGD          (PGSIZE / sizeof(unsigned))
 
@@ -118,8 +116,8 @@
                              "movl %%eax,%%fs;"
                              "movl %%eax,%%gs;"
                              "movl %%eax,%%ss" : : "a" (DATA_SELECTOR));
-/* XXX 0x10 == CODE_SELECTOR (figure out gnuas) */
-       __asm__ __volatile__ ("ljmp $0x10,$1f; 1:");
+
+       __asm__ __volatile__ ("ljmp %0,$1f; 1:" : : "i" (CODE_SELECTOR));
 
        __asm__ __volatile__ ("ltr %%ax" : : "a" (TSS_SELECTOR));
 }
diff -Nru a/tools/firmware/vmxassist/vm86.c b/tools/firmware/vmxassist/vm86.c
--- a/tools/firmware/vmxassist/vm86.c   2005-06-21 04:04:55 -04:00
+++ b/tools/firmware/vmxassist/vm86.c   2005-06-21 04:04:55 -04:00
@@ -39,6 +39,13 @@
 
 #ifdef DEBUG
 int traceset = 0;
+
+char *states[] = {
+       "<VM86_REAL>",
+       "<VM86_REAL_TO_PROTECTED>",
+       "<VM86_PROTECTED_TO_REAL>",
+       "<VM86_PROTECTED>"
+};
 #endif /* DEBUG */
 
 
@@ -596,7 +603,6 @@
 {
        switch (newmode) {
        case VM86_REAL:
-               TRACE((regs, 0, "<VM86_REAL>"));
                if (mode == VM86_PROTECTED_TO_REAL) {
                        real_mode(regs);
                        break;
@@ -607,7 +613,6 @@
                break;
 
        case VM86_REAL_TO_PROTECTED:
-               TRACE((regs, 0, "<VM86_REAL_TO_PROTECTED>"));
                if (mode == VM86_REAL) {
                        regs->eflags |= EFLAGS_TF;
                        break;
@@ -624,7 +629,6 @@
                        panic("unexpected protected-to-real mode transition");
 
        case VM86_PROTECTED:
-               TRACE((regs, 0, "<VM86_PROTECTED>"));
                if (mode == VM86_REAL_TO_PROTECTED) {
                        protected_mode(regs);
                        break;
@@ -634,6 +638,7 @@
        }
 
        mode = newmode;
+       TRACE((regs, 0, states[mode]));
 }
 
 void

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.