Changeset 281 for soft/giet_vm/giet_drivers/xcu_driver.c
- Timestamp:
- Jan 30, 2014, 5:32:13 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/xcu_driver.c
r275 r281 54 54 //////////////////////////////////////////////////////////////////////////////// 55 55 // _xcu_set_mask() 56 // This function set the mask register for the XICU channel identified 57 // by the cluster index and the processor index. 56 // This function set the mask register for the XICU channel identified by the 57 // cluster index and the processor index multiplied by the number of IRQ per 58 // processor. 58 59 // All '1' bits are set / all '0' bits are not modified. 59 60 // Returns 0 if success, > 0 if error. 60 61 //////////////////////////////////////////////////////////////////////////////// 61 62 unsigned int _xcu_set_mask( unsigned int cluster_xy, 62 unsigned int proc_id,63 unsigned int irq_index, 63 64 unsigned int value, 64 65 unsigned int irq_type ) … … 67 68 unsigned int x = cluster_xy >> Y_WIDTH; 68 69 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 69 if (x >= X_SIZE) return 1;70 if (y >= Y_SIZE) return 1;71 if ( proc_id >= NB_PROCS_MAX) return 1;70 if (x >= X_SIZE) return 1; 71 if (y >= Y_SIZE) return 1; 72 if (irq_index >= (NB_PROCS_MAX * IRQ_PER_PROCESSOR)) return 1; 72 73 73 74 #if USE_XICU … … 80 81 else if (irq_type == IRQ_TYPE_SWI) func = XICU_MSK_WTI_ENABLE; 81 82 else func = XICU_MSK_HWI_ENABLE; 82 xcu_address[XICU_REG(func, proc_id)] = value;83 xcu_address[XICU_REG(func,irq_index)] = value; 83 84 return 0; 84 85 #else … … 96 97 // - active PTI (Timer Interrupt), or 97 98 // - active SWI (Software Interrupt). 98 // The ICU channel is identified by the cluster index and the processor index. 99 // The ICU channel is identified by the cluster index and the processor index 100 // multiplied by the number of IRQ per processor. 99 101 // Returns 0 if success, > 0 if error. 100 102 //////////////////////////////////////////////////////////////////////////////// 101 103 unsigned int _xcu_get_index( unsigned int cluster_xy, 102 unsigned int proc_id,104 unsigned int irq_index, 103 105 unsigned int * buffer) 104 106 { … … 106 108 unsigned int x = cluster_xy >> Y_WIDTH; 107 109 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 108 if (x >= X_SIZE) return 1;109 if (y >= Y_SIZE) return 1;110 if ( proc_id >= NB_PROCS_MAX) return 1;110 if (x >= X_SIZE) return 1; 111 if (y >= Y_SIZE) return 1; 112 if (irq_index >= (NB_PROCS_MAX * IRQ_PER_PROCESSOR)) return 1; 111 113 112 114 #if USE_XICU … … 115 117 (cluster_xy * (unsigned int)&vseg_cluster_increment)); 116 118 117 unsigned int prio = xcu_address[XICU_REG(XICU_PRIO, proc_id)];119 unsigned int prio = xcu_address[XICU_REG(XICU_PRIO,irq_index)]; 118 120 unsigned int pti_ok = (prio & 0x00000001); 119 121 unsigned int hwi_ok = (prio & 0x00000002); … … 140 142 // It writes the "wdata" value in the mailbox defined by the cluster index 141 143 // and the processor index. 144 // Giet-VM supports at most NB_PROCS_MAX mailboxes: 145 // (0 <= wti_index <= NB_PROCS_MAX-1) 142 146 // Returns 0 if success, > 0 if error. 143 147 //////////////////////////////////////////////////////////////////////////////// 144 148 unsigned int _xcu_send_ipi( unsigned int cluster_xy, 145 unsigned int proc_id,149 unsigned int wti_index, 146 150 unsigned int wdata ) 147 151 { … … 149 153 unsigned int x = cluster_xy >> Y_WIDTH; 150 154 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 151 if (x >= X_SIZE) return 1;152 if (y >= Y_SIZE) return 1;153 if ( proc_id>= NB_PROCS_MAX) return 1;155 if (x >= X_SIZE) return 1; 156 if (y >= Y_SIZE) return 1; 157 if (wti_index >= NB_PROCS_MAX) return 1; 154 158 155 159 #if USE_XICU … … 158 162 (cluster_xy * (unsigned int)&vseg_cluster_increment)); 159 163 160 xcu_address[XICU_REG(XICU_WTI_REG, proc_id)] = wdata;164 xcu_address[XICU_REG(XICU_WTI_REG,wti_index)] = wdata; 161 165 return 0; 162 166 #else
Note: See TracChangeset
for help on using the changeset viewer.