]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
ShellPkg/setvar: Add assertion indicating TempData shouldn't be NULL
[mirror_edk2.git] / UefiCpuPkg / Library / RegisterCpuFeaturesLib / RegisterCpuFeaturesLib.c
index 32189cbc79c954ce7d6675ddf79c6a33e83ddc5e..7ef015537401b52e77fdcefa0aabbac447414c42 100644 (file)
@@ -240,7 +240,7 @@ CheckCpuFeaturesDependency (
 /**
   Worker function to register CPU Feature.
 
-  @param[in]  CpuFeature                Pointer to CPU feature entry
+  @param[in]  CpuFeature            Pointer to CPU feature entry
 
   @retval  RETURN_SUCCESS           The CPU feature was successfully registered.
   @retval  RETURN_OUT_OF_RESOURCES  There are not enough resources to register
@@ -372,35 +372,37 @@ SetCpuFeaturesBitMask (
 /**
   Registers a CPU Feature.
 
-  @param  GetConfigDataFunc  CPU feature get configuration data function.  This
-                             is an optional parameter that may be NULL.  If NULL,
-                             then the most recently registered function for the
-                             CPU feature is used.  If no functions are registered
-                             for a CPU feature, then the CPU configuration data
-                             for the registered feature is NULL.
-  @param  SupportFunc        CPU feature support function.  This is an optional
-                             parameter that may be NULL.  If NULL, then the most
-                             recently registered function for the CPU feature is
-                             used. If no functions are registered for a CPU
-                             feature, then the CPU feature is assumed to be
-                             supported by all CPUs.
-  @param  InitializeFunc     CPU feature initialize function.  This is an optional
-                             parameter that may be NULL.  If NULL, then the most
-                             recently registered function for the CPU feature is
-                             used. If no functions are registered for a CPU
-                             feature, then the CPU feature initialization is
-                             skipped.
-  @param  ...                Variable argument list of UINT32 CPU feature value.
-                             Values with no modifiers are the features provided
-                             by the registered functions.
-                             Values with CPU_FEATURE_BEFORE modifier are features
-                             that must be initialized after the features provided
-                             by the registered functions are used.
-                             Values with CPU_FEATURE_AFTER modifier are features
-                             that must be initialized before the features provided
-                             by the registered functions are used.
-                             The last argument in this variable argument list must
-                             always be CPU_FEATURE_END.
+  @param[in]  FeatureName        A Null-terminated Ascii string indicates CPU feature
+                                 name.
+  @param[in]  GetConfigDataFunc  CPU feature get configuration data function.  This
+                                 is an optional parameter that may be NULL.  If NULL,
+                                 then the most recently registered function for the
+                                 CPU feature is used.  If no functions are registered
+                                 for a CPU feature, then the CPU configuration data
+                                 for the registered feature is NULL.
+  @param[in]  SupportFunc        CPU feature support function.  This is an optional
+                                 parameter that may be NULL.  If NULL, then the most
+                                 recently registered function for the CPU feature is
+                                 used. If no functions are registered for a CPU
+                                 feature, then the CPU feature is assumed to be
+                                 supported by all CPUs.
+  @param[in]  InitializeFunc     CPU feature initialize function.  This is an optional
+                                 parameter that may be NULL.  If NULL, then the most
+                                 recently registered function for the CPU feature is
+                                 used. If no functions are registered for a CPU
+                                 feature, then the CPU feature initialization is
+                                 skipped.
+  @param[in]  ...                Variable argument list of UINT32 CPU feature value.
+                                 Values with no modifiers are the features provided
+                                 by the registered functions.
+                                 Values with CPU_FEATURE_BEFORE modifier are features
+                                 that must be initialized after the features provided
+                                 by the registered functions are used.
+                                 Values with CPU_FEATURE_AFTER modifier are features
+                                 that must be initialized before the features provided
+                                 by the registered functions are used.
+                                 The last argument in this variable argument list must
+                                 always be CPU_FEATURE_END.
 
   @retval  RETURN_SUCCESS           The CPU feature was successfully registered.
   @retval  RETURN_OUT_OF_RESOURCES  There are not enough resources to register
@@ -551,6 +553,7 @@ CpuRegisterTableWriteWorker (
   RegisterTableEntry = (CPU_REGISTER_TABLE_ENTRY *) (UINTN) RegisterTable->RegisterTableEntry;
   RegisterTableEntry[RegisterTable->TableLength].RegisterType   = RegisterType;
   RegisterTableEntry[RegisterTable->TableLength].Index          = (UINT32) Index;
+  RegisterTableEntry[RegisterTable->TableLength].HighIndex      = (UINT32) RShiftU64 (Index, 32);
   RegisterTableEntry[RegisterTable->TableLength].ValidBitStart  = ValidBitStart;
   RegisterTableEntry[RegisterTable->TableLength].ValidBitLength = ValidBitLength;
   RegisterTableEntry[RegisterTable->TableLength].Value          = Value;