]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Use a local variable and assign 0 to it, then use it as legacy interrupt table base...
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 18 Oct 2011 02:42:34 +0000 (02:42 +0000)
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 18 Oct 2011 02:42:34 +0000 (02:42 +0000)
Signed-off-by: li-elvin
Reviewed-by: mdkinney, ydong10
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12544 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Foundation/Library/Thunk16/X86Thunk.c

index ed24663b48a17dc081832fac6e24e0bc66493628..7f562cf484914f54d2d45e94c2e9cfa92885edc6 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -381,8 +381,15 @@ Returns:
 \r
 --*/\r
 {\r
-  RegisterSet->E.EIP = (UINT16)((UINT32 *)NULL)[IntNumber];\r
-  RegisterSet->E.CS  = (UINT16)(((UINT32 *)NULL)[IntNumber] >> 16);\r
+  UINT32  *VectorBase;\r
+  \r
+  //\r
+  // The base address of legacy interrupt vector table is 0.\r
+  // We use this base address to get the legacy interrupt handler.\r
+  //\r
+  VectorBase = 0;\r
+  RegisterSet->E.EIP = (UINT16)(VectorBase)[IntNumber];\r
+  RegisterSet->E.CS  = (UINT16)((VectorBase)[IntNumber] >> 16);\r
 \r
   return AsmThunk16 (ThunkContext, RegisterSet, Flags | THUNK_INTERRUPT);\r
 }\r