]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupportX64.c
Refine code to make code run more safely.
[mirror_edk2.git] / MdeModulePkg / Universal / DebugSupportDxe / X64 / PlDebugSupportX64.c
index 8e623b9419b2d2c2f862b2ab578c832111569bd5..fa8869d287363d3d3c315c5d24e66c2c57f6c445 100644 (file)
@@ -36,9 +36,9 @@ GetInterruptHandleFromIdt (
   // InterruptHandle 16-31 : OffsetHigh\r
   // InterruptHandle 32-63 : OffsetUpper\r
   //\r
-  ((UINT16 *) &InterruptHandle)[0] = (UINT16) IdtGateDecriptor->Bits.OffsetLow;\r
-  ((UINT16 *) &InterruptHandle)[1] = (UINT16) IdtGateDecriptor->Bits.OffsetHigh;\r
-  ((UINT32 *) &InterruptHandle)[1] = (UINT32) IdtGateDecriptor->Bits.OffsetUpper;\r
+  InterruptHandle = ((UINTN) IdtGateDecriptor->Bits.OffsetLow) |\r
+                    (((UINTN) IdtGateDecriptor->Bits.OffsetHigh)  << 16) |\r
+                    (((UINTN) IdtGateDecriptor->Bits.OffsetUpper) << 32) ;\r
 \r
   return InterruptHandle;\r
 }\r