Exemplo n.º 1
0
void
mtx_enter(struct mutex *mtx)
{
	int psr;

	if (mtx->mtx_wantipl != IPL_NONE << 8) {
		psr = getpsr();
		mtx->mtx_oldipl = psr & PSR_PIL;
		if (mtx->mtx_oldipl < mtx->mtx_wantipl)
			setpsr((psr & ~PSR_PIL) | mtx->mtx_wantipl);
	}

	MUTEX_ASSERT_UNLOCKED(mtx);
	mtx->mtx_lock = 1;
}
Exemplo n.º 2
0
Arquivo: fpu.c Projeto: EliasLuiz/TCC
fputest()
{
	int tmp;

	tmp = xgetpsr();
	setpsr(tmp | (1 << 12));
	tmp = xgetpsr();
	if (!(tmp & (1 <<12))) return(0);
	set_fsr(0);

	report_subtest(FPU_TEST+(get_pid()<<4));

	fpu_main();

}
Exemplo n.º 3
0
void
mtx_enter(struct mutex *mtx)
{
	int psr;

	if (mtx->mtx_wantipl != IPL_NONE << 8) {
		psr = getpsr();
		mtx->mtx_oldipl = psr & PSR_PIL;
		if (mtx->mtx_oldipl < mtx->mtx_wantipl)
			setpsr((psr & ~PSR_PIL) | mtx->mtx_wantipl);
	}

	MUTEX_ASSERT_UNLOCKED(mtx);
	mtx->mtx_lock = 1;
#ifdef DIAGNOSTIC
	curcpu()->ci_mutex_level++;
#endif
}