Various cleanups.
Signed-off-by: Christian Limpach <chris@xensource.com>
};
struct gdb_regs {
- long ebx; /* 0 */
- long ecx; /* 4 */
- long edx; /* 8 */
- long esi; /* 12 */
- long edi; /* 16 */
- long ebp; /* 20 */
- long eax; /* 24 */
- int xds; /* 28 */
- int xes; /* 32 */
- int xfs; /* 36 */
- int xgs; /* 40 */
- long orig_eax; /* 44 */
- long eip; /* 48 */
- int xcs; /* 52 */
- long eflags; /* 56 */
- long esp; /* 60 */
- int xss; /* 64 */
+ long ebx; /* 0 */
+ long ecx; /* 4 */
+ long edx; /* 8 */
+ long esi; /* 12 */
+ long edi; /* 16 */
+ long ebp; /* 20 */
+ long eax; /* 24 */
+ int xds; /* 28 */
+ int xes; /* 32 */
+ int xfs; /* 36 */
+ int xgs; /* 40 */
+ long orig_eax; /* 44 */
+ long eip; /* 48 */
+ int xcs; /* 52 */
+ long eflags; /* 56 */
+ long esp; /* 60 */
+ int xss; /* 64 */
};
#define printval(x) printf("%s = %lx\n", #x, (long)x);
#define SET_PT_REGS(pt, xc) \
{ \
-pt.ebx = xc.ebx; \
-pt.ecx = xc.ecx; \
-pt.edx = xc.edx; \
-pt.esi = xc.esi; \
-pt.edi = xc.edi; \
-pt.ebp = xc.ebp; \
-pt.eax = xc.eax; \
-pt.eip = xc.eip; \
-pt.xcs = xc.cs; \
-pt.eflags = xc.eflags; \
-pt.esp = xc.esp; \
-pt.xss = xc.ss; \
-pt.xes = xc.es; \
-pt.xds = xc.ds; \
-pt.xfs = xc.fs; \
-pt.xgs = xc.gs; \
+ pt.ebx = xc.ebx; \
+ pt.ecx = xc.ecx; \
+ pt.edx = xc.edx; \
+ pt.esi = xc.esi; \
+ pt.edi = xc.edi; \
+ pt.ebp = xc.ebp; \
+ pt.eax = xc.eax; \
+ pt.eip = xc.eip; \
+ pt.xcs = xc.cs; \
+ pt.eflags = xc.eflags; \
+ pt.esp = xc.esp; \
+ pt.xss = xc.ss; \
+ pt.xes = xc.es; \
+ pt.xds = xc.ds; \
+ pt.xfs = xc.fs; \
+ pt.xgs = xc.gs; \
}
#define SET_XC_REGS(pt, xc) \
{ \
-xc.ebx = pt->ebx; \
-xc.ecx = pt->ecx; \
-xc.edx = pt->edx; \
-xc.esi = pt->esi; \
-xc.edi = pt->edi; \
-xc.ebp = pt->ebp; \
-xc.eax = pt->eax; \
-xc.eip = pt->eip; \
-xc.cs = pt->xcs; \
-xc.eflags = pt->eflags; \
-xc.esp = pt->esp; \
-xc.ss = pt->xss; \
-xc.es = pt->xes; \
-xc.ds = pt->xds; \
-xc.fs = pt->xfs; \
-xc.gs = pt->xgs; \
+ xc.ebx = pt->ebx; \
+ xc.ecx = pt->ecx; \
+ xc.edx = pt->edx; \
+ xc.esi = pt->esi; \
+ xc.edi = pt->edi; \
+ xc.ebp = pt->ebp; \
+ xc.eax = pt->eax; \
+ xc.eip = pt->eip; \
+ xc.cs = pt->xcs; \
+ xc.eflags = pt->eflags; \
+ xc.esp = pt->esp; \
+ xc.ss = pt->xss; \
+ xc.es = pt->xes; \
+ xc.ds = pt->xds; \
+ xc.fs = pt->xfs; \
+ xc.gs = pt->xgs; \
}
verbose ?= n
debug ?= n
-debugger ?= n
perfc ?= n
trace ?= n
optimize ?= y
+domu_debug ?= n
crash_debug ?= n
# Currently supported architectures: x86_32, x86_64
CFLAGS += -DVERBOSE
endif
-ifeq ($(debugger),y)
-CFLAGS += -DXEN_UDB
+ifeq ($(domu_debug),y)
+CFLAGS += -DDOMU_DEBUG
endif
ifeq ($(crash_debug),y)
show_registers(regs);
panic("CPU%d FATAL TRAP: vector = 3 (Int3)\n", smp_processor_id());
}
-#ifdef XEN_UDB
+#ifdef DOMU_DEBUG
else if ( KERNEL_MODE(ed, regs) && ed->domain->id != 0 )
{
if ( !test_and_set_bit(EDF_CTRLPAUSE, &ed->ed_flags) ) {
return 0;
}
-#endif /* XEN_UDB */
+#endif /* DOMU_DEBUG */
ti = current->arch.traps + 3;
tb->flags = TBF_EXCEPTION;
tb->cs = ti->cs;
*/
goto out;
}
-#ifdef XEN_UDB
+#ifdef DOMU_DEBUG
else if ( KERNEL_MODE(ed, regs) && ed->domain->id != 0 )
{
regs->eflags &= ~EF_TF;
goto out;
}
-#endif /* XEN_UDB */
+#endif /* DOMU_DEBUG */
/* Save debug status register where guest OS can peek at it */
ed->arch.debugreg[6] = condition;
unsigned long vcpu = setdomaininfo->exec_domain;
struct exec_domain *ed;
- if ( (vcpu >= MAX_VIRT_CPUS) || ((ed = p->exec_domain[vcpu]) != NULL) )
+ if ( (vcpu >= MAX_VIRT_CPUS) || ((ed = p->exec_domain[vcpu]) == NULL) )
return -EINVAL;
if (test_bit(DF_CONSTRUCTED, &p->d_flags) &&