]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. removed an extra call to SetVectorBase() in the SetMode() function.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 1 Jun 2009 07:16:03 +0000 (07:16 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 1 Jun 2009 07:16:03 +0000 (07:16 +0000)
2. implemented GetInterruptLine() function.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8418 6f19259b-4bc3-4df7-8a09-765794883524

PcAtChipsetPkg/8259InterruptControllerDxe/8259.c
PcAtChipsetPkg/8259InterruptControllerDxe/8259.h
PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf

index 7d33f847e7212ced5069ac146d799d8af232e35a..ac0642750cbcc2ab9d68b25e5a01d8332addd225 100644 (file)
@@ -209,8 +209,8 @@ Interrupt8259SetVectorBase (
     IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, Mask);\r
   }\r
 \r
-  IoWrite8 (LEGACY_8259_CONTROL_REGISTER_SLAVE, 0x20);\r
-  IoWrite8 (LEGACY_8259_CONTROL_REGISTER_MASTER, 0x20);\r
+  IoWrite8 (LEGACY_8259_CONTROL_REGISTER_SLAVE, LEGACY_8259_EOI);\r
+  IoWrite8 (LEGACY_8259_CONTROL_REGISTER_MASTER, LEGACY_8259_EOI);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -351,11 +351,6 @@ Interrupt8259SetMode (
     //\r
     // Write new legacy mode mask/trigger level\r
     //\r
-    Interrupt8259SetVectorBase (This, LEGACY_MODE_BASE_VECTOR_MASTER, LEGACY_MODE_BASE_VECTOR_SLAVE);\r
-\r
-    //\r
-    // Enable Interrupts\r
-    //\r
     Interrupt8259WriteMask (mLegacyModeMask, mLegacyModeEdgeLevel);\r
 \r
     return EFI_SUCCESS;\r
@@ -391,11 +386,6 @@ Interrupt8259SetMode (
     //\r
     // Write new protected mode mask/trigger level\r
     //\r
-    Interrupt8259SetVectorBase (This, PROTECTED_MODE_BASE_VECTOR_MASTER, PROTECTED_MODE_BASE_VECTOR_SLAVE);\r
-\r
-    //\r
-    // Enable Interrupts\r
-    //\r
     Interrupt8259WriteMask (mProtectedModeMask, mProtectedModeEdgeLevel);\r
 \r
     return EFI_SUCCESS;\r
@@ -519,7 +509,33 @@ Interrupt8259GetInterruptLine (
   OUT UINT8                     *Vector\r
   )\r
 {\r
-  return EFI_UNSUPPORTED;\r
+  EFI_PCI_IO_PROTOCOL *PciIo;\r
+  UINT8               InterruptLine;\r
+  EFI_STATUS          Status;\r
+\r
+  Status = gBS->HandleProtocol (\r
+                  PciHandle,\r
+                  &gEfiPciIoProtocolGuid,\r
+                  (VOID **) &PciIo\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  PciIo->Pci.Read (\r
+               PciIo,\r
+               EfiPciIoWidthUint8,\r
+               PCI_INT_LINE_OFFSET,\r
+               1,\r
+               &InterruptLine\r
+               );\r
+  //\r
+  // Interrupt line is same location for standard PCI cards, standard\r
+  // bridge and CardBus bridge.\r
+  //\r
+  *Vector = InterruptLine;\r
+\r
+  return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
index 85b8c7af23d4dfb1fb887de2874b5b7e20d0ad4b..8e4a41e68b161bb9fb136e5f8d1688e3f7bd53a0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Driver implementing the Tiano Legacy 8259 Protocol\r
 \r
-Copyright (c) 2005, 2009, Intel Corporation                                                         \r
+Copyright (c) 2005 - 2009, Intel Corporation                                                         \r
 All rights reserved. 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
@@ -18,11 +18,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <FrameworkDxe.h>\r
 \r
 #include <Protocol/Legacy8259.h>\r
+#include <Protocol/PciIo.h>\r
 \r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/IoLib.h>\r
+#include <Library/BaseLib.h>\r
 \r
+#include <IndustryStandard/Pci22.h>\r
 //\r
 // 8259 Hardware definitions\r
 //\r
index d0bb1dc0eafc6670827a395e98e506632fa49a46..a40ac77f92d8c48f2025797997c1c6f7435a294a 100644 (file)
@@ -1,7 +1,7 @@
 #/** @file\r
 # 8259 Interrupt Controller driver\r
 #\r
-# Copyright (c) 2005 - 2007, 2009, Intel Corporation                                                         \r
+# Copyright (c) 2005 - 2009, Intel Corporation                                                         \r
 # All rights reserved. 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
@@ -40,6 +40,7 @@
 \r
 [Protocols]\r
   gEfiLegacy8259ProtocolGuid                    # PROTOCOL ALWAYS_PRODUCED\r
+  gEfiPciIoProtocolGuid\r
 \r
 [Depex]\r
   TRUE\r