ia64/xen-unstable

changeset 19198:a624353a668d

rombios: fix int15/86h (wait for microseconds)

The bcc compiler generates wrong stack pointer offset of a local
variable within ASM code if another local variable is declared
later.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 12 10:52:05 2009 +0000 (2009-02-12)
parents 9e3be0660c1e
children 94e12fa57816
files tools/firmware/rombios/rombios.c
line diff
     1.1 --- a/tools/firmware/rombios/rombios.c	Thu Feb 12 10:48:55 2009 +0000
     1.2 +++ b/tools/firmware/rombios/rombios.c	Thu Feb 12 10:52:05 2009 +0000
     1.3 @@ -4609,6 +4609,10 @@ int15_function32(regs, ES, DS, FLAGS)
     1.4  {
     1.5    Bit32u  extended_memory_size=0; // 64bits long
     1.6    Bit16u  CX,DX;
     1.7 +#ifdef HVMASSIST
     1.8 +  Bit16u off, e820_table_size;
     1.9 +  Bit32u base, type, size;
    1.10 +#endif
    1.11  
    1.12  BX_DEBUG_INT15("int15 AX=%04x\n",regs.u.r16.ax);
    1.13  
    1.14 @@ -4625,8 +4629,10 @@ ASM_START
    1.15  
    1.16        ;; Get the count in eax
    1.17        mov  bx, sp
    1.18 +SEG SS
    1.19        mov  ax, _int15_function32.CX [bx]
    1.20        shl  eax, #16
    1.21 +SEG SS
    1.22        mov  ax, _int15_function32.DX [bx]
    1.23  
    1.24        ;; convert to numbers of 15usec ticks
    1.25 @@ -4660,8 +4666,7 @@ ASM_END
    1.26          {
    1.27  #ifdef HVMASSIST
    1.28         case 0x20: {
    1.29 -            Bit16u e820_table_size =
    1.30 -                read_word(E820_SEG, E820_NR_OFFSET) * 0x14;
    1.31 +            e820_table_size = read_word(E820_SEG, E820_NR_OFFSET) * 0x14;
    1.32  
    1.33              if (regs.u.r32.edx != 0x534D4150) /* SMAP */
    1.34                  goto int15_unimplemented;
    1.35 @@ -4674,8 +4679,6 @@ ASM_END
    1.36                  if ((regs.u.r32.ebx + 0x14 - 1) > e820_table_size)
    1.37                      regs.u.r32.ebx = 0;
    1.38              } else if (regs.u.r16.bx == 1) {
    1.39 -                Bit32u base, type;
    1.40 -                Bit16u off;
    1.41                  for (off = 0; off < e820_table_size; off += 0x14) {
    1.42                      base = read_dword(E820_SEG, E820_OFFSET + off);
    1.43                      type = read_dword(E820_SEG, E820_OFFSET + 0x10 + off);
    1.44 @@ -4699,9 +4702,7 @@ ASM_END
    1.45          }
    1.46  
    1.47          case 0x01: {
    1.48 -            Bit16u off, e820_table_size =
    1.49 -                read_word(E820_SEG, E820_NR_OFFSET) * 0x14;
    1.50 -            Bit32u base, type, size;
    1.51 +            e820_table_size = read_word(E820_SEG, E820_NR_OFFSET) * 0x14;
    1.52  
    1.53              // do we have any reason to fail here ?
    1.54              CLEAR_CF();