WIP: work around iothread lock

This commit is contained in:
Alwin Berger 2024-06-18 15:57:32 +02:00
parent 68565a638b
commit 4cc1ffae7d

View File

@ -2762,10 +2762,10 @@ type_init(armv7m_nvic_register_types)
#include "include/qom/object.h" #include "include/qom/object.h"
void libafl_send_irq(int irqn); void libafl_send_irq(int irqn);
void libafl_send_irq(int irqn) { void libafl_send_irq(int irqn) {
bool haslock = qemu_mutex_iothread_locked(); // bool haslock = qemu_mutex_iothread_locked();
if (!haslock) { // if (!haslock) {
qemu_mutex_lock_iothread(); // qemu_mutex_lock_iothread();
} // }
// CPUState *cpu; // CPUState *cpu;
//CPU_FOREACH(cpu) { //CPU_FOREACH(cpu) {
//CPUARMState* env = cpu->env_ptr; //CPUARMState* env = cpu->env_ptr;
@ -2774,8 +2774,8 @@ void libafl_send_irq(int irqn) {
// set_irq_level(nvic, irqn, 0); // set_irq_level(nvic, irqn, 0);
armv7m_nvic_set_pending(nvic, irqn+16, false); armv7m_nvic_set_pending(nvic, irqn+16, false);
//} //}
if (!haslock) { // if (!haslock) {
qemu_mutex_unlock_iothread(); // qemu_mutex_unlock_iothread();
} // }
} }
/* End LibAFL instrumentation */ /* End LibAFL instrumentation */