Changeset 199 for soft/giet_vm/sys/drivers.c
- Timestamp:
- Aug 9, 2012, 2:38:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/drivers.c
r189 r199 162 162 { 163 163 unsigned int buffer = value; 164 unsigned int timer_id = _get_current_context_slot(CTX_TIMER_ID); 164 unsigned int task_id = _get_current_task_id(); 165 unsigned int timer_id = _get_context_slot(task_id, CTX_TIMER_ID); 165 166 unsigned int cluster_id = timer_id / (NB_PROCS_MAX + NB_TIMERS_MAX); 166 167 unsigned int local_id = timer_id % (NB_PROCS_MAX + NB_TIMERS_MAX); … … 190 191 unsigned int* buffer ) 191 192 { 192 unsigned int timer_id = _get_current_context_slot(CTX_TIMER_ID); 193 unsigned int task_id = _get_current_task_id(); 194 unsigned int timer_id = _get_context_slot(task_id, CTX_TIMER_ID); 193 195 unsigned int cluster_id = timer_id / (NB_PROCS_MAX + NB_TIMERS_MAX); 194 196 unsigned int local_id = timer_id % (NB_PROCS_MAX + NB_TIMERS_MAX); … … 232 234 // _tty_error() 233 235 //////////////////////////////////////////////////////////////////////////////// 234 void _tty_error() 235 { 236 unsigned int task_id = _get_current_task_id(); 236 void _tty_error( unsigned int task_id ) 237 { 237 238 unsigned int proc_id = _procid(); 238 239 … … 259 260 unsigned int nwritten; 260 261 261 unsigned int tty_id = _get_current_context_slot(CTX_TTY_ID); 262 unsigned int task_id = _get_current_task_id(); 263 unsigned int tty_id = _get_context_slot(task_id, CTX_TTY_ID); 264 262 265 if ( tty_id >= NB_TTYS ) 263 266 { 264 _tty_error( );267 _tty_error( task_id ); 265 268 return 0; 266 269 } … … 291 294 unsigned int length) 292 295 { 293 unsigned int tty_id = _get_current_context_slot(CTX_TTY_ID); 296 unsigned int task_id = _get_current_task_id(); 297 unsigned int tty_id = _get_context_slot(task_id, CTX_TTY_ID); 294 298 295 299 if ( tty_id >= NB_TTYS ) 296 300 { 297 _tty_error( );301 _tty_error( task_id ); 298 302 return 0; 299 303 } … … 320 324 unsigned int length) 321 325 { 322 unsigned int tty_id = _get_current_context_slot(CTX_TTY_ID); 326 unsigned int task_id = _get_current_task_id(); 327 unsigned int tty_id = _get_context_slot(task_id, CTX_TTY_ID); 328 323 329 if ( tty_id >= NB_TTYS ) 324 330 { 325 _tty_error( );331 _tty_error( task_id ); 326 332 return 0; 327 333 } … … 544 550 545 551 // get user space page table virtual address 546 unsigned int user_pt_vbase = _get_current_context_slot(CTX_PTAB_ID); 552 unsigned int task_id = _get_current_task_id(); 553 unsigned int user_pt_vbase = _get_context_slot( task_id, CTX_PTAB_ID ); 547 554 548 555 user_vpn_min = user_vaddr >> 12; … … 815 822 816 823 // get DMA channel and compute DMA vbase address 817 unsigned int dma_id = _get_current_context_slot(CTX_FBDMA_ID); 824 unsigned int task_id = _get_current_task_id(); 825 unsigned int dma_id = _get_context_slot( task_id, CTX_FBDMA_ID ); 818 826 unsigned int cluster_id = dma_id / NB_DMAS_MAX; 819 827 unsigned int loc_id = dma_id % NB_DMAS_MAX; … … 830 838 831 839 // get user space page table virtual address 832 unsigned int user_ptab = _get_c urrent_context_slot(CTX_PTAB_ID);840 unsigned int user_ptab = _get_context_slot( task_id, CTX_PTAB_ID ); 833 841 834 842 // compute frame buffer pbase address … … 985 993 unsigned int _fb_completed() 986 994 { 987 unsigned int dma_id = _get_current_context_slot(CTX_FBDMA_ID); 995 unsigned int task_id = _get_current_task_id(); 996 unsigned int dma_id = _get_context_slot( task_id, CTX_FBDMA_ID ); 988 997 989 998 // busy waiting with a pseudo random delay between bus access
Note: See TracChangeset
for help on using the changeset viewer.