Changeset 3a4ae6c in rtems for c/src/lib/libbsp/unix
- Timestamp:
- 09/11/95 19:35:39 (27 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- ced11f99
- Parents:
- 5072b07
- Location:
- c/src/lib/libbsp/unix/posix
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/unix/posix/console/console.c
r5072b07 r3a4ae6c 3 3 * 4 4 * These provide UNIX-like read and write calls for the C library. 5 * 6 * NOTE: For the most part, this is just a space holder. 5 7 * 6 8 * COPYRIGHT (c) 1994 by Division Incorporated … … 32 34 ) 33 35 { 34 return RTEMS_SUCCESSFUL;36 return 0; 35 37 } 36 38 39 40 /* 41 * Open entry point 42 */ 43 44 rtems_device_driver console_open( 45 rtems_device_major_number major, 46 rtems_device_minor_number minor, 47 void * arg 48 ) 49 { 50 return RTEMS_SUCCESSFUL; 51 } 52 53 /* 54 * Close entry point 55 */ 56 57 rtems_device_driver console_close( 58 rtems_device_major_number major, 59 rtems_device_minor_number minor, 60 void * arg 61 ) 62 { 63 return RTEMS_SUCCESSFUL; 64 } 65 66 /* 67 * read bytes from the serial port. We only have stdin. 68 */ 69 70 rtems_device_driver console_read( 71 rtems_device_major_number major, 72 rtems_device_minor_number minor, 73 void * arg 74 ) 75 { 76 return RTEMS_UNSATISFIED; 77 } 78 79 /* 80 * write bytes to the serial port. Stdout and stderr are the same. 81 */ 82 83 rtems_device_driver console_write( 84 rtems_device_major_number major, 85 rtems_device_minor_number minor, 86 void * arg 87 ) 88 { 89 return -1; 90 } 91 92 /* 93 * IO Control entry point 94 */ 95 96 rtems_device_driver console_control( 97 rtems_device_major_number major, 98 rtems_device_minor_number minor, 99 void * arg 100 ) 101 { 102 return RTEMS_SUCCESSFUL; 103 } -
c/src/lib/libbsp/unix/posix/include/bsp.h
r5072b07 r3a4ae6c 23 23 #include <rtems.h> 24 24 #include <clockdrv.h> 25 #include <console.h> 25 26 #include <iosupp.h> 26 27 #include <libcsupport.h> … … 81 82 82 83 /* 83 * Console driver init84 * Device Driver Table Entries 84 85 */ 85 86 rtems_device_driver console_initialize( 87 rtems_device_major_number, rtems_device_minor_number minor, void *); 88 89 #define CONSOLE_DRIVER_TABLE_ENTRY \ 90 { console_initialize, NULL, NULL, NULL, NULL, NULL } 86 87 /* 88 * NOTE: Use the standard Console driver entry 89 */ 91 90 92 91 /* … … 94 93 */ 95 94 95 /* 96 * How many libio files we want 97 */ 98 99 #define BSP_LIBIO_MAX_FDS 20 100 96 101 /* functions */ 97 102 -
c/src/lib/libbsp/unix/posix/startup/bspstart.c
r5072b07 r3a4ae6c 37 37 #include <bsp.h> 38 38 #include <libcsupport.h> 39 40 #include <rtems/libio.h> 39 41 40 42 #ifdef STACK_CHECKER_ON … … 113 115 RTEMS_Malloc_Initialize((void *)heap_start, Heap_size, 1024 * 1024); 114 116 117 /* 118 * Init the RTEMS libio facility to provide UNIX-like system 119 * calls for use by newlib (ie: provide __open, __close, etc) 120 * Uses malloc() to get area for the iops, so must be after malloc init 121 */ 122 123 rtems_libio_init(); 124 115 125 libc_init(1); 116 126 } … … 159 169 #ifdef RTEMS_DEBUG 160 170 rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); 171 #endif 172 } 173 174 /* 175 * After drivers are setup, register some "filenames" 176 * and open stdin, stdout, stderr files 177 * 178 * Newlib will automatically associate the files with these 179 * (it hardcodes the numbers) 180 */ 181 182 void 183 bsp_postdriver_hook(void) 184 { 185 #if 0 186 int stdin_fd, stdout_fd, stderr_fd; 187 188 if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) 189 rtems_fatal_error_occurred('STD0'); 190 191 if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) 192 rtems_fatal_error_occurred('STD1'); 193 194 if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) 195 rtems_fatal_error_occurred('STD2'); 196 197 if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) 198 rtems_fatal_error_occurred('STIO'); 161 199 #endif 162 200 } … … 262 300 Cpu_table.predriver_hook = NULL; 263 301 264 Cpu_table.postdriver_hook = NULL;302 Cpu_table.postdriver_hook = bsp_postdriver_hook; 265 303 266 304 Cpu_table.idle_task = NULL; /* do not override system IDLE task */ … … 302 340 #endif 303 341 304 /* 305 * Add 1 extension for MPCI_fatal 306 */ 307 308 if (BSP_Configuration.User_multiprocessing_table) 309 BSP_Configuration.maximum_extensions++; 310 311 CPU_CLICKS_PER_TICK = 1; 312 313 /* 314 * Start most of RTEMS 315 * main() will start the rest 316 */ 317 318 bsp_isr_level = rtems_initialize_executive_early( 319 &BSP_Configuration, 320 &Cpu_table 321 ); 342 /* 343 * Tell libio how many fd's we want and allow it to tweak config 344 */ 345 346 rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); 347 348 /* 349 * Add 1 extension for MPCI_fatal 350 */ 351 352 if (BSP_Configuration.User_multiprocessing_table) 353 BSP_Configuration.maximum_extensions++; 354 355 CPU_CLICKS_PER_TICK = 1; 356 357 /* 358 * Start most of RTEMS 359 * main() will start the rest 360 */ 361 362 bsp_isr_level = rtems_initialize_executive_early( 363 &BSP_Configuration, 364 &Cpu_table 365 ); 322 366 }
Note: See TracChangeset
for help on using the changeset viewer.