Lines Matching defs:priority

8  * Exception handlers at EL3, their priority levels, and management.
37 * Convert index into secure priority using the platform-defined priority bits
47 /* Returns whether given priority is in secure priority range */
53 /* Translate priority to the index in the priority array */
54 static unsigned int pri_to_idx(unsigned int priority)
58 idx = EHF_PRI_TO_IDX(priority, exception_data.pri_bits);
65 /* Return whether there are outstanding priority activation */
77 * Return the current priority index of this CPU. If no priority is active,
85 /* Current priority is the right-most bit */
90 * Mark priority active by setting the corresponding bit in active_pri_bits and
91 * programming the priority mask.
99 void ehf_activate_priority(unsigned int priority)
106 * Query interrupt controller for the running priority, or idle priority
107 * if no interrupts are being handled. The requested priority must be
108 * less (higher priority) than the active running priority.
111 if (priority >= run_pri) {
112 ERROR("Running priority higher (0x%x) than requested (0x%x)\n",
113 run_pri, priority);
118 * If there were priority activations already, the requested priority
119 * must be less (higher priority) than the current highest priority
123 idx = pri_to_idx(priority);
126 ERROR("Activation priority mismatch: req=0x%x current=0x%x\n",
127 priority, IDX_TO_PRI(cur_pri_idx));
131 /* Set the bit corresponding to the requested priority */
135 * Program priority mask for the activated level. Check that the new
136 * priority mask is setting a higher priority level than the existing
139 old_mask = plat_ic_set_priority_mask(priority);
140 if (priority >= old_mask) {
141 ERROR("Requested priority (0x%x) lower than Priority Mask (0x%x)\n",
142 priority, old_mask);
147 * If this is the first activation, save the priority mask. This will be
157 * Mark priority inactive by clearing the corresponding bit in active_pri_bits,
158 * and programming the priority mask.
166 void ehf_deactivate_priority(unsigned int priority)
173 * Query interrupt controller for the running priority, or idle priority
174 * if no interrupts are being handled. The requested priority must be
175 * less (higher priority) than the active running priority.
178 if (priority >= run_pri) {
179 ERROR("Running priority higher (0x%x) than requested (0x%x)\n",
180 run_pri, priority);
185 * Deactivation is allowed only when there are priority activations, and
186 * the deactivation priority level must match the current activated
187 * priority.
190 idx = pri_to_idx(priority);
193 ERROR("Deactivation priority mismatch: req=0x%x current=0x%x\n",
194 priority, IDX_TO_PRI(cur_pri_idx));
198 /* Clear bit corresponding to highest priority */
202 * Restore priority mask corresponding to the next priority, or the
209 old_mask = plat_ic_set_priority_mask(priority);
211 if (old_mask > priority) {
212 ERROR("Deactivation priority (0x%x) lower than Priority Mask (0x%x)\n",
213 priority, old_mask);
222 * set Priority Mask to the highest Non-secure priority so that Non-secure
225 * If the current running priority is in the secure range, or if there are
226 * outstanding priority activations, this function does nothing.
236 /* If the running priority is in the secure range, do nothing */
268 * If there the current running priority is in the secure range, or if there are
269 * outstanding priority activations, this function does nothing.
279 /* If the running priority is in the secure range, do nothing */
300 * priority mask set upon calling ehf_allow_ns_preemption()
316 * Program Priority Mask to the original Non-secure priority such that
334 * therefore have stashed the Non-secure priority mask.
338 /* Make sure no priority levels are active when requesting this */
340 ERROR("PE %lx has priority activations: 0x%x\n",
370 /* If running priority is in secure range, return false */
379 * - There wouldn't have been priority activations;
413 * a higher-priority interrupt of another type.
420 /* Having acknowledged the interrupt, get the running priority */
423 /* Check EL3 interrupt priority is in secure range */
427 * Translate the priority to a descriptor index. We do this by masking
428 * and shifting the running priority value (platform-supplied).
432 /* Validate priority */
438 ERROR("No EL3 exception handler for priority 0x%x\n",
464 * Make sure that priority water mark has enough bits to represent the
465 * whole priority array.
472 * Bit 7 of GIC priority must be 0 for secure interrupts. This means
496 * Register a handler at the supplied priority. Registration is allowed only if
498 * time. The priority for which the handler is being registered must also accord
511 /* Ensure we register for valid priority */
518 ERROR("Handler already registered for priority 0x%x\n", pri);