static bool clear_masked_cond(volatile event_word_t *word)
{
	event_word_t new, old, w;

	w = *word;

	do {
		if (w & (1 << EVTCHN_FIFO_PENDING))
			return false;

		old = w & ~(1 << EVTCHN_FIFO_BUSY);
		new = old & ~(1 << EVTCHN_FIFO_MASKED);
		w = sync_cmpxchg(word, old, new);
	} while (w != old);

	return true;
}
static bool clear_masked_cond(volatile event_word_t *word)
{
	event_word_t new, old, w;

	w = *word;

	do {
		if (w & (1 << EVTCHN_FIFO_PENDING))
			return false;

		old = w & ~(1 << EVTCHN_FIFO_BUSY);
		new = old & ~(1 << EVTCHN_FIFO_MASKED);
		w = sync_cmpxchg(word, old, new);
	} while (w != old);

	return true;
}