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); } }
int _splraise(int s) { int cur = alpha_pal_rdps() & ALPHA_PSL_IPL_MASK; return (s > cur ? alpha_pal_swpipl(s) : cur); }