int hppa_ipi_intr(void *arg) { struct cpu_info *ci = curcpu(); struct cpu_softc *sc = ci->ci_softc; u_long ipi_pending; int bit = 0; /* Handle an IPI. */ ipi_pending = atomic_swap_ulong(&ci->ci_ipi, 0); KASSERT(ipi_pending); sc->sc_evcnt_ipi.ev_count++; while (ipi_pending) { if (ipi_pending & (1L << bit)) { sc->sc_evcnt_which_ipi[bit].ev_count++; (*ipifunc[bit])(); } ipi_pending &= ~(1L << bit); bit++; } return 1; }
int atomicExchange(volatile atomic_t& val, int exch) { volatile ulong_t* uvalue = reinterpret_cast<volatile ulong_t*>(&val.l); volatile ulong_t unewval = exch; return atomic_swap_ulong(uvalue, unewval); }