diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-01 07:16:03 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-01 07:16:03 +0000 |
commit | ae6a37f06bce9e1f6218409bc1087c6b34b63ed8 (patch) | |
tree | 6124fae1526d21353aa0a3ef155687d9527327e8 /PcAtChipsetPkg | |
parent | 6535652ebdfd4678719500d412a26e5641cb7931 (diff) | |
download | edk2-ae6a37f06bce9e1f6218409bc1087c6b34b63ed8.zip edk2-ae6a37f06bce9e1f6218409bc1087c6b34b63ed8.tar.gz edk2-ae6a37f06bce9e1f6218409bc1087c6b34b63ed8.tar.bz2 |
1. removed an extra call to SetVectorBase() in the SetMode() function.
2. implemented GetInterruptLine() function.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8418 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'PcAtChipsetPkg')
-rw-r--r-- | PcAtChipsetPkg/8259InterruptControllerDxe/8259.c | 42 | ||||
-rw-r--r-- | PcAtChipsetPkg/8259InterruptControllerDxe/8259.h | 5 | ||||
-rw-r--r-- | PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf | 3 |
3 files changed, 35 insertions, 15 deletions
diff --git a/PcAtChipsetPkg/8259InterruptControllerDxe/8259.c b/PcAtChipsetPkg/8259InterruptControllerDxe/8259.c index 7d33f84..ac06427 100644 --- a/PcAtChipsetPkg/8259InterruptControllerDxe/8259.c +++ b/PcAtChipsetPkg/8259InterruptControllerDxe/8259.c @@ -209,8 +209,8 @@ Interrupt8259SetVectorBase ( IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, Mask);
}
- IoWrite8 (LEGACY_8259_CONTROL_REGISTER_SLAVE, 0x20);
- IoWrite8 (LEGACY_8259_CONTROL_REGISTER_MASTER, 0x20);
+ IoWrite8 (LEGACY_8259_CONTROL_REGISTER_SLAVE, LEGACY_8259_EOI);
+ IoWrite8 (LEGACY_8259_CONTROL_REGISTER_MASTER, LEGACY_8259_EOI);
return EFI_SUCCESS;
}
@@ -351,11 +351,6 @@ Interrupt8259SetMode ( //
// Write new legacy mode mask/trigger level
//
- Interrupt8259SetVectorBase (This, LEGACY_MODE_BASE_VECTOR_MASTER, LEGACY_MODE_BASE_VECTOR_SLAVE);
-
- //
- // Enable Interrupts
- //
Interrupt8259WriteMask (mLegacyModeMask, mLegacyModeEdgeLevel);
return EFI_SUCCESS;
@@ -391,11 +386,6 @@ Interrupt8259SetMode ( //
// Write new protected mode mask/trigger level
//
- Interrupt8259SetVectorBase (This, PROTECTED_MODE_BASE_VECTOR_MASTER, PROTECTED_MODE_BASE_VECTOR_SLAVE);
-
- //
- // Enable Interrupts
- //
Interrupt8259WriteMask (mProtectedModeMask, mProtectedModeEdgeLevel);
return EFI_SUCCESS;
@@ -519,7 +509,33 @@ Interrupt8259GetInterruptLine ( OUT UINT8 *Vector
)
{
- return EFI_UNSUPPORTED;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ UINT8 InterruptLine;
+ EFI_STATUS Status;
+
+ Status = gBS->HandleProtocol (
+ PciHandle,
+ &gEfiPciIoProtocolGuid,
+ (VOID **) &PciIo
+ );
+ if (EFI_ERROR (Status)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint8,
+ PCI_INT_LINE_OFFSET,
+ 1,
+ &InterruptLine
+ );
+ //
+ // Interrupt line is same location for standard PCI cards, standard
+ // bridge and CardBus bridge.
+ //
+ *Vector = InterruptLine;
+
+ return EFI_SUCCESS;
}
/**
diff --git a/PcAtChipsetPkg/8259InterruptControllerDxe/8259.h b/PcAtChipsetPkg/8259InterruptControllerDxe/8259.h index 85b8c7a..8e4a41e 100644 --- a/PcAtChipsetPkg/8259InterruptControllerDxe/8259.h +++ b/PcAtChipsetPkg/8259InterruptControllerDxe/8259.h @@ -1,7 +1,7 @@ /** @file
Driver implementing the Tiano Legacy 8259 Protocol
-Copyright (c) 2005, 2009, Intel Corporation
+Copyright (c) 2005 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -18,11 +18,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <FrameworkDxe.h>
#include <Protocol/Legacy8259.h>
+#include <Protocol/PciIo.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
+#include <Library/BaseLib.h>
+#include <IndustryStandard/Pci22.h>
//
// 8259 Hardware definitions
//
diff --git a/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf b/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf index d0bb1dc..a40ac77 100644 --- a/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf +++ b/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf @@ -1,7 +1,7 @@ #/** @file
# 8259 Interrupt Controller driver
#
-# Copyright (c) 2005 - 2007, 2009, Intel Corporation
+# Copyright (c) 2005 - 2009, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -40,6 +40,7 @@ [Protocols]
gEfiLegacy8259ProtocolGuid # PROTOCOL ALWAYS_PRODUCED
+ gEfiPciIoProtocolGuid
[Depex]
TRUE
|