Author: wmb Date: 2009-11-22 00:50:51 +0100 (Sun, 22 Nov 2009) New Revision: 1497
Modified: dev/via/smi.fth Log: OLPC trac 9693 - fixed strange crash when exiting from SMI handler during Windows booting.
Modified: dev/via/smi.fth =================================================================== --- dev/via/smi.fth 2009-11-21 03:40:50 UTC (rev 1496) +++ dev/via/smi.fth 2009-11-21 23:50:51 UTC (rev 1497) @@ -299,7 +299,7 @@ smm-d16 # ax mov ax ss mov ax ds mov \ Reload data and stack segments
cr0 ax mov 1 invert # al and ax cr0 mov \ Exit protected mode - here 7 + smi-handler - +smm-offset smm-base 4 rshift #) far jmp \ Set CS for real mode + here 5 + smi-handler - +smm-offset smm-base 4 rshift #) far jmp \ Set CS for real mode
wbinvd
@@ -360,6 +360,10 @@
: smm-map? ( vadr -- ) smm>physical . ;
+\ Linear address of the EIP, accounting for the code segment value +\ This is the return address in the SMM handler's 0-based memory map. +: smm-eip-la ( -- adr ) smm-eip smm@ smm-cs-base smm@ + ; + \ Programs that write to the caller's data space should use this, \ as it works when called from paged V86 mode. : >caller-physical ( vadr -- padr )