Changeset 437 for soft/giet_vm/giet_drivers/xcu_driver.c
- 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.c
r395 r437 4 4 // Author : alain greiner 5 5 // Copyright (c) UPMC-LIP6 6 ///////////////////////////////////////////////////////////////////////////////////7 // This peripheral is replicated in all clusters containing processors.8 //9 // SEG_XCU_BASE and PERI_CLUSTER_INCREMENT must be defined in hard_config.h file.10 6 /////////////////////////////////////////////////////////////////////////////////// 11 7 … … 85 81 } 86 82 87 //////////////////////////////////////////////////////////////////////////////// 88 // This function set the mask register for the IRQ type defined by "irq_type", 89 // and for the channel identified by the "cluster_xy" and "channel" arguments. 90 // All '1' bits are set / all '0' bits are not modified. 91 //////////////////////////////////////////////////////////////////////////////// 83 //////////////////////////////////////////// 92 84 void _xcu_set_mask( unsigned int cluster_xy, 93 85 unsigned int channel, … … 109 101 else 110 102 { 111 _p rintf("[GIET ERROR] _xcu_set_mask() receives illegal IRQ type\n");103 _puts("[GIET ERROR] _xcu_set_mask() receives illegal IRQ type\n"); 112 104 _exit(); 113 105 } … … 116 108 117 109 #else 118 _printf("[GIET ERROR] _xcu_set_mask() should not be used if USE_XCU not set\n"); 119 _exit(); 120 #endif 121 } 122 123 //////////////////////////////////////////////////////////////////////////////// 124 // This function returns the index and the type of the highest priority 125 // - active PTI (Timer Interrupt), then 126 // - active HWI (Hardware Interrupt), then 127 // - active WTI (Software Interrupt) 128 // As the hardware can define more than one IRQ per processor, but the GIET 129 // use only one, channel = lpid * IRQ_PER_PROCESSOR. 130 //////////////////////////////////////////////////////////////////////////////// 110 _puts("[GIET ERROR] _xcu_set_mask() should not be used if USE_XCU not set\n"); 111 _exit(); 112 #endif 113 } 114 115 ///////////////////////////////////////////// 131 116 void _xcu_get_index( unsigned int cluster_xy, 132 117 unsigned int channel, … … 170 155 171 156 #else 172 _printf("[GIET ERROR] _xcu_get_index should not be used if USE_XCU is not set\n"); 173 _exit(); 174 #endif 175 } 176 177 //////////////////////////////////////////////////////////////////////////////// 178 // This function writes the "wdata" value in the mailbox defined 179 // by the "cluster_xy" and "wti_index" arguments. 180 //////////////////////////////////////////////////////////////////////////////// 157 _puts("[GIET ERROR] _xcu_get_index should not be used if USE_XCU is not set\n"); 158 _exit(); 159 #endif 160 } 161 162 //////////////////////////////////////////// 181 163 void _xcu_send_wti( unsigned int cluster_xy, 182 164 unsigned int wti_index, … … 194 176 195 177 #else 196 _p rintf("[GIET ERROR] _xcu_send_wti() should not be used if USE_XCU is not set\n");178 _puts("[GIET ERROR] _xcu_send_wti() should not be used if USE_XCU is not set\n"); 197 179 _exit(); 198 180 #endif 199 181 } 200 182 201 //////////////////////////////////////////////////////////////////////////////// 202 // This function returns the value contained in a WTI mailbox defined by 203 // the cluster_xy and "wti_index" arguments. This value is written in 204 // the "value" argument, and the corresponding WTI is acknowledged. 205 // returns 0 if success, > 0 if error. 206 //////////////////////////////////////////////////////////////////////////////// 183 /////////////////////////////////////////////////// 207 184 void _xcu_get_wti_value( unsigned int cluster_xy, 208 185 unsigned int wti_index, … … 220 197 221 198 #else 222 _printf("[GIET ERROR] in _xcu_get_wti_value() USE_XCU is not set\n"); 223 _exit(); 224 #endif 225 } 226 227 //////////////////////////////////////////////////////////////////////////////// 228 // This function returns the address of a WTI mailbox defined by 229 // the "wti_index" argument, in the unsigned int "address" argument. 230 // It is used by the GIET to configurate the IOPIC component. 231 // There is no access to a specific XCU component in a specific cluster. 232 // returns 0 if success, > 0 if error. 233 //////////////////////////////////////////////////////////////////////////////// 199 _puts("[GIET ERROR] in _xcu_get_wti_value() USE_XCU is not set\n"); 200 _exit(); 201 #endif 202 } 203 204 //////////////////////////////////////////////////// 234 205 void _xcu_get_wti_address( unsigned int wti_index, 235 206 unsigned int * address ) … … 241 212 242 213 #else 243 _printf("[GIET ERROR] in _xcu_get_wti_address() USE_XCU is not set\n"); 244 _exit(); 245 #endif 246 } 247 248 //////////////////////////////////////////////////////////////////////////////// 249 // This function activates a timer contained in XCU by writing in the 250 // proper register the period value. 251 //////////////////////////////////////////////////////////////////////////////// 214 _puts("[GIET ERROR] in _xcu_get_wti_address() USE_XCU is not set\n"); 215 _exit(); 216 #endif 217 } 218 219 /////////////////////////////////////////////// 252 220 void _xcu_timer_start( unsigned int cluster_xy, 253 221 unsigned int pti_index, … … 264 232 265 233 #else 266 _printf("[GIET ERROR] in _xcu_timer_start() USE_XCU is not set\n"); 267 _exit(); 268 #endif 269 } 270 271 ////////////////////////////////////////////////////////////////////////////// 272 // This function desactivates a timer in XCU component 273 // by writing in the proper register. 274 ////////////////////////////////////////////////////////////////////////////// 234 _puts("[GIET ERROR] in _xcu_timer_start() USE_XCU is not set\n"); 235 _exit(); 236 #endif 237 } 238 239 ////////////////////////////////////////////// 275 240 void _xcu_timer_stop( unsigned int cluster_xy, 276 241 unsigned int pti_index) … … 286 251 287 252 #else 288 _printf("[GIET ERROR] in _xcu_timer_stop() USE_XCU is not set\n"); 289 _exit(); 290 #endif 291 } 292 293 ////////////////////////////////////////////////////////////////////////////// 294 // This function acknowlegge a timer interrupt in XCU 295 // component by reading in the proper XCU register. 296 // It can be used by both the isr_switch() for a "system" timer, 297 // or by the _isr_timer() for an "user" timer. 298 ////////////////////////////////////////////////////////////////////////////// 253 _puts("[GIET ERROR] in _xcu_timer_stop() USE_XCU is not set\n"); 254 _exit(); 255 #endif 256 } 257 258 /////////////////////////////////////////////////////////// 299 259 unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy, 300 260 unsigned int pti_index ) … … 311 271 312 272 #else 313 _p rintf("[GIET ERROR] in _xcu_timer_reset_irq() USE_XCU is not set\n");273 _puts("[GIET ERROR] in _xcu_timer_reset_irq() USE_XCU is not set\n"); 314 274 _exit(); 315 275 return 0; … … 317 277 } 318 278 319 ////////////////////////////////////////////////////////////////////////////// 320 // This function resets a timer counter. To do so, we re-write the period 321 // in the proper register, what causes the count to restart. 322 // The period value is read from the same (TIMER_PERIOD) register, 323 // this is why in appearance we do nothing useful (read a value 324 // from a register and write this value in the same register). 325 // This function is called during a context switch (user or preemptive) 326 ///////////////////////////////////////////////////////////////////////////// 279 /////////////////////////////////////////////////// 327 280 void _xcu_timer_reset_cpt( unsigned int cluster_xy, 328 281 unsigned int pti_index ) … … 343 296 344 297 #else 345 _p rintf("[GIET ERROR] in _xcu_timer_reset_cpt() USE_XCU is not set\n");298 _puts("[GIET ERROR] in _xcu_timer_reset_cpt() USE_XCU is not set\n"); 346 299 _exit(); 347 300 #endif
Note: See TracChangeset
for help on using the changeset viewer.