Changeset 203 for soft/giet_vm/sys/kernel_init.c
- Timestamp:
- Aug 13, 2012, 10:52:25 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/kernel_init.c
r199 r203 76 76 77 77 // step 2 : initialise page table addresse arrays 78 // it scans all tasks contexts in the scheduler79 // and get VSID, PTAB and PTPR values78 // each processor scans all tasks contexts in its 79 // private scheduler and get VSID, PTAB and PTPR values 80 80 81 81 unsigned int ltid; … … 87 87 unsigned int ptab_vaddr = _get_context_slot( ltid , CTX_PTAB_ID ); 88 88 unsigned int ptab_paddr = _get_context_slot( ltid , CTX_PTPR_ID ) << 13; 89 89 90 _ptabs_vaddr[vspace_id] = ptab_vaddr; 90 91 _ptabs_paddr[vspace_id] = ptab_paddr; … … 106 107 } 107 108 108 // step 3 : compute and set ICU mask 109 // step 3 : compute and set ICU masks 110 // there is at most 32 interrupts per processor 111 // software interrupts are not supported yet 112 109 113 unsigned int irq_id; 110 unsigned int mask = 0; 114 unsigned int hwi_mask = 0; 115 unsigned int pti_mask = 0; 116 111 117 for ( irq_id = 0 ; irq_id < 32 ; irq_id++ ) 112 118 { 113 unsigned int entry = _get_interrupt_vector_entry(irq_id); 114 if ( entry ) mask = mask | 0x1<< irq_id; 115 } 116 _icu_write( cluster_id, 117 lpid, 118 ICU_MASK_SET, 119 mask ); 119 unsigned int entry = _get_interrupt_vector_entry(irq_id); 120 unsigned int isr = entry & 0x000000FF; 121 122 if ( (isr == ISR_DMA) || (isr == ISR_IOC) || (isr == ISR_TTY) ) 123 { 124 hwi_mask = hwi_mask | 0x1<< irq_id; 125 } 126 else if ( (isr == ISR_SWITCH) || (isr == ISR_TIMER) ) 127 { 128 pti_mask = pti_mask | 0x1<< irq_id; 129 } 130 } 131 _icu_set_mask( cluster_id, lpid, hwi_mask, 0 ); // set HWI_MASK 132 _icu_set_mask( cluster_id, lpid, pti_mask, 1 ); // set PTI_MASK 120 133 121 134 #if GIET_DEBUG_INIT … … 123 136 _puts("\n[GIET DEBUG] step 3 for processor "); 124 137 _putd( proc_id ); 125 _puts(" / ICU mask = "); 126 _putw( mask ); 138 _puts("\n - ICU HWI_MASK = "); 139 _putw( hwi_mask ); 140 _puts("\n - ICU PTI_MASK = "); 141 _putw( pti_mask ); 127 142 _puts("\n"); 128 143 _release_lock(&_tty_put_lock); … … 133 148 if ( tasks > 1 ) 134 149 { 135 unsigned int period = GIET_TICK_VALUE; 136 unsigned int mode = 0x3; 137 _timer_access( 0, // write access 138 cluster_id, 139 proc_id, 140 TIMER_PERIOD, 141 &period ); 142 _timer_access( 0, // write access 143 cluster_id, 144 proc_id, 145 TIMER_MODE, 146 &mode ); 150 _timer_start( cluster_id, 151 proc_id, 152 GIET_TICK_VALUE ); 147 153 148 154 #if GIET_DEBUG_INIT … … 150 156 _puts("\n[GIET DEBUG] Step 4 for processor "); 151 157 _putd( proc_id ); 152 _puts(" / TICKactivated\n");158 _puts(" / context switch activated\n"); 153 159 _release_lock(&_tty_put_lock); 154 160 #endif
Note: See TracChangeset
for help on using the changeset viewer.