Refactor CPU mutex code

This commit is contained in:
2023-10-22 19:30:42 +02:00
parent 02114ea7d8
commit 71f3fbc8b5
5 changed files with 23 additions and 23 deletions
+2 -2
View File
@@ -33,7 +33,7 @@ void interrupt_trigger(rv32_cpu_t* cpu, uint32_t scause)
// but we know it is not in the middle of an instruction
// (we got the mutex) ; this way we can just change
// registers to set interrupt handler execution
pthread_mutex_lock(&cpu0_mutex);
pthread_mutex_lock(&cpu->mutex);
// Set xCAUSE with interrupt bit set
cpu->csr[CSR_SCAUSE] = 0x80000000 | scause;
@@ -67,7 +67,7 @@ void interrupt_trigger(rv32_cpu_t* cpu, uint32_t scause)
break;
}
pthread_mutex_unlock(&cpu0_mutex);
pthread_mutex_unlock(&cpu->mutex);
}
void interrupt_timer_thread()