[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.4-testing] rombios: compute checksum for roms bigger than a segment



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1244109280 -3600
# Node ID f18a7185e7872ffe7fb6e38d391d3b5af6eb325f
# Parent  549956f395d444f2a4cdac3830ed2abf750069fa
rombios: compute checksum for roms bigger than a segment

From: Glauber Costa <glommer@xxxxxxxxxx>
From: "Sebastian Herbszt" <herbszt@xxxxxx>
Ported by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
xen-unstable changeset:   19713:e638b32985fb
xen-unstable date:        Thu Jun 04 10:36:01 2009 +0100
---
 tools/firmware/rombios/rombios.c |   34 ++++++++++++++++++++++++++++------
 1 files changed, 28 insertions(+), 6 deletions(-)

diff -r 549956f395d4 -r f18a7185e787 tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c  Thu Jun 04 10:54:11 2009 +0100
+++ b/tools/firmware/rombios/rombios.c  Thu Jun 04 10:54:40 2009 +0100
@@ -10439,22 +10439,44 @@ no_serial:
   ret
 
 rom_checksum:
-  push ax
-  push bx
-  push cx
+  pusha
+  push ds
+
   xor  ax, ax
   xor  bx, bx
   xor  cx, cx
+  xor  dx, dx
+
   mov  ch, [2]
   shl  cx, #1
+
+  jnc checksum_loop
+  jz  checksum_loop
+  xchg dx, cx
+  dec  cx
+
 checksum_loop:
   add  al, [bx]
   inc  bx
   loop checksum_loop
+
+  test dx, dx
+  je checksum_out
+
+  add  al, [bx]
+  mov  cx, dx
+  mov  dx, ds
+  add  dh, #0x10
+  mov  ds, dx
+  xor  dx, dx
+  xor  bx, bx
+
+  jmp  checksum_loop
+
+checksum_out:
   and  al, #0xff
-  pop  cx
-  pop  bx
-  pop  ax
+  pop  ds
+  popa
   ret
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.