interrupt.h header reference
[Hardware abstraction layer module]

The source code of this header can be browsed online.

Description  

Interrupts, exceptions and syscall events management

Members  

Types  

Functions  

Macros  

Members detail  

#define CPU_EXCEPTION_HANDLER(n)  

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)  

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  

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  

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)  

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_  

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)   

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)  

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)  

Set exception interrupt handler for the current cpu

void cpu_interrupt_cls_sethandler(void *cls, cpu_interrupt_handler_t *handler)  

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.

void cpu_interrupt_disable(void )  

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

void cpu_interrupt_enable(void )  

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

bool_t cpu_interrupt_getstate(void )  

this function reads current interrupts state as boolean

typedef void (cpu_interrupt_handler_t)(uint_fast8_t irq)   

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 )  

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)  

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)  

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)  

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

void cpu_interrupt_wait(void )  

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.

bool_t cpu_is_interruptible(void )  

this function checks if the cpu is interruptible

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

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)  

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

void cpu_syscall_sethandler_ctx(struct context_s *context, cpu_syscall_handler_t *hndl)  

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

void cpu_user_exception_sethandler(cpu_exception_handler_t *hndl)  

Set user exception interrupt handler for the current context

void cpu_user_exception_sethandler_ctx(struct context_s *context, cpu_exception_handler_t *hndl)  

Set user exception interrupt handler for the given context

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Oct 17 21:18:38 2018 using MkDoc