ST486DX ST Microelectronics, ST486DX Datasheet - Page 23

no-image

ST486DX

Manufacturer Part Number
ST486DX
Description
PROGRAMMING MANUAL
Manufacturer
ST Microelectronics
Datasheet
3.6
When implementing power management into a system it is common to want to power down periph-
erals when they are not in use. When an I/O instruction is issued to a powered down device, the
SMM routine is called to power up the peripheral and then reissue the I/O instruction. SGS-Thom-
son CPUs make it easy to restart the I/O instruction that has generated an SMI interrupt.
The system will generate an SMI interrupt when an I/O bus cycle to a powered-down peripheral is
detected. The SMM routine should interrogate the system hardware to find out if the SMI was
caused by an I/O trap. By checking the SMM header information, the SMM routine can determine
the type of I/O instruction that was trapped. If the I/O instruction has a REP prefix, the ECX regis-
ter needs to be incremented before restarting the instruction. If the I/O trap was on a string I/O in-
struction, the ESI or EDI registers must be restored to their previous value before restarting the
instruction.
The following code example shows how easy I/O restart is with the SGS Thomson CPU.
; Set MMAC to access main memory
MMAC = 1 shl 3
;Now all data memory access will use ADS#, Code fetches
;will continue to be done with SMADS# from SMM memory.
;
;Disable MMAC
;Restart the interrupted instruction
;test for REP instruction
I/O Restart
mov
out
in
mov
mov
out
mov
or
out
mov
out
mov
out
mov
mov
mov
al, 0c1h
22h, al
al, 23h
ah, al
al, 0c1h
22h, al
al, ah
al, MMAC
23h, al
al, 0c1h
22h, al
al, ah
23h, al
eax,dword ptr cs:[SMI_CURRENTIP]
dword ptr cs:[SMI_NEXTIP],eax
al,byte ptr cs:[SMI_BITS]
ST486DX - SMM SOFTWARE CONSIDERATIONS
;select CCR1
;get CCR1 current value
;save it
;select CCR1 again
;set MMAC
;write new value to CCR1
;select CCR1
;get old value of CCR1
;and restore it
33

Related parts for ST486DX