/*
- * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
unsigned int client_el = sdei_client_el();
/* Return error if called without an active event */
- disp_ctx = pop_dispatch();
+ disp_ctx = get_outstanding_dispatch();
if (!disp_ctx)
return SDEI_EDENY;
map = disp_ctx->map;
assert(map);
-
se = get_event_entry(map);
- SDEI_LOG("EOI:%lx, %d spsr:%lx elr:%lx\n", read_mpidr_el1(),
- map->ev_num, read_spsr_el3(), read_elr_el3());
-
- if (is_event_shared(map))
- sdei_map_lock(map);
-
act = resume ? DO_COMPLETE_RESUME : DO_COMPLETE;
if (!can_sdei_state_trans(se, act)) {
if (is_event_shared(map))
return SDEI_EDENY;
}
+ /* Having done sanity checks, pop dispatch */
+ pop_dispatch();
+
+ SDEI_LOG("EOI:%lx, %d spsr:%lx elr:%lx\n", read_mpidr_el1(),
+ map->ev_num, read_spsr_el3(), read_elr_el3());
+
+ if (is_event_shared(map))
+ sdei_map_lock(map);
+
/*
* Restore Non-secure to how it was originally interrupted. Once done,
* it's up-to-date with the saved copy.