From 43f69915d9ff15ee437f9e8869d7ae33780943b3 Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Mon, 15 Aug 2011 16:47:18 +0000 Subject: ArmPkg/PL390Gic: Fix RegisterInterruptSource() to be able to unregister an interrupt handler git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12135 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPkg/Drivers/PL390Gic/PL390GicDxe.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ArmPkg') diff --git a/ArmPkg/Drivers/PL390Gic/PL390GicDxe.c b/ArmPkg/Drivers/PL390Gic/PL390GicDxe.c index 8bf818768e..02853a2f31 100644 --- a/ArmPkg/Drivers/PL390Gic/PL390GicDxe.c +++ b/ArmPkg/Drivers/PL390Gic/PL390GicDxe.c @@ -80,7 +80,7 @@ RegisterInterruptSource ( if (Source > PcdGet32(PcdGicNumInterrupts)) { ASSERT(FALSE); return EFI_UNSUPPORTED; - } + } if ((Handler == NULL) && (gRegisteredInterruptHandlers[Source] == NULL)) { return EFI_INVALID_PARAMETER; @@ -91,7 +91,13 @@ RegisterInterruptSource ( } gRegisteredInterruptHandlers[Source] = Handler; - return This->EnableInterruptSource(This, Source); + + // If the interrupt handler is unregistered then disable the interrupt + if (NULL == Handler){ + return This->DisableInterruptSource (This, Source); + } else { + return This->EnableInterruptSource (This, Source); + } } /** -- cgit v1.2.3