/**@file\r
This contains the installation function for the driver.\r
- \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
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+Copyright (c) 2005 - 2009, 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
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
UINT8 mSlaveBase = 0xff;\r
EFI_8259_MODE mMode = Efi8259ProtectedMode;\r
UINT16 mProtectedModeMask = 0xffff;\r
-UINT16 mLegacyModeMask = 0x06b8;\r
+UINT16 mLegacyModeMask = FixedPcdGet16(Pcd8259LegacyModeMask);\r
UINT16 mProtectedModeEdgeLevel = 0x0000;\r
-UINT16 mLegacyModeEdgeLevel = 0x0000;\r
+UINT16 mLegacyModeEdgeLevel = FixedPcdGet16(Pcd8259LegacyModeEdgeLevel);\r
\r
//\r
// Worker Functions\r
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
//\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
//\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
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
);\r
return Status;\r
}\r
-\r