Changeset de9edc4 in rtems
- Timestamp:
- 08/31/98 22:56:20 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- b285860
- Parents:
- 85734b3
- Location:
- c/src/lib/libbsp/i386
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/i386/pc386/console/console.c
r85734b3 rde9edc4 43 43 #include <libcpu/cpuModel.h> 44 44 45 int PC386ConsolePort = PC386_CONSOLE_PORT_CONSOLE; 45 /* 46 * Possible value for console input/output : 47 * PC386_CONSOLE_PORT_CONSOLE 48 * PC386_UART_COM1 49 * PC386_UART_COM2 50 */ 51 52 int PC386ConsolePort = PC386_UART_COM2; 46 53 47 54 static int conSetAttr(int minor, const struct termios *); … … 80 87 static char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot..."; 81 88 unsigned char ch; 82 const unsigned char *cp;83 84 89 85 90 /* … … 185 190 printk("Initialized console on port COM2 9600-8-N-1\n\n"); 186 191 } 192 #define PRINTK_ON_SERIAL 193 #ifdef PRINTK_ON_SERIAL 194 /* 195 * You can remove the follwoing tree lines if you want to have printk 196 * using the video console for output while printf use serial line. 197 * This may be convenient to debug the serial line driver itself... 198 */ 187 199 printk("Warning : This will be the last message displayed on console\n"); 188 200 BSP_output_char = (BSP_output_char_function_type) BSP_output_char_via_serial; 189 201 BSP_poll_char = (BSP_polling_getchar_function_type) BSP_poll_char_via_serial; 190 } 191 #define DISPLAY_CPU_INFO 192 #ifdef DISPLAY_CPU_INFO 193 printCpuInfo(); 194 #endif 195 202 #endif 203 } 196 204 return RTEMS_SUCCESSFUL; 197 205 } /* console_initialize */ … … 447 455 448 456 449 450 451 452 453 454 -
c/src/lib/libbsp/i386/shared/io/printk.c
r85734b3 rde9edc4 21 21 22 22 #include <stdarg.h> 23 23 #include <stdio.h> 24 24 #include <bspIo.h> 25 #include <libcpu/cpu.h> 25 26 26 27 /*-------------------------------------------------------------------------+ … … 32 33 +--------------------------------------------------------------------------*/ 33 34 static void 34 printNum(long int num, int base)35 printNum(long unsigned int num, int base, int sign) 35 36 { 36 long int n; 37 long unsigned int n; 38 int count; 39 char toPrint[20]; 37 40 38 if ((n = num / base) > 0) 39 printNum(n, base); 40 BSP_output_char("0123456789ABCDEF"[(int)(num % base)]); 41 if ( (sign == 1) && ((long)num < 0) ) { 42 BSP_output_char('-'); 43 num = -num; 44 } 45 46 count = 0; 47 while ((n = num / base) > 0) { 48 toPrint[count++] = (num - (n*base)); 49 num = n ; 50 } 51 toPrint[count++] = num; 52 53 for (n = 0; n < count; n++){ 54 BSP_output_char("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]); 55 } 41 56 } /* printNum */ 42 57 … … 55 70 va_list ap; /* points to each unnamed argument in turn */ 56 71 char c, *str; 57 int lflag, base; 72 int lflag, base, sign; 73 unsigned int level; 74 75 _CPU_ISR_Disable(level); 58 76 59 77 va_start(ap, fmt); /* make ap point to 1st unnamed arg */ … … 62 80 lflag = 0; 63 81 base = 0; 82 sign = 0; 64 83 if (*fmt == '%') 65 84 { … … 71 90 switch (c) 72 91 { 73 case 'o': case 'O': base = 8; break; 74 case 'd': case 'D': base = 10; break; 75 case 'x': case 'X': base = 16; break; 92 case 'o': case 'O': base = 8; sign = 0; break; 93 case 'd': case 'D': base = 10; sign = 1; break; 94 case 'u': case 'U': base = 10; sign = 0; break; 95 case 'x': case 'X': base = 16; sign = 0; break; 76 96 case 's': 77 97 for (str = va_arg(ap, char *); *str; str++) … … 88 108 if (base) 89 109 printNum(lflag ? va_arg(ap, long int) : (long int)va_arg(ap, int), 90 base );110 base, sign); 91 111 } 92 112 else … … 96 116 } 97 117 va_end(ap); /* clean up when done */ 118 _CPU_ISR_Enable(level); 119 98 120 } /* printk */ 99 121
Note: See TracChangeset
for help on using the changeset viewer.