Changeset 443 for trunk/kernel/syscalls/sys_display.c
- Timestamp:
- May 16, 2018, 4:15:22 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_display.c
r440 r443 30 30 #include <process.h> 31 31 #include <string.h> 32 32 #include <shared_syscalls.h> 33 34 ///////////////////////////////////////////////////////////////////////////////// 35 // This static function returns a printable string for the type of display. 36 ///////////////////////////////////////////////////////////////////////////////// 37 38 #if DEBUG_SYS_DISPLAY 39 static char* display_type_str( uint32_t type ) 40 { 41 if ( type == DISPLAY_STRING ) return "STRING"; 42 else if( type == DISPLAY_VMM ) return "VMM"; 43 else if( type == DISPLAY_SCHED ) return "SCHED"; 44 else if( type == DISPLAY_CLUSTER_PROCESSES ) return "CLUSTER_PROCESSES"; 45 else if( type == DISPLAY_VFS ) return "VFS"; 46 else if( type == DISPLAY_CHDEV ) return "CHDEV"; 47 else if( type == DISPLAY_TXT_PROCESSES ) return "TXT_PROCESSES"; 48 } 49 #endif 33 50 34 51 ///////////////////////////// … … 49 66 tm_start = hal_get_cycles(); 50 67 if( DEBUG_SYS_DISPLAY < tm_start ) 51 printk("\n[DBG] %s : thread %d enter / process %x / type % d/ cycle = %d\n",52 __FUNCTION__, this, this->process->pid, type, (uint32_t)tm_start );68 printk("\n[DBG] %s : thread %d enter / process %x / type %s / cycle = %d\n", 69 __FUNCTION__, this, this->process->pid, display_type_str(type), (uint32_t)tm_start ); 53 70 #endif 54 71 … … 98 115 else if( type == DISPLAY_VMM ) 99 116 { 100 pid_t pid = (pid_t)arg0; 101 102 // get extended pointer on reference process 103 xptr_t process_xp = cluster_get_reference_process_from_pid( pid ); 117 cxy_t cxy = (cxy_t)arg0; 118 pid_t pid = (pid_t)arg1; 119 120 // check cxy argument 121 if( cluster_is_undefined( cxy ) ) 122 { 123 124 #if DEBUG_SYSCALLS_ERROR 125 printk("\n[ERROR] in %s : illegal cxy argument %x / thread %x / process %x\n", 126 __FUNCTION__ , cxy , this->trdid , process->pid ); 127 #endif 128 this->errno = EINVAL; 129 return -1; 130 } 131 132 // get extended pointer on process PID in cluster CXY 133 xptr_t process_xp = cluster_get_process_from_pid_in_cxy( cxy , pid ); 104 134 105 135 if( process_xp == XPTR_NULL ) … … 107 137 108 138 #if DEBUG_SYSCALLS_ERROR 109 printk("\n[ERROR] in %s : undefined pid argument %d / thread %x / process %x\n", 110 __FUNCTION__ , pid , this->trdid , process->pid ); 111 #endif 112 this->errno = EINVAL; 113 return -1; 114 } 115 116 // get cluster and local pointer on process 117 cxy_t process_cxy = GET_CXY( process_xp ); 118 process_t * process_ptr = (process_t *)GET_PTR( process_xp ); 139 printk("\n[ERROR] in %s : process %x in cluster %x not found / thread %x / process %x\n", 140 __FUNCTION__ , pid , cxy , this->trdid , process->pid ); 141 #endif 142 this->errno = EINVAL; 143 return -1; 144 } 145 146 // get local pointer on process 147 process_t * process = (process_t *)GET_PTR( process_xp ); 119 148 120 149 // call kernel function 121 if( process_cxy == local_cxy )122 { 123 vmm_display( process _ptr, true );150 if( cxy == local_cxy ) 151 { 152 vmm_display( process , true ); 124 153 } 125 154 else 126 155 { 127 rpc_vmm_display_client( process_cxy , process_ptr, true );156 rpc_vmm_display_client( cxy , process , true ); 128 157 } 129 158 }
Note: See TracChangeset
for help on using the changeset viewer.