summaryrefslogtreecommitdiff
path: root/UefiCpuPkg
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-12-17 02:38:26 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-12-17 02:38:26 +0000
commit304a39b746f947398d2b084ef8623a51f21e49d0 (patch)
tree426465779e3d5393afa0ef8e99b0a12f08e14ef2 /UefiCpuPkg
parentbcec20df61bd3c43943a21557e784ac0ae37e6ac (diff)
downloadedk2-platforms-304a39b746f947398d2b084ef8623a51f21e49d0.tar.xz
Fix a bug that the size of a gate descriptor in the IDT is 8 bytes. The size is 8 bytes in 32-bit mode, while it is 16 bytes in 64-bit mode. Replace the hard-coded size with a sizeof.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11177 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r--UefiCpuPkg/CpuDxe/CpuDxe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c
index c5f3bb76f4..6e7498344e 100644
--- a/UefiCpuPkg/CpuDxe/CpuDxe.c
+++ b/UefiCpuPkg/CpuDxe/CpuDxe.c
@@ -1082,7 +1082,7 @@ InitInterruptDescriptorTable (
if ((OldIdtPtr.Base != 0) && ((OldIdtPtr.Limit & 7) == 7)) {
OldIdt = (IA32_IDT_GATE_DESCRIPTOR*) OldIdtPtr.Base;
- OldIdtSize = (OldIdtPtr.Limit + 1) / 8;
+ OldIdtSize = (OldIdtPtr.Limit + 1) / sizeof (IA32_IDT_GATE_DESCRIPTOR);
} else {
OldIdt = NULL;
OldIdtSize = 0;