]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg RegisterCpuFeaturesLib: Match data type and format specifier
authorZeng, Star <star.zeng@intel.com>
Tue, 4 Feb 2020 07:02:04 +0000 (15:02 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 19 Feb 2020 05:36:42 +0000 (05:36 +0000)
Match data type and format specifier for printing.
1. Type cast ProcessorNumber and FeatureIndex to UINT32
  as %d only expects a UINT32.
2. Use %08x instead of %08lx for CacheControl to print Index
  as it is UINT32 type.
3. Use %016lx instead of %08lx for MemoryMapped to print
  (Index | LShiftU64 (HighIndex, 32)) as it is UINT64 type.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c

index cdee6d92abe7af996d09632649e1657c614025fd..5c673fa8cf417d1202a92b91115745d914112879 100644 (file)
@@ -504,8 +504,8 @@ DumpRegisterTableOnProcessor (
       DEBUG ((\r
         DebugPrintErrorLevel,\r
         "Processor: %04d: Index %04d, MSR  : %08x, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",\r
-        ProcessorNumber,\r
-        FeatureIndex,\r
+        (UINT32) ProcessorNumber,\r
+        (UINT32) FeatureIndex,\r
         RegisterTableEntry->Index,\r
         RegisterTableEntry->ValidBitStart,\r
         RegisterTableEntry->ValidBitLength,\r
@@ -516,8 +516,8 @@ DumpRegisterTableOnProcessor (
       DEBUG ((\r
         DebugPrintErrorLevel,\r
         "Processor: %04d: Index %04d, CR   : %08x, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",\r
-        ProcessorNumber,\r
-        FeatureIndex,\r
+        (UINT32) ProcessorNumber,\r
+        (UINT32) FeatureIndex,\r
         RegisterTableEntry->Index,\r
         RegisterTableEntry->ValidBitStart,\r
         RegisterTableEntry->ValidBitLength,\r
@@ -527,9 +527,9 @@ DumpRegisterTableOnProcessor (
     case MemoryMapped:\r
       DEBUG ((\r
         DebugPrintErrorLevel,\r
-        "Processor: %04d: Index %04d, MMIO : %08lx, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",\r
-        ProcessorNumber,\r
-        FeatureIndex,\r
+        "Processor: %04d: Index %04d, MMIO : %016lx, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",\r
+        (UINT32) ProcessorNumber,\r
+        (UINT32) FeatureIndex,\r
         RegisterTableEntry->Index | LShiftU64 (RegisterTableEntry->HighIndex, 32),\r
         RegisterTableEntry->ValidBitStart,\r
         RegisterTableEntry->ValidBitLength,\r
@@ -539,9 +539,9 @@ DumpRegisterTableOnProcessor (
     case CacheControl:\r
       DEBUG ((\r
         DebugPrintErrorLevel,\r
-        "Processor: %04d: Index %04d, CACHE: %08lx, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",\r
-        ProcessorNumber,\r
-        FeatureIndex,\r
+        "Processor: %04d: Index %04d, CACHE: %08x, Bit Start: %02d, Bit Length: %02d, Value: %016lx\r\n",\r
+        (UINT32) ProcessorNumber,\r
+        (UINT32) FeatureIndex,\r
         RegisterTableEntry->Index,\r
         RegisterTableEntry->ValidBitStart,\r
         RegisterTableEntry->ValidBitLength,\r
@@ -552,8 +552,8 @@ DumpRegisterTableOnProcessor (
       DEBUG ((\r
         DebugPrintErrorLevel,\r
         "Processor: %04d: Index %04d, SEMAP: %s\r\n",\r
-        ProcessorNumber,\r
-        FeatureIndex,\r
+        (UINT32) ProcessorNumber,\r
+        (UINT32) FeatureIndex,\r
         mDependTypeStr[MIN ((UINT32)RegisterTableEntry->Value, InvalidDepType)]\r
         ));\r
       break;\r