mbv: move a few things around

This commit is contained in:
2025-09-04 15:01:50 +02:00
parent dd51b5d610
commit 9edebe637b
58 changed files with 68 additions and 494 deletions

21
mbv/lib/lock.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#ifndef __x86_64__
#include "hal/interrupts.h"
struct InterruptLock {
bool was_on;
InterruptLock() : was_on(EnableInterrupts(false)) {}
~InterruptLock() { EnableInterrupts(was_on); }
};
#else // __x86_64__
#include <mutex>
struct InterruptLock {
static std::recursive_mutex m;
InterruptLock() { m.lock(); }
~InterruptLock() { m.unlock(); }
};
#endif // __x86_64__