Changeset 5 for trunk/kernel/kern/printk.h
- Timestamp:
- Apr 26, 2017, 2:11:56 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/printk.h
r1 r5 24 24 /////////////////////////////////////////////////////////////////////////////////// 25 25 // The printk.c and printk.h files define the functions used by the kernel 26 // to display messages on the kernel text terminal, using a busy waiting 27 // policy if required : these functions does not use the TXT kernel thread, 28 // and does not deschedule if TXT peripheral is not available. 29 // These functions use the generic TXT device to call the proper implementation 26 // to display messages on a text terminal. 27 // Two access modes are supported: 28 // - The printk() function displays kernel messages on the kernel terminal TXT0, 29 // using a busy waiting policy: It calls directly the relevant TXT driver, 30 // after taking the TXT0 chdev lock for exclusive access to the TXT0 terminal. 31 // - The user_printk() function displays messages on the calling thread private 32 // terminal, using a descheduling policy: it register the request in the selected 33 // TXT chdev waiting queue and deschedule. The calling thread is reactivated by 34 // the IRQ signaling completion. 35 // Both functions use the generic TXT device to call the proper implementation 30 36 // dependant TXT driver. 37 // Finally these files define a set of conditionnal trace <***_dmsg> for debug. 31 38 /////////////////////////////////////////////////////////////////////////////////// 32 39 … … 34 41 #define _PRINTK_H 35 42 36 /////////////////////////////////////////////////////////////////////////////////// 37 // Access functions to kernel terminal TTY0 38 /////////////////////////////////////////////////////////////////////////////////// 39 43 #include <hal_types.h> 44 #include <stdarg.h> 45 46 47 /********************************************************************************** 48 * This function displays a formated string on the kernel terminal TXT0, 49 * using a busy waiting policy: It calls directly the relevant TXT driver, 50 * after taking the TXT0 chdev lock for exclusive access to the TXT0 terminal. 51 ********************************************************************************** 52 * @ format : formated string. 53 *********************************************************************************/ 40 54 extern void printk( char* format, ... ); 41 55 42 extern void nolock_printk( char* format, ... ); 43 56 /********************************************************************************** 57 * Display a formated string on the calling thread private terminal, using a 58 * descheduling policy: it register the request in the selected TXT chdev waiting 59 * queue and deschedule. IT is reactivated by the IRQ signaling completion. 60 * Not fully implemented yet ( use TXT0 in deschedling mode ). 61 ********************************************************************************** 62 * @ format : formated string. 63 *********************************************************************************/ 44 64 extern void user_printk( char* format, ... ); 45 65 66 /********************************************************************************** 67 * This function displaya "PANIC" message and force the calling core in 68 * sleeping mode if a Boolean condition is false. 69 * These functions are actually used to debug the kernel... 70 ********************************************************************************** 71 * @ condition : condition that must be true. 72 * @ function_name : name of the calling function. 73 * @ string : error message if condition is false. 74 *********************************************************************************/ 75 inline void assert( bool_t condition, 76 const char * function_name, 77 char * string ); 78 46 79 /////////////////////////////////////////////////////////////////////////////////// 47 80 // Conditionnal debug macros 48 81 /////////////////////////////////////////////////////////////////////////////////// 49 82 83 #if CONFIG_CONTEXT_DEBUG 84 #define context_dmsg(...) printk(__VA_ARGS__) 85 #else 86 #define context_dmsg(...) 87 #endif 88 50 89 #if CONFIG_CORE_DEBUG 51 #define core_dmsg(...) printk(__VA_ _ARGS__)90 #define core_dmsg(...) printk(__VA_ARGS__) 52 91 #else 53 92 #define core_dmsg(...) … … 55 94 56 95 #if CONFIG_DQDT_DEBUG 57 #define dqdt_dmsg(...) printk(__VA__ARGS__) 96 #define dma_dmsg(...) printk(__VA_ARGS__) 97 #else 98 #define dma_dmsg(...) 99 #endif 100 101 #if CONFIG_DQDT_DEBUG 102 #define dqdt_dmsg(...) printk(__VA_ARGS__) 58 103 #else 59 104 #define dqdt_dmsg(...) … … 61 106 62 107 #if CONFIG_ELF_DEBUG 63 #define elf_dmsg(...) printk(__VA_ _ARGS__)108 #define elf_dmsg(...) printk(__VA_ARGS__) 64 109 #else 65 110 #define elf_dmsg(...) 66 111 #endif 67 112 113 #if CONFIG_EXEC_DEBUG 114 #define exec_dmsg(...) printk(__VA_ARGS__) 115 #else 116 #define exec_dmsg(...) 117 #endif 118 119 #if CONFIG_FBF_DEBUG 120 #define fbf_dmsg(...) printk(__VA_ARGS__) 121 #else 122 #define fbf_dmsg(...) 123 #endif 124 68 125 #if CONFIG_FORK_DEBUG 69 #define fork_dmsg(...) printk(__VA_ _ARGS__)126 #define fork_dmsg(...) printk(__VA_ARGS__) 70 127 #else 71 128 #define fork_dmsg(...) 72 129 #endif 73 130 74 #if CONFIG_EXEC_DEBUG75 #define exec_dmsg(...) printk(__VA__ARGS__)76 #else77 #define exec_dmsg(...)78 #endif79 80 131 #if CONFIG_ICU_DEBUG 81 #define icu_dmsg(...) printk(__VA_ _ARGS__)132 #define icu_dmsg(...) printk(__VA_ARGS__) 82 133 #else 83 134 #define icu_dmsg(...) … … 85 136 86 137 #if CONFIG_IOC_DEBUG 87 #define ioc_dmsg(...) printk(__VA_ _ARGS__)138 #define ioc_dmsg(...) printk(__VA_ARGS__) 88 139 #else 89 140 #define ioc_dmsg(...) 141 #endif 142 143 #if CONFIG_KCM_DEBUG 144 #define kcm_dmsg(...) printk(__VA_ARGS__) 145 #else 146 #define kcm_dmsg(...) 147 #endif 148 149 #if CONFIG_KHM_DEBUG 150 #define khm_dmsg(...) printk(__VA_ARGS__) 151 #else 152 #define khm_dmsg(...) 90 153 #endif 91 154 … … 102 165 #endif 103 166 167 #if CONFIG_MAPPER_DEBUG 168 #define mapper_dmsg(...) printk(__VA_ARGS__) 169 #else 170 #define mapper_dmsg(...) 171 #endif 172 104 173 #if CONFIG_MMC_DEBUG 105 #define mmc_dmsg(...) printk(__VA_ _ARGS__)174 #define mmc_dmsg(...) printk(__VA_ARGS__) 106 175 #else 107 176 #define mmc_dmsg(...) … … 109 178 110 179 #if CONFIG_NIC_DEBUG 111 #define nic_dmsg(...) printk(__VA_ _ARGS__)180 #define nic_dmsg(...) printk(__VA_ARGS__) 112 181 #else 113 182 #define nic_dmsg(...) … … 115 184 116 185 #if CONFIG_PIC_DEBUG 117 #define pic_dmsg(...) printk(__VA_ _ARGS__)186 #define pic_dmsg(...) printk(__VA_ARGS__) 118 187 #else 119 188 #define pic_dmsg(...) 120 189 #endif 121 190 191 #if CONFIG_PPM_DEBUG 192 #define ppm_dmsg(...) printk(__VA_ARGS__) 193 #else 194 #define ppm_dmsg(...) 195 #endif 196 122 197 #if CONFIG_PROCESS_DEBUG 123 #define process_dmsg(...) printk(__VA_ _ARGS__)198 #define process_dmsg(...) printk(__VA_ARGS__) 124 199 #else 125 200 #define process_dmsg(...) … … 127 202 128 203 #if CONFIG_RPC_DEBUG 129 #define rpc_dmsg(...) printk(__VA_ _ARGS__)204 #define rpc_dmsg(...) printk(__VA_ARGS__) 130 205 #else 131 206 #define rpc_dmsg(...) … … 133 208 134 209 #if CONFIG_SCHED_DEBUG 135 #define sched_dmsg(...) printk(__VA_ _ARGS__)210 #define sched_dmsg(...) printk(__VA_ARGS__) 136 211 #else 137 212 #define sched_dmsg(...) … … 139 214 140 215 #if CONFIG_THREAD_DEBUG 141 #define thread_dmsg(...) printk(__VA_ _ARGS__)216 #define thread_dmsg(...) printk(__VA_ARGS__) 142 217 #else 143 218 #define thread_dmsg(...) … … 145 220 146 221 #if CONFIG_TXT_DEBUG 147 #define txt_dmsg(...) printk(__VA_ _ARGS__)222 #define txt_dmsg(...) printk(__VA_ARGS__) 148 223 #else 149 224 #define txt_dmsg(...) … … 151 226 152 227 #if CONFIG_VFS_DEBUG 153 #define vfs_dmsg(...) printk(__VA_ _ARGS__)228 #define vfs_dmsg(...) printk(__VA_ARGS__) 154 229 #else 155 230 #define vfs_dmsg(...) … … 157 232 158 233 #if CONFIG_VMM_DEBUG 159 #define vmm_dmsg(...) printk(__VA_ _ARGS__)234 #define vmm_dmsg(...) printk(__VA_ARGS__) 160 235 #else 161 236 #define vmm_dmsg(...)
Note: See TracChangeset
for help on using the changeset viewer.