]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuDxe/CpuDxe.c
Fix a bug that the size of a gate descriptor in the IDT is 8 bytes. The size is 8...
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / CpuDxe.c
index c5f3bb76f4a0bc2c21ad7bce8fd60e4c61e9a27e..6e7498344e01e55211e101a91f40f94ac1b34caa 100644 (file)
@@ -1082,7 +1082,7 @@ InitInterruptDescriptorTable (
 \r
   if ((OldIdtPtr.Base != 0) && ((OldIdtPtr.Limit & 7) == 7)) {\r
     OldIdt = (IA32_IDT_GATE_DESCRIPTOR*) OldIdtPtr.Base;\r
-    OldIdtSize = (OldIdtPtr.Limit + 1) / 8;\r
+    OldIdtSize = (OldIdtPtr.Limit + 1) / sizeof (IA32_IDT_GATE_DESCRIPTOR);\r
   } else {\r
     OldIdt = NULL;\r
     OldIdtSize = 0;\r