From 026c3d34ee83b4df623cc80761450a53e9f7622b Mon Sep 17 00:00:00 2001 From: andrewfish Date: Wed, 24 Feb 2010 22:38:46 +0000 Subject: Updated Hardware Interrupt protocol to add an EOI member. Added ARM Data/Instruction syncronization barrier support to the ARM lib. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10063 6f19259b-4bc3-4df7-8a09-765794883524 --- Omap35xxPkg/InterruptDxe/HardwareInterrupt.c | 46 ++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 10 deletions(-) (limited to 'Omap35xxPkg/InterruptDxe/HardwareInterrupt.c') diff --git a/Omap35xxPkg/InterruptDxe/HardwareInterrupt.c b/Omap35xxPkg/InterruptDxe/HardwareInterrupt.c index 6e30eb7e67..eae92067d6 100644 --- a/Omap35xxPkg/InterruptDxe/HardwareInterrupt.c +++ b/Omap35xxPkg/InterruptDxe/HardwareInterrupt.c @@ -1,7 +1,7 @@ /** @file - Template for Metronome Architecture Protocol driver of the ARM flavor + Handle OMAP35xx interrupt controller - Copyright (c) 2008-2009, Apple Inc. All rights reserved. + Copyright (c) 2008-2010, Apple Inc. All rights reserved. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -143,7 +144,7 @@ EnableInterruptSource ( **/ EFI_STATUS EFIAPI -DisableInterruptSource( +DisableInterruptSource ( IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This, IN HARDWARE_INTERRUPT_SOURCE Source ) @@ -209,6 +210,28 @@ GetInterruptSourceState ( return EFI_SUCCESS; } +/** + Signal to the hardware that the End Of Intrrupt state + has been reached. + + @param This Instance pointer for this protocol + @param Source Hardware source of the interrupt + + @retval EFI_SUCCESS Source interrupt EOI'ed. + @retval EFI_DEVICE_ERROR Hardware could not be programmed. + +**/ +EFI_STATUS +EFIAPI +EndOfInterrupt ( + IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This, + IN HARDWARE_INTERRUPT_SOURCE Source + ) +{ + MmioWrite32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR); + ArmDataSyncronizationBarrier (); + return EFI_SUCCESS; +} /** @@ -232,19 +255,21 @@ IrqInterruptHandler ( UINT32 Vector; HARDWARE_INTERRUPT_HANDLER InterruptHandler; - Vector = MmioRead32(INTCPS_SIR_IRQ) & INTCPS_SIR_IRQ_MASK; + Vector = MmioRead32 (INTCPS_SIR_IRQ) & INTCPS_SIR_IRQ_MASK; // Needed to prevent infinite nesting when Time Driver lowers TPL MmioWrite32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR); - + ArmDataSyncronizationBarrier (); + InterruptHandler = gRegisteredInterruptHandlers[Vector]; if (InterruptHandler != NULL) { // Call the registered interrupt handler. - InterruptHandler(Vector, SystemContext); + InterruptHandler (Vector, SystemContext); } // Needed to clear after running the handler MmioWrite32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR); + ArmDataSyncronizationBarrier (); } // @@ -259,7 +284,8 @@ EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptProtocol = { RegisterInterruptSource, EnableInterruptSource, DisableInterruptSource, - GetInterruptSourceState + GetInterruptSourceState, + EndOfInterrupt }; // @@ -277,19 +303,19 @@ CpuProtocolInstalledNotification ( // // Get the cpu protocol that this driver requires. // - Status = gBS->LocateProtocol(&gEfiCpuArchProtocolGuid, NULL, (VOID **)&Cpu); + Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&Cpu); ASSERT_EFI_ERROR(Status); // // Unregister the default exception handler. // - Status = Cpu->RegisterInterruptHandler(Cpu, EXCEPT_ARM_IRQ, NULL); + Status = Cpu->RegisterInterruptHandler (Cpu, EXCEPT_ARM_IRQ, NULL); ASSERT_EFI_ERROR(Status); // // Register to receive interrupts // - Status = Cpu->RegisterInterruptHandler(Cpu, EXCEPT_ARM_IRQ, IrqInterruptHandler); + Status = Cpu->RegisterInterruptHandler (Cpu, EXCEPT_ARM_IRQ, IrqInterruptHandler); ASSERT_EFI_ERROR(Status); } -- cgit v1.2.3