Retro Rocket Kernel BASIC-Powered Operating System

Data Structures | Typedefs | Enumerations | Functions
interrupt.h File Reference
`#include "kernel.h"`

## Data Structures
struct | shared_interrupt_t
| An entry in a linked list of handlers attached to an ISR. More...

## Typedefs
typedef void(* | isr_t) (uint8_t isrnumber, uint64_t errorcode, uint64_t irqnumber, void *opaque)
| A definition for an interrupt handler. More...

## Enumerations
enum | irq_number_t { IRQ0 = 32 , IRQ1 = 33 , IRQ2 = 34 , IRQ3 = 35 , IRQ4 = 36 , IRQ5 = 37 , IRQ6 = 38 , IRQ7 = 39 , IRQ8 = 40 , IRQ9 = 41 , IRQ10 = 42 , IRQ11 = 43 , IRQ12 = 44 , IRQ13 = 45 , IRQ14 = 46 , IRQ15 = 47 , IRQ16 = 50 }

## Functions
void | register_interrupt_handler (uint8_t n, isr_t handler, pci_dev_t device, void *opaque)
| Register an interrupt handler. More...
void | Interrupt (uint64_t isrnumber, uint64_t errorcode)
| Global routing function for interrupts (ISR number < 32) More...
void | IRQ (uint64_t isrnumber, uint64_t errorcode)
| Global routing function for IRQs (ISR number >= 32) More...

## Detailed Description

Author
  Craig Edwards (craig.nosp@m.edwa.nosp@m.rds@b.nosp@m.rain.nosp@m.box.c.nosp@m.c)

Copyright
  Copyright (c) 2012-2023

## Typedef Documentation

## ◆ isr_t

typedef void(* isr_t) (uint8_t isrnumber, uint64_t errorcode, uint64_t irqnumber, void *opaque)

A definition for an interrupt handler.

## Enumeration Type Documentation

## ◆ irq_number_t

enum irq_number_t

Enumerator
IRQ0 |
IRQ1 |
IRQ2 |
IRQ3 |
IRQ4 |
IRQ5 |
IRQ6 |
IRQ7 |
IRQ8 |
IRQ9 |
IRQ10 |
IRQ11 |
IRQ12 |
IRQ13 |
IRQ14 |
IRQ15 |
IRQ16 |

## Function Documentation

## ◆ Interrupt()

void Interrupt | ( | uint64_t | isrnumber,
|  | uint64_t | errorcode
| ) |  |

Global routing function for interrupts (ISR number < 32)

Parameters

  isrnumber | ISR number
  errorcode | Error code

## ◆ IRQ()

void IRQ | ( | uint64_t | isrnumber,
|  | uint64_t | errorcode
| ) |  |

Global routing function for IRQs (ISR number >= 32)

Parameters

  isrnumber | ISR number
  errorcode | Error code (always zero)

## ◆ register_interrupt_handler()

void register_interrupt_handler | ( | uint8_t | n,
|  | isr_t | handler,
|  | pci_dev_t | device,
|  | void * | opaque
| ) |  |

Register an interrupt handler.

Parameters

  n | Interrupt number, IRQs start at 32 as per irq_number_t
  handler | IRQ handler function
  device | For PCI devices, specify the device node in this parameter. This is to allow for IRQ sharing.
  opaque | An opaque pointer that can be passed back to your interrupt handler