コード例 #1
0
ファイル: s3c2xx0_intr.c プロジェクト: MarginC/kame
void
s3c2xx0_do_pending(int enable_int)
{
	static __cpu_simple_lock_t processing = __SIMPLELOCK_UNLOCKED;
	int oldirqstate, irqstate, spl_save;

	if (__cpu_simple_lock_try(&processing) == 0)
		return;

	spl_save = current_spl_level;

	oldirqstate = irqstate = disable_interrupts(I32_bit);

	if (enable_int)
		irqstate &= ~I32_bit;


#define	DO_SOFTINT(si,ipl)						\
	if (get_pending_softint() & SI_TO_IRQBIT(si)) {			\
		softint_pending &= ~SI_TO_IRQBIT(si);			\
                __raise(ipl);                                           \
		restore_interrupts(irqstate);				\
		softintr_dispatch(si);					\
		disable_interrupts(I32_bit);				\
		s3c2xx0_setipl(spl_save);				\
	}

	do {
		DO_SOFTINT(SI_SOFTSERIAL, IPL_SOFTSERIAL);
		DO_SOFTINT(SI_SOFTNET, IPL_SOFTNET);
		DO_SOFTINT(SI_SOFTCLOCK, IPL_SOFTCLOCK);
		DO_SOFTINT(SI_SOFT, IPL_SOFT);
	} while (get_pending_softint());

	__cpu_simple_unlock(&processing);

	restore_interrupts(oldirqstate);
}
コード例 #2
0
ファイル: pthread_lock.c プロジェクト: ajinkya93/netbsd-src
static int
pthread__atomic_simple_lock_try(__cpu_simple_lock_t *alp)
{

	return (__cpu_simple_lock_try(alp));
}