void splassert_check(int wantipl, const char *func) { struct cpu_info *ci = curcpu(); if (ci->ci_cpl < wantipl) splassert_fail(wantipl, ci->ci_cpl, func); if (wantipl == IPL_NONE && ci->ci_intrdepth != -1) splassert_fail(-1, ci->ci_intrdepth, func); }
void splassert_check(int wantipl, const char *func) { int curipl = alpha_pal_rdps() & ALPHA_PSL_IPL_MASK; /* * Tell soft interrupts apart from regular levels. */ if (wantipl < 0) wantipl = IPL_SOFTINT; /* * Depending on the system, hardware interrupts may occur either * at level 3 or level 4. Avoid false positives in the former case. */ if (curipl == ALPHA_PSL_IPL_IO - 1) curipl = ALPHA_PSL_IPL_IO; if (curipl < wantipl) { splassert_fail(wantipl, curipl, func); /* * If splassert_ctl is set to not panic, raise the ipl * in a feeble attempt to reduce damage. */ alpha_pal_swpipl(wantipl); } }
void arm_splassert_check(int wantipl, const char *func) { int oldipl = curcpu()->ci_cpl; if (oldipl < wantipl) { splassert_fail(wantipl, oldipl, func); /* * If the splassert_ctl is set to not panic, raise the ipl * in a feeble attempt to reduce damage. */ arm_intr_func.setipl(wantipl); } if (wantipl == IPL_NONE && curcpu()->ci_idepth != 0) { splassert_fail(-1, curcpu()->ci_idepth, func); } }
void splassert_check(int wantipl, const char *func) { int cpl = curcpu()->ci_ilevel; if (cpl < wantipl) { splassert_fail(wantipl, cpl, func); } }