summaryrefslogtreecommitdiff
path: root/common/runtime_svc.c
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2014-02-02 12:02:23 +0000
committerDan Handley <dan.handley@arm.com>2014-02-17 18:51:44 +0000
commit07f4e078b6871e5c74f6cb38f2726a2cfcb2b746 (patch)
tree9a97b777e588ace873fdd63e0fe7f6c826286f2e /common/runtime_svc.c
parent7421b4653dcfe6b10be5ca7167d2a5f3584c95c1 (diff)
Introduce new exception handling framework
This patch introduces the reworked exception handling logic which lays the foundation for accessing runtime services in later patches. The type of an exception has a greater say in the way it is handled. SP_EL3 is used as the stack pointer for: 1. Determining the type of exception and handling the unexpected ones on the exception stack 2. Saving and restoring the essential general purpose and system register state after exception entry and prior to exception exit. SP_EL0 is used as the stack pointer for handling runtime service requests e.g. SMCs. A new structure for preserving general purpose register state has been added to the 'cpu_context' structure. All assembler ensures that it does not use callee saved registers (x19-x29). The C runtime preserves them across functions calls. Hence EL3 code does not have to save and restore them explicitly. Since the exception handling framework has undergone substantial change, the changes have been kept in separate files to aid readability. These files will replace the existing ones in subsequent patches. Change-Id: Ice418686592990ff7a4260771e8d6676e6c8c5ef
Diffstat (limited to 'common/runtime_svc.c')
-rw-r--r--common/runtime_svc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/runtime_svc.c b/common/runtime_svc.c
index c0590784..0ea1bf55 100644
--- a/common/runtime_svc.c
+++ b/common/runtime_svc.c
@@ -39,6 +39,7 @@
#include <bl_common.h>
#include <psci.h>
#include <runtime_svc.h>
+#include <context.h>
#include <debug.h>
/*******************************************************************************
@@ -142,3 +143,11 @@ void runtime_svc_init()
error:
panic();
}
+
+void fault_handler(void *handle)
+{
+ gp_regs_next *gpregs_ctx = get_gpregs_ctx(handle);
+ ERROR("Unhandled synchronous fault. Register dump @ 0x%x \n",
+ gpregs_ctx);
+ panic();
+}