Changeset 623 for trunk/kernel/kern/printk.h
- Timestamp:
- Mar 6, 2019, 4:37:15 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/printk.h
r583 r623 24 24 /////////////////////////////////////////////////////////////////////////////////// 25 25 // The printk.c and printk.h files define the functions used by the kernel 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 busylock 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 signalling completion. 35 // Both functions use the generic TXT device to call the proper implementation 36 // dependant TXT driver. 37 // Finally these files define a set of conditional trace <***_dmsg> for debug. 26 // to display messages on the kernel terminal TXT0, using a busy waiting policy. 27 // It calls synchronously the TXT0 driver, without descheduling. 38 28 /////////////////////////////////////////////////////////////////////////////////// 39 29 … … 44 34 #include <stdarg.h> 45 35 46 #include <hal_special.h> // hal_get_cycles()36 #include <hal_special.h> 47 37 48 38 /********************************************************************************** 49 39 * This function build a formatted string. 50 40 * The supported formats are defined below : 51 * %c : single character 52 * %d : signed decimal 32 bits integer 53 * %u : unsigned decimal 32 bits integer 54 * %x : hexadecimal 32 bits integer 55 * %l : hexadecimal 64 bits integer 41 * %b : exactly 2 digits hexadecimal integer (8 bits) 42 * %c : single ascii character (8 bits) 43 * %d : up to 10 digits decimal integer (32 bits) 44 * %u : up to 10 digits unsigned decimal (32 bits) 45 * %x : up to 8 digits hexadecimal integer (32 bits) 46 * %X : exactly 8 digits hexadecimal integer (32 bits) 47 * %l : up to 16 digits hexadecimal integer (64 bits) 48 * %L : exactly 16 digits hexadecimal integer (64 bits) 56 49 * %s : NUL terminated character string 57 50 ********************************************************************************** … … 153 146 void putl( uint64_t val ); 154 147 148 /********************************************************************************** 149 * This debug function displays on the kernel TXT0 terminal the content of an 150 * array of bytes defined by <buffer> and <size> arguments (16 bytes per line). 151 * The <string> argument is displayed before the buffer content. 152 * The line format is an address folowed by 16 (hexa) bytes. 153 ********************************************************************************** 154 * @ string : buffer name or identifier. 155 * @ buffer : local pointer on bytes array. 156 * @ size : number of bytes bytes to display. 157 *********************************************************************************/ 158 void putb( char * string, 159 uint8_t * buffer, 160 uint32_t size ); 161 162 155 163 156 164 #endif // _PRINTK_H
Note: See TracChangeset
for help on using the changeset viewer.