KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
irq.h File Reference

Timer functionality. More...

#include <sys/cdefs.h>
#include <stdbool.h>
#include <stdint.h>
#include <arch/irq.h>

Go to the source code of this file.

Data Structures

struct  irq_cb_t
 The type of a full callback of an IRQ handler and userdata. More...
 

Macros

#define irq_disable_scoped()
 Disable interrupts with scope management.
 

Typedefs

typedef struct irq_context irq_context_t
 Architecture-specific structure for holding the processor state.
 
typedef enum irq_exception irq_t
 Architecture-specific interrupt exception codes.
 
typedef uint32_t irq_mask_t
 Type representing an interrupt mask state.
 
typedef void(* irq_hdl_t) (irq_t code, irq_context_t *context, void *data)
 The type of an IRQ handler.
 

Functions

static void irq_enable (void)
 Enable all interrupts.
 
static irq_mask_t irq_disable (void)
 Disable interrupts.
 
static void irq_restore (irq_mask_t state)
 Restore interrupt state.
 
static bool irq_inside_int (void)
 Returns whether inside of an interrupt context.
 
static void irq_create_context (irq_context_t *context, uintptr_t stack_pointer, uintptr_t routine, const uintptr_t *args)
 Fill a newly allocated context block.
 
static void irq_set_context (irq_context_t *cxt)
 Switch out contexts (for interrupt return).
 
static irq_context_tirq_get_context (void)
 Get the current IRQ context.
 
static int irq_set_handler (irq_t code, irq_hdl_t hnd, void *data)
 Set or remove an IRQ handler.
 
static irq_cb_t irq_get_handler (irq_t code)
 Get the address of the current handler for the IRQ type.
 
static int irq_set_global_handler (irq_hdl_t hnd, void *data)
 Set a global exception handler.
 
static irq_cb_t irq_get_global_handler (void)
 Get the global exception handler.
 

Detailed Description

Timer functionality.

This file contains functions for enabling/disabling interrupts, and setting interrupt handlers.

Author
Megan Potter
Paul Cercueil
Falco Girgis

Typedef Documentation

◆ irq_context_t

typedef struct irq_context irq_context_t

Architecture-specific structure for holding the processor state.

This structure should hold register values and other important parts of the processor state.

◆ irq_hdl_t

typedef void(* irq_hdl_t) (irq_t code, irq_context_t *context, void *data)

The type of an IRQ handler.

Parameters
codeThe IRQ that caused the handler to be called.
contextThe CPU's context.
dataArbitrary userdata associated with the handler.

◆ irq_mask_t

typedef uint32_t irq_mask_t

Type representing an interrupt mask state.

◆ irq_t

typedef enum irq_exception irq_t

Architecture-specific interrupt exception codes.

Used to identify the source or type of an interrupt.