dev/acpi: Implement uACPI kernel APIs
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <zinnia/list.h>
|
||||
#include <zinnia/percpu.h>
|
||||
#include <zinnia/print.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <arch/irq.h>
|
||||
|
||||
[[__percpu]]
|
||||
@@ -69,3 +70,16 @@ void irq_line_attach(struct irq_line* line, struct irq_handler* handler) {
|
||||
list_insert_head(&line->handlers, handler, next);
|
||||
irq_unlock();
|
||||
}
|
||||
|
||||
void irq_line_detach(struct irq_line* line, struct irq_handler* handler) {
|
||||
irq_lock();
|
||||
struct irq_handler** link = &list_first(&line->handlers);
|
||||
while (*link && *link != handler)
|
||||
link = &list_next(*link, next);
|
||||
if (*link)
|
||||
*link = list_next(handler, next);
|
||||
irq_unlock();
|
||||
|
||||
while (__atomic_load_n(&line->is_busy, __ATOMIC_ACQUIRE))
|
||||
arch_cpu_pause();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user