From b460b8bf23633195535006b29e14c615f888fa24 Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Tue, 27 May 2014 16:54:31 +0100 Subject: [PATCH 1/2] Pass 'cookie' parameter to interrupt handler in BL3-1 The interrupt handling routine in BL3-1 expects a cookie as its last parameter which was not being passed when invoking the interrupt handler in BL3-1. This patch fixes that by passing a dummy cookie parameter in the x3 register. Fixes ARM-software/tf-issues#171 Change-Id: Ic98abbbd9f849e6f1c55343e865b5e0a4904a1c5 --- bl31/aarch64/runtime_exceptions.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bl31/aarch64/runtime_exceptions.S b/bl31/aarch64/runtime_exceptions.S index e3673f0d99..97ca956df2 100644 --- a/bl31/aarch64/runtime_exceptions.S +++ b/bl31/aarch64/runtime_exceptions.S @@ -125,6 +125,9 @@ /* Restore the reference to the 'handle' i.e. SP_EL3 */ mov x2, x20 + /* x3 will point to a cookie (not used now) */ + mov x3, xzr + /* Call the interrupt type handler */ blr x21 From a37810853630098559d93f1b9ecdc222e63ef9cf Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Wed, 28 May 2014 17:14:36 +0100 Subject: [PATCH 2/2] Fix compilation issue for IMF_READ_INTERRUPT_ID build flag This patch fixes the compilation issue for trusted firmware when the IMF_READ_INTERRUPT_ID is enabled. Change-Id: I94ab613b9bc96a7c1935796c674dc42246aaafee --- bl31/aarch64/runtime_exceptions.S | 3 ++- services/spd/tspd/tspd_main.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bl31/aarch64/runtime_exceptions.S b/bl31/aarch64/runtime_exceptions.S index 97ca956df2..a11cd71f1f 100644 --- a/bl31/aarch64/runtime_exceptions.S +++ b/bl31/aarch64/runtime_exceptions.S @@ -105,8 +105,9 @@ * Read the id of the highest priority pending interrupt. If * no interrupt is asserted then return to where we came from. */ + mov x19, #INTR_ID_UNAVAILABLE bl plat_ic_get_pending_interrupt_id - cmp x0, #INTR_ID_UNAVAILABLE + cmp x19, x0 b.eq interrupt_exit_\label #endif diff --git a/services/spd/tspd/tspd_main.c b/services/spd/tspd/tspd_main.c index 4477fd78b3..1a6913a57a 100644 --- a/services/spd/tspd/tspd_main.c +++ b/services/spd/tspd/tspd_main.c @@ -90,7 +90,7 @@ static uint64_t tspd_sel1_interrupt_handler(uint32_t id, #if IMF_READ_INTERRUPT_ID /* Check the security status of the interrupt */ - assert(ic_get_interrupt_group(id) == SECURE); + assert(plat_ic_get_interrupt_type(id) == INTR_TYPE_S_EL1); #endif /* Sanity check the pointer to this cpu's context */