summaryrefslogtreecommitdiff
path: root/ArmPkg/Drivers/PL390Gic/PL390GicDxe.c
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-15 16:47:18 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-15 16:47:18 +0000
commit43f69915d9ff15ee437f9e8869d7ae33780943b3 (patch)
treef66e9a80c394859e72e0886575ec0094dae528b4 /ArmPkg/Drivers/PL390Gic/PL390GicDxe.c
parent6b73be803b7a43035b673c9a8f7cd19420a1c331 (diff)
downloadedk2-43f69915d9ff15ee437f9e8869d7ae33780943b3.zip
edk2-43f69915d9ff15ee437f9e8869d7ae33780943b3.tar.gz
edk2-43f69915d9ff15ee437f9e8869d7ae33780943b3.tar.bz2
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
Diffstat (limited to 'ArmPkg/Drivers/PL390Gic/PL390GicDxe.c')
-rw-r--r--ArmPkg/Drivers/PL390Gic/PL390GicDxe.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ArmPkg/Drivers/PL390Gic/PL390GicDxe.c b/ArmPkg/Drivers/PL390Gic/PL390GicDxe.c
index 8bf8187..02853a2 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);
+ }
}
/**