direct-io.hg

changeset 5519:dbca2f11731d

bitkeeper revision 1.1721 (42b7bc5cSB_7vlyUCCpWT0qq4GN_xg)

[PATCH] vmxassist-cleanup.patch
Some minor fixups and improved debug output.

Signed-Off-By: Leendert van Doorn <leendert@watson.ibm.com>
author leendert@watson.ibm.com[iap10]
date Tue Jun 21 07:06:04 2005 +0000 (2005-06-21)
parents 649cd37aa1ab
children 7d9339b717d6
files tools/firmware/vmxassist/Makefile tools/firmware/vmxassist/setup.c tools/firmware/vmxassist/vm86.c
line diff
     1.1 --- a/tools/firmware/vmxassist/Makefile	Tue Jun 21 07:02:30 2005 +0000
     1.2 +++ b/tools/firmware/vmxassist/Makefile	Tue Jun 21 07:06:04 2005 +0000
     1.3 @@ -23,9 +23,9 @@ include $(XEN_ROOT)/tools/Rules.mk
     1.4  
     1.5  # The emulator code lives in ROM space
     1.6  TEXTADDR=0x000D0000
     1.7 +
     1.8  DEFINES=-DDEBUG -DTEXTADDR=${TEXTADDR}
     1.9 -XENINC=-I../../../xen/include
    1.10 -#TEXTADDR=0x000E0000
    1.11 +XENINC=-I$(XEN_ROOT)/xen/include
    1.12  #DEFINES=-DDEBUG -DTEST -DTEXTADDR=${TEXTADDR}
    1.13  #XENINC=-I/home/leendert/xen/xeno-unstable.bk/xen/include
    1.14  
     2.1 --- a/tools/firmware/vmxassist/setup.c	Tue Jun 21 07:02:30 2005 +0000
     2.2 +++ b/tools/firmware/vmxassist/setup.c	Tue Jun 21 07:06:04 2005 +0000
     2.3 @@ -21,11 +21,9 @@
     2.4  #include "util.h"
     2.5  #include "machine.h"
     2.6  
     2.7 -#ifndef TEST
     2.8  #if (VMXASSIST_BASE != TEXTADDR)
     2.9  #error VMXAssist base mismatch
    2.10  #endif
    2.11 -#endif
    2.12  
    2.13  #define	NR_PGD		(PGSIZE / sizeof(unsigned))
    2.14  
    2.15 @@ -118,8 +116,8 @@ setup_gdt(void)
    2.16  			      "movl %%eax,%%fs;"
    2.17  			      "movl %%eax,%%gs;"
    2.18  			      "movl %%eax,%%ss" : : "a" (DATA_SELECTOR));
    2.19 -/* XXX 0x10 == CODE_SELECTOR (figure out gnuas) */
    2.20 -	__asm__ __volatile__ ("ljmp $0x10,$1f; 1:");
    2.21 +
    2.22 +	__asm__ __volatile__ ("ljmp %0,$1f; 1:" : : "i" (CODE_SELECTOR));
    2.23  
    2.24  	__asm__ __volatile__ ("ltr %%ax" : : "a" (TSS_SELECTOR));
    2.25  }
     3.1 --- a/tools/firmware/vmxassist/vm86.c	Tue Jun 21 07:02:30 2005 +0000
     3.2 +++ b/tools/firmware/vmxassist/vm86.c	Tue Jun 21 07:06:04 2005 +0000
     3.3 @@ -39,6 +39,13 @@ enum vm86_mode mode;
     3.4  
     3.5  #ifdef DEBUG
     3.6  int traceset = 0;
     3.7 +
     3.8 +char *states[] = {
     3.9 +	"<VM86_REAL>",
    3.10 +	"<VM86_REAL_TO_PROTECTED>",
    3.11 +	"<VM86_PROTECTED_TO_REAL>",
    3.12 +	"<VM86_PROTECTED>"
    3.13 +};
    3.14  #endif /* DEBUG */
    3.15  
    3.16  
    3.17 @@ -596,7 +603,6 @@ set_mode(struct regs *regs, enum vm86_mo
    3.18  {
    3.19  	switch (newmode) {
    3.20  	case VM86_REAL:
    3.21 -		TRACE((regs, 0, "<VM86_REAL>"));
    3.22  		if (mode == VM86_PROTECTED_TO_REAL) {
    3.23  			real_mode(regs);
    3.24  			break;
    3.25 @@ -607,7 +613,6 @@ set_mode(struct regs *regs, enum vm86_mo
    3.26  		break;
    3.27  
    3.28  	case VM86_REAL_TO_PROTECTED:
    3.29 -		TRACE((regs, 0, "<VM86_REAL_TO_PROTECTED>"));
    3.30  		if (mode == VM86_REAL) {
    3.31  			regs->eflags |= EFLAGS_TF;
    3.32  			break;
    3.33 @@ -624,7 +629,6 @@ set_mode(struct regs *regs, enum vm86_mo
    3.34  			panic("unexpected protected-to-real mode transition");
    3.35  
    3.36  	case VM86_PROTECTED:
    3.37 -		TRACE((regs, 0, "<VM86_PROTECTED>"));
    3.38  		if (mode == VM86_REAL_TO_PROTECTED) {
    3.39  			protected_mode(regs);
    3.40  			break;
    3.41 @@ -634,6 +638,7 @@ set_mode(struct regs *regs, enum vm86_mo
    3.42  	}
    3.43  
    3.44  	mode = newmode;
    3.45 +	TRACE((regs, 0, states[mode]));
    3.46  }
    3.47  
    3.48  void