Changes between Version 1 and Version 2 of pic_device_api


Ignore:
Timestamp:
Nov 6, 2016, 11:52:06 PM (7 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pic_device_api

    v1 v2  
    1 = Generic PIC device API =
     1= PIC device API =
    22
     3[[PageOutline]]
     4
     5 == A) General principles ==
     6
     7The PIC generic device describes an external interrupt Controler, that translates N input IRQs generated by external peripherals to N WTI IRQs, that will be routed to a dynamically allocated WTI mailbox in a given cluster.
     8
     9The max number of input IRQs is defined by the CONFIG_IRQ_PIC_MAX parameter. The actual number of connected IRQs is defined in the ''arch_info'' file, and stored in the PIC device extension. 
     10
     11The "source" device for each input IRQ is also defined in the ''arch_info'' file, and are stored in the ''devices_irq'' global variable in the kernel initialization phase.
     12
     13This external peripheral does not execute I/O operations, but is just acting as a dynamically configurable interrupt router for another I/O operation. Therefore, ALMOS-MK does not use the PIC device waiting queue, but call directly the PIC driver blocking functions to dynamically configure the PIC component.
     14
     15== B) Access Functions ==
     16
     17=== 1) '''void dev_pic_init'''( xptr_t   xp_dev ,  uint32_t irq_nr ) ===
     18
     19This function makes two initializations:
     20It initializes the PIC specific fields of the device descriptor. It call the PIC driver to initialize the PIC hardware device.
     21It is executed once in the kernel initialisation phase.
     22
     23=== 2) '''void dev_pic_bind_irq'''( uint32_t   irq_id ,  cxy_t  cxy ,  uint32_t   wti_id ) ===
     24
     25This function link a WTI mailbox to the PIC input IRQ identified by its index, and unmask the selected input IRQ.
     26The <irq_id> argument is the input IRQ index. The <cxy> argument is the WTI mailbox cluster. The <wti_id>  argument
     27is the WTI mailbox index in cluster.
     28
     29=== 3) '''void dev_pic_unbind_irq'''( uint32_t  irq_id ) ===
     30
     31This function mask a PIC input IRQ identified by its index. The <irq_id> argument is the input IRQ index.
     32
     33/*****************************************************************************************
     34 * This function mask a PIC input IRQ identified by its index.
     35 *****************************************************************************************
     36 * @ irq_id    : input IRQ index.
     37 * @ returns 0 if success / returns EINVAL if input IRQ not found.
     38 ****************************************************************************************/
     39void dev_pic_unbind_irq( uint32_t   irq_id );
     40