Turnstone Operating System
Loading...
Searching...
No Matches
interrupt.h File Reference

defines interrupt functions at long mode More...

#include <types.h>

Classes

struct  interrupt_frame_t
 
struct  interrupt_frame_ext_t
 
union  interrupt_errorcode_pagefault_u
 bit fileds for page fault error no More...
 

Macros

#define ___CPU_INTERRUPT_H   0
 
#define interrupt_errcode_t   uint64_t
 interrupt error code type
 
#define INTERRUPT_IRQ_BASE   0x20
 
#define INTERRUPT_VECTOR_SPURIOUS   0xFF
 

Typedefs

typedef struct interrupt_frame_t interrupt_frame_t
 struct short hand
 
typedef struct interrupt_frame_ext_t interrupt_frame_ext_t
 struct short hand
 
typedef int8_t(* interrupt_irq) (interrupt_frame_ext_t *frame)
 irq method signature More...
 
typedef union interrupt_errorcode_pagefault_u interrupt_errorcode_pagefault_t
 union short hand for interrupt_errorcode_pagefault_u
 

Functions

int8_t interrupt_init (void)
 interrupt table builder functions More...
 
int8_t interrupt_ist_redirect_main_interrupts (uint8_t ist)
 interrupt redirector for main interrupts More...
 
int8_t interrupt_ist_redirect_interrupt (uint8_t vec, uint8_t ist)
 interrupt redirector for main interrupts More...
 
int8_t interrupt_irq_set_handler (uint8_t irqnum, interrupt_irq irq)
 registers irq for irq number, for an irq there can be more irq handlers, loops with return of interrupt_irq More...
 
int8_t interrupt_irq_remove_handler (uint8_t irqnum, interrupt_irq irq)
 remove irq for irq number More...
 
uint8_t interrupt_get_next_empty_interrupt (void)
 finds not used interrupt for registering More...
 
void interrupt_generic_handler (interrupt_frame_ext_t *frame)
 

Detailed Description

defines interrupt functions at long mode

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Macro Definition Documentation

◆ ___CPU_INTERRUPT_H

#define ___CPU_INTERRUPT_H   0

prevent duplicate header error macro

◆ INTERRUPT_IRQ_BASE

#define INTERRUPT_IRQ_BASE   0x20

the base interrupt number of irqs

◆ INTERRUPT_VECTOR_SPURIOUS

#define INTERRUPT_VECTOR_SPURIOUS   0xFF

apci spurious interrupt number

Typedef Documentation

◆ interrupt_irq

typedef int8_t(* interrupt_irq) (interrupt_frame_ext_t *frame)

irq method signature

Parameters
[in]frameinterrupt frame
[in]intnuminterrupt/irq number
Returns
0 if irq handled success fully.

Function Documentation

◆ interrupt_get_next_empty_interrupt()

uint8_t interrupt_get_next_empty_interrupt ( void  )

finds not used interrupt for registering

Returns
interrupt number

◆ interrupt_init()

int8_t interrupt_init ( void  )

interrupt table builder functions

builds interrupt table at idtr look for descriptor_idt

◆ interrupt_irq_remove_handler()

int8_t interrupt_irq_remove_handler ( uint8_t  irqnum,
interrupt_irq  irq 
)

remove irq for irq number

Parameters
[in]irqnumirq number to handle
[in]irqthe irq handler
Returns
0 if succeed

◆ interrupt_irq_set_handler()

int8_t interrupt_irq_set_handler ( uint8_t  irqnum,
interrupt_irq  irq 
)

registers irq for irq number, for an irq there can be more irq handlers, loops with return of interrupt_irq

Parameters
[in]irqnumirq number to handle
[in]irqthe irq handler
Returns
0 if succeed

◆ interrupt_ist_redirect_interrupt()

int8_t interrupt_ist_redirect_interrupt ( uint8_t  vec,
uint8_t  ist 
)

interrupt redirector for main interrupts

Parameters
[in]istinterrupt stack table index
Returns
0 if succeed

◆ interrupt_ist_redirect_main_interrupts()

int8_t interrupt_ist_redirect_main_interrupts ( uint8_t  ist)

interrupt redirector for main interrupts

Parameters
[in]istinterrupt stack table index
Returns
0 if succeed