debuggers.hg

changeset 2956:764b406523af

bitkeeper revision 1.1159.170.3 (418fc30fH17ZA9UiJHFIG5IhuuiaCQ)

Rename xen_regs xcs,xds,xes,xfs,xgs,xss to remove the 'x' prefix.
author kaf24@freefall.cl.cam.ac.uk
date Mon Nov 08 19:03:43 2004 +0000 (2004-11-08)
parents 4a610e420c0d
children 90b094417ff3 7f55ce2d0c24 8a95c29bd669
files xen/arch/x86/pdb-stub.c xen/arch/x86/traps.c xen/arch/x86/x86_32/seg_fixup.c xen/include/asm-x86/x86_32/regs.h
line diff
     1.1 --- a/xen/arch/x86/pdb-stub.c	Mon Nov 08 18:54:03 2004 +0000
     1.2 +++ b/xen/arch/x86/pdb-stub.c	Mon Nov 08 19:03:43 2004 +0000
     1.3 @@ -255,17 +255,17 @@ pdb_x86_to_gdb_regs (char *buffer, struc
     1.4      idx += sizeof(regs->eip) * 2;
     1.5      mem2hex ((char *)&regs->eflags, &buffer[idx], sizeof(regs->eflags));
     1.6      idx += sizeof(regs->eflags) * 2;
     1.7 -    mem2hex ((char *)&regs->xcs, &buffer[idx], sizeof(regs->xcs));
     1.8 -    idx += sizeof(regs->xcs) * 2;
     1.9 -    mem2hex ((char *)&regs->xss, &buffer[idx], sizeof(regs->xss));
    1.10 -    idx += sizeof(regs->xss) * 2;
    1.11 -    mem2hex ((char *)&regs->xds, &buffer[idx], sizeof(regs->xds));
    1.12 -    idx += sizeof(regs->xds) * 2;
    1.13 -    mem2hex ((char *)&regs->xes, &buffer[idx], sizeof(regs->xes));
    1.14 -    idx += sizeof(regs->xes) * 2;
    1.15 -    mem2hex ((char *)&regs->xfs, &buffer[idx], sizeof(regs->xfs));
    1.16 -    idx += sizeof(regs->xfs) * 2;
    1.17 -    mem2hex ((char *)&regs->xgs, &buffer[idx], sizeof(regs->xgs));
    1.18 +    mem2hex ((char *)&regs->cs, &buffer[idx], sizeof(regs->cs));
    1.19 +    idx += sizeof(regs->cs) * 2;
    1.20 +    mem2hex ((char *)&regs->ss, &buffer[idx], sizeof(regs->ss));
    1.21 +    idx += sizeof(regs->ss) * 2;
    1.22 +    mem2hex ((char *)&regs->ds, &buffer[idx], sizeof(regs->ds));
    1.23 +    idx += sizeof(regs->ds) * 2;
    1.24 +    mem2hex ((char *)&regs->es, &buffer[idx], sizeof(regs->es));
    1.25 +    idx += sizeof(regs->es) * 2;
    1.26 +    mem2hex ((char *)&regs->fs, &buffer[idx], sizeof(regs->fs));
    1.27 +    idx += sizeof(regs->fs) * 2;
    1.28 +    mem2hex ((char *)&regs->gs, &buffer[idx], sizeof(regs->gs));
    1.29  }
    1.30  
    1.31  /* at this point we allow any register to be changed, caveat emptor */
    1.32 @@ -292,17 +292,17 @@ pdb_gdb_to_x86_regs (struct xen_regs *re
    1.33      buffer += sizeof(regs->eip) * 2;
    1.34      hex2mem(buffer, (char *)&regs->eflags, sizeof(regs->eflags));
    1.35      buffer += sizeof(regs->eflags) * 2;
    1.36 -    hex2mem(buffer, (char *)&regs->xcs, sizeof(regs->xcs));
    1.37 -    buffer += sizeof(regs->xcs) * 2;
    1.38 -    hex2mem(buffer, (char *)&regs->xss, sizeof(regs->xss));
    1.39 -    buffer += sizeof(regs->xss) * 2;
    1.40 -    hex2mem(buffer, (char *)&regs->xds, sizeof(regs->xds));
    1.41 -    buffer += sizeof(regs->xds) * 2;
    1.42 -    hex2mem(buffer, (char *)&regs->xes, sizeof(regs->xes));
    1.43 -    buffer += sizeof(regs->xes) * 2;
    1.44 -    hex2mem(buffer, (char *)&regs->xfs, sizeof(regs->xfs));
    1.45 -    buffer += sizeof(regs->xfs) * 2;
    1.46 -    hex2mem(buffer, (char *)&regs->xgs, sizeof(regs->xgs));
    1.47 +    hex2mem(buffer, (char *)&regs->cs, sizeof(regs->cs));
    1.48 +    buffer += sizeof(regs->cs) * 2;
    1.49 +    hex2mem(buffer, (char *)&regs->ss, sizeof(regs->ss));
    1.50 +    buffer += sizeof(regs->ss) * 2;
    1.51 +    hex2mem(buffer, (char *)&regs->ds, sizeof(regs->ds));
    1.52 +    buffer += sizeof(regs->ds) * 2;
    1.53 +    hex2mem(buffer, (char *)&regs->es, sizeof(regs->es));
    1.54 +    buffer += sizeof(regs->es) * 2;
    1.55 +    hex2mem(buffer, (char *)&regs->fs, sizeof(regs->fs));
    1.56 +    buffer += sizeof(regs->fs) * 2;
    1.57 +    hex2mem(buffer, (char *)&regs->gs, sizeof(regs->gs));
    1.58  }
    1.59  
    1.60  int
    1.61 @@ -1088,11 +1088,11 @@ int pdb_handle_exception(int exceptionVe
    1.62         This occurs when leaving a system call from a domain.
    1.63      */
    1.64      if ( exceptionVector == 3 &&
    1.65 -	 (xen_regs->xcs & 3) == 3 && 
    1.66 +	 (xen_regs->cs & 3) == 3 && 
    1.67  	 xen_regs->eip != pdb_system_call_next_addr + 1)
    1.68      {
    1.69          TRC(printf("pdb: user bkpt (0x%x) at 0x%x:0x%lx:0x%lx\n", 
    1.70 -		   exceptionVector, xen_regs->xcs & 3, cr3, xen_regs->eip));
    1.71 +		   exceptionVector, xen_regs->cs & 3, cr3, xen_regs->eip));
    1.72  	return 1;
    1.73      }
    1.74  
     2.1 --- a/xen/arch/x86/traps.c	Mon Nov 08 18:54:03 2004 +0000
     2.2 +++ b/xen/arch/x86/traps.c	Mon Nov 08 19:03:43 2004 +0000
     2.3 @@ -168,14 +168,14 @@ void show_registers(struct xen_regs *reg
     2.4      unsigned long esp;
     2.5      unsigned short ss, ds, es, fs, gs;
     2.6  
     2.7 -    if ( regs->xcs & 3 )
     2.8 +    if ( regs->cs & 3 )
     2.9      {
    2.10          esp = regs->esp;
    2.11 -        ss  = regs->xss & 0xffff;
    2.12 -        ds  = regs->xds & 0xffff;
    2.13 -        es  = regs->xes & 0xffff;
    2.14 -        fs  = regs->xfs & 0xffff;
    2.15 -        gs  = regs->xgs & 0xffff;
    2.16 +        ss  = regs->ss & 0xffff;
    2.17 +        ds  = regs->ds & 0xffff;
    2.18 +        es  = regs->es & 0xffff;
    2.19 +        fs  = regs->fs & 0xffff;
    2.20 +        gs  = regs->gs & 0xffff;
    2.21      }
    2.22      else
    2.23      {
    2.24 @@ -188,7 +188,7 @@ void show_registers(struct xen_regs *reg
    2.25      }
    2.26  
    2.27      printk("CPU:    %d\nEIP:    %04x:[<%08lx>]      \nEFLAGS: %08lx\n",
    2.28 -           smp_processor_id(), 0xffff & regs->xcs, regs->eip, regs->eflags);
    2.29 +           smp_processor_id(), 0xffff & regs->cs, regs->eip, regs->eflags);
    2.30      printk("eax: %08lx   ebx: %08lx   ecx: %08lx   edx: %08lx\n",
    2.31             regs->eax, regs->ebx, regs->ecx, regs->edx);
    2.32      printk("esi: %08lx   edi: %08lx   ebp: %08lx   esp: %08lx\n",
    2.33 @@ -222,7 +222,7 @@ static inline void do_trap(int trapnr, c
    2.34      trap_info_t *ti;
    2.35      unsigned long fixup;
    2.36  
    2.37 -    if (!(regs->xcs & 3))
    2.38 +    if (!(regs->cs & 3))
    2.39          goto xen_fault;
    2.40  
    2.41      ti = current->thread.traps + trapnr;
    2.42 @@ -285,9 +285,9 @@ asmlinkage void do_int3(struct xen_regs 
    2.43          return;
    2.44  #endif
    2.45  
    2.46 -    if ( (regs->xcs & 3) != 3 )
    2.47 +    if ( (regs->cs & 3) != 3 )
    2.48      {
    2.49 -        if ( unlikely((regs->xcs & 3) == 0) )
    2.50 +        if ( unlikely((regs->cs & 3) == 0) )
    2.51          {
    2.52              show_registers(regs);
    2.53              panic("CPU%d FATAL TRAP: vector = 3 (Int3)\n"
    2.54 @@ -382,7 +382,7 @@ asmlinkage void do_page_fault(struct xen
    2.55              return; /* successfully copied the mapping */
    2.56      }
    2.57  
    2.58 -    if ( unlikely(!(regs->xcs & 3)) )
    2.59 +    if ( unlikely(!(regs->cs & 3)) )
    2.60          goto xen_fault;
    2.61  
    2.62      ti = d->thread.traps + 14;
    2.63 @@ -449,7 +449,7 @@ asmlinkage void do_general_protection(st
    2.64      unsigned long fixup;
    2.65  
    2.66      /* Badness if error in ring 0, or result of an interrupt. */
    2.67 -    if ( !(regs->xcs & 3) || (error_code & 1) )
    2.68 +    if ( !(regs->cs & 3) || (error_code & 1) )
    2.69          goto gp_in_kernel;
    2.70  
    2.71      /*
    2.72 @@ -476,7 +476,7 @@ asmlinkage void do_general_protection(st
    2.73      {
    2.74          /* This fault must be due to <INT n> instruction. */
    2.75          ti = current->thread.traps + (error_code>>3);
    2.76 -        if ( TI_GET_DPL(ti) >= (regs->xcs & 3) )
    2.77 +        if ( TI_GET_DPL(ti) >= (regs->cs & 3) )
    2.78          {
    2.79  #ifdef XEN_DEBUGGER
    2.80              if ( pdb_initialized && (pdb_ctx.system_call != 0) )
    2.81 @@ -662,7 +662,7 @@ asmlinkage void do_debug(struct xen_regs
    2.82          return;
    2.83      }
    2.84  
    2.85 -    if ( (regs->xcs & 3) == 0 )
    2.86 +    if ( (regs->cs & 3) == 0 )
    2.87      {
    2.88          /* Clear TF just for absolute sanity. */
    2.89          regs->eflags &= ~EF_TF;
     3.1 --- a/xen/arch/x86/x86_32/seg_fixup.c	Mon Nov 08 18:54:03 2004 +0000
     3.2 +++ b/xen/arch/x86/x86_32/seg_fixup.c	Mon Nov 08 19:03:43 2004 +0000
     3.3 @@ -297,15 +297,15 @@ int gpf_emulate_4gb(struct xen_regs *reg
     3.4      unsigned int  *pseg = NULL; /* segment for memory operand (NULL=default) */
     3.5  
     3.6      /* WARNING: We only work for ring-3 segments. */
     3.7 -    if ( unlikely((regs->xcs & 3) != 3) )
     3.8 +    if ( unlikely((regs->cs & 3) != 3) )
     3.9      {
    3.10 -        DPRINTK("Taken fault at bad CS %04x\n", regs->xcs);
    3.11 +        DPRINTK("Taken fault at bad CS %04x\n", regs->cs);
    3.12          goto fail;
    3.13      }
    3.14  
    3.15 -    if ( !linearise_address((u16)regs->xcs, regs->eip, (unsigned long *)&eip) )
    3.16 +    if ( !linearise_address((u16)regs->cs, regs->eip, (unsigned long *)&eip) )
    3.17      {
    3.18 -        DPRINTK("Cannot linearise %04x:%08lx\n", regs->xcs, regs->eip);
    3.19 +        DPRINTK("Cannot linearise %04x:%08lx\n", regs->cs, regs->eip);
    3.20          goto fail;
    3.21      }
    3.22  
    3.23 @@ -332,22 +332,22 @@ int gpf_emulate_4gb(struct xen_regs *reg
    3.24          case 0x66: /* Operand-size override */
    3.25              break;
    3.26          case 0x2e: /* CS override */
    3.27 -            pseg = &regs->xcs;
    3.28 +            pseg = &regs->cs;
    3.29              break;
    3.30          case 0x3e: /* DS override */
    3.31 -            pseg = &regs->xds;
    3.32 +            pseg = &regs->ds;
    3.33              break;
    3.34          case 0x26: /* ES override */
    3.35 -            pseg = &regs->xes;
    3.36 +            pseg = &regs->es;
    3.37              break;
    3.38          case 0x64: /* FS override */
    3.39 -            pseg = &regs->xfs;
    3.40 +            pseg = &regs->fs;
    3.41              break;
    3.42          case 0x65: /* GS override */
    3.43 -            pseg = &regs->xgs;
    3.44 +            pseg = &regs->gs;
    3.45              break;
    3.46          case 0x36: /* SS override */
    3.47 -            pseg = &regs->xss;
    3.48 +            pseg = &regs->ss;
    3.49              break;
    3.50          default: /* Not a prefix byte */
    3.51              goto done_prefix;
    3.52 @@ -409,7 +409,7 @@ int gpf_emulate_4gb(struct xen_regs *reg
    3.53      {
    3.54      case 0:
    3.55          if ( pseg == NULL )
    3.56 -            pseg = &regs->xds;
    3.57 +            pseg = &regs->ds;
    3.58          disp32 = 0;
    3.59          if ( rm == 5 ) /* disp32 rather than (EBP) */
    3.60          {
    3.61 @@ -425,7 +425,7 @@ int gpf_emulate_4gb(struct xen_regs *reg
    3.62  
    3.63      case 1:
    3.64          if ( pseg == NULL ) /* NB. EBP defaults to SS */
    3.65 -            pseg = (rm == 5) ? &regs->xss : &regs->xds;
    3.66 +            pseg = (rm == 5) ? &regs->ss : &regs->ds;
    3.67          if ( get_user(disp8, pb) )
    3.68          {
    3.69              DPRINTK("Fault while extracting <disp8>.\n");
    3.70 @@ -437,7 +437,7 @@ int gpf_emulate_4gb(struct xen_regs *reg
    3.71  
    3.72      case 2:
    3.73          if ( pseg == NULL ) /* NB. EBP defaults to SS */
    3.74 -            pseg = (rm == 5) ? &regs->xss : &regs->xds;
    3.75 +            pseg = (rm == 5) ? &regs->ss : &regs->ds;
    3.76          if ( get_user(disp32, (u32 *)pb) )
    3.77          {
    3.78              DPRINTK("Fault while extracting <disp8>.\n");
    3.79 @@ -482,7 +482,7 @@ int gpf_emulate_4gb(struct xen_regs *reg
    3.80              "caused GPF(0) at %04x:%08lx\n",
    3.81              eip[0], eip[1], eip[2], eip[3],
    3.82              eip[4], eip[5], eip[6], eip[7],
    3.83 -            regs->xcs, regs->eip);
    3.84 +            regs->cs, regs->eip);
    3.85   fail:
    3.86      return 0;
    3.87  }
     4.1 --- a/xen/include/asm-x86/x86_32/regs.h	Mon Nov 08 18:54:03 2004 +0000
     4.2 +++ b/xen/include/asm-x86/x86_32/regs.h	Mon Nov 08 19:03:43 2004 +0000
     4.3 @@ -13,16 +13,16 @@ struct xen_regs
     4.4      long eax;
     4.5      long orig_eax;
     4.6      long eip;
     4.7 -    int  xcs;
     4.8 +    int  cs;
     4.9      long eflags;
    4.10  
    4.11      /* Only saved guest activations contain the following fields. */
    4.12      long esp;
    4.13 -    int  xss;
    4.14 -    int  xes;
    4.15 -    int  xds;
    4.16 -    int  xfs;
    4.17 -    int  xgs;
    4.18 +    int  ss;
    4.19 +    int  es;
    4.20 +    int  ds;
    4.21 +    int  fs;
    4.22 +    int  gs;
    4.23  };
    4.24  
    4.25  enum EFLAGS {