text: /** @file
    Header file for CpuPlatform Lib.
  
  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
  This program and the accompanying materials are licensed and made available under
  the terms and conditions of the BSD License that accompanies this distribution.
  The full text of the license may be found at
  http://opensource.org/licenses/bsd-license.php.
  
  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  
  **/
  
  #ifndef _CPU_PLATFORM_LIB_H_
  #define _CPU_PLATFORM_LIB_H_
  
  #include <CpuRegs.h>
  #include <CpuDataStruct.h>
  
  /**
    Check CPU Type of the platform
  
    @retval CPU_FAMILY              CPU type
  **/
  CPU_FAMILY
  EFIAPI
  GetCpuFamily (
    VOID
    );
  
  /**
    Return Cpu stepping type
  
    @retval CPU_STEPPING                   Cpu stepping type
  **/
  CPU_STEPPING
  EFIAPI
  GetCpuStepping (
    VOID
    );
  
  /**
    Return CPU Sku
  
    @retval UINT8              CPU Sku
  **/
  UINT8
  EFIAPI
  GetCpuSku (
    VOID
    );
  
  
  /**
    Returns the processor microcode revision of the processor installed in the system.
  
    @retval Processor Microcode Revision
  **/
  UINT32
  GetCpuUcodeRevision (
    VOID
    );
  
  /**
    Check if this microcode is correct one for processor
  
    @param[in] Cpuid               - processor CPUID
    @param[in] MicrocodeEntryPoint - entry point of microcode
    @param[in] Revision            - revision of microcode
  
    @retval CorrectMicrocode if this microcode is correct
  **/
  BOOLEAN
  CheckMicrocode (
    IN UINT32               Cpuid,
    IN CPU_MICROCODE_HEADER *MicrocodeEntryPoint,
    IN UINT32               *Revision
    );
  
  
  /**
    Check on the processor if SGX is supported.
  
    @retval True if SGX supported or FALSE if not
  **/
  BOOLEAN
  IsSgxSupported (
    VOID
    );
  
  /**
    Get processor generation
  
    @retval EnumSklCpu    Executing thread is Skylake
    @retval EnumKblCpu    Executing thread is Kabylake
  **/
  CPU_GENERATION
  GetCpuGeneration (
    VOID
    );
  #endif
  