Changeset dbfa3148 in rtems
- Timestamp:
- 07/10/98 15:43:18 (25 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 3a447c3
- Parents:
- cc8a388a
- Location:
- c/src/lib/libbsp/i386/pc386
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/i386/pc386/console/console.c
rcc8a388a rdbfa3148 32 32 +--------------------------------------------------------------------------*/ 33 33 34 34 #include <stdio.h> 35 35 #include <stdlib.h> 36 36 #include <assert.h> … … 58 58 /* keyboard (IRQ 0x01) Interrupt Service Routine (defined in 'inch.c') */ 59 59 60 extern rtems_boolean _IBMPC_scankey(char *); /* defined in 'inch.c' */ 60 61 61 62 void console_reserve_resources(rtems_configuration_table *conf) … … 70 71 void __assert(const char *file, int line, const char *msg) 71 72 { 72 printk("assert failed: %s: ", file); 73 printk("%d: ", line); 74 printk("%s\n", msg); 75 76 exit(1); 77 78 return; 73 static char buf[20]; 74 static char exit_msg[] = "EXECUTIVE SHUTDOWN! Any key to reboot..."; 75 static char assert_msg[] = "assert failed: "; 76 unsigned char ch; 77 const unsigned char *cp; 78 79 80 /* 81 * Note we cannot call exit or printf from here, 82 * assert can fail inside ISR too 83 */ 84 if(PC386ConsolePort == PC386_CONSOLE_PORT_CONSOLE) 85 { 86 printk("\nassert failed: %s: ", file); 87 printk("%d: ", line); 88 printk("%s\n\n", msg); 89 printk(exit_msg); 90 while(!_IBMPC_scankey(&ch)); 91 printk("\n\n"); 92 } 93 else 94 { 95 PC386_uart_intr_ctrl(PC386ConsolePort, PC386_UART_INTR_CTRL_DISABLE); 96 97 PC386_uart_polled_write(PC386ConsolePort, '\r'); 98 PC386_uart_polled_write(PC386ConsolePort, '\n'); 99 100 for(cp=assert_msg; *cp!=0; cp++) 101 { 102 PC386_uart_polled_write(PC386ConsolePort, *cp); 103 } 104 105 for(cp=file; *cp!=0; cp++) 106 { 107 PC386_uart_polled_write(PC386ConsolePort, *cp); 108 } 109 110 PC386_uart_polled_write(PC386ConsolePort, ':'); 111 PC386_uart_polled_write(PC386ConsolePort, ' '); 112 113 sprintf(buf, "%d: ", line); 114 115 for(cp=buf; *cp!=0; cp++) 116 { 117 PC386_uart_polled_write(PC386ConsolePort, *cp); 118 } 119 120 for(cp=msg; *cp!=0; cp++) 121 { 122 PC386_uart_polled_write(PC386ConsolePort, *cp); 123 } 124 125 PC386_uart_polled_write(PC386ConsolePort, '\r'); 126 PC386_uart_polled_write(PC386ConsolePort, '\n'); 127 PC386_uart_polled_write(PC386ConsolePort, '\r'); 128 PC386_uart_polled_write(PC386ConsolePort, '\n'); 129 130 for(cp=exit_msg; *cp != 0; cp++) 131 { 132 PC386_uart_polled_write(PC386ConsolePort, *cp); 133 } 134 135 PC386_uart_polled_read(PC386ConsolePort); 136 137 PC386_uart_polled_write(PC386ConsolePort, '\r'); 138 PC386_uart_polled_write(PC386ConsolePort, '\n'); 139 PC386_uart_polled_write(PC386ConsolePort, '\r'); 140 PC386_uart_polled_write(PC386ConsolePort, '\n'); 141 142 } 143 144 rtemsReboot(); 79 145 } 146 80 147 81 148 /*-------------------------------------------------------------------------+ -
c/src/lib/libbsp/i386/pc386/console/inch.c
rcc8a388a rdbfa3148 293 293 _IBMPC_inch_sleep(void) 294 294 { 295 char c; 296 extern rtems_interval _TOD_Ticks_per_second; /* XXX should not do this */ 297 rtems_interval ticks_to_delay; 298 299 ticks_to_delay = (_TOD_Ticks_per_second + 24) / 25; 295 char c; 296 rtems_interval ticks_per_second; 297 298 ticks_per_second = 0; 300 299 301 300 for(;;) … … 305 304 return c; 306 305 } 307 rtems_task_wake_after(ticks_to_delay); 306 307 if(ticks_per_second == 0) 308 { 309 rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND, 310 &ticks_per_second); 311 } 312 rtems_task_wake_after((ticks_per_second+24)/25); 308 313 } 309 314 -
c/src/lib/libbsp/i386/pc386/startup/exit.c
rcc8a388a rdbfa3148 35 35 #include <stdio.h> 36 36 #include <bsp.h> 37 #include <rtems/libio.h> 37 38 #include <pc386uart.h> 38 39 … … 71 72 else 72 73 { 74 /* Close console */ 75 __rtems_close(2); 76 __rtems_close(1); 77 __rtems_close(0); 78 73 79 PC386_uart_intr_ctrl(PC386ConsolePort, PC386_UART_INTR_CTRL_DISABLE); 74 80
Note: See TracChangeset
for help on using the changeset viewer.