ST486DX ST Microelectronics, ST486DX Datasheet - Page 25

no-image

ST486DX

Manufacturer Part Number
ST486DX
Description
PROGRAMMING MANUAL
Manufacturer
ST Microelectronics
Datasheet
3.8
To make an SMI interrupt truly transparent to the system, an SMI interrupt from a HLT instruction
should return to the HLT instruction. There are known cases with DOS software where returning
from an SMI handler to the instruction following the HLT will cause a system error. To determine
if a HLT instruction was interrupted by the SMI, the opcode from memory needs to be interrogated.
This code example describes how to determine if the current instruction is a HLT and how to
restart it.
;This is the start of specific code to check if the SMI
;occurred while in a HLT instruction. If it did, then
;return back to the HLT instruction when SMI is finished.
;on a SGS Thomson part, if the SMI occurred while in a HLT
;instruction, the CURRENT IP and the NEXT IP will both
;point to the instruction following the HLT.
;load EAX with CS base from the SMM header
;calculate linear address
;set MMAC to get access to Main memory
Return to HLT Instruction
rsdc
mov
cmp
jne
mov
mov
shl
mov
add
dec
mov
mov
test
je
mov
out
in
mov
mov
out
eax,cs:dword ptr[SMI_CURRENTIP]
eax,cs:dword ptr[SMI_NEXTIP]
not_hlt
ax,cs:word ptr [SMI_CSSELH+2]
al,cs:byte ptr [SMI_CSSELH]
eax,10h
ax,cs:word ptr[SMI_CSSELL+2]
eax,cs:dword ptr [SMI_CURRENTIP]
eax
edx,eax
eax,cs:dword ptr [SMI_CR0] ;check if paging on
eax,80000000h
no_paging
al,0c1h
22h,al
al,23h
cl,al
al,0c1h
22h,al
fs,cs:,[seg4G]
ST486DX - SMM SOFTWARE CONSIDERATIONS
;FS is base=0 limit=4G data
;segment to be used to check if
;HLT instruction was executing
;can’t be a HLT but could be
;a LOOP or REP
;decrement to HLT instruction
;save lin addr in edx
;if no paging then linear
;address = physical address
;save old CCR1 value in cl
35

Related parts for ST486DX