LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
irq.h File Reference

IRQ Handler and utilities. More...

#include <arch/x86_64/idt.h>
Include dependency graph for irq.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void(* irq_handler_fn) (struct interrupt_frame *frame)

Functions

void irq_register (uint8_t irq, irq_handler_fn fn)
 Registers a handler function for the specified IRQ number.
void irq_handler (struct interrupt_frame *frame)
 Calls the correct handler and returns the interrupt.
static uint64_t irq_save (void)
 Saves the IRQ and disables interrupts (used when using a variable that is modified by an interrupt).
static void irq_restore (uint64_t flags)
 Restores the IRQ and re-enables interrupts (used when using a variable that is modified by an interrupt).

Detailed Description

IRQ Handler and utilities.

Author
Matheus Boscariol
Since
24/11/2026

Definition in file irq.h.

Typedef Documentation

◆ irq_handler_fn

typedef void(* irq_handler_fn) (struct interrupt_frame *frame)

Definition at line 15 of file irq.h.

Function Documentation

◆ irq_handler()

void irq_handler ( struct interrupt_frame * frame)

Calls the correct handler and returns the interrupt.

Parameters
frameThe frame that caused the exception

Definition at line 25 of file irq.c.

Here is the call graph for this function:

◆ irq_register()

void irq_register ( uint8_t irq,
irq_handler_fn fn )

Registers a handler function for the specified IRQ number.

Parameters
irqIRQ number
fnReference to the handler function

Definition at line 18 of file irq.c.

◆ irq_restore()

void irq_restore ( uint64_t flags)
inlinestatic

Restores the IRQ and re-enables interrupts (used when using a variable that is modified by an interrupt).

Parameters
flagsThe flags from the saved IRQ

Definition at line 44 of file irq.h.

◆ irq_save()

uint64_t irq_save ( void )
inlinestatic

Saves the IRQ and disables interrupts (used when using a variable that is modified by an interrupt).

Returns
The saved IRQ flags

Definition at line 34 of file irq.h.