Changeset 216
- Timestamp:
- Sep 18, 2012, 6:38:49 PM (12 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_config.h
r215 r216 19 19 #define BOOT_DEBUG_PT 0 /* trace page tables initialisation on TTY0 */ 20 20 #define BOOT_DEBUG_VOBJS 0 /* trace vobjs initialisation on TTY0 */ 21 #define BOOT_DEBUG_SCHED 1/* trace schedulers initialisation on TTY0 */21 #define BOOT_DEBUG_SCHED 0 /* trace schedulers initialisation on TTY0 */ 22 22 23 23 #define GIET_DEBUG_INIT 0 /* trace parallel kernel initialisation on TTY0 */ … … 29 29 30 30 #define GIET_NB_VSPACE_MAX 64 /* max number of virtual spaces */ 31 #define GIET_TICK_VALUE 0x 4000 /* context switch period (number of cycles) */31 #define GIET_TICK_VALUE 0x1000 /* context switch period (number of cycles) */ 32 32 33 33 #endif -
soft/giet_vm/sys/drivers.c
r215 r216 78 78 #endif 79 79 80 #if ( (NB_TIMERS_MAX + NB_PROCS_MAX) > 32 )80 #if ( (NB_TIMERS_MAX) > 32 ) 81 81 # error: NB_TIMERS_MAX + NB_PROCS_MAX cannot be larger than 32 82 82 #endif … … 111 111 // local_id in [0, NB_PROCS_MAX-1], 112 112 // - "user" timers : requested by the task in the mapping_info data structure. 113 // local_id in [NB_PROC_MAX, NB_PROCS_MAX + NB_TIMERS_MAX - 1]114 113 // For each user timer, the timer_id is stored in the context of the task. 115 114 // The global index is cluster_id * (NB_PROCS_MAX+NB_TIMERS_MAX) + local_id … … 136 135 { 137 136 // parameters checking 138 if ( cluster_id >= NB_CLUSTERS) 139 if ( local_id >= NB_TIMERS_MAX + NB_PROCS_MAX ) return 1;137 if ( cluster_id >= NB_CLUSTERS) return 1; 138 if ( local_id >= NB_TIMERS_MAX) return 2; 140 139 141 140 #if USE_XICU … … 164 163 { 165 164 // parameters checking 166 if ( cluster_id >= NB_CLUSTERS) 167 if ( local_id >= NB_TIMERS_MAX + NB_PROCS_MAX ) return 1;165 if ( cluster_id >= NB_CLUSTERS) return 1; 166 if ( local_id >= NB_TIMERS_MAX ) return 2; 168 167 169 168 #if USE_XICU … … 193 192 { 194 193 // parameters checking 195 if ( cluster_id >= NB_CLUSTERS) 196 if ( local_id >= NB_TIMERS_MAX + NB_PROCS_MAX ) return 1;194 if ( cluster_id >= NB_CLUSTERS) return 1; 195 if ( local_id >= NB_TIMERS_MAX ) return 2; 197 196 198 197 #if USE_XICU -
soft/giet_vm/sys/irq_handler.c
r215 r216 45 45 unsigned int irq_id; 46 46 47 47 48 // get the highest priority active IRQ index 48 49 if ( _icu_get_index( pid / NB_PROCS_MAX, … … 55 56 } 56 57 58 57 59 if ( irq_id < 32 ) // do nothing if no interrupt active 58 60 { … … 60 62 unsigned int isr_id = entry & 0x000000FF; 61 63 unsigned int channel_id = (entry>>16) & 0x0000FFFF; 62 if ( isr_id == ISR_SWITCH ) _isr_switch( );64 if ( isr_id == ISR_SWITCH ) _isr_switch( channel_id ); 63 65 else if ( isr_id == ISR_IOC ) _isr_ioc(); 64 66 else if ( isr_id == ISR_DMA ) _isr_dma( channel_id ); … … 169 171 // aknowledge IRQ 170 172 if ( _timer_reset_irq( cluster_id, 171 NB_PROCS_MAX +timer_id ) )173 timer_id ) ) 172 174 { 173 175 _get_lock(&_tty_put_lock); … … 230 232 // The ISR acknowledges the IRQ and calls the _ctx_switch() function. 231 233 ///////////////////////////////////////////////////////////////////////////////////// 232 void _isr_switch( )234 void _isr_switch( unsigned int timer_id) 233 235 { 234 236 // get cluster index and proc local index 235 unsigned int pid = _procid(); 236 unsigned int local_id = pid % NB_PROCS_MAX; 237 unsigned int cluster_id = pid / NB_PROCS_MAX; 237 unsigned int cluster_id = _procid() / NB_PROCS_MAX; 238 238 239 239 // acknowledge IRQ 240 if ( _timer_reset_irq( cluster_id, local_id ) )240 if ( _timer_reset_irq( cluster_id, timer_id ) ) 241 241 { 242 242 _get_lock(&_tty_put_lock); -
soft/giet_vm/sys/kernel_init.c
r215 r216 124 124 } 125 125 126 unsigned int isr_switch_channel = 0xFFFFFFFF; 127 126 128 // step 3 : compute and set ICU masks 127 129 // there is at most 32 interrupts per processor … … 131 133 unsigned int hwi_mask = 0; 132 134 unsigned int pti_mask = 0; 133 134 unsigned int isr_switch_channel = 0xFFFFFFFF;135 135 136 136 for ( irq_id = 0 ; irq_id < 32 ; irq_id++ ) … … 173 173 if(isr_switch_channel == 0xFFFFFFFF) 174 174 { 175 _get_lock(&_tty_put_lock); 175 176 _puts("\n[GIET ERROR] ISR_SWITCH not found on proc "); 176 177 _putd( proc_id); 177 178 _puts("\n"); 179 _release_lock(&_tty_put_lock); 178 180 _sys_exit(); 179 181 } 180 _timer_start( cluster_id, 181 isr_switch_channel, 182 GIET_TICK_VALUE ); 182 183 if(_timer_start( cluster_id, isr_switch_channel, GIET_TICK_VALUE )) 184 { 185 _get_lock(&_tty_put_lock); 186 _puts("\n[GIET ERROR] ISR_SWITCH init error for proc "); 187 _putd( proc_id); 188 _puts("\n"); 189 _release_lock(&_tty_put_lock); 190 _sys_exit(); 191 } 183 192 184 193 #if GIET_DEBUG_INIT -
soft/giet_vm/xml/xml_parser.c
r215 r216 1129 1129 if(icu_base_offset == 0xFFFFFFFF) 1130 1130 icu_base_offset = pseg[ periph[periph_index]->psegid ]->base; 1131 1132 if(nb_timer_channel_max == 0) 1133 nb_timer_channel_max = 32; 1131 1134 } 1132 1135 else if ( strcmp( str, "DMA" ) == 0 )
Note: See TracChangeset
for help on using the changeset viewer.