/* Recover from PTC deadlocks conditions. Recovery requires stepping thru each TLB flush transaction. The recovery sequence is somewhat tricky & is coded in assembly language.  */
void sn2_ptc_deadlock_recovery(short *, short, short, int, volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long)
/* Recover from PTC deadlocks conditions. Recovery requires stepping thru each TLB flush transaction. The recovery sequence is somewhat tricky & is coded in assembly language.  */
void sn2_ptc_deadlock_recovery(short *, short, short, int, volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long)
{
	short nasid, i;
	unsigned long *piows, zeroval, n;
	__get_cpu_var(ptcstats).deadlocks++;
	piows = (unsigned long *) pda->pio_write_status_addr;
	zeroval = pda->pio_write_status_val;
	for (i=ib; i <= ie; i++) {
		nasid = nasids[i];
		if (local_node_uses_ptc_ga(is_shub1()) && nasid == mynasid)
			continue;
		ptc0 = CHANGE_NASID(nasid, ptc0);
		if (ptc1)
			ptc1 = CHANGE_NASID(nasid, ptc1);
		n = sn2_ptc_deadlock_recovery_core(ptc0, data0, ptc1, data1, piows, zeroval);
		__get_cpu_var(ptcstats).deadlocks2 += n;
	}
}