diff options
-rw-r--r-- | xen/Makefile | 2 | ||||
-rw-r--r-- | xen/Rules.mk | 25 | ||||
-rw-r--r-- | xen/arch/i386/Makefile | 5 | ||||
-rw-r--r-- | xen/arch/i386/entry.S | 4 | ||||
-rw-r--r-- | xen/arch/i386/io_apic.c | 2 | ||||
-rw-r--r-- | xen/arch/i386/irq.c | 6 | ||||
-rw-r--r-- | xen/arch/i386/setup.c | 7 | ||||
-rw-r--r-- | xen/arch/i386/smp.c | 2 | ||||
-rw-r--r-- | xen/arch/i386/traps.c | 171 | ||||
-rw-r--r-- | xen/common/Makefile | 15 | ||||
-rw-r--r-- | xen/common/dom0_ops.c | 2 | ||||
-rw-r--r-- | xen/common/domain.c | 16 | ||||
-rw-r--r-- | xen/common/keyhandler.c | 4 | ||||
-rw-r--r-- | xen/common/schedule.c | 3 | ||||
-rw-r--r-- | xen/common/trace.c | 5 | ||||
-rw-r--r-- | xen/drivers/Makefile | 2 | ||||
-rw-r--r-- | xen/drivers/pci/pci.c | 8 | ||||
-rw-r--r-- | xen/include/asm-i386/config.h | 1 | ||||
-rw-r--r-- | xen/include/asm-i386/processor.h | 8 | ||||
-rw-r--r-- | xen/include/asm-x86_64/config.h | 1 | ||||
-rw-r--r-- | xen/include/xen/blkdev.h | 2 | ||||
-rw-r--r-- | xen/include/xen/perfc.h | 6 | ||||
-rw-r--r-- | xen/include/xen/vif.h | 2 |
23 files changed, 163 insertions, 136 deletions
diff --git a/xen/Makefile b/xen/Makefile index 90bd0a8cfc..6ec66b6964 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -37,7 +37,7 @@ clean: delete-links $(TARGET): delete-unfresh-files make-links $(GENERATED_FILES) $(MAKE) -C tools $(MAKE) -C common - if [ "$(nodev)" != "y" ]; then \ + if [ "$(old_drivers)" == "y" ]; then \ $(MAKE) -C net ; \ fi $(MAKE) -C drivers diff --git a/xen/Rules.mk b/xen/Rules.mk index e75a79cbe2..fd2bddfc01 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -1,10 +1,13 @@ + +debug ?= n +debugger ?= n +old_drivers ?= n +perfc ?= n +trace ?= n + COMPILE_ARCH := $(shell uname -m | sed -e s/i.86/i386/) TARGET_ARCH ?= $(COMPILE_ARCH) -nodev ?= n -debug ?= n -trace ?= n - TARGET := $(BASEDIR)/xen HDRS := $(wildcard $(BASEDIR)/include/xen/*.h) HDRS += $(wildcard $(BASEDIR)/include/scsi/*.h) @@ -23,7 +26,7 @@ ALL_OBJS := $(BASEDIR)/common/common.o ALL_OBJS += $(BASEDIR)/drivers/char/driver.o ALL_OBJS += $(BASEDIR)/drivers/acpi/driver.o ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o -ifneq ($(nodev),y) +ifeq ($(old_drivers),y) ALL_OBJS += $(BASEDIR)/net/network.o ALL_OBJS += $(BASEDIR)/drivers/net/driver.o ALL_OBJS += $(BASEDIR)/drivers/block/driver.o @@ -43,12 +46,16 @@ ifneq ($(debug),y) CFLAGS += -DNDEBUG endif -ifeq ($(nperfc),y) -CFLAGS += -DNPERFC +ifeq ($(debugger),y) +CFLAGS += -DXEN_DEBUGGER +endif + +ifeq ($(old_drivers),y) +CFLAGS += -DOLD_DRIVERS endif -ifeq ($(nodev),y) -CFLAGS += -DNO_DEVICES_IN_XEN +ifeq ($(perfc),y) +CFLAGS += -DPERF_COUNTERS endif ifeq ($(trace),y) diff --git a/xen/arch/i386/Makefile b/xen/arch/i386/Makefile index 43b1b0ca05..8257f479ad 100644 --- a/xen/arch/i386/Makefile +++ b/xen/arch/i386/Makefile @@ -1,6 +1,11 @@ include $(BASEDIR)/Rules.mk +ifneq ($(debugger),y) +OBJS := $(subst pdb-linux.o,,$(OBJS)) +OBJS := $(subst pdb-stub.o,,$(OBJS)) +endif + # What happens here? We link monitor object files together, starting # at MONITOR_BASE (a very high address). But bootloader cannot put # things there, so we initially load at LOAD_BASE. A hacky little diff --git a/xen/arch/i386/entry.S b/xen/arch/i386/entry.S index d63f383017..d7600ade07 100644 --- a/xen/arch/i386/entry.S +++ b/xen/arch/i386/entry.S @@ -711,7 +711,7 @@ ENTRY(hypervisor_call_table) .long SYMBOL_NAME(do_set_gdt) .long SYMBOL_NAME(do_stack_switch) .long SYMBOL_NAME(do_set_callbacks) /* 5 */ -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS .long SYMBOL_NAME(do_net_io_op) #else .long SYMBOL_NAME(do_ni_syscall) @@ -719,7 +719,7 @@ ENTRY(hypervisor_call_table) .long SYMBOL_NAME(do_fpu_taskswitch) .long SYMBOL_NAME(do_sched_op) .long SYMBOL_NAME(do_dom0_op) -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS .long SYMBOL_NAME(do_network_op) /* 10 */ .long SYMBOL_NAME(do_block_io_op) #else diff --git a/xen/arch/i386/io_apic.c b/xen/arch/i386/io_apic.c index 7c307922b3..0c9af32961 100644 --- a/xen/arch/i386/io_apic.c +++ b/xen/arch/i386/io_apic.c @@ -212,7 +212,7 @@ static void set_ioapic_affinity (unsigned int irq, unsigned long mask) * In new I/O model, the interrupt is pinned to the CPU of the first * device-driver domain that attaches. Dynamic balancing is pointless. */ -#if defined(CONFIG_SMP) && !defined(NO_DEVICES_IN_XEN) +#if defined(CONFIG_SMP) && defined(OLD_DRIVERS) typedef struct { unsigned int cpu; diff --git a/xen/arch/i386/irq.c b/xen/arch/i386/irq.c index 5b16bb0e63..8224082fc8 100644 --- a/xen/arch/i386/irq.c +++ b/xen/arch/i386/irq.c @@ -481,7 +481,7 @@ asmlinkage unsigned int do_IRQ(struct pt_regs regs) struct irqaction * action; unsigned int status; -#ifndef NPERFC +#ifdef PERF_COUNTERS int cpu = smp_processor_id(); u32 cc_start, cc_end; @@ -553,7 +553,7 @@ asmlinkage unsigned int do_IRQ(struct pt_regs regs) desc->handler->end(irq); spin_unlock(&desc->lock); -#ifndef NPERFC +#ifdef PERF_COUNTERS rdtscl(cc_end); if ( !action || (!(action->flags & SA_NOPROFILE)) ) @@ -564,7 +564,7 @@ asmlinkage unsigned int do_IRQ(struct pt_regs regs) printk("Long interrupt %08x -> %08x\n", cc_start, cc_end); #endif } -#endif /* NPERFC */ +#endif return 1; } diff --git a/xen/arch/i386/setup.c b/xen/arch/i386/setup.c index 1772a7afc4..5219fda9ab 100644 --- a/xen/arch/i386/setup.c +++ b/xen/arch/i386/setup.c @@ -328,7 +328,7 @@ void __init start_of_day(void) extern void timer_bh(void); extern void init_timervecs(void); extern void ac_timer_init(void); -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS extern int setup_network_devices(void); extern void net_init(void); extern void initialize_block_io(void); @@ -415,7 +415,10 @@ void __init start_of_day(void) serial_init_stage2(); initialize_keyboard(); /* setup keyboard (also for debugging) */ + +#ifdef XEN_DEBUGGER initialize_pdb(); /* pervasive debugger */ +#endif if ( !cpu_has_apic ) { @@ -434,7 +437,7 @@ void __init start_of_day(void) pci_init(); #endif do_initcalls(); -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS if ( !setup_network_devices() ) panic("Must have a network device!\n"); net_init(); /* initializes virtual network system. */ diff --git a/xen/arch/i386/smp.c b/xen/arch/i386/smp.c index e79385c278..e3d861e826 100644 --- a/xen/arch/i386/smp.c +++ b/xen/arch/i386/smp.c @@ -222,7 +222,7 @@ asmlinkage void smp_invalidate_interrupt(void) local_flush_tlb(); } -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS int try_flush_tlb_mask(unsigned long mask) { if ( mask & (1 << smp_processor_id()) ) diff --git a/xen/arch/i386/traps.c b/xen/arch/i386/traps.c index d798477a38..9b3b11851a 100644 --- a/xen/arch/i386/traps.c +++ b/xen/arch/i386/traps.c @@ -24,7 +24,7 @@ * Copyright (C) 1991, 1992 Linus Torvalds * * Pentium III FXSR, SSE support - * Gareth Hughes <gareth@valinux.com>, May 2000 + * Gareth Hughes <gareth@valinux.com>, May 2000 */ #include <xen/config.h> @@ -167,7 +167,7 @@ void show_registers(struct pt_regs *regs) regs->xfs & 0xffff, regs->xgs & 0xffff, ss); show_stack(®s->esp); -} +} spinlock_t die_lock = SPIN_LOCK_UNLOCKED; @@ -184,7 +184,7 @@ void die(const char * str, struct pt_regs * regs, long err) static inline void do_trap(int trapnr, char *str, - struct pt_regs *regs, + struct pt_regs *regs, long error_code, int use_error_code) { struct task_struct *p = current; @@ -233,27 +233,30 @@ do_trap(trapnr, str, regs, error_code, 1); \ } DO_ERROR_NOCODE( 0, "divide error", divide_error) -DO_ERROR_NOCODE( 4, "overflow", overflow) -DO_ERROR_NOCODE( 5, "bounds", bounds) -DO_ERROR_NOCODE( 6, "invalid operand", invalid_op) -DO_ERROR_NOCODE( 9, "coprocessor segment overrun", coprocessor_segment_overrun) -DO_ERROR(10, "invalid TSS", invalid_TSS) -DO_ERROR(11, "segment not present", segment_not_present) -DO_ERROR(12, "stack segment", stack_segment) + DO_ERROR_NOCODE( 4, "overflow", overflow) + DO_ERROR_NOCODE( 5, "bounds", bounds) + DO_ERROR_NOCODE( 6, "invalid operand", invalid_op) + DO_ERROR_NOCODE( 9, "coprocessor segment overrun", coprocessor_segment_overrun) + DO_ERROR(10, "invalid TSS", invalid_TSS) + DO_ERROR(11, "segment not present", segment_not_present) + DO_ERROR(12, "stack segment", stack_segment) /* Vector 15 reserved by Intel */ -DO_ERROR_NOCODE(16, "fpu error", coprocessor_error) -DO_ERROR(17, "alignment check", alignment_check) -DO_ERROR_NOCODE(18, "machine check", machine_check) -DO_ERROR_NOCODE(19, "simd error", simd_coprocessor_error) + DO_ERROR_NOCODE(16, "fpu error", coprocessor_error) + DO_ERROR(17, "alignment check", alignment_check) + DO_ERROR_NOCODE(18, "machine check", machine_check) + DO_ERROR_NOCODE(19, "simd error", simd_coprocessor_error) -asmlinkage void do_int3(struct pt_regs *regs, long error_code) + asmlinkage void do_int3(struct pt_regs *regs, long error_code) { struct task_struct *p = current; struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id(); trap_info_t *ti; +#ifdef XEN_DEBUGGER if ( pdb_initialized && pdb_handle_exception(3, regs) == 0 ) return; +#endif + if ( (regs->xcs & 3) != 3 ) { if ( unlikely((regs->xcs & 3) == 0) ) @@ -333,7 +336,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, long error_code) if ( unlikely(p->mm.shadow_mode) && (addr < PAGE_OFFSET) && shadow_fault(addr, error_code) ) - return; /* Returns TRUE if fault was handled. */ + return; /* Returns TRUE if fault was handled. */ if ( unlikely(!(regs->xcs & 3)) ) goto fault_in_hypervisor; @@ -377,14 +380,16 @@ asmlinkage void do_page_fault(struct pt_regs *regs, long error_code) #endif } - if (pdb_page_fault_possible) /* implicit pdb_initialized */ +#ifdef XEN_DEBUGGER + if ( pdb_page_fault_possible ) { pdb_page_fault = 1; - /* make eax & edx valid to complete the instruction */ - regs->eax = (long)&pdb_page_fault_scratch; - regs->edx = (long)&pdb_page_fault_scratch; - return; + /* make eax & edx valid to complete the instruction */ + regs->eax = (long)&pdb_page_fault_scratch; + regs->edx = (long)&pdb_page_fault_scratch; + return; } +#endif show_registers(regs); panic("CPU%d FATAL PAGE FAULT\n" @@ -430,14 +435,15 @@ asmlinkage void do_general_protection(struct pt_regs *regs, long error_code) ti = current->thread.traps + (error_code>>3); if ( TI_GET_DPL(ti) >= (regs->xcs & 3) ) { - unsigned long cr3; - - __asm__ __volatile__ ("movl %%cr3,%0" : "=r" (cr3) : ); - if (pdb_initialized && pdb_ctx.system_call != 0 && - cr3 == pdb_ctx.ptbr) - { - pdb_linux_syscall_enter_bkpt(regs, error_code, ti); - } +#ifdef XEN_DEBUGGER + if ( pdb_initialized && (pdb_ctx.system_call != 0) ) + { + unsigned long cr3; + __asm__ __volatile__ ("movl %%cr3,%0" : "=r" (cr3) : ); + if ( cr3 == pdb_ctx.ptbr ) + pdb_linux_syscall_enter_bkpt(regs, error_code, ti); + } +#endif gtb->flags = GTBF_TRAP_NOCODE; regs->eip += 2; @@ -535,13 +541,41 @@ asmlinkage void math_state_restore(struct pt_regs *regs, long error_code) } } -asmlinkage void do_debug_orig(struct pt_regs *regs, long error_code) +#ifdef XEN_DEBUGGER +asmlinkage void do_pdb_debug(struct pt_regs *regs, long error_code) { unsigned int condition; struct task_struct *tsk = current; struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id(); __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); + if ( (condition & (1 << 14)) != (1 << 14) ) + printk("\nwarning: debug trap w/o BS bit [0x%x]\n\n", condition); + __asm__("movl %0,%%db6" : : "r" (0)); + + if ( pdb_handle_exception(1, regs) != 0 ) + { + tsk->thread.debugreg[6] = condition; + + gtb->flags = GTBF_TRAP_NOCODE; + gtb->cs = tsk->thread.traps[1].cs; + gtb->eip = tsk->thread.traps[1].address; + } +} +#endif + +asmlinkage void do_debug(struct pt_regs *regs, long error_code) +{ + unsigned int condition; + struct task_struct *tsk = current; + struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id(); + +#ifdef XEN_DEBUGGER + if ( pdb_initialized ) + return do_pdb_debug(regs, error_code); +#endif + + __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); /* Mask out spurious debug traps due to lazy DR7 setting */ if ( (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) && @@ -574,37 +608,8 @@ asmlinkage void do_debug_orig(struct pt_regs *regs, long error_code) } -asmlinkage void do_debug(struct pt_regs *regs, long error_code) -{ - unsigned int condition; - struct task_struct *tsk = current; - struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id(); - - /* This handler is broken! Only use it if PDB is enabled. */ - if ( !pdb_initialized ) - { - do_debug_orig(regs, error_code); - return; - } - - __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); - if ( (condition & (1 << 14)) != (1 << 14) ) - printk("\nwarning: debug trap w/o BS bit [0x%x]\n\n", condition); - __asm__("movl %0,%%db6" : : "r" (0)); - - if ( pdb_handle_exception(1, regs) != 0 ) - { - tsk->thread.debugreg[6] = condition; - - gtb->flags = GTBF_TRAP_NOCODE; - gtb->cs = tsk->thread.traps[1].cs; - gtb->eip = tsk->thread.traps[1].address; - } -} - - asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs, - long error_code) + long error_code) { /* nothing */ } @@ -612,13 +617,13 @@ asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs, do { \ int __d0, __d1; \ __asm__ __volatile__ ("movw %%dx,%%ax\n\t" \ - "movw %4,%%dx\n\t" \ - "movl %%eax,%0\n\t" \ - "movl %%edx,%1" \ - :"=m" (*((long *) (gate_addr))), \ - "=m" (*(1+(long *) (gate_addr))), "=&a" (__d0), "=&d" (__d1) \ - :"i" ((short) (0x8000+(dpl<<13)+(type<<8))), \ - "3" ((char *) (addr)),"2" (__HYPERVISOR_CS << 16)); \ + "movw %4,%%dx\n\t" \ + "movl %%eax,%0\n\t" \ + "movl %%edx,%1" \ + :"=m" (*((long *) (gate_addr))), \ + "=m" (*(1+(long *) (gate_addr))), "=&a" (__d0), "=&d" (__d1) \ + :"i" ((short) (0x8000+(dpl<<13)+(type<<8))), \ + "3" ((char *) (addr)),"2" (__HYPERVISOR_CS << 16)); \ } while (0) void set_intr_gate(unsigned int n, void *addr) @@ -638,25 +643,25 @@ static void set_task_gate(unsigned int n, unsigned int sel) } #define _set_seg_desc(gate_addr,type,dpl,base,limit) {\ - *((gate_addr)+1) = ((base) & 0xff000000) | \ - (((base) & 0x00ff0000)>>16) | \ - ((limit) & 0xf0000) | \ - ((dpl)<<13) | \ - (0x00408000) | \ - ((type)<<8); \ - *(gate_addr) = (((base) & 0x0000ffff)<<16) | \ - ((limit) & 0x0ffff); } + *((gate_addr)+1) = ((base) & 0xff000000) | \ + (((base) & 0x00ff0000)>>16) | \ + ((limit) & 0xf0000) | \ + ((dpl)<<13) | \ + (0x00408000) | \ + ((type)<<8); \ + *(gate_addr) = (((base) & 0x0000ffff)<<16) | \ + ((limit) & 0x0ffff); } #define _set_tssldt_desc(n,addr,limit,type) \ __asm__ __volatile__ ("movw %w3,0(%2)\n\t" \ - "movw %%ax,2(%2)\n\t" \ - "rorl $16,%%eax\n\t" \ - "movb %%al,4(%2)\n\t" \ - "movb %4,5(%2)\n\t" \ - "movb $0,6(%2)\n\t" \ - "movb %%ah,7(%2)\n\t" \ - "rorl $16,%%eax" \ - : "=m"(*(n)) : "a" (addr), "r"(n), "ir"(limit), "i"(type)) + "movw %%ax,2(%2)\n\t" \ + "rorl $16,%%eax\n\t" \ + "movb %%al,4(%2)\n\t" \ + "movb %4,5(%2)\n\t" \ + "movb $0,6(%2)\n\t" \ + "movb %%ah,7(%2)\n\t" \ + "rorl $16,%%eax" \ + : "=m"(*(n)) : "a" (addr), "r"(n), "ir"(limit), "i"(type)) void set_tss_desc(unsigned int n, void *addr) { diff --git a/xen/common/Makefile b/xen/common/Makefile index 5edce92487..12454c9aed 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -1,14 +1,23 @@ include $(BASEDIR)/Rules.mk -ifeq ($(nperfc),y) -OBJS := $(subst perfc.o,,$(OBJS)) +ifneq ($(debugger),y) +OBJS := $(subst debug.o,,$(OBJS)) +OBJS := $(subst debug-linux.o,,$(OBJS)) endif -ifeq ($(nodev),y) +ifneq ($(old_drivers),y) OBJS := $(subst network.o,,$(OBJS)) endif +ifneq ($(perfc),y) +OBJS := $(subst perfc.o,,$(OBJS)) +endif + +ifneq ($(trace),y) +OBJS := $(subst trace.o,,$(OBJS)) +endif + default: $(OBJS) $(LD) $(LDARCHFLAGS) -r -o common.o $(OBJS) diff --git a/xen/common/dom0_ops.c b/xen/common/dom0_ops.c index 76d8afd437..39847e58f1 100644 --- a/xen/common/dom0_ops.c +++ b/xen/common/dom0_ops.c @@ -473,6 +473,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op) } break; +#ifdef XEN_DEBUGGER case DOM0_DEBUG: { pdb_do_debug(op); @@ -480,6 +481,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op) ret = 0; } break; +#endif case DOM0_SETTIME: { diff --git a/xen/common/domain.c b/xen/common/domain.c index c152d6532b..6c0dccc8ac 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -299,10 +299,10 @@ struct pfn_info *alloc_domain_page(struct task_struct *p) unsigned long flags, mask, pfn_stamp, cpu_stamp; int i; -#ifdef NO_DEVICES_IN_XEN - ASSERT(!in_irq()); -#else +#ifdef OLD_DRIVERS ASSERT((p == NULL) || !in_irq()); +#else + ASSERT(!in_irq()); #endif spin_lock_irqsave(&free_list_lock, flags); @@ -332,14 +332,14 @@ struct pfn_info *alloc_domain_page(struct task_struct *p) if ( unlikely(mask != 0) ) { -#ifdef NO_DEVICES_IN_XEN - flush_tlb_mask(mask); -#else +#ifdef OLD_DRIVERS /* In IRQ ctxt, flushing is best-effort only, to avoid deadlock. */ if ( likely(!in_irq()) ) flush_tlb_mask(mask); else if ( unlikely(!try_flush_tlb_mask(mask)) ) goto free_and_exit; +#else + flush_tlb_mask(mask); #endif perfc_incrc(need_flush_tlb_flush); } @@ -815,7 +815,7 @@ int construct_dom0(struct task_struct *p, extern void physdev_init_dom0(struct task_struct *); -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS extern void ide_probe_devices(xen_disk_info_t *); extern void scsi_probe_devices(xen_disk_info_t *); extern void cciss_probe_devices(xen_disk_info_t *); @@ -1078,7 +1078,7 @@ int construct_dom0(struct task_struct *p, while ( num_vifs-- > 0 ) (void)create_net_vif(0); -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS /* DOM0 gets access to all real block devices. */ #define MAX_REAL_DISKS 256 xd = kmalloc(MAX_REAL_DISKS * sizeof(xen_disk_t), GFP_KERNEL); diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index 7cd60e439f..16e2f37132 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -107,7 +107,7 @@ void do_task_queues(u_char key, void *dev_id, struct pt_regs *regs) extern void dump_runq(u_char key, void *dev_id, struct pt_regs *regs); extern void print_sched_histo(u_char key, void *dev_id, struct pt_regs *regs); extern void reset_sched_histo(u_char key, void *dev_id, struct pt_regs *regs); -#ifndef NPERFC +#ifdef PERF_COUNTERS extern void perfc_printall (u_char key, void *dev_id, struct pt_regs *regs); extern void perfc_reset (u_char key, void *dev_id, struct pt_regs *regs); #endif @@ -134,7 +134,7 @@ void initialize_keytable(void) add_key_handler('r', dump_runq, "dump run queues"); add_key_handler('B', kill_dom0, "reboot machine gracefully"); add_key_handler('R', halt_machine, "reboot machine ungracefully"); -#ifndef NPERFC +#ifdef PERF_COUNTERS add_key_handler('p', perfc_printall, "print performance counters"); add_key_handler('P', perfc_reset, "reset performance counters"); #endif diff --git a/xen/common/schedule.c b/xen/common/schedule.c index f3f6ad89e1..00929ffc93 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -27,9 +27,6 @@ #include <xen/perfc.h> #include <xen/sched-if.h> #include <hypervisor-ifs/sched_ctl.h> - -#undef TRACE_BUFFER - #include <xen/trace.h> /*#define WAKEUP_HISTO*/ diff --git a/xen/common/trace.c b/xen/common/trace.c index e79c97ee54..98da9f692b 100644 --- a/xen/common/trace.c +++ b/xen/common/trace.c @@ -17,9 +17,6 @@ */ #include <xen/config.h> - -#ifdef TRACE_BUFFER - #include <asm/timex.h> #include <asm/types.h> #include <asm/io.h> @@ -127,5 +124,3 @@ int get_tb_info(dom0_gettbufs_t *st) return -ENODATA; } } - -#endif /* TRACE_BUFFER */ diff --git a/xen/drivers/Makefile b/xen/drivers/Makefile index 0d26c89cbb..78635ed603 100644 --- a/xen/drivers/Makefile +++ b/xen/drivers/Makefile @@ -3,7 +3,7 @@ default: $(MAKE) -C char $(MAKE) -C acpi $(MAKE) -C pci - if [ "$(nodev)" != "y" ]; then \ + if [ "$(old_drivers)" == "y" ]; then \ $(MAKE) -C net ; \ $(MAKE) -C block ; \ $(MAKE) -C cdrom ; \ diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c index 488a510cc4..f8c33bad06 100644 --- a/xen/drivers/pci/pci.c +++ b/xen/drivers/pci/pci.c @@ -619,7 +619,7 @@ pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) return NULL; } -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS static int pci_announce_device(struct pci_driver *drv, struct pci_dev *dev) { @@ -644,7 +644,7 @@ pci_announce_device(struct pci_driver *drv, struct pci_dev *dev) out: return ret; } -#endif /* !NO_DEVICES_IN_XEN */ +#endif /* OLD_DRIVERS */ /** * pci_register_driver - register a new pci driver @@ -658,7 +658,7 @@ out: int pci_register_driver(struct pci_driver *drv) { -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS struct pci_dev *dev; int count = 0; @@ -686,7 +686,7 @@ pci_register_driver(struct pci_driver *drv) void pci_unregister_driver(struct pci_driver *drv) { -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS struct pci_dev *dev; list_del(&drv->node); diff --git a/xen/include/asm-i386/config.h b/xen/include/asm-i386/config.h index cb550ee172..bd3532e773 100644 --- a/xen/include/asm-i386/config.h +++ b/xen/include/asm-i386/config.h @@ -135,7 +135,6 @@ #ifndef NDEBUG #define MEMORY_GUARD -#define TRACE_BUFFER #endif #ifndef __ASSEMBLY__ diff --git a/xen/include/asm-i386/processor.h b/xen/include/asm-i386/processor.h index b1eab99d56..823c6ca851 100644 --- a/xen/include/asm-i386/processor.h +++ b/xen/include/asm-i386/processor.h @@ -406,10 +406,16 @@ extern struct desc_struct *idt_tables[]; (memset(idt_tables[smp_processor_id()] + (_p)->fast_trap_idx, \ 0, 8)) +#ifdef XEN_DEBUGGER #define SET_FAST_TRAP(_p) \ (pdb_initialized ? (void *) 0 : \ (memcpy(idt_tables[smp_processor_id()] + (_p)->fast_trap_idx, \ - &((_p)->fast_trap_desc), 8))) + &((_p)->fast_trap_desc), 8))) +#else +#define SET_FAST_TRAP(_p) \ + (memcpy(idt_tables[smp_processor_id()] + (_p)->fast_trap_idx, \ + &((_p)->fast_trap_desc), 8)) +#endif long set_fast_trap(struct task_struct *p, int idx); diff --git a/xen/include/asm-x86_64/config.h b/xen/include/asm-x86_64/config.h index 1de494f85a..5a0acabf2a 100644 --- a/xen/include/asm-x86_64/config.h +++ b/xen/include/asm-x86_64/config.h @@ -281,7 +281,6 @@ #ifndef NDEBUG #define MEMORY_GUARD -#define TRACE_BUFFER #endif #ifndef __ASSEMBLY__ diff --git a/xen/include/xen/blkdev.h b/xen/include/xen/blkdev.h index b53f1e645b..fa3be2291e 100644 --- a/xen/include/xen/blkdev.h +++ b/xen/include/xen/blkdev.h @@ -26,7 +26,7 @@ typedef struct { extern kdev_t xendev_to_physdev(unsigned short xendev); -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS extern void init_blkdev_info(struct task_struct *); extern void unlink_blkdev_info(struct task_struct *); extern void destroy_blkdev_info(struct task_struct *); diff --git a/xen/include/xen/perfc.h b/xen/include/xen/perfc.h index 5396be9c06..3814043238 100644 --- a/xen/include/xen/perfc.h +++ b/xen/include/xen/perfc.h @@ -2,7 +2,7 @@ #ifndef __XEN_PERFC_H__ #define __XEN_PERFC_H__ -#ifndef NPERFC +#ifdef PERF_COUNTERS #include <asm/atomic.h> @@ -67,7 +67,7 @@ extern struct perfcounter_t perfcounters; #define perfc_addc(x,y) atomic_add((y), &perfcounters.x[smp_processor_id()]) #define perfc_adda(x,y,z) atomic_add((z), &perfcounters.x[y]) -#else /* !NPERFC */ +#else /* PERF_COUNTERS */ #define perfc_value(x) ((void)0) #define perfc_valuec(x) ((void)0) @@ -83,6 +83,6 @@ extern struct perfcounter_t perfcounters; #define perfc_addc(x,y) ((void)0) #define perfc_adda(x,y,z) ((void)0) -#endif /* !NPERFC */ +#endif /* PERF_COUNTERS */ #endif /* __XEN_PERFC_H__ */ diff --git a/xen/include/xen/vif.h b/xen/include/xen/vif.h index 63469ece65..7d447d86f6 100644 --- a/xen/include/xen/vif.h +++ b/xen/include/xen/vif.h @@ -95,7 +95,7 @@ do { \ } while (0) \ /* vif prototypes */ -#ifndef NO_DEVICES_IN_XEN +#ifdef OLD_DRIVERS net_vif_t *create_net_vif(domid_t dom); void destroy_net_vif(net_vif_t *vif); void unlink_net_vif(net_vif_t *vif); |