/* This function scans the cpu-private fault map & clears all bits that are set. The function returns a bitmap that indicates the bits that were cleared. Note that sense the maps may be updated asynchronously by the GRU, atomic operations must be used to clear bits.  */
static void get_clear_fault_map(struct gru_state *gru, struct gru_tlb_fault_map *imap, struct gru_tlb_fault_map *dmap)
/* This function scans the cpu-private fault map & clears all bits that are set. The function returns a bitmap that indicates the bits that were cleared. Note that sense the maps may be updated asynchronously by the GRU, atomic operations must be used to clear bits.  */
static void get_clear_fault_map(struct gru_state *gru, struct gru_tlb_fault_map *imap, struct gru_tlb_fault_map *dmap)
{
	unsigned long i, k;
	struct gru_tlb_fault_map *tfm;
	tfm = get_tfm_for_cpu(gru, gru_cpu_fault_map_id());
	prefetchw(tfm);
	for (i = 0; i < BITS_TO_LONGS(GRU_NUM_CBE); i++) {
		k = tfm->fault_bits[i];
		if (k)
			k = xchg(&tfm->fault_bits[i], 0UL);
		imap->fault_bits[i] = k;
		k = tfm->done_bits[i];
		if (k)
			k = xchg(&tfm->done_bits[i], 0UL);
		dmap->fault_bits[i] = k;
	}
	gru_flush_cache(tfm);
}