Dynamic IRQ handling

This commit is contained in:
2025-12-10 01:33:51 +01:00
parent 64b14f3878
commit 6feea1444a
18 changed files with 341 additions and 121 deletions

View File

@@ -32,7 +32,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <libk/stdatomic.h>
#include <libk/string.h>
#include <sync/spinlock.h>
#include <sys/cpu.h>
#if defined(__i386__)
#include <sys/cpu.h>
#endif
void sl_init(struct spinlock *sl, const char *name) {
if (strlen(name) > SPINLOCK_NAME_MAX) {
@@ -46,7 +49,9 @@ void sl_init(struct spinlock *sl, const char *name) {
void sl_lock(struct spinlock *sl) {
intr_save();
while (atomic_flag_test_and_set_explicit(&sl->flag, memory_order_acquire)) {
#if defined(__i386__)
cpu_relax();
#endif
}
}