Refactor CPU mutex code
This commit is contained in:
+2
-2
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user