#ifndef _KERNEL_IRQ_IRQ_H
#define _KERNEL_IRQ_IRQ_H

#include <libk/list.h>
#include <libk/std.h>

#define IRQ_INTERRUPT_SAFE   (1 << 0)
#define IRQ_INTERRUPT_UNSAFE (1 << 1)

typedef void (*irq_func_t) (void* arg, void* regs);

struct irq {
  struct list_node_link irqs_link;

  irq_func_t func;
  void* arg;
  uint32_t irq_num;
  uint32_t flags;
};

bool irq_attach (irq_func_t, void* arg, uint32_t irq_num, uint32_t flags);
void irq_detach (irq_func_t func);
struct irq* irq_find (uint32_t irq_num);

#endif // _KERNEL_IRQ_IRQ_H
