thermosphere: optimize barrier and core_ctx

This commit is contained in:
TuxSH
2020-01-26 15:07:26 +00:00
parent 1f2b8e7918
commit 8538fed043
7 changed files with 53 additions and 33 deletions

View File

@@ -36,5 +36,9 @@ void barrierInitAll(Barrier *barrier)
void barrierWait(Barrier *barrier)
{
while (atomic_fetch_and(&barrier->val, ~(BIT(currentCoreCtx->coreId))) != 0);
atomic_fetch_and(&barrier->val, ~(BIT(currentCoreCtx->coreId)));
__sev();
do {
__wfe();
} while (atomic_load(&barrier->val) != 0);
}