Changes between Version 11 and Version 12 of icu_device_api
- Timestamp:
- Nov 6, 2016, 9:48:06 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
icu_device_api
v11 v12 37 37 The <icu> argument is a local pointer on the ICU device descriptor. 38 38 39 === 2) ''' error_tdev_icu_enable_irq'''( uint32_t irq_type , uint32_t irq_id , xptr_t src_dev ) ===39 === 2) '''void dev_icu_enable_irq'''( uint32_t irq_type , uint32_t irq_id , xptr_t src_dev ) === 40 40 41 41 This function enables the routing of a given IRQ, defined by its type and index, to the calling core. It registers it in the calling core interrupt vector the extended pointer on the "source" device descriptor. 42 42 The <irq_type> and <irq_id> arguments define the IRQ type and index. The <src_dev> argument is the remote pointer on the source device. 43 It returns 0 if success / returns EINVAL if illegal arguments.44 43 45 === 3) ''' error_tdev_icu_disable_irq'''( uint32_t irq_type , uint32_t irq_id ) ===44 === 3) '''void dev_icu_disable_irq'''( uint32_t irq_type , uint32_t irq_id ) === 46 45 47 46 This function must be executed by a thread running in the cluster containing the ICU device descriptor. It disables one IRQ defined by its type and index, for the calling core, and remove it from the interrupt vector. 48 47 The <irq_type> and <irq_id> arguments define the IRQ type and index. 49 It returns 0 if success / returns EINVAL if illegal arguments.50 48 51 === 4) ''' error_t dev_icu_set_period'''( core_t * core ,uint32_t pti_id , uint32_t period ) ===49 === 4) '''void dev_icu_set_period'''( uint32_t pti_id , uint32_t period ) === 52 50 53 51 This function set the period value for a PTI timer identified by its index in the local ICU device descriptor. 54 The <core> argument is local pointer on the target core. The <pti_id> argument is the timer index.55 52 The <period> argument is the period value (number of cycles). 56 It returns 0 if success / returns EINVAL if illegal arguments.57 53 58 === 5) '''error_t dev_icu_send_ipi'''( cxy_t cxy , lid_t lid ) === 54 === 5) '''void dev_icu_ack_timer'''( uint32_t pti_id ) === 55 56 This function acknowledge a PTI IRQ for a timer identified by the PTI index in the local ICU device descriptor. 57 The <pti_id> argument is the timer index. 58 59 === 6) '''void dev_icu_send_ipi'''( cxy_t cxy , lid_t lid ) === 59 60 60 61 This function send an IPI (Inter Processor Interrupt) to a core identified by its cluster identifier and local index. 61 62 This IPI force a context switch, and the handling of pending RPC(s). 62 63 The <cxy> argument is the destination cluster identifier. The <lid> argument is the destination core local index. 63 It returns 0 if success / returns EINVAL if illegal arguments.64 64 65 === 6) '''void dev_icu_irq_handler'''() ===66 65 === 7) '''void dev_icu_irq_handler'''() === 66 : 67 67 This function is called by a core when it receives an IRQ from the ICU device. 68 68 It access the local ICU device descriptor to get the highest priority active IRQ of each type (HWI / WTI / PTI). 69 69 * If it is a WTI or an HWI, the function uses the calling core interrupt-vectors to call the relevant ISR, registered in the source device descriptor. 70 70 * If it is a PTI, the source device descriptor is the ICU device itself, and it call the core_clock() function to execute all operations related to the TICK event. 71 ****************************************************************************************/ 71 72 === 8) '''uint32_t dev_icu_wti_alloc'''() === 73 74 This function implements the WTI mailbox allocator. This mailbox is used by all I/O operations for completion signaling. 75 If there is no mailbox available, the client thread must deschedule and retry later. It returns the allocated WTI mailbox index. 76 If N is the total number of WTI mailboxes in a cluster, and NC the number of cores, the number of dynamically allocatable WTI mailboxes is (N-NC) because the first N WTI mailboxes are used by the IPIs (one IPI per core). 77 78 === 9) '''void dev_icu_wti_release'''( uint32_t wti_id ) === 79 80 This function releases a dynamically allocated WTI mailbox. The <wti_id> argument is the WTI index. 81 82 === 10) ''' xptr_t dev_icu_wti_xptr'''( cxy_t cxy , uint32_t wti_id ) === 83 84 This function returns an extended pointer on a WTI mailbox identified by its cluster identifier and local index in ICU. 85 WARNING: it assumes that all ICU hardware devices have the same local base address. 86 The <cxy> argument is the mailbox cluster identifier. The <wti_id> argument is the mailbox WTI index. 87 It returns extended pointer on the mailbox register.