Interrupt handling, Name, Synopsis – Comtrol eCos User Manual

Page 87: Description

Advertising
background image

Interrupt Handling

Name

cyg_interrupt_create, cyg_interrupt_delete, cyg_interrupt_attach,

cyg_interrupt_detach, cyg_interrupt_configure, cyg_interrupt_acknowledge,

cyg_interrupt_enable, cyg_interrupt_disable, cyg_interrupt_mask,

cyg_interrupt_mask_intunsafe, cyg_interrupt_unmask,

cyg_interrupt_unmask_intunsafe, cyg_interrupt_set_cpu,

cyg_interrupt_get_cpu, cyg_interrupt_get_vsr, cyg_interrupt_set_vsr

— Manage

interrupt handlers

Synopsis

#include

<

cyg/kernel/kapi.h

>

void cyg_interrupt_create(cyg_vector_t vector, cyg_priority_t priority , cyg_addrword_t

data, cyg_ISR_t* isr, cyg_DSR_t* dsr, cyg_handle_t* handle, cyg_interrupt* intr);

void cyg_interrupt_delete(cyg_handle_t interrupt);

void cyg_interrupt_attach(cyg_handle_t interrupt);

void cyg_interrupt_detach(cyg_handle_t interrupt);

void cyg_interrupt_configure(cyg_vector_t vector, cyg_bool_t level, cyg_bool_t up);

void cyg_interrupt_acknowledge(cyg_vector_t vector);

void cyg_interrupt_disable(void);

void cyg_interrupt_enable(void);

void cyg_interrupt_mask(cyg_vector_t vector);

void cyg_interrupt_mask_intunsafe(cyg_vector_t vector);

void cyg_interrupt_unmask(cyg_vector_t vector);

void cyg_interrupt_unmask_intunsafe(cyg_vector_t vector);

void cyg_interrupt_set_cpu(cyg_vector_t vector, cyg_cpu_t cpu);

cyg_cpu_t cyg_interrupt_get_cpu(cyg_vector_t vector);

void cyg_interrupt_get_vsr(cyg_vector_t vector, cyg_VSR_t** vsr);

void cyg_interrupt_set_vsr(cyg_vector_t vector, cyg_VSR_t* vsr);

Description

The kernel provides an interface for installing interrupt handlers and controlling when interrupts occur. This func-
tionality is used primarily by eCos device drivers and by any application code that interacts directly with hardware.
However in most cases it is better to avoid using this kernel functionality directly, and instead the device driver
API provided by the common HAL package should be used. Use of the kernel package is optional, and some ap-
plications such as RedBoot work with no need for multiple threads or synchronization primitives. Any code which
calls the kernel directly rather than the device driver API will not function in such a configuration. When the kernel
package is present the device driver API is implemented as

#define

’s to the equivalent kernel calls, otherwise it

is implemented inside the common HAL package. The latter implementation can be simpler than the kernel one
because there is no need to consider thread preemption and similar issues.

87

Advertising