[OpenBIOS] r685 - cpu/x86/pc/olpc

svn at openbios.org svn at openbios.org
Thu Oct 18 23:25:41 CEST 2007


Author: wmb
Date: 2007-10-18 23:25:41 +0200 (Thu, 18 Oct 2007)
New Revision: 685

Modified:
   cpu/x86/pc/olpc/draminit.fth
   cpu/x86/pc/olpc/resume.bth
Log:
OLPC suspend/resume - Added configed-out code to checksum memory around
suspend/resume.  Enable it for specific test builds.  OLPC trac #4223.


Modified: cpu/x86/pc/olpc/draminit.fth
===================================================================
--- cpu/x86/pc/olpc/draminit.fth	2007-10-16 23:46:10 UTC (rev 684)
+++ cpu/x86/pc/olpc/draminit.fth	2007-10-18 21:25:41 UTC (rev 685)
@@ -59,7 +59,10 @@
       0 1430 port-wl
       h# 1b # al mov  al h# 80 # out
       char r 3f8 port-wb  begin  3fd port-rb 40 bitand  0<> until
-      resume-entry # sp mov  sp jmp
+
+      resume-data  # sp mov
+      resume-entry # ax mov  ax call   \ This might return if checksumming fails
+      char x 3f8 port-wb  begin  3fd port-rb 40 bitand  0<> until
    then
 
    h# 1c # al mov  al h# 80 # out

Modified: cpu/x86/pc/olpc/resume.bth
===================================================================
--- cpu/x86/pc/olpc/resume.bth	2007-10-16 23:46:10 UTC (rev 684)
+++ cpu/x86/pc/olpc/resume.bth	2007-10-18 21:25:41 UTC (rev 685)
@@ -23,6 +23,7 @@
 \ create reset-smbus
 \ create reset-smbus-bitbang
 \ create restore-usb-power
+\ create checksum-test
 
 h# fe00.0000 constant gp-pa
 h# fe00.4000 constant dc-pa
@@ -256,6 +257,15 @@
    begin  dx ax in  h# e0 # al and  h# c0 # al cmp  loopne
 [then]
 
+[ifdef] checksum-test
+   \ Checksum memory from 1M to top (excluding framebuffer)
+   bx bx xor
+   h# 0010.0000 #  si  mov
+   h# 0ef0.0000 2 rshift #  cx  mov  \ Word count
+   begin  ax lods  ax bx add  loopa
+   bx  resume-data h# 10 - #)  mov   \ Save checksum
+[then]
+
    \ Stop video refresh
    h# 4758 #  h# fe00.4000 #)  mov  \ Unlock DC registers
    h#    0 #  h# fe00.4004 #)  mov  \ Turn off access to display memory
@@ -328,6 +338,15 @@
       si bx cmp
    = until
 
+[ifdef] checksum-test
+   \ Checksum memory from 1M to top (excluding framebuffer)
+   bx bx xor
+   h# 0010.0000 #  si  mov
+   h# 0ef0.0000 2 rshift #  cx  mov  \ Word count
+   begin  ax lods  ax bx add  loopa
+   bx  resume-data h# 10 - #)  cmp  <>  if  ret  then
+[then]
+
    h# 38 [bp]  si  lea    \ Save area
 
    ax lods  ax dx xchg  ax lods  ax dx xchg  h# 4c00.0014 wmsr  \ RSTPLL




More information about the OpenBIOS mailing list