Changeset 428 for soft/giet_vm/giet_kernel/sys_handler.c
- Timestamp:
- Oct 4, 2014, 3:19:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/sys_handler.c
r410 r428 35 35 const void * _syscall_vector[64] = 36 36 { 37 &_ get_procid,/* 0x00 */37 &_proc_xyp, /* 0x00 */ 38 38 &_get_proctime, /* 0x01 */ 39 39 &_tty_write, /* 0x02 */ … … 113 113 } 114 114 115 ////////////////////////////////////////////////////////////////////////////// 116 // This function returns the processor (x,y,p) identifiers. 117 ////////////////////////////////////////////////////////////////////////////// 118 void _proc_xyp( unsigned int* x, 119 unsigned int* y, 120 unsigned int* p ) 121 { 122 unsigned int gpid = _get_procid(); // global processor index from CPO register 123 124 *x = (gpid >> (Y_WIDTH + P_WIDTH)) & ((1<<X_WIDTH)-1); 125 *y = (gpid >> P_WIDTH) & ((1<<Y_WIDTH)-1); 126 *p = gpid & ((1<<P_WIDTH)-1); 127 } 115 128 //////////////////////////////////////////////////////////////////////////// 116 129 // Task suicide... after printing a death message. … … 119 132 { 120 133 unsigned int date = _get_proctime(); 121 unsigned int proc_id = _get_procid(); 122 unsigned int cluster_xy = proc_id / NB_PROCS_MAX; 134 135 unsigned int gpid = _get_procid(); 136 unsigned int cluster_xy = gpid >> P_WIDTH; 123 137 unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1); 124 138 unsigned int x = cluster_xy >> Y_WIDTH; 125 unsigned int lpid = proc_id % NB_PROCS_MAX; 139 unsigned int lpid = gpid & ((1<<P_WIDTH)-1); 140 126 141 unsigned int task_id = _get_context_slot(CTX_LTID_ID); 127 142
Note: See TracChangeset
for help on using the changeset viewer.