Loading [MathJax]/extensions/tex2jax.js
CS350 COS
COS
All Data Structures Files Functions Variables Typedefs Macros
irq.h File Reference
#include <sys/queue.h>
Include dependency graph for irq.h:

Go to the source code of this file.

Data Structures

struct  IRQHandler
 

Typedefs

typedef struct IRQHandler IRQHandler
 

Functions

void IRQ_Init ()
 
void IRQ_Handler (int irq)
 
void IRQ_Register (int irq, struct IRQHandler *h)
 
void IRQ_Unregister (int irq, struct IRQHandler *h)
 

Typedef Documentation

◆ IRQHandler

typedef struct IRQHandler IRQHandler

Function Documentation

◆ IRQ_Handler()

void IRQ_Handler ( int  irq)

Definition at line 25 of file irq.c.

26{
27 struct IRQHandler *h;
28 LIST_FOREACH(h, &handlers[irq], link)
29 {
30 h->cb(h->arg);
31 }
32}
struct IRQHandlerList handlers[T_IRQ_LEN]
Definition: irq.c:11
#define LIST_FOREACH(var, head, field)
Definition: queue.h:410
static uint8_t irq
Definition: sercons.c:38
Definition: irq.h:7
void * arg
Definition: irq.h:10
void(* cb)(void *)
Definition: irq.h:9
Here is the caller graph for this function:

◆ IRQ_Init()

void IRQ_Init ( )

Definition at line 14 of file irq.c.

15{
16 int i;
17
18 for (i = 0; i < T_IRQ_LEN; i++)
19 {
21 }
22}
#define LIST_INIT(head)
Definition: queue.h:430
#define T_IRQ_LEN
Definition: trap.h:29
Here is the caller graph for this function:

◆ IRQ_Register()

void IRQ_Register ( int  irq,
struct IRQHandler h 
)

Definition at line 35 of file irq.c.

36{
38
39 LIST_INSERT_HEAD(&handlers[irq], h, link);
40
42}
void IOAPIC_Enable(int irq)
Definition: ioapic.c:70
#define ASSERT(_x)
Definition: kassert.h:8
#define LIST_INSERT_HEAD(head, elm, field)
Definition: queue.h:451
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IRQ_Unregister()

void IRQ_Unregister ( int  irq,
struct IRQHandler h 
)

Definition at line 45 of file irq.c.

46{
47 LIST_REMOVE(h, link);
48
49 if (LIST_EMPTY(&handlers[irq]))
51}
void IOAPIC_Disable(int irq)
Definition: ioapic.c:77
#define LIST_REMOVE(elm, field)
Definition: queue.h:465
#define LIST_EMPTY(head)
Definition: queue.h:406
Here is the call graph for this function: