diff options
Diffstat (limited to 'services')
-rw-r--r-- | services/std_svc/sdei/sdei_intr_mgmt.c | 11 | ||||
-rw-r--r-- | services/std_svc/sdei/sdei_main.c | 21 | ||||
-rw-r--r-- | services/std_svc/sdei/sdei_private.h | 7 |
3 files changed, 28 insertions, 11 deletions
diff --git a/services/std_svc/sdei/sdei_intr_mgmt.c b/services/std_svc/sdei/sdei_intr_mgmt.c index c0bd9de6..a7104b4f 100644 --- a/services/std_svc/sdei/sdei_intr_mgmt.c +++ b/services/std_svc/sdei/sdei_intr_mgmt.c @@ -520,15 +520,8 @@ int sdei_dispatch_event(int ev_num, unsigned int preempted_sec_state) if (!map) return -1; - /* - * Statically-bound or dynamic maps are dispatched only as a result of - * interrupt, and not upon explicit request. - */ - if (is_map_dynamic(map) || is_map_bound(map)) - return -1; - - /* The event must be private */ - if (is_event_shared(map)) + /* Only explicit events can be dispatched */ + if (!is_map_explicit(map)) return -1; /* Examine state of dispatch stack */ diff --git a/services/std_svc/sdei/sdei_main.c b/services/std_svc/sdei/sdei_main.c index 9589a252..f881ba82 100644 --- a/services/std_svc/sdei/sdei_main.c +++ b/services/std_svc/sdei/sdei_main.c @@ -1,5 +1,5 @@ /* - * 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 */ @@ -111,6 +111,9 @@ void sdei_class_init(sdei_class_t class) /* No shared mapping should have signalable property */ assert(!is_event_signalable(map)); + + /* Shared mappings can't be explicit */ + assert(!is_map_explicit(map)); #endif /* Skip initializing the wrong priority */ @@ -162,6 +165,16 @@ void sdei_class_init(sdei_class_t class) /* Make sure it's a private event */ assert(is_event_private(map)); + + /* + * Other than priority, explicit events can only have explicit + * and private flags set. + */ + if (is_map_explicit(map)) { + assert((map->map_flags | SDEI_MAPF_CRITICAL) == + (SDEI_MAPF_EXPLICIT | SDEI_MAPF_PRIVATE + | SDEI_MAPF_CRITICAL)); + } #endif /* Skip initializing the wrong priority */ @@ -174,6 +187,12 @@ void sdei_class_init(sdei_class_t class) assert(map->intr == SDEI_DYN_IRQ); assert(is_event_normal(map)); num_dyn_priv_slots++; + } else if (is_map_explicit(map)) { + /* + * Explicit mappings don't have a backing + * SDEI interrupt, but verify that anyway. + */ + assert(map->intr == SDEI_DYN_IRQ); } else { /* * Private mappings must be bound to private diff --git a/services/std_svc/sdei/sdei_private.h b/services/std_svc/sdei/sdei_private.h index 44db4193..45d537f5 100644 --- a/services/std_svc/sdei/sdei_private.h +++ b/services/std_svc/sdei/sdei_private.h @@ -1,5 +1,5 @@ /* - * 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 */ @@ -137,6 +137,11 @@ static inline void set_map_bound(sdei_ev_map_t *map) map->map_flags |= BIT(_SDEI_MAPF_BOUND_SHIFT); } +static inline int is_map_explicit(sdei_ev_map_t *map) +{ + return ((map->map_flags & BIT(_SDEI_MAPF_EXPLICIT_SHIFT)) != 0); +} + static inline void clr_map_bound(sdei_ev_map_t *map) { map->map_flags &= ~(BIT(_SDEI_MAPF_BOUND_SHIFT)); |