interrupt.h header reference
[Hardware abstraction layer module]

The source code of this header can be browsed online.

Description [link] 

Interrupts, exceptions and syscall events management

Members [link] 

Types [link] 

Functions [link] 

Macros [link] 

Members detail [link] 

#define CPU_EXCEPTION_HANDLER(n) [link] 

This macro is declared in interrupt.h source file, line 133.

CPU exception handler function template

This macro expands to:

void (n) (uint_fast8_t type, uintptr_t execptr,
uintptr_t dataptr, struct cpu_context_s *regs,
uintptr_t stackptr)

See also cpu_exception_handler_t.

#define CPU_INTERRUPT_HANDLER(n) [link] 

This macro is declared in interrupt.h source file, line 48.

CPU interrupt handler function template

Preprocessor condition: defined( CONFIG_HEXO_IRQ )

This macro expands to:

void (n) (uint_fast8_t irq)

See also cpu_interrupt_handler_t.

#define CPU_INTERRUPT_RESTORESTATE [link] 

This macro is declared in interrupt.h source file, line 120.

this macro restores interrupts enable state. This macro must be matched with the CPU_INTERRUPT_SAVESTATE_DISABLE macro. This acts as a compiler memory barrier.

This macro expands to:

cpu_interrupt_restorestate(&__interrupt_state);
}

#define CPU_INTERRUPT_SAVESTATE_DISABLE [link] 

This macro is declared in interrupt.h source file, line 111.

this macro saves interrupts enable state end disable interrupts. This macro must be matched with the CPU_INTERRUPT_RESTORESTATE macro. This acts as a compiler memory barrier.

This macro expands to:

{
cpu_irq_state_t __interrupt_state;
cpu_interrupt_savestate_disable(&__interrupt_state);

#define CPU_SYSCALL_HANDLER(n) [link] 

This macro is declared in interrupt.h source file, line 186.

CPU syscall handler function template

Preprocessor condition: defined( CONFIG_HEXO_USERMODE )

This macro expands to:

void (n) (uint_fast8_t number, struct cpu_context_s *regs)

See also cpu_syscall_handler_t.

#define INTERRUPT_H_ [link] 

This macro is declared in interrupt.h source file, line 29.

typedef void (cpu_exception_handler_t)(uint_fast8_t type, uintptr_t execptr, uintptr_t dataptr, struct cpu_context_s *regs, uintptr_t stackptr) [link] 

This typedef is declared in interrupt.h source file, line 158.

This function is called when a fault exception occurs.

Parameter list:

  • type: Exception ID which is processor specific.
  • execptr: Pointer to faulty instruction.
  • dataptr: Bad memory data access address, validity depends on processor and fault.
  • regs: Can be used with the cpu_exception_resume_pc function. Some general purpose registers may be saved depending on processor.
  • stackptr: Value of stack pointer.

A context local handler may be defined for each struct context_s instance and will be used when a fault occurs in user mode. The cpu local handler is used for other cases.

This declaration involves expansion of the CPU_EXCEPTION_HANDLER macro.

See also CPU_EXCEPTION_HANDLER and cpu_exception_resume_pc.

void cpu_exception_resume_pc(struct cpu_context_s *regs, uintptr_t pc) [link] 

This function is declared in interrupt.h source file, line 166.

Change exception resume addess. This function must only be called from an exception or syscall handler.

void cpu_exception_sethandler(cpu_exception_handler_t *hndl) [link] 

This function is declared in interrupt.h source file, line 162.

Set exception interrupt handler for the current cpu

void cpu_interrupt_cls_sethandler(void *cls, cpu_interrupt_handler_t *handler) [link] 

This function is declared in interrupt.h source file, line 66.

This function sets the hardware interrupt handler for an other cpu. The processor local storage of the processor which will have its interrupt handler updated must be specified.

This is available when CONFIG_ARCH_SMP is defined.

Preprocessor condition: defined( CONFIG_HEXO_IRQ )

void cpu_interrupt_disable(void ) [link] 

This function is declared in interrupt.h source file, line 73.

this function disables all maskable interrupts for the current cpu. This acts as a compiler memory barrier.

void cpu_interrupt_enable(void ) [link] 

This function is declared in interrupt.h source file, line 77.

this function enables all maskable interrupts for the current cpu. This acts as a compiler memory barrier.

bool_t cpu_interrupt_getstate(void ) [link] 

This function is declared in interrupt.h source file, line 88.

this function reads current interrupts state as boolean

typedef void (cpu_interrupt_handler_t)(uint_fast8_t irq) [link] 

This typedef is declared in interrupt.h source file, line 57.

CPU interrupt handler function type.

Parameter list:

  • irq: Highest priority pending processor irq line number.

Preprocessor condition: defined( CONFIG_HEXO_IRQ )

This declaration involves expansion of the CPU_INTERRUPT_HANDLER macro.

void cpu_interrupt_process(void ) [link] 

This function is declared in interrupt.h source file, line 98.

this function enables interrupts and give a chance to pending requests to execute. This function must be used to avoid the "sti; cli" sequence which don't let interrupts raise on some processors. Memory is marked as clobbered by this function to force global variable reload after interrupts occured.

bool_t cpu_interrupt_restorestate(const cpu_irq_state_t *state) [link] 

This function is declared in interrupt.h source file, line 85.

this function restores interrupts enable state (may use stack). This acts as a compiler memory barrier.

void cpu_interrupt_savestate_disable(cpu_irq_state_t *state) [link] 

This function is declared in interrupt.h source file, line 81.

this function saves interrupts enable state end disable interrupts. This acts as a compiler memory barrier.

void cpu_interrupt_sethandler(cpu_interrupt_handler_t *handler) [link] 

This function is declared in interrupt.h source file, line 60.

This function sets the hardware interrupt handler for the current cpu.

Preprocessor condition: defined( CONFIG_HEXO_IRQ )

void cpu_interrupt_wait(void ) [link] 

This function is declared in interrupt.h source file, line 105.

this function enables interrupts and enters in interrupt wait state. The CONFIG_CPU_WAIT_IRQ token may be used to check for availability. Memory is marked as clobbered by this function to force global variable reload after interrupts occured.

Preprocessor condition: defined( CONFIG_CPU_WAIT_IRQ )

bool_t cpu_is_interruptible(void ) [link] 

This function is declared in interrupt.h source file, line 91.

this function checks if the cpu is interruptible

typedef void (cpu_syscall_handler_t)(uint_fast8_t number, struct cpu_context_s *regs) [link] 

This typedef is declared in interrupt.h source file, line 207.

This function is called when a syscall trap is generated by execution of a software interrupt instruction in user mode. Syscall traps from processor kernel mode have undefined behavior.

Parameter list:

  • number: Processor specific trap number. Some processors only have one trap (0).
  • regs: Contains valid values for argument passing registers on current processor ABI and can be used with the cpu_exception_resume_pc function. The return value register is restored from this object on syscall return.

Syscall handler is context local and must be defined for each struct context_s instance.

Preprocessor condition: defined( CONFIG_HEXO_USERMODE )

This declaration involves expansion of the CPU_SYSCALL_HANDLER macro.

See also CPU_SYSCALL_HANDLER.

void cpu_syscall_sethandler(cpu_syscall_handler_t *hndl) [link] 

This function is declared in interrupt.h source file, line 211.

this function sets the syscall handler for the current struct context_s.

Preprocessor condition: defined( CONFIG_HEXO_USERMODE )

void cpu_syscall_sethandler_ctx(struct context_s *context, cpu_syscall_handler_t *hndl) [link] 

This function is declared in interrupt.h source file, line 215.

this function sets syscall interrupt handler for an other struct context_s.

Preprocessor condition: defined( CONFIG_HEXO_USERMODE )

void cpu_user_exception_sethandler(cpu_exception_handler_t *hndl) [link] 

This function is declared in interrupt.h source file, line 171.

Set user exception interrupt handler for the current context

Preprocessor condition: defined( CONFIG_HEXO_USERMODE )

void cpu_user_exception_sethandler_ctx(struct context_s *context, cpu_exception_handler_t *hndl) [link] 

This function is declared in interrupt.h source file, line 176.

Set user exception interrupt handler for the given context

Preprocessor condition: defined( CONFIG_HEXO_USERMODE )

Valid XHTML 1.0 StrictGenerated by diaxen on Thu Aug 4 15:44:06 2022 using MkDoc