Changeset 527 for trunk/kernel
- Timestamp:
- Aug 30, 2018, 10:26:27 PM (6 years ago)
- Location:
- trunk/kernel
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_txt.c
r492 r527 49 49 50 50 //////////////////////////////////////// 51 char * dev_txt_type_str( uint32_t type ) 52 { 53 if ( type == TXT_SYNC_WRITE ) return "TXT_SYNC_WRITE"; 54 else if( type == TXT_READ ) return "TXT_READ"; 55 else if( type == TXT_WRITE ) return "TXT_WRITE"; 56 else return "undefined"; 51 const char * dev_txt_type_str( dev_txt_cmd_t type ) 52 { 53 switch (type) { 54 case (TXT_SYNC_WRITE): return "TXT_SYNC_WRITE"; 55 case (TXT_READ): return "TXT_READ"; 56 case (TXT_WRITE): return "TXT_WRITE"; 57 default: return "undefined"; 58 } 57 59 } 58 60 -
trunk/kernel/devices/dev_txt.h
r457 r527 78 78 *****************************************************************************************/ 79 79 80 enum80 typedef enum 81 81 { 82 82 TXT_READ = 0, 83 83 TXT_WRITE = 1, 84 84 TXT_SYNC_WRITE = 2, 85 } ;85 } dev_txt_cmd_t; 86 86 87 87 typedef struct txt_command_s … … 113 113 * @ type : command type (TXT_READ / TXT_WRITE / TXT_SYNC_WRITE) 114 114 *****************************************************************************************/ 115 c har * dev_txt_type_str( uint32_t type );115 const char * dev_txt_type_str( dev_txt_cmd_t type ); 116 116 117 117 /****************************************************************************************** -
trunk/kernel/fs/vfs.c
r492 r527 127 127 ////////////////////////////////////////////////////////////////////////////////////////// 128 128 129 char * vfs_inode_type_str( uint32_t type ) 130 { 131 if ( type == INODE_TYPE_FILE ) return "FILE"; 132 else if( type == INODE_TYPE_DIR ) return "DIR "; 133 else if( type == INODE_TYPE_FIFO ) return "FIFO"; 134 else if( type == INODE_TYPE_PIPE ) return "PIPE"; 135 else if( type == INODE_TYPE_SOCK ) return "SOCK"; 136 else if( type == INODE_TYPE_DEV ) return "DEV "; 137 else if( type == INODE_TYPE_SYML ) return "SYML"; 138 else return "undefined"; 129 static const char * vfs_inode_type_str( vfs_inode_type_t type ) 130 { 131 switch ( type ) { 132 case INODE_TYPE_FILE: return "FILE"; 133 case INODE_TYPE_DIR: return "DIR "; 134 case INODE_TYPE_FIFO: return "FIFO"; 135 case INODE_TYPE_PIPE: return "PIPE"; 136 case INODE_TYPE_SOCK: return "SOCK"; 137 case INODE_TYPE_DEV: return "DEV "; 138 case INODE_TYPE_SYML: return "SYML"; 139 default: return "undefined"; 140 } 139 141 } 140 142 -
trunk/kernel/kern/chdev.c
r516 r527 57 57 char * chdev_func_str( uint32_t func_type ) 58 58 { 59 if ( func_type == DEV_FUNC_RAM ) return "RAM"; 60 else if( func_type == DEV_FUNC_ROM ) return "ROM"; 61 else if( func_type == DEV_FUNC_FBF ) return "FBF"; 62 else if( func_type == DEV_FUNC_IOB ) return "IOB"; 63 else if( func_type == DEV_FUNC_IOC ) return "IOC"; 64 else if( func_type == DEV_FUNC_MMC ) return "MMC"; 65 else if( func_type == DEV_FUNC_DMA ) return "DMA"; 66 else if( func_type == DEV_FUNC_NIC ) return "NIC"; 67 else if( func_type == DEV_FUNC_TIM ) return "TIM"; 68 else if( func_type == DEV_FUNC_TXT ) return "TXT"; 69 else if( func_type == DEV_FUNC_ICU ) return "ICU"; 70 else if( func_type == DEV_FUNC_PIC ) return "PIC"; 71 else return "undefined"; 59 switch ( func_type ) { 60 case DEV_FUNC_RAM: return "RAM"; 61 case DEV_FUNC_ROM: return "ROM"; 62 case DEV_FUNC_FBF: return "FBF"; 63 case DEV_FUNC_IOB: return "IOB"; 64 case DEV_FUNC_IOC: return "IOC"; 65 case DEV_FUNC_MMC: return "MMC"; 66 case DEV_FUNC_DMA: return "DMA"; 67 case DEV_FUNC_NIC: return "NIC"; 68 case DEV_FUNC_TIM: return "TIM"; 69 case DEV_FUNC_TXT: return "TXT"; 70 case DEV_FUNC_ICU: return "ICU"; 71 case DEV_FUNC_PIC: return "PIC"; 72 default: return "undefined"; 73 } 72 74 } 73 75 -
trunk/kernel/kern/do_syscall.c
r503 r527 30 30 #include <syscalls.h> 31 31 #include <shared_syscalls.h> 32 #include <syscalls_numbers.h> 32 33 33 34 /////////////////////////////////////////////////////////////////////////////////////// … … 106 107 107 108 //////////////////////////////////// 108 const char * syscall_str( uint32_t index ) 109 { 110 if ( index == SYS_THREAD_EXIT ) return "THREAD_EXIT"; // 0 111 else if( index == SYS_THREAD_YIELD ) return "THREAD_YIELD"; // 1 112 else if( index == SYS_THREAD_CREATE ) return "THREAD_CREATE"; // 2 113 else if( index == SYS_THREAD_JOIN ) return "THREAD_JOIN"; // 3 114 else if( index == SYS_THREAD_DETACH ) return "THREAD_DETACH"; // 4 115 else if( index == SYS_THREAD_CANCEL ) return "THREAD_CANCEL"; // 5 116 else if( index == SYS_SEM ) return "SEM"; // 6 117 else if( index == SYS_CONDVAR ) return "CONDVAR"; // 7 118 else if( index == SYS_BARRIER ) return "BARRIER"; // 8 119 else if( index == SYS_MUTEX ) return "MUTEX"; // 9 120 121 else if( index == SYS_EXIT ) return "EXIT"; // 10 122 else if( index == SYS_MUNMAP ) return "MUNMAP"; // 11 123 else if( index == SYS_OPEN ) return "OPEN"; // 12 124 else if( index == SYS_MMAP ) return "MMAP"; // 13 125 else if( index == SYS_READ ) return "READ"; // 14 126 else if( index == SYS_WRITE ) return "WRITE"; // 15 127 else if( index == SYS_LSEEK ) return "LSEEK"; // 16 128 else if( index == SYS_CLOSE ) return "CLOSE"; // 17 129 else if( index == SYS_UNLINK ) return "UNLINK"; // 18 130 else if( index == SYS_PIPE ) return "PIPE"; // 19 131 132 else if( index == SYS_CHDIR ) return "CHDIR"; // 20 133 else if( index == SYS_MKDIR ) return "MKDIR"; // 21 134 else if( index == SYS_MKFIFO ) return "MKFIFO"; // 22 135 else if( index == SYS_OPENDIR ) return "OPENDIR"; // 23 136 else if( index == SYS_READDIR ) return "READDIR"; // 24 137 else if( index == SYS_CLOSEDIR ) return "CLOSEDIR"; // 25 138 else if( index == SYS_GETCWD ) return "GETCWD"; // 26 139 else if( index == SYS_ISATTY ) return "ISATTY"; // 27 140 else if( index == SYS_ALARM ) return "ALARM"; // 28 141 else if( index == SYS_RMDIR ) return "RMDIR"; // 29 142 143 else if( index == SYS_UTLS ) return "UTLS"; // 30 144 else if( index == SYS_CHMOD ) return "CHMOD"; // 31 145 else if( index == SYS_SIGNAL ) return "SIGNAL"; // 32 146 else if( index == SYS_TIMEOFDAY ) return "TIMEOFDAY"; // 33 147 else if( index == SYS_KILL ) return "KILL"; // 34 148 else if( index == SYS_GETPID ) return "GETPID"; // 35 149 else if( index == SYS_FORK ) return "FORK"; // 36 150 else if( index == SYS_EXEC ) return "EXEC"; // 37 151 else if( index == SYS_STAT ) return "STAT"; // 38 152 else if( index == SYS_WAIT ) return "WAIT"; // 39 153 154 else if( index == SYS_GET_CONFIG ) return "GET_CONFIG"; // 40 155 else if( index == SYS_GET_CORE ) return "GET_CORE"; // 41 156 else if( index == SYS_GET_CYCLE ) return "GET_CYCLE"; // 42 157 else if( index == SYS_DISPLAY ) return "DISPLAY"; // 43 158 else if( index == SYS_THREAD_SLEEP ) return "THREAD_SLEEP"; // 45 159 else if( index == SYS_THREAD_WAKEUP ) return "THREAD_WAKEUP"; // 46 160 else if( index == SYS_TRACE ) return "TRACE"; // 47 161 else if( index == SYS_FG ) return "FG"; // 48 162 else if( index == SYS_IS_FG ) return "IS_FG"; // 49 163 164 else return "undefined"; 109 const char * syscall_str( syscalls_t index ) 110 { 111 switch (index) { 112 case SYS_THREAD_EXIT: return "THREAD_EXIT"; // 0 113 case SYS_THREAD_YIELD: return "THREAD_YIELD"; // 1 114 case SYS_THREAD_CREATE: return "THREAD_CREATE"; // 2 115 case SYS_THREAD_JOIN: return "THREAD_JOIN"; // 3 116 case SYS_THREAD_DETACH: return "THREAD_DETACH"; // 4 117 case SYS_THREAD_CANCEL: return "THREAD_CANCEL"; // 5 118 case SYS_SEM : return "SEM"; // 6 119 case SYS_CONDVAR: return "CONDVAR"; // 7 120 case SYS_BARRIER: return "BARRIER"; // 8 121 case SYS_MUTEX : return "MUTEX"; // 9 122 123 case SYS_EXIT: return "EXIT"; // 10 124 case SYS_MUNMAP: return "MUNMAP"; // 11 125 case SYS_OPEN: return "OPEN"; // 12 126 case SYS_MMAP: return "MMAP"; // 13 127 case SYS_READ: return "READ"; // 14 128 case SYS_WRITE: return "WRITE"; // 15 129 case SYS_LSEEK: return "LSEEK"; // 16 130 case SYS_CLOSE: return "CLOSE"; // 17 131 case SYS_UNLINK: return "UNLINK"; // 18 132 case SYS_PIPE: return "PIPE"; // 19 133 134 case SYS_CHDIR: return "CHDIR"; // 20 135 case SYS_MKDIR: return "MKDIR"; // 21 136 case SYS_MKFIFO: return "MKFIFO"; // 22 137 case SYS_OPENDIR: return "OPENDIR"; // 23 138 case SYS_READDIR: return "READDIR"; // 24 139 case SYS_CLOSEDIR: return "CLOSEDIR"; // 25 140 case SYS_GETCWD: return "GETCWD"; // 26 141 case SYS_ISATTY: return "ISATTY"; // 27 142 case SYS_ALARM : return "ALARM"; // 28 143 case SYS_RMDIR : return "RMDIR"; // 29 144 145 case SYS_UTLS: return "UTLS"; // 30 146 case SYS_CHMOD : return "CHMOD"; // 31 147 case SYS_SIGNAL: return "SIGNAL"; // 32 148 case SYS_TIMEOFDAY: return "TIMEOFDAY"; // 33 149 case SYS_KILL: return "KILL"; // 34 150 case SYS_GETPID: return "GETPID"; // 35 151 case SYS_FORK: return "FORK"; // 36 152 case SYS_EXEC: return "EXEC"; // 37 153 case SYS_STAT: return "STAT"; // 38 154 case SYS_WAIT: return "WAIT"; // 39 155 156 case SYS_GET_CONFIG: return "GET_CONFIG"; // 40 157 case SYS_GET_CORE: return "GET_CORE"; // 41 158 case SYS_GET_CYCLE: return "GET_CYCLE"; // 42 159 case SYS_DISPLAY: return "DISPLAY"; // 43 160 case SYS_THREAD_SLEEP: return "THREAD_SLEEP"; // 45 161 case SYS_THREAD_WAKEUP: return "THREAD_WAKEUP"; // 46 162 case SYS_TRACE: return "TRACE"; // 47 163 case SYS_FG: return "FG"; // 48 164 case SYS_IS_FG: return "IS_FG"; // 49 165 166 case SYS_UNDEFINED: 167 default: return "undefined"; 168 } 165 169 } 166 170 -
trunk/kernel/kern/process.c
r514 r527 456 456 457 457 ///////////////////////////////////////////////// 458 char * process_action_str( uint32_t action_type ) 459 { 460 if ( action_type == BLOCK_ALL_THREADS ) return "BLOCK"; 461 else if( action_type == UNBLOCK_ALL_THREADS ) return "UNBLOCK"; 462 else if( action_type == DELETE_ALL_THREADS ) return "DELETE"; 463 else return "undefined"; 458 const char * process_action_str( process_sigactions_t action_type ) 459 { 460 switch ( action_type ) { 461 case BLOCK_ALL_THREADS: return "BLOCK"; 462 case UNBLOCK_ALL_THREADS: return "UNBLOCK"; 463 case DELETE_ALL_THREADS: return "DELETE"; 464 default: return "undefined"; 465 } 464 466 } 465 467 -
trunk/kernel/kern/process.h
r503 r527 56 56 ********************************************************************************************/ 57 57 58 enum process_sigactions58 typedef enum process_sigactions 59 59 { 60 60 BLOCK_ALL_THREADS = 0x11, 61 61 UNBLOCK_ALL_THREADS = 0x22, 62 62 DELETE_ALL_THREADS = 0x33, 63 } ;63 } process_sigactions_t; 64 64 65 65 /********************************************************************************************* … … 275 275 * @ return a string pointer. 276 276 ********************************************************************************************/ 277 c har * process_action_str( uint32_t sigaction_type );277 const char * process_action_str( process_sigactions_t sigaction_type ); 278 278 279 279 /********************************************************************************************* -
trunk/kernel/kern/thread.c
r518 r527 53 53 // This function returns a printable string for the thread type. 54 54 ////////////////////////////////////////////////////////////////////////////////////// 55 char * thread_type_str( uint32_t type ) 56 { 57 if ( type == THREAD_USER ) return "USR"; 58 else if( type == THREAD_RPC ) return "RPC"; 59 else if( type == THREAD_DEV ) return "DEV"; 60 else if( type == THREAD_IDLE ) return "IDL"; 61 else return "undefined"; 55 const char * thread_type_str( thread_type_t type ) 56 { 57 switch ( type ) { 58 case THREAD_USER: return "USR"; 59 case THREAD_RPC: return "RPC"; 60 case THREAD_DEV: return "DEV"; 61 case THREAD_IDLE: return "IDL"; 62 default: return "undefined"; 63 } 62 64 } 63 65 -
trunk/kernel/kern/thread.h
r503 r527 205 205 * returns pointer on string. 206 206 **************************************************************************************/ 207 c har * thread_type_str( uint32_t type );207 const char * thread_type_str( thread_type_t type ); 208 208 209 209 /*************************************************************************************** -
trunk/kernel/syscalls/syscalls.h
r506 r527 37 37 38 38 // debug: 39 const char * syscall_str( uint32_t index );39 const char * syscall_str( syscalls_t index ); 40 40 41 41 /******************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.