网站公告列表

  没有公告

加入收藏
设为首页
联系本站
您现在的位置: AnalogCN安诺电子 >> 文章 >> 技术交流 >> 文章正文
  uclinux-2008r1-rc8(bf561)的中断处理(8):中断描述           ★★★ 【字体:
uclinux-2008r1-rc8(bf561)的中断处理(8):中断描述
作者:快乐虾    文章来源:http://blog.csdn.net/lights_joy    点击数:    更新时间:2008-5-26    
uclinux内核为每一个中断设置了一个称为irq_desc的结构体进行描述:
 
/**
 * struct irq_desc - interrupt descriptor
 *
 * @handle_irq:        highlevel irq-events handler [if NULL, __do_IRQ()]
 * @chip:     low level interrupt hardware access
 * @msi_desc:      MSI descriptor
 * @handler_data: per-IRQ data for the irq_chip methods
 * @chip_data:         platform-specific per-chip private data for the chip
 *            methods, to allow shared chip implementations
 * @action:        the irq action chain
 * @status:        status information
 * @depth:         disable-depth, for nested irq_disable() calls
 * @wake_depth:        enable depth, for multiple set_irq_wake() callers
 * @irq_count:         stats field to detect stalled irqs
 * @irqs_unhandled:    stats field for spurious unhandled interrupts
 * @lock:     locking for SMP
 * @affinity:      IRQ affinity on SMP
 * @cpu:      cpu index useful for balancing
 * @pending_mask: pending rebalanced interrupts
 * @dir:      /proc/irq/ procfs entry
 * @affinity_entry:    /proc/irq/smp_affinity procfs entry on SMP
 * @name:     flow handler name for /proc/interrupts output
 */
struct irq_desc {
     irq_flow_handler_t handle_irq;
     struct irq_chip        *chip;
     struct msi_desc        *msi_desc;
     void          *handler_data;
     void          *chip_data;
     struct irqaction   *action; /* IRQ action list */
     unsigned int       status;       /* IRQ status */
 
     unsigned int       depth;        /* nested irq disables */
     unsigned int       wake_depth;   /* nested wake enables */
     unsigned int       irq_count;    /* For detecting broken IRQs */
     unsigned int       irqs_unhandled;
     spinlock_t         lock;
#ifdef CONFIG_SMP
     cpumask_t     affinity;
     unsigned int       cpu;
#endif
#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
     cpumask_t     pending_mask;
#endif
#ifdef CONFIG_PROC_FS
     struct proc_dir_entry *dir;
#endif
     const char         *name;
} ____cacheline_internodealigned_in_smp;
 
extern struct irq_desc irq_desc[NR_IRQS];
对它的各个成员的描述其注释已经比较清楚了,这里需要注意的是NR_IRQS的定义。在bf561中,提供了64个外部中断和6个内部中断,其中60-63这4个外部中断保留。但是NR_IRQS的定义高达121,这主要是因为在BF561中对PF0 – PF47这48个PF口仅仅用了8个中断源,但是在内核中则为这48个PF口每个都留了中断描述。
irq_desc这个数组的定义在kernel/irq/handle.c中:
/*
 * Linux has a controller-independent interrupt architecture.
 * Every controller has a 'controller-template', that is used
 * by the main code to do the right thing. Each driver-visible
 * interrupt source is transparently wired to the appropriate
 * controller. Thus drivers need not be aware of the
 * interrupt-controller.
 *
 * The code is designed to be easily extended with new/different
 * interrupt controllers, without having to do assembly magic or
 * having to touch the generic code.
 *
 * Controller mappings for all interrupt sources:
 */
struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = {
     [0 ... NR_IRQS-1] = {
         .status = IRQ_DISABLED,
         .chip = &no_irq_chip,
         .handle_irq = handle_bad_irq,
         .depth = 1,
         .lock = __SPIN_LOCK_UNLOCKED(irq_desc->lock),
#ifdef CONFIG_SMP
         .affinity = CPU_MASK_ALL
#endif
     }
};
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    对比ADI两代TD-SCDMA射频IC得
    [结尾篇]ADSP-TS20XS系列DSP
    一种基于DDS的幅值可调信号发
    基于ADSP2181的CAN总线通讯设
    一种采用单片机控制AD9854为
    在vs2008下使用ffmpeg(5):
    在vs2008下使用ffmpeg(4):
    在vs2008下使用ffmpeg(3):
    ADI AD8275电平转换16位ADC驱
    Boot在ADSP-BF533上的移植
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    版权所有:AnalogCN安诺电子 湘ICP备06016315号