Files
chipsec-chipsec/source/drivers/win7/include/cpu.h
T
CHIPSEC ac2ca7264f 1. We have support for uefi variables on Windows and Linux but not
UEFI shell.
2.       Decompression of images in SPI flash parsing is only supported in
Windows.
3.	UEFI - Support for IA32 and i586 (Quark)
4.	Added capability to use modules from an arbitrary path with the -I
/ --import command line option
5.	Module functionality encapsulated in class inheriting BaseModule
6.	Fixed  loading platform specific configuration
7.	Fixed issue with modules which run on multiple logical CPUs
hanging on Bay Trail (Windows/Linux). The issue still exist when running
from UEFI shell
8.	Added template for a module - module_template.py
9.	Added options to flush log files
10.	Added ability to define custom platforms
Driver changes:
1.	Windows - Added IOCTL_ALLOC_PHYSMEM to allocate physical memory
buffer
2.	Linux - Fix wrpci defect
2014-05-29 21:57:40 +01:00

76 lines
2.5 KiB
C

#ifndef CPU_H
#define CPU_H
//#ifndef _WIN64 TODO: remove
#if 0
#define _eflags( eflags ) __asm \
{ \
__asm push eax \
__asm pushfd \
__asm pop eax \
__asm mov eflags, eax \
__asm pop eax \
}
#endif
#if defined(_M_AMD64)
typedef UINT64 CPU_REG_TYPE;
#elif defined(_M_IX86)
typedef UINT32 CPU_REG_TYPE;
#else
#error "Architecture not supported"
#endif
/*
* External Assembly Functions
*/
// -- Access to CPU MSRs
extern void _rdmsr( UINT32 msr_num, UINT32* msr_lo, UINT32* msr_hi );
extern void _wrmsr( UINT32 msr_num, UINT32 msr_lo, UINT32 msr_hi );
// -- Access to PCI CFG space
extern void WritePCIByte ( UINT32 pci_reg, UINT16 cfg_data_port, UINT8 byte_value );
extern void WritePCIWord ( UINT32 pci_reg, UINT16 cfg_data_port, UINT16 word_value );
extern void WritePCIDword( UINT32 pci_reg, UINT16 cfg_data_port, UINT32 dword_value );
extern UINT8 ReadPCIByte ( UINT32 pci_reg, UINT16 cfg_data_port );
extern UINT16 ReadPCIWord ( UINT32 pci_reg, UINT16 cfg_data_port );
extern UINT32 ReadPCIDword ( UINT32 pci_reg, UINT16 cfg_data_port );
// -- Access to Port I/O
extern UINT32 ReadPortDword ( UINT16 port_num );
extern UINT16 ReadPortWord ( UINT16 port_num );
extern UINT8 ReadPortByte ( UINT16 port_num );
extern void WritePortDword( UINT32 out_value, UINT16 port_num );
extern void WritePortWord ( UINT16 out_value, UINT16 port_num );
extern void WritePortByte ( UINT8 out_value, UINT16 port_num );
// -- Access to CPU Descriptor tables
extern void _store_idtr( void* desc_address );
extern void _load_idtr ( void* desc_address );
extern void _store_gdtr( void* desc_address );
extern void _store_ldtr( void* desc_address );
// -- Interrupts
extern void _swsmi( UINT32 smi_code_data, CPU_REG_TYPE rax_value, CPU_REG_TYPE rbx_value, CPU_REG_TYPE rcx_value, CPU_REG_TYPE rdx_value, CPU_REG_TYPE rsi_value, CPU_REG_TYPE rdi_value );
// --
// -- MSR definitions
// --
#define MSR_IA32_BIOS_UPDT_TRIG 0x79
#define MSR_IA32_BIOS_SIGN_ID 0x8b
// -- CPU Descriptor tables
typedef enum {
CPU_DT_CODE_IDTR = 0x0,
CPU_DT_CODE_GDTR = 0x1,
CPU_DT_CODE_LDTR = 0x2,
} DTR_CODE;
#pragma pack(1)
typedef struct _DESCRIPTOR_TABLE_RECORD {
UINT16 limit;
//UINT32 base_hi;
//UINT32 base_lo;
ULONG_PTR base;
} DESCRIPTOR_TABLE_RECORD, *PDESCRIPTOR_TABLE_RECORD;
#pragma pack()
#endif // CPU_H