Specifications

AMD Geode™ GeodeROM Functional Specification 235
System Management Mode Software
32087C
15.13.5 Shorthand Macros
Since the AL, AX and EAX registers are the most commonly accessed registers, specific macros are defined to facilitate
readability of the code. These macros and their equivalent definitions are shown in Table 15-9.
15.13.6 PCI Register Access
All PCI accesses must be naturally aligned. Otherwise, unpredictable results will occur.
15.13.6.1 READ_PCI_BYTE
Parameter0
PCI configuration address
Example of usage:
HeaderType = READ_PCI_BYTE(0x8000930E);
15.13.6.2 READ_PCI_WORD
Parameter0
PCI configuration address
Example of usage:
DeviceID = READ_PCI_WORD(0x80009302);
15.13.6.3 READ_PCI_DWORD
Parameter0
PCI configuration address
Example of usage:
BAR0 = READ_PCI_DWORD(0x80009310);
15.13.6.4 READ_PCI_DWORD_NO_TRAP, READ_PCI_WORD_NO_TRAP, READ_PCI_BYTE_NO_TRAP
These macros disable trapping on the PCI address, perform a PCI configuration space read, then re-enable PCI trapping
on the address. This is useful for accessing hardware directly and avoiding any trapping that may be in place.
Parameter0
PCI Configuration Address
Example of usage:
BAR1 = READ_PCI_DWORD_NO_TRAP (0x800093144);
Table 15-9. Shorthand Macros
Shorthand Macro Equivalent Macro
GET_AL( ) GET_REGISTER(R_AL)
GET_AH( ) GET_REGISTER (R_AH)
GET_AX( ) GET_REGISTER(R_AX)
GET_EAX( ) GET_REGISTER(R_EAX)
SET_AL(data) SET_REGISTER(R_AL, (unsigned char) data)
SET_AH (data) SET_REGISTER (R_AH, (unsigned char) data)
SET_AX(data) SET_REGISTER(R_AX, (unsigned short) data)
SET_EAX(data) SET_REGISTER(R_EAX, (unsigned long) data)
SET EFLAGS (data) SET_HEADER_DATA (EFLAGS, (unsigned long) data)