Changeset 232 for soft/giet_vm/sys/drivers.c
- Timestamp:
- Mar 5, 2013, 4:00:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/drivers.c
r228 r232 120 120 #if (NB_TIMERS_MAX > 0) 121 121 in_unckdata volatile unsigned char _user_timer_event[NB_CLUSTERS * NB_TIMERS_MAX] 122 = { [0 ... ((NB_CLUSTERS * NB_TIMERS_MAX) - 1)] = 0 };122 = { [0 ... ((NB_CLUSTERS * NB_TIMERS_MAX) - 1)] = 0 }; 123 123 #endif 124 124 … … 205 205 bloup++; // to avoid a warning 206 206 #else 207 unsigned int * timer_address = (unsigned int *) ((char *) &seg_tim_base +207 unsigned int * timer_address = (unsigned int *) ((char *) &seg_tim_base + 208 208 (cluster_id * CLUSTER_SIZE)); 209 209 … … 213 213 return 0; 214 214 } 215 216 217 //////////////////////////////////////////////// 218 // _timer_reset_irq_cpt() 219 //////////////////////////////////////////////// 220 //unsigned int _timer_reset_irq_cpt(unsigned int cluster_id, unsigned int local_id) { 221 // // parameters checking 222 // if ( cluster_id >= NB_CLUSTERS) return 1; 223 // if ( local_id >= NB_TIMERS_MAX ) return 2; 224 // 225 //#if USE_XICU 226 //#error // not implemented 227 //#else 228 // unsigned int * timer_address = (unsigned int *) ((char *) &seg_tim_base + (cluster_id * CLUSTER_SIZE)); 229 // 230 // timer_address[local_id * TIMER_SPAN + TIMER_RESETIRQ] = 1; 231 //#endif 232 // 233 // return 0; 234 //} 215 235 216 236 … … 264 284 unsigned int _tty_write(const char * buffer, unsigned int length) { 265 285 unsigned int nwritten; 266 unsigned int task_id = _get_ current_task_id();286 unsigned int task_id = _get_proc_task_id(); 267 287 unsigned int tty_id = _get_context_slot(task_id, CTX_TTY_ID); 268 288 … … 300 320 ////////////////////////////////////////////////////////////////////////////// 301 321 unsigned int _tty_read(char * buffer, unsigned int length) { 302 unsigned int task_id = _get_ current_task_id();322 unsigned int task_id = _get_proc_task_id(); 303 323 unsigned int tty_id = _get_context_slot(task_id, CTX_TTY_ID); 304 324 … … 567 587 568 588 // get user space page table virtual address 569 unsigned int task_id = _get_ current_task_id();589 unsigned int task_id = _get_proc_task_id(); 570 590 unsigned int user_pt_vbase = _get_context_slot(task_id, CTX_PTAB_ID); 571 591 … … 877 897 878 898 // get DMA channel and compute DMA vbase address 879 unsigned int task_id = _get_ current_task_id();899 unsigned int task_id = _get_proc_task_id(); 880 900 unsigned int dma_id = _get_context_slot(task_id, CTX_DMA_ID); 881 901 unsigned int cluster_id = dma_id / NB_DMAS_MAX; … … 1012 1032 unsigned int _dma_completed() { 1013 1033 #if NB_DMAS_MAX > 0 1014 unsigned int task_id = _get_ current_task_id();1034 unsigned int task_id = _get_proc_task_id(); 1015 1035 unsigned int dma_id = _get_context_slot(task_id, CTX_DMA_ID); 1016 1036 unsigned int dma_ret; … … 1246 1266 } 1247 1267 1268 /////////////////////////////////////////////////////////////////////////////////// 1269 // _heap_info() 1270 // This function returns the information associated to a heap (size and vaddr) 1271 // It uses the global task id (CTX_GTID_ID, unique for each giet task) and the 1272 // vspace id (CTX_VSID_ID) defined in the context 1273 /////////////////////////////////////////////////////////////////////////////////// 1274 unsigned int _heap_info(unsigned int * vaddr, unsigned int * size) { 1275 mapping_header_t * header = (mapping_header_t *) (&seg_mapping_base); 1276 mapping_task_t * tasks = _get_task_base(header); 1277 mapping_vobj_t * vobjs = _get_vobj_base(header); 1278 mapping_vspace_t * vspaces = _get_vspace_base(header); 1279 unsigned int taskid = _get_context_slot(_get_proc_task_id(), CTX_GTID_ID); 1280 unsigned int vspaceid = _get_context_slot(_get_proc_task_id(), CTX_VSID_ID); 1281 int heap_local_vobjid = tasks[taskid].heap_vobjid; 1282 if (heap_local_vobjid != -1) { 1283 unsigned int vobjheapid = heap_local_vobjid + vspaces[vspaceid].vobj_offset; 1284 *vaddr = vobjs[vobjheapid].vaddr; 1285 *size = vobjs[vobjheapid].length; 1286 return 0; 1287 } 1288 else { 1289 *vaddr = 0; 1290 *size = 0; 1291 return 0; 1292 } 1293 } 1294 1248 1295 // Local Variables: 1249 1296 // tab-width: 4
Note: See TracChangeset
for help on using the changeset viewer.