From b7c51c9cf4864df6aabb99a1ae843becd577237c Mon Sep 17 00:00:00 2001 From: raywu Date: Fri, 15 Jun 2018 00:00:50 +0800 Subject: init. 1AQQW051 --- ReferenceCode/Haswell/Protocol/CpuInfo/CpuInfo.c | 25 ++++++++ ReferenceCode/Haswell/Protocol/CpuInfo/CpuInfo.h | 79 ++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 ReferenceCode/Haswell/Protocol/CpuInfo/CpuInfo.c create mode 100644 ReferenceCode/Haswell/Protocol/CpuInfo/CpuInfo.h (limited to 'ReferenceCode/Haswell/Protocol/CpuInfo') diff --git a/ReferenceCode/Haswell/Protocol/CpuInfo/CpuInfo.c b/ReferenceCode/Haswell/Protocol/CpuInfo/CpuInfo.c new file mode 100644 index 0000000..01f84c5 --- /dev/null +++ b/ReferenceCode/Haswell/Protocol/CpuInfo/CpuInfo.c @@ -0,0 +1,25 @@ +/** @file + Protocol used for CPU driver to provide the CPU information. + +@copyright + Copyright (c) 1999 - 2012 Intel Corporation. All rights reserved + This software and associated documentation (if any) is furnished + under a license and may only be used or copied in accordance + with the terms of the license. Except as permitted by such + license, no part of this software or documentation may be + reproduced, stored in a retrieval system, or transmitted in any + form or by any means without the express written consent of + Intel Corporation. + + This file contains an 'Intel Peripheral Driver' and is + licensed for Intel CPUs and chipsets under the terms of your + license agreement with Intel or your vendor. This file may + be modified by the user, subject to additional terms of the + license agreement +**/ +#include "Tiano.h" +#include EFI_PROTOCOL_DEFINITION (CpuInfo) + +EFI_GUID gDxeCpuInfoProtocolGuid = DXE_CPU_INFO_PROTOCOL_GUID; + +EFI_GUID_STRING(&gDxeCpuInfoProtocolGuid, "CPU Information", "CPU information from CPU Drivers"); diff --git a/ReferenceCode/Haswell/Protocol/CpuInfo/CpuInfo.h b/ReferenceCode/Haswell/Protocol/CpuInfo/CpuInfo.h new file mode 100644 index 0000000..394386f --- /dev/null +++ b/ReferenceCode/Haswell/Protocol/CpuInfo/CpuInfo.h @@ -0,0 +1,79 @@ +/** @file + Protocol used to report CPU information + +@copyright + Copyright (c) 1999 - 2014 Intel Corporation. All rights reserved + This software and associated documentation (if any) is furnished + under a license and may only be used or copied in accordance + with the terms of the license. Except as permitted by such + license, no part of this software or documentation may be + reproduced, stored in a retrieval system, or transmitted in any + form or by any means without the express written consent of + Intel Corporation. + + This file contains an 'Intel Peripheral Driver' and is + licensed for Intel CPUs and chipsets under the terms of your + license agreement with Intel or your vendor. This file may + be modified by the user, subject to additional terms of the + license agreement +**/ +#ifndef _CPU_INFO_H_ +#define _CPU_INFO_H_ + +EFI_FORWARD_DECLARATION (DXE_CPU_INFO_PROTOCOL_GUID); +#define DXE_CPU_INFO_PROTOCOL_GUID \ + { \ + 0xe223cf65, 0xf6ce, 0x4122, 0xb3, 0xaf, 0x4b, 0xd1, 0x8a, 0xff, 0x40, 0xa1 \ + } + +/// +/// Protocol revision number +/// Any backwards compatible changes to this protocol will result in an update in the revision number +/// Major changes will require publication of a new protocol +/// +#define DXE_CPU_INFO_REVISION_1 1 + +/// +/// RCVersion[7:0] is the release number. +/// For example: +/// Version 0.7.1 should be 00 07 01 00 (0x00070100) +/// +#define CPU_RC_VERSION 0x01090000 + +extern EFI_GUID gDxeCpuInfoProtocolGuid; + +// +// Forward reference for ANSI C compatibility +// +typedef struct _DXE_CPU_INFO_PROTOCOL DXE_CPU_INFO_PROTOCOL; + +// +// CPU Common Feature Definition +// + +/// +/// The processor Command Feature Definition is a super set and abstracts from hardware. +/// +#define TXT_SUPPORT 1 +#define VMX_SUPPORT (1 << 1) +#define XD_SUPPORT (1 << 2) +#define DCA_SUPPORT (1 << 3) +#define XAPIC_SUPPORT (1 << 4) +#define AES_SUPPORT (1 << 5) +#define HT_SUPPORT (1 << 6) +#define DEBUG_SUPPORT (1 << 7) +#define DEBUG_LOCK_SUPPORT (1 << 8) + +/// +/// Interface structure for the CPU Info Protocol +/// +struct _DXE_CPU_INFO_PROTOCOL { + UINT8 Revision; ///< Revision for the protocol structure. + UINT32 RcVersion; ///< Processor Features information. + // + // Bit definition for functionality enable/disable + // + UINT64 CpuCommonFeatures; ///< CPU Supported Feature. Output from CPU code. +}; + +#endif -- cgit v1.2.3