- Timestamp:
- Aug 16, 2012, 6:36:16 PM (12 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/Makefile
r206 r207 5 5 DU=mipsel-unknown-elf-objdump 6 6 7 MAP_XML = map.xml7 MAP_XML = 4c_1p_four.xml 8 8 9 9 SYS_OBJS = build/sys/vm_handler.o \ -
soft/giet_vm/boot/boot_init.c
r205 r207 286 286 void boot_puts(const char *buffer) 287 287 { 288 unsigned int* tty_address = (unsigned int*)( ( unsigned)&seg_tty_base +289 288 unsigned int* tty_address = (unsigned int*)( (char*)&seg_tty_base + 289 (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) ); 290 290 unsigned int n; 291 291 … … 293 293 { 294 294 if (buffer[n] == 0) break; 295 tty_address[ 0] = (unsigned int)buffer[n];295 tty_address[TTY_WRITE] = (unsigned int)buffer[n]; 296 296 } 297 298 297 } 299 298 //////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/boot/reset.S
r204 r207 65 65 nop 66 66 mfc0 a0, CP0_TIME 67 jal boot_put x67 jal boot_putd 68 68 nop 69 69 la a0, boot_lf_string … … 76 76 mfc0 k0, CP0_PROCID 77 77 andi a0, k0, 0xFFF 78 jal boot_put x78 jal boot_putd 79 79 nop 80 80 la a0, boot_lf_string -
soft/giet_vm/display/main.c
r191 r207 8 8 unsigned char buf_in[128*128]; 9 9 unsigned char buf_out[128*128]; 10 10 11 unsigned int i; 11 12 unsigned int x; … … 14 15 while (base < 5 * NBLOCS) 15 16 { 16 17 17 giet_tty_printf("\n *** image %d *** at date = %d \n", 18 18 base / NBLOCS, giet_proctime()); … … 50 50 giet_exit(); 51 51 } 52 52 53 x = giet_fb_completed(); 53 54 if ( x ) -
soft/giet_vm/giet_config.h
r204 r207 25 25 /* hardware parameters */ 26 26 27 #define NB_CLUSTERS 1/* number of clusters */27 #define NB_CLUSTERS 4 /* number of clusters */ 28 28 #define CLUSTER_SIZE 0x40000000 /* address increment between clusters */ 29 #define CLUSTER_IO_ID 0/* cluster containing non replicated peripherals */29 #define CLUSTER_IO_ID 2 /* cluster containing non replicated peripherals */ 30 30 31 #define NB_PROCS_MAX 4/* max number of processors per cluster */31 #define NB_PROCS_MAX 1 /* max number of processors per cluster */ 32 32 #define NB_TIMERS_MAX 0 /* max number of user timers per cluster */ 33 33 #define NB_DMAS_MAX 1 /* max number of DMA channels per cluster*/ 34 34 #define NB_TTYS 8 /* total number of TTY channels */ 35 #define NB_IOCS 0/* total number of IOC channels */36 #define NB_NICS 0/* total number of NIC channels */35 #define NB_IOCS 1 /* total number of IOC channels */ 36 #define NB_NICS 8 /* total number of NIC channels */ 37 37 38 38 /* software parameters */ -
soft/giet_vm/hello/main.c
r199 r207 5 5 char byte; 6 6 unsigned int proc = giet_procid(); 7 unsigned int* illegal = 0xFFFFFFF0;7 unsigned int* illegal = (unsigned int*)0xFFFFFFF0; 8 8 9 9 while (1) -
soft/giet_vm/libs/mwmr_channel.c
r200 r207 62 62 :"$2", "$3", "$4"); 63 63 } 64 ////////////////////////////////////////////////////////////////////////////// 65 // nb_mwmr_write() 66 // This is a non-blocking function. 67 // The nitems parameter is the number of items to be transfered. 68 // The requested transfer is therefore (nitems * width) words. 69 // It takes the lock for exclusive access before testing the channel state. 70 // If there is not enough data in mwmr channel to read nitems, 71 // it reads as many items as possible, releases the lock, and returns 72 // the number of read items (it can be 0). 73 ////////////////////////////////////////////////////////////////////////////// 74 unsigned int nb_mwmr_write( mwmr_channel_t* mwmr, 75 unsigned int* buffer, 76 unsigned int nitems ) 77 { 78 unsigned int x; 79 unsigned int spaces; // number of empty slots (in words) 80 unsigned int nwords; // requested transfer length (in words) 81 unsigned int depth; // channel depth (in words) 82 unsigned int width; // channel width (in words) 83 unsigned int sts; // channel sts 84 unsigned int ptw; // channel ptw 85 86 if(nitems == 0) return 0; 87 88 // get the lock 89 mwmr_lock_acquire( &mwmr->lock ); 90 91 // access fifo status 92 depth = mwmr->depth; 93 width = mwmr->width; 94 sts = mwmr->sts; 95 ptw = mwmr->ptw; 96 spaces = depth - sts; 97 nwords = width * nitems; 98 99 if( spaces >= nwords ) // transfer nitems, release lock and return 100 { 101 for ( x = 0 ; x < nwords ; x++ ) 102 { 103 mwmr->data[ptw] = buffer[x]; 104 if ( (ptw + 1) == depth ) ptw = 0; 105 else ptw = ptw + 1; 106 } 107 mwmr->sts = mwmr->sts + nwords; 108 mwmr->ptw = ptw; 109 mwmr->lock = 0; 110 return nitems; 111 } 112 113 else if ( spaces < width ) // release lock and return 114 { 115 mwmr->lock = 0; 116 return 0; 117 } 118 else // transfer as many items as possible, release lock and return 119 { 120 nwords = (spaces/width) * width; // integer number of items 121 for ( x = 0 ; x < nwords ; x++ ) 122 { 123 mwmr->data[ptw] = buffer[x]; 124 if ( (ptw + 1) == depth ) ptw = 0; 125 else ptw = ptw + 1; 126 } 127 mwmr->sts = sts + nwords; 128 mwmr->ptw = ptw; 129 mwmr->lock = 0; 130 return (nwords/width); 131 } 132 } // end nb_mwmr_write() 64 133 65 134 ////////////////////////////////////////////////////////////////////////////// … … 136 205 for ( x = giet_rand()>>6 ; x > 0 ; x-- ) asm volatile ( "nop" ); 137 206 } 138 } 207 } // end mwmr_write() 208 209 ////////////////////////////////////////////////////////////////////////////// 210 // nb_mwmr_read() 211 // This is a non-blocking function. 212 // The nitems parameter is the number of items to be transfered. 213 // The requested transfer is therefore (nitems * width) words. 214 // It takes the lock for exclusive access before testing the channel state. 215 // If there is not enough data in mwmr channel to read nitems, 216 // it reads as many items as possible, releases the lock, and returns 217 // the number of read items (it can be 0). 218 ////////////////////////////////////////////////////////////////////////////// 219 unsigned int nb_mwmr_read( mwmr_channel_t* mwmr, 220 unsigned int* buffer, 221 unsigned int nitems ) 222 { 223 unsigned int x; 224 unsigned int nwords; // requested transfer length (in words) 225 unsigned int depth; // channel depth (in words) 226 unsigned int width; // channel width (in words) 227 unsigned int sts; // channel sts 228 unsigned int ptr; // channel ptr 229 230 if(nitems == 0) return 0; 231 232 // get the lock 233 mwmr_lock_acquire( &mwmr->lock ); 234 235 // access fifo status 236 depth = mwmr->depth; 237 width = mwmr->width; 238 sts = mwmr->sts; 239 ptr = mwmr->ptr; 240 nwords = width * nitems; 241 242 if( sts >= nwords ) // transfer nitems, release lock and return 243 { 244 for ( x = 0 ; x < nwords ; x++ ) 245 { 246 buffer[x] = mwmr->data[ptr]; 247 if ( (ptr + 1) == depth ) ptr = 0; 248 else ptr = ptr + 1; 249 } 250 mwmr->sts = mwmr->sts - nwords; 251 mwmr->ptr = ptr; 252 mwmr->lock = 0; 253 return nitems; 254 } 255 256 else if ( sts < width ) // release lock and return 257 { 258 mwmr->lock = 0; 259 return 0; 260 } 261 else // transfer as many items as possible, release lock and return 262 { 263 nwords = (sts/width) * width; // integer number of items 264 for ( x = 0 ; x < nwords ; x++ ) 265 { 266 buffer[x] = mwmr->data[ptr]; 267 if ( (ptr + 1) == depth ) ptr = 0; 268 else ptr = ptr + 1; 269 } 270 mwmr->sts = sts - nwords; 271 mwmr->ptr = ptr; 272 mwmr->lock = 0; 273 return (nwords/width); 274 } 275 } // nb_mwmr_read() 139 276 140 277 ////////////////////////////////////////////////////////////////////////////// … … 157 294 unsigned int width; // channel width (in words) 158 295 unsigned int sts; // channel sts 159 unsigned int ptr; // channel pt w296 unsigned int ptr; // channel ptr 160 297 161 298 if(nitems == 0) return; … … 209 346 for ( x = giet_rand()>>6 ; x > 0 ; x-- ) asm volatile ( "nop" ); 210 347 } 211 } 212 348 } // end mwmr_read() 349 350 -
soft/giet_vm/sys/common.c
r199 r207 13 13 #include <ctx_handler.h> 14 14 #include <drivers.h> 15 #include <hwr_mapping.h> 15 16 #include <stdarg.h> 16 17 … … 153 154 //////////////////////////////////////////////////////////////////////////// 154 155 // _puts() 155 // display a string on TTY0 / used for system code debugand log 156 //////////////////////////////////////////////////////////////////////////// 157 void _puts(char *buffer) 158 { 159 unsigned int* tty_address = (unsigned int*)&seg_tty_base; 156 // display a string on TTY0 / used for system code debug and log 157 //////////////////////////////////////////////////////////////////////////// 158 void _puts(char* buffer) 159 { 160 unsigned int* tty_address = (unsigned int*)( (char*)&seg_tty_base + 161 (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) ); 160 162 unsigned int n; 161 163 … … 163 165 { 164 166 if (buffer[n] == 0) break; 165 tty_address[ 0] = (unsigned int)buffer[n];167 tty_address[TTY_WRITE] = (unsigned int)buffer[n]; 166 168 } 167 169 } 168 170 //////////////////////////////////////////////////////////////////////////// 169 // _put w()171 // _putx() 170 172 // display an int (hexa) on TTY0 / used for system code debug and log 171 173 //////////////////////////////////////////////////////////////////////////// 172 void _put w(unsigned int val)174 void _putx(unsigned int val) 173 175 { 174 176 static const char HexaTab[] = "0123456789ABCDEF"; -
soft/giet_vm/sys/common.h
r203 r207 33 33 34 34 void _puts(char *string); 35 void _put w(unsigned int val);35 void _putx(unsigned int val); 36 36 void _putd(unsigned int val); 37 37 -
soft/giet_vm/sys/drivers.c
r205 r207 231 231 _get_lock(&_tty_put_lock); 232 232 _puts("\n[GIET ERROR] TTY index too large for task "); 233 _put w( task_id );233 _putd( task_id ); 234 234 _puts(" on processor "); 235 _put w( proc_id );235 _putd( proc_id ); 236 236 _puts("\n"); 237 237 _release_lock(&_tty_put_lock); … … 316 316 //////////////////////////////////////////////////////////////////////////////// 317 317 unsigned int _tty_get_char( unsigned int tty_id, 318 char*buffer )318 unsigned char* buffer ) 319 319 { 320 320 // checking argument … … 731 731 ////////////////////////////////////////////////////////////////////////////////// 732 732 unsigned int _dma_reset_irq( unsigned int cluster_id, 733 unsigned int local_id )733 unsigned int channel_id ) 734 734 { 735 735 // parameters checking 736 736 if ( cluster_id >= NB_CLUSTERS ) return 1; 737 if ( local_id >= NB_DMAS_MAX )return 1;737 if ( channel_id >= NB_DMAS_MAX ) return 1; 738 738 739 739 // compute DMA base address … … 741 741 (cluster_id * (unsigned)CLUSTER_SIZE) ); 742 742 743 dma_address[ local_id*DMA_SPAN + DMA_RESET] = 0;743 dma_address[channel_id*DMA_SPAN + DMA_RESET] = 0; 744 744 return 0; 745 745 } … … 748 748 ////////////////////////////////////////////////////////////////////////////////// 749 749 unsigned int _dma_get_status( unsigned int cluster_id, 750 unsigned int local_id,750 unsigned int channel_id, 751 751 unsigned int* status ) 752 752 { 753 753 // parameters checking 754 754 if ( cluster_id >= NB_CLUSTERS ) return 1; 755 if ( local_id >= NB_DMAS_MAX )return 1;755 if ( channel_id >= NB_DMAS_MAX ) return 1; 756 756 757 757 // compute DMA base address 758 758 unsigned int* dma_address = (unsigned int*)( (char*)&seg_dma_base + 759 759 (cluster_id * (unsigned)CLUSTER_SIZE) ); 760 761 *status = dma_address[ local_id*DMA_SPAN + DMA_LEN];760 761 *status = dma_address[channel_id*DMA_SPAN + DMA_LEN]; 762 762 return 0; 763 763 } … … 839 839 // - user_vaddr : virtual base address of the memory buffer. 840 840 // - length : number of bytes to be transfered. 841 // The memorybuffer must be mapped in user address space and word-aligned.841 // The user buffer must be mapped in user address space and word-aligned. 842 842 // The user buffer length must be multiple of 4 bytes. 843 843 // Me must compute the physical base addresses for both the frame buffer 844 844 // and the user buffer before programming the DMA transfer. 845 // The GIET being fully static, we don't need to split the transfer in 4 Kbytes845 // The GIET being fully static, we don't need to split the transfer in 4 Kbytes 846 846 // pages, because the user buffer is contiguous in physical space. 847 847 // Returns 0 if success, > 0 if error. … … 871 871 { 872 872 _get_lock(&_tty_put_lock); 873 _puts(" [GIET ERROR] in _fbdma_access() : user buffer not word aligned\n");873 _puts("\n[GIET ERROR] in _fbdma_access() : user buffer not word aligned\n"); 874 874 _release_lock(&_tty_put_lock); 875 875 return 1; … … 880 880 881 881 // compute frame buffer pbase address 882 unsigned int fb_vaddr = (unsigned int)&seg_fbf_base + offset; 882 unsigned int fb_vaddr = (unsigned int)&seg_fbf_base + 883 (CLUSTER_IO_ID * (unsigned int)CLUSTER_SIZE) + offset; 883 884 884 885 ko = _v2p_translate( (page_table_t*)user_ptab, … … 891 892 { 892 893 _get_lock(&_tty_put_lock); 893 _puts(" [GIET ERROR] in _fbdma_access() : frame buffer unmapped\n");894 _puts("\n[GIET ERROR] in _fbdma_access() : frame buffer unmapped\n"); 894 895 _release_lock(&_tty_put_lock); 895 896 return 2; … … 906 907 { 907 908 _get_lock(&_tty_put_lock); 908 _puts(" [GIET ERROR] in _fbdma_access() : user buffer unmapped\n");909 _puts("\n[GIET ERROR] in _fbdma_access() : user buffer unmapped\n"); 909 910 _release_lock(&_tty_put_lock); 910 911 return 3; … … 920 921 { 921 922 _get_lock(&_tty_put_lock); 922 _puts(" [GIET ERROR] in _fbdma_access() : user buffer not writable\n");923 _puts("\n[GIET ERROR] in _fbdma_access() : user buffer not writable\n"); 923 924 _release_lock(&_tty_put_lock); 924 925 return 5; -
soft/giet_vm/sys/drivers.h
r204 r207 41 41 42 42 unsigned int _tty_get_char( unsigned int tty_id, 43 char*buffer);43 unsigned char* buffer); 44 44 45 45 /////////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/sys/exc_handler.c
r199 r207 77 77 _puts( (char*)exc_type[type] ); 78 78 _puts("\n - EPC : "); 79 _put w( _get_epc() );79 _putx( _get_epc() ); 80 80 _puts("\n - BVAR : "); 81 _put w( _get_bvar() );81 _putx( _get_bvar() ); 82 82 _puts("\n"); 83 83 -
soft/giet_vm/sys/irq_handler.c
r204 r207 82 82 // This ISR handles all IRQs generated by the multi-channels DMA controlers. 83 83 // The multi_dma components can be distributed in the clusters. 84 // The channel_id argument is the global DMA channel index.85 // channel_id = cluster_id*NB_DMAS_MAX + loc_id86 // - The ISR saves the transfert status in _dma_status[ channel_id].84 // The channel_id argument is the local DMA channel index. 85 // dma_global_id = cluster_id*NB_DMAS_MAX + channel_id 86 // - The ISR saves the transfert status in _dma_status[dma_global_id]. 87 87 // - It acknowledges the interrupt to reinitialize the DMA controler. 88 // - it resets the synchronisation variable _dma_busy[ channel_id].88 // - it resets the synchronisation variable _dma_busy[dma_global_id]. 89 89 /////////////////////////////////////////////////////////////////////////////////// 90 90 void _isr_dma( unsigned int channel_id ) 91 91 { 92 // compute cluster_id and loc_id 93 unsigned int cluster_id = channel_id / NB_DMAS_MAX; 94 unsigned int local_id = channel_id % NB_DMAS_MAX; 92 // compute cluster_id 93 unsigned int cluster_id = _procid()/NB_PROCS_MAX; 94 95 // compute dma_global_id 96 unsigned int dma_global_id = cluster_id*NB_DMAS_MAX + channel_id; 95 97 96 98 // save DMA channel status 97 if ( _dma_get_status(cluster_id, local_id, &_dma_status[channel_id]) ) 99 if ( _dma_get_status(cluster_id, 100 channel_id, 101 (unsigned int*)&_dma_status[dma_global_id] ) ) 98 102 { 99 103 _get_lock(&_tty_put_lock); … … 104 108 105 109 // reset DMA channel irq 106 if ( _dma_reset_irq(cluster_id, local_id) ) 110 if ( _dma_reset_irq( cluster_id, 111 channel_id) ) 107 112 { 108 113 _get_lock(&_tty_put_lock); … … 113 118 114 119 // release DMA channel 115 _dma_done[ channel_id] = 1;120 _dma_done[dma_global_id] = 1; 116 121 } 117 122 … … 125 130 { 126 131 // save status & reset IRQ 127 if ( _ioc_get_status( &_ioc_status ) )132 if ( _ioc_get_status( (unsigned int*)&_ioc_status ) ) 128 133 { 129 134 _get_lock(&_tty_put_lock); … … 143 148 // These timers are distributed in all clusters, and can be implemented 144 149 // in a vci_multi_timer component, or in a vci_xicu component. 145 // The timer_id argument is a global index: 146 // timer_id = cluster_id*(NB_TIMERS_MAX+NB_PROCS_MAX) + local_id 147 // The user timer local index is (loc_id - NB_PROCS_MAX). 148 // 150 // The timer_id argument is the user timer local index. 151 // timer_globa_id = cluster_id*(NB_TIMERS_MAX) + timer_id 149 152 // The ISR acknowledges the IRQ and registers the event in the proper entry 150 153 // of the _timer_event[] array, and a log message is displayed on kernel terminal. … … 152 155 void _isr_timer(unsigned int timer_id) 153 156 { 154 155 unsigned int cluster_id = timer_id / (NB_TIMERS_MAX + NB_PROCS_MAX); 156 unsigned int local_id = timer_id % (NB_TIMERS_MAX + NB_PROCS_MAX); 157 158 // checking timer type 159 if (local_id < NB_PROCS_MAX ) 160 { 161 _get_lock(&_tty_put_lock); 162 _puts("[GIET ERROR] Strange... User timer ISR for a system timer\n"); 163 _release_lock(&_tty_put_lock); 164 return; 165 } 157 // compute cluster_id 158 unsigned int cluster_id = _procid()/NB_PROCS_MAX; 166 159 167 160 // aknowledge IRQ 168 if ( _timer_reset_irq( cluster_id, local_id ) ) 161 if ( _timer_reset_irq( cluster_id, 162 NB_PROCS_MAX + timer_id ) ) 169 163 { 170 164 _get_lock(&_tty_put_lock); … … 176 170 #if NB_TIMERS_MAX 177 171 // register the event 178 _timer_event[(cluster_id*NB_TIMERS_MAX) + (loc_id - NB_PROCS_MAX)] = 1; 172 unsigned int timer_global_id = cluster_id*NB_TIMERS_MAX + timer_id; 173 _user_timer_event[timer_global_id] = 1; 179 174 #endif 180 175 181 176 // display a message on TTY 0 182 177 _get_lock(&_tty_put_lock); 183 _puts(" [GIET] User Timer IRQ at cycle ");178 _puts("\n[GIET] User Timer IRQ at cycle "); 184 179 _putd( _proctime() ); 185 _puts(" / index = "); 186 _putd(timer_id); 180 _puts("\n - cluster_id = "); 181 _putd( cluster_id ); 182 _puts("\n - timer_id = "); 183 _putd( timer_id ); 187 184 _puts("\n"); 188 185 _release_lock(&_tty_put_lock); … … 194 191 // signaling that a character is available. 195 192 // There is one single multi_tty component controling all TTYs, 196 // and the tty_id //argument is the global TTY index.193 // and the tty_id argument is the global TTY index. 197 194 // There is one communication buffer _tty_buf[tty_id] per terminal. 198 195 // The sychronisation variable _tty_full[tty_id], is set by the ISR, … … 203 200 { 204 201 // save character and reset IRQ 205 if ( _tty_get_char( tty_id, &_tty_get_buf[tty_id] ) ) 202 if ( _tty_get_char( tty_id, 203 (unsigned char*)&_tty_get_buf[tty_id] ) ) 206 204 { 207 205 _get_lock(&_tty_put_lock); -
soft/giet_vm/sys/kernel_init.c
r203 r207 54 54 { 55 55 // compute cluster and local processor index 56 unsigned int proc_id = _procid(); 57 unsigned int cluster_id = proc_id / NB_PROCS_MAX; 58 unsigned int lpid = proc_id % NB_PROCS_MAX; 56 unsigned int global_pid = _procid(); 57 unsigned int cluster_id = global_pid / NB_PROCS_MAX; 58 unsigned int proc_id = global_pid % NB_PROCS_MAX; 59 60 // Step 0 : Compute number of tasks allocated to proc 61 62 unsigned int tasks = _get_tasks_number(); 63 64 #if GIET_DEBUG_INIT 65 _get_lock(&_tty_put_lock); 66 _puts("\n[GIET DEBUG] step 0 for processor "); 67 _putd( global_pid ); 68 _puts(" : tasks = "); 69 _putd( tasks ); 70 _puts("\n"); 71 _release_lock(&_tty_put_lock); 72 #endif 59 73 60 74 // step 1 : Initialise scheduler physical addresses array 61 62 // get scheduler physical address from register 75 // get scheduler physical address (from CP0 register) 76 63 77 static_scheduler_t* psched = (static_scheduler_t*)_get_sched(); 64 _schedulers_paddr[ proc_id]= psched;78 _schedulers_paddr[global_pid] = psched; 65 79 66 80 #if GIET_DEBUG_INIT 67 81 _get_lock(&_tty_put_lock); 68 82 _puts("\n[GIET DEBUG] step 1 for processor "); 69 _putd( proc_id );83 _putd( global_pid ); 70 84 _puts(" / scheduler pbase = "); 71 _putw( (unsigned int)psched ); 72 _puts("\n"); 73 _release_lock(&_tty_put_lock); 74 #endif 75 85 _putx( (unsigned int)psched ); 86 _puts("\n"); 87 _release_lock(&_tty_put_lock); 88 #endif 76 89 77 90 // step 2 : initialise page table addresse arrays … … 80 93 81 94 unsigned int ltid; 82 unsigned int tasks = _get_tasks_number();83 95 84 96 for ( ltid = 0 ; ltid < tasks ; ltid++ ) … … 94 106 _get_lock(&_tty_put_lock); 95 107 _puts("\n[GIET DEBUG] step 2 for processor "); 96 _putd( proc_id );108 _putd( global_pid ); 97 109 _puts(" / vspace "); 98 110 _putd( vspace_id ); 99 111 _puts("\n- ptab vbase = "); 100 _put w( ptab_vaddr );112 _putx( ptab_vaddr ); 101 113 _puts("\n- ptab pbase = "); 102 _put w( ptab_paddr );114 _putx( ptab_paddr ); 103 115 _puts("\n"); 104 116 _release_lock(&_tty_put_lock); … … 129 141 } 130 142 } 131 _icu_set_mask( cluster_id, lpid, hwi_mask, 0 ); // set HWI_MASK132 _icu_set_mask( cluster_id, lpid, pti_mask, 1 ); // set PTI_MASK143 _icu_set_mask( cluster_id, proc_id, hwi_mask, 0 ); // set HWI_MASK 144 _icu_set_mask( cluster_id, proc_id, pti_mask, 1 ); // set PTI_MASK 133 145 134 146 #if GIET_DEBUG_INIT 135 147 _get_lock(&_tty_put_lock); 136 148 _puts("\n[GIET DEBUG] step 3 for processor "); 137 _putd( proc_id );149 _putd( global_pid ); 138 150 _puts("\n - ICU HWI_MASK = "); 139 _put w( hwi_mask );151 _putx( hwi_mask ); 140 152 _puts("\n - ICU PTI_MASK = "); 141 _putw( pti_mask ); 142 _puts("\n"); 143 _release_lock(&_tty_put_lock); 144 #endif 145 153 _putx( pti_mask ); 154 _puts("\n"); 155 _release_lock(&_tty_put_lock); 156 #endif 146 157 147 158 // step 4 : start TICK timer if more than one task … … 155 166 _get_lock(&_tty_put_lock); 156 167 _puts("\n[GIET DEBUG] Step 4 for processor "); 157 _putd( proc_id );168 _putd( global_pid ); 158 169 _puts(" / context switch activated\n"); 159 170 _release_lock(&_tty_put_lock); … … 169 180 _set_context_slot( IDLE_TASK_INDEX, CTX_RUN_ID, 1 ); 170 181 _set_context_slot( IDLE_TASK_INDEX, CTX_SR_ID, 0xFF03 ); 171 _set_context_slot( IDLE_TASK_INDEX, CTX_SP_ID, (unsigned int)&_idle_stack[ proc_id] + 64 );182 _set_context_slot( IDLE_TASK_INDEX, CTX_SP_ID, (unsigned int)&_idle_stack[global_pid] + 64 ); 172 183 _set_context_slot( IDLE_TASK_INDEX, CTX_RA_ID, (unsigned int)&_ctx_eret ); 173 184 _set_context_slot( IDLE_TASK_INDEX, CTX_EPC_ID, (unsigned int)&_ctx_idle ); … … 178 189 _get_lock(&_tty_put_lock); 179 190 _puts("\n[GIET DEBUG] Step 5 for processor "); 180 _putd( proc_id );191 _putd( global_pid ); 181 192 _puts(" / idle task context set\n"); 182 193 _release_lock(&_tty_put_lock); … … 195 206 _get_lock( &_tty_put_lock ); 196 207 _puts("\n [GIET WARNING] No task allocated to processor "); 197 _put w( proc_id );208 _putd( global_pid ); 198 209 _puts(" => idle\n"); 199 210 _release_lock ( &_tty_put_lock ); … … 212 223 _get_lock(&_tty_put_lock); 213 224 _puts("\n[GIET DEBUG] step 6 for processor "); 214 _putd( proc_id );225 _putd( global_pid ); 215 226 _puts(" / registers initialised \n"); 216 227 _puts("- sp = "); 217 _put w( sp_value );228 _putx( sp_value ); 218 229 _puts("\n"); 219 230 _puts("- sr = "); 220 _put w( sr_value );231 _putx( sr_value ); 221 232 _puts("\n"); 222 233 _puts("- ptpr = "); 223 _put w( ptpr_value<<13 );234 _putx( ptpr_value<<13 ); 224 235 _puts("\n"); 225 236 _puts("- epc = "); 226 _put w( epc_value );237 _putx( epc_value ); 227 238 _puts("\n"); 228 239 _release_lock(&_tty_put_lock); -
soft/giet_vm/sys/sys_handler.c
r204 r207 66 66 _puts("\n\n!!! Undefined System Call !!!\n"); 67 67 _puts("\nEPC = "); 68 _put w( epc );68 _putx( epc ); 69 69 _exit(); 70 70 } -
soft/giet_vm/sys/vm_handler.c
r189 r207 45 45 _puts("\n[GIET ERROR] in iommu_add_pte2 function\n"); 46 46 _puts("the IOMMU PT1 entry is not mapped / ix1 = "); 47 _put w( ix1 );47 _putx( ix1 ); 48 48 _puts("\n"); 49 49 _exit(); … … 76 76 _puts("\n[GIET ERROR] in iommu_inval_pte2 function\n"); 77 77 _puts("the IOMMU PT1 entry is not mapped / ix1 = "); 78 _put w( ix1 );78 _putx( ix1 ); 79 79 _puts("\n"); 80 80 _exit(); … … 105 105 unsigned int ix1 = vpn >> 9; 106 106 unsigned int ix2 = vpn & 0x1FF; 107 107 /* 108 _puts("\n\n********************** entering v2p_translate"); 109 _puts("\n - pt = "); 110 _putx( (unsigned int)pt ); 111 _puts("\n - vpn = "); 112 _putx( vpn << 12 ); 113 _puts("\n - ptba = "); 114 _putx( pt->pt1[ix1] << 12 ) ; 115 _puts("\n - &pte2 = "); 116 _putx( (pt->pt1[ix1] << 12) + 8*ix2 ); 117 _puts("\n - flags = "); 118 _putx( *(unsigned int*)((pt->pt1[ix1] << 12) + 8*ix2) ); 119 _puts("\n"); 120 */ 108 121 // check PTE1 mapping 109 122 if ( (pt->pt1[ix1] & PTE_V) == 0 )
Note: See TracChangeset
for help on using the changeset viewer.