Specifications
AMD Geode™ GeodeROM Functional Specification 233
System Management Mode Software
32087C
15.13.1 ENTER_CRITICAL_SECTION, EXIT_CRITICAL_SECTION
The critical section macros are used to mark the beginning and end of VSM code that should not be interrupted. Typically,
this is brief sections of code that are very timing sensitive. For example, if a VSM creates a software-generated pulse of a
precise duration, the VSM must not be interrupted. Otherwise, the pulse would be longer than desired. Surrounding such
code with critical section macros prevents any interruption.
Implementing critical sections ensures that structures are updated automatically.
Example of usage:
ENTER_CRITICAL_SECTION(); // timing sensitive code goes here
EXIT_CRITICAL_SECTION();
15.13.2 SET_VIRTUAL_REGISTER
The SET_VIRTUAL_REGISTER macro is used to write to a virtual register from within a VSM. While I/O operations can be
performed to accomplish the same effect, using this macro allows the System Manager to perform the operation more effi-
ciently.
Example of usage:
SET_VIRTUAL_REGISTER(Virtual_Class, Virtual_Index, data);
15.13.3 GET_VIRTUAL_REGISTER
The GET_VIRTUAL_REGISTER macro is used to read to a virtual register from within a VSM. While I/O operations can be
performed to accomplish the same effect, using this macro allows the System Manager to perform the operation more effi-
ciently.
Example of usage:
Data = GET_VIRTUAL_REGISTER(Virtual_Class, Virtual_Index);
15.13.4 General Purpose Register Access
15.13.4.1 SET_REGISTER
The SET_REGISTER macro is used to modify the interrupted (non-SMM) task's registers.
• Parameter0
— Register name
• Parameter1
— Data value
Note: This system call is only valid when servicing a synchronous event (EVENT_SOFTWARE_SMI, EVENT_IO_TRAP,
EVENT_MEMORY_TRAP). Attempting to use it when servicing an asynchronous event is a programming error.
Valid register names are:
R_EAX, R_AX, R_AH, R_AL
R_EBX, R_BX, R_BH, R_BL
R_ECX, R_CX, R_CH, R_CL
R_EDX, R_DX, R_DH, R_DL
R_ESI, R_SI
R_EDI, R_DI
R_EBP, R_BP
R_ESP, R_SP
R_DS
R_SS
R_ES
R_FS
R_GS
Example of usage:
SET_REGISTER (R_EAX, 0x123456578); // Set caller's EAX to 0x12345678