Changeset 437 for soft/giet_vm/giet_drivers/xcu_driver.h
- Timestamp:
- Nov 3, 2014, 10:53:00 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/xcu_driver.h
r320 r437 7 7 // The xcu_driver.c and xcu_driver.h files are part ot the GIET-VM nano-kernel. 8 8 // This driver supports the SoCLib vci_xicu, that is a vectorised interrupt 9 // controler supporting IPI (Inter Processor Interrupts) and integrated timers. 9 // controler supporting three types of interrupts: 10 // 11 // - HWI : HardWare Interrupts (from hardware peripherals) 12 // - PTI : Programmable Timer Interrupts (contained in the XCU component) 13 // - WTI : Write Trigered Interrupts (from software, or from a PIC controller) 10 14 // 11 15 // It can exist several interrupt controller unit in the architecture 12 // (one per cluster), and each one can contain several channels .16 // (one per cluster), and each one can contain several channels: 13 17 // The number of XICU channels is equal to NB_PROCS_MAX, because there is 14 18 // one private XICU channel per processor in a cluster. 15 // //////////////////////////////////////////////////////////////////////////////19 // 16 20 // The virtual base address of the segment associated to the component is: 17 21 // 18 // seg_xcu_base + cluster_xy * vseg_cluster_increment22 // vbase = SEG_XCU_BASE + cluster_xy * PERI_CLUSTER_INCREMENT 19 23 // 20 // The seg_xcu_base and vseg_cluster_incrementvalues must be defined21 // in giet_vsegs.ldfile.24 // The SEG_XCU_BSE and PERI_CLUSTER_INCREMENT values must be defined 25 // in the hard_config.h file. 22 26 //////////////////////////////////////////////////////////////////////////////// 23 27 … … 56 60 #define XCU_REG(func, index) (((func)<<5)|(index)) 57 61 58 //////////////////////////////////////////////////////////////////////////////// ///59 // XICUaccess functions60 //////////////////////////////////////////////////////////////////////////////// ///62 //////////////////////////////////////////////////////////////////////////////// 63 // access functions 64 //////////////////////////////////////////////////////////////////////////////// 61 65 66 //////////////////////////////////////////////////////////////////////////////// 67 // This function set the mask register for the IRQ type defined by "irq_type", 68 // and for the channel identified by the "cluster_xy" and "channel" arguments. 69 // All '1' bits are set / all '0' bits are not modified. 70 //////////////////////////////////////////////////////////////////////////////// 62 71 extern void _xcu_set_mask( unsigned int cluster_xy, 63 72 unsigned int channel, … … 65 74 unsigned int irq_type ); 66 75 76 //////////////////////////////////////////////////////////////////////////////// 77 // This function returns the index and the type of the highest priority 78 // - active PTI (Timer Interrupt), then 79 // - active HWI (Hardware Interrupt), then 80 // - active WTI (Software Interrupt) 81 //////////////////////////////////////////////////////////////////////////////// 67 82 extern void _xcu_get_index( unsigned int cluster_xy, 68 83 unsigned int channel, … … 70 85 unsigned int * irq_type ); 71 86 87 //////////////////////////////////////////////////////////////////////////////// 88 // This function writes the "wdata" value in the mailbox defined 89 // by the "cluster_xy" and "wti_index" arguments. 90 //////////////////////////////////////////////////////////////////////////////// 72 91 extern void _xcu_send_wti( unsigned int cluster_xy, 73 92 unsigned int wti_index, 74 93 unsigned int wdata ); 75 94 95 //////////////////////////////////////////////////////////////////////////////// 96 // This function returns the value contained in a WTI mailbox defined by 97 // the cluster_xy and "wti_index" arguments. This value is written in 98 // the "value" argument, and the corresponding WTI is acknowledged. 99 //////////////////////////////////////////////////////////////////////////////// 76 100 extern void _xcu_get_wti_value( unsigned int cluster_xy, 77 101 unsigned int wti_index, 78 102 unsigned int * value ); 79 103 104 //////////////////////////////////////////////////////////////////////////////// 105 // This function returns the address of a WTI mailbox defined by 106 // the "wti_index" argument, in the unsigned int "address" argument. 107 // It is used by the GIET to configurate the IOPIC component. 108 // There is no access to a specific XCU component in a specific cluster. 109 //////////////////////////////////////////////////////////////////////////////// 80 110 extern void _xcu_get_wti_address( unsigned int wti_index, 81 111 unsigned int * address ); 82 112 113 //////////////////////////////////////////////////////////////////////////////// 114 // This function activates a timer contained in XCU by writing in the 115 // proper register the period value. 116 //////////////////////////////////////////////////////////////////////////////// 83 117 extern void _xcu_timer_start( unsigned int cluster_xy, 84 118 unsigned int pti_index, 85 119 unsigned int period ); 86 120 121 ////////////////////////////////////////////////////////////////////////////// 122 // This function desactivates a timer in XCU component 123 // by writing in the proper register. 124 ////////////////////////////////////////////////////////////////////////////// 87 125 extern void _xcu_timer_stop( unsigned int cluster_xy, 88 126 unsigned int pti_index ); 89 127 128 ////////////////////////////////////////////////////////////////////////////// 129 // This function acknowlegge a timer interrupt in XCU 130 // component by reading in the proper XCU register. 131 // It can be used by both the isr_switch() for a "system" timer, 132 // or by the _isr_timer() for an "user" timer. 133 ////////////////////////////////////////////////////////////////////////////// 90 134 extern unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy, 91 135 unsigned int pti_index ); 92 136 137 ////////////////////////////////////////////////////////////////////////////// 138 // This function resets a timer counter. To do so, we re-write the period 139 // in the proper register, what causes the count to restart. 140 // The period value is read from the same (TIMER_PERIOD) register, 141 // this is why in appearance we do nothing useful (read a value 142 // from a register and write this value in the same register). 143 // This function is called during a context switch (user or preemptive) 144 ///////////////////////////////////////////////////////////////////////////// 93 145 extern void _xcu_timer_reset_cpt( unsigned int cluster_xy, 94 146 unsigned int pti_index ); 95 96 ///////////////////////////////////////////////////////////////////////////////////97 147 98 148 #endif
Note: See TracChangeset
for help on using the changeset viewer.