debuggers.hg

diff xen/arch/x86/traps.c @ 3635:ed902e5c4b49

bitkeeper revision 1.1159.212.62 (41fff40aESe4aWS82z_rLHeonXpxuQ)

More x86/64 stuff.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Tue Feb 01 21:26:34 2005 +0000 (2005-02-01)
parents 578b6c14e635
children 9a9c5a491401 e6af5d8f8b39 fd1dd0663b09
line diff
     1.1 --- a/xen/arch/x86/traps.c	Tue Feb 01 09:24:57 2005 +0000
     1.2 +++ b/xen/arch/x86/traps.c	Tue Feb 01 21:26:34 2005 +0000
     1.3 @@ -1,5 +1,5 @@
     1.4  /******************************************************************************
     1.5 - * arch/i386/traps.c
     1.6 + * arch/x86/traps.c
     1.7   * 
     1.8   * Modifications to Linux original are copyright (c) 2002-2004, K A Fraser
     1.9   * 
    1.10 @@ -66,8 +66,6 @@ char opt_nmi[10] = "fatal";
    1.11  #endif
    1.12  string_param("nmi", opt_nmi);
    1.13  
    1.14 -#if defined(__i386__)
    1.15 -
    1.16  #define GUEST_FAULT(_r) (likely(VM86_MODE(_r) || !RING_0(_r)))
    1.17  
    1.18  #define DOUBLEFAULT_STACK_SIZE 1024
    1.19 @@ -77,9 +75,9 @@ static unsigned char doublefault_stack[D
    1.20  asmlinkage int hypercall(void);
    1.21  
    1.22  /* Master table, and the one used by CPU0. */
    1.23 -struct desc_struct idt_table[256] = { {0, 0}, };
    1.24 +idt_entry_t idt_table[IDT_ENTRIES] = { {0, 0}, };
    1.25  /* All other CPUs have their own copy. */
    1.26 -struct desc_struct *idt_tables[NR_CPUS] = { 0 };
    1.27 +idt_entry_t *idt_tables[NR_CPUS] = { 0 };
    1.28  
    1.29  asmlinkage void divide_error(void);
    1.30  asmlinkage void debug(void);
    1.31 @@ -112,7 +110,7 @@ static inline int kernel_text_address(un
    1.32  
    1.33  }
    1.34  
    1.35 -void show_guest_stack()
    1.36 +void show_guest_stack(void)
    1.37  {
    1.38      int i;
    1.39      execution_context_t *ec = get_execution_context();
    1.40 @@ -199,11 +197,11 @@ void show_registers(struct xen_regs *reg
    1.41          gs  = __HYPERVISOR_DS;
    1.42      }
    1.43  
    1.44 -    printk("CPU:    %d\nEIP:    %04x:[<%08x>]      \nEFLAGS: %08x\n",
    1.45 +    printk("CPU:    %d\nEIP:    %04lx:[<%08lx>]      \nEFLAGS: %08lx\n",
    1.46             smp_processor_id(), 0xffff & regs->cs, regs->eip, regs->eflags);
    1.47 -    printk("eax: %08x   ebx: %08x   ecx: %08x   edx: %08x\n",
    1.48 +    printk("eax: %08lx   ebx: %08lx   ecx: %08lx   edx: %08lx\n",
    1.49             regs->eax, regs->ebx, regs->ecx, regs->edx);
    1.50 -    printk("esi: %08x   edi: %08x   ebp: %08x   esp: %08lx\n",
    1.51 +    printk("esi: %08lx   edi: %08lx   ebp: %08lx   esp: %08lx\n",
    1.52             regs->esi, regs->edi, regs->ebp, esp);
    1.53      printk("ds: %04x   es: %04x   fs: %04x   gs: %04x   ss: %04x\n",
    1.54             ds, es, fs, gs, ss);
    1.55 @@ -283,7 +281,7 @@ static inline int do_trap(int trapnr, ch
    1.56  
    1.57      if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
    1.58      {
    1.59 -        DPRINTK("Trap %d: %08x -> %08lx\n", trapnr, regs->eip, fixup);
    1.60 +        DPRINTK("Trap %d: %08lx -> %08lx\n", trapnr, regs->eip, fixup);
    1.61          regs->eip = fixup;
    1.62          return 0;
    1.63      }
    1.64 @@ -472,7 +470,7 @@ asmlinkage int do_page_fault(struct xen_
    1.65      {
    1.66          perfc_incrc(copy_user_faults);
    1.67          if ( !ed->mm.shadow_mode )
    1.68 -            DPRINTK("Page fault: %08x -> %08lx\n", regs->eip, fixup);
    1.69 +            DPRINTK("Page fault: %08lx -> %08lx\n", regs->eip, fixup);
    1.70          regs->eip = fixup;
    1.71          return 0;
    1.72      }
    1.73 @@ -704,7 +702,7 @@ asmlinkage int do_general_protection(str
    1.74  
    1.75      if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
    1.76      {
    1.77 -        DPRINTK("GPF (%04x): %08x -> %08lx\n",
    1.78 +        DPRINTK("GPF (%04x): %08lx -> %08lx\n",
    1.79                  regs->error_code, regs->eip, fixup);
    1.80          regs->eip = fixup;
    1.81          return 0;
    1.82 @@ -1151,11 +1149,3 @@ unsigned long do_get_debugreg(int reg)
    1.83      if ( (reg < 0) || (reg > 7) ) return -EINVAL;
    1.84      return current->thread.debugreg[reg];
    1.85  }
    1.86 -
    1.87 -#else
    1.88 -
    1.89 -asmlinkage void fatal_trap(int trapnr, struct xen_regs *regs)
    1.90 -{
    1.91 -}
    1.92 -
    1.93 -#endif /* __i386__ */