⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interrupt.h

📁 AMLOGIC DPF source code
💻 H
字号:
/*******************************************************************
 * 
 *  Copyright C 2005 by Amlogic, Inc. All Rights Reserved.
 *
 *  Description: Interrupt handling functions.
 *
 *  Author: Eric Knudstrup
 *  Created: Tue Dec  6 19:22:14 2005
 *
 *******************************************************************/

#ifndef INTERRUPT_H
#define INTERRUPT_H

#define IRQ_STACK_SIZE 0x1000
#define FIQ_STACK_SIZE 0x800

/**
 * @file interrupt.h
 * Interrupt handling routines.  Provided by avos.lib
 */

/**
 * @defgroup interrupt Interrupt handling routines.
 */

/*@{*/

typedef enum {
    ISR_TYPE_GENERAL, /**< Attach to a system interrupt */
    ISR_TYPE_GPIO,    /**< Attach to a GPIO interrupt */
    ISR_TYPE_AMRISC,  /**< Attach to an AMRISC interrupt */
    ISR_TYPE_FAST_GENERAL, /**< Attach to a fast system interrupt */
    ISR_TYPE_FAST_GPIO,    /**< Attach to a fast GPIO interrupt */
    ISR_TYPE_FAST_AMRISC,  /**< Attach to a fast AMRISC interrupt */
    ISR_TYPE_POLL,         /**< Just poll every tick */
    ISR_TYPE_MAX
} ISRType_t;

typedef void (*irq_handler_t)(void *context);

/*;emacs generated header for file interrupt.c. Global function declarations only. */
/**
 * Initialize all of the available IRQ handles.
 */
extern void OS_IrqDescInit(void);

/**
 * Request bottom half processing for the current interrupt handler.
 */
extern void AVBHPost(void);

/**
 * Clear the interrupt mask and stop handling interrupts for \a handle.
 */
extern int AVDetachIrq(int handle);

/**
 * Determine if interrupt handler \a handle is enabled.
 * @returns TRUE if enabled, FALSE otherwise.
 */
extern int
AVIrqEnabled(int handle);

/**
 * Reenable interrupt processing for \a handle.
 */
extern void
AVEnableIrq(int handle);

/**
 * Clear the interrupt mask and stop handling interrupts for \a handle.
 * \a Handle remains valid.
 */
extern void
AVDisableIrq(int handle);

/**
 * Request interrupt handling. If a handle is successfully allocated the
 * system will enable the \a mask and begin handling interrupts.
 * Interrupt handlers for level triggered interrupts must clear the interrupt status
 * themselves.
 * @param [in] type The \a ISRType_t of the interrupt handler
 * @param [in] mask The interrupt mask to process.
 * @param [in] irq_handler The address of the handler routine.
 * @param [in] bh_handler The address of the bottom half handler. May be NULL.
 * @returns The handle for the allocated interrupt, or -1.
 */
extern int AVRequestIrq(ISRType_t type, unsigned long mask, irq_handler_t irq_handler, irq_handler_t bh_handler);

/**
 * Request interrupt handling. If a handle is successfully allocated the
 * system will enable the \a mask and begin handling interrupts.
 * Interrupt handlers for level triggered interrupts must clear the interrupt status
 * themselves.
 * @param [in] type The \a ISRType_t of the interrupt handler
 * @param [in] mask The interrupt mask to process.
 * @param [in] irq_handler The address of the handler routine.
 * @param [in] bh_handler The address of the bottom half handler. May be NULL.
 * @param [in] A context handle to be passed into the \a irq_handler.
 * @returns The handle for the allocated interrupt, or -1.
 */
extern int AVRequestIrqContext(ISRType_t type, unsigned long mask, irq_handler_t irq_handler, irq_handler_t bh_handler, void *context);

/**
 * Process fast speed interrupts. OS internal.
 */
extern void process_fiq(void);

/**
 * Process normal speed interrupts. OS internal.
 */
extern void process_irq(void);


/*;end emacs generated header for file interrupt.c. Global function declarations only. */

#endif
/*@}*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -