Changeset 3a4ae6c in rtems for c/src/lib/libbsp/unix


Ignore:
Timestamp:
Sep 11, 1995, 7:35:39 PM (26 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
ced11f99
Parents:
5072b07
Message:

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

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  
    33 *
    44 *  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.
    57 *
    68 *  COPYRIGHT (c) 1994 by Division Incorporated
     
    3234)
    3335{
    34     return RTEMS_SUCCESSFUL;
     36  return 0;
    3537}
    3638
     39
     40/*
     41 *  Open entry point
     42 */
     43
     44rtems_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
     57rtems_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
     70rtems_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
     83rtems_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
     96rtems_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  
    2323#include <rtems.h>
    2424#include <clockdrv.h>
     25#include <console.h>
    2526#include <iosupp.h>
    2627#include <libcsupport.h>
     
    8182
    8283/*
    83  * Console driver init
     84 *  Device Driver Table Entries
    8485 */
    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 */
    9190 
    9291/*
     
    9493 */
    9594 
     95/*
     96 * How many libio files we want
     97 */
     98
     99#define BSP_LIBIO_MAX_FDS       20
     100
    96101/* functions */
    97102
  • c/src/lib/libbsp/unix/posix/startup/bspstart.c

    r5072b07 r3a4ae6c  
    3737#include <bsp.h>
    3838#include <libcsupport.h>
     39
     40#include <rtems/libio.h>
    3941
    4042#ifdef STACK_CHECKER_ON
     
    113115    RTEMS_Malloc_Initialize((void *)heap_start, Heap_size, 1024 * 1024);
    114116
     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
    115125    libc_init(1);
    116126}
     
    159169#ifdef RTEMS_DEBUG
    160170    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 
     182void
     183bsp_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');
    161199#endif
    162200}
     
    262300    Cpu_table.predriver_hook = NULL;
    263301
    264     Cpu_table.postdriver_hook = NULL;
     302    Cpu_table.postdriver_hook = bsp_postdriver_hook;
    265303
    266304    Cpu_table.idle_task = NULL;  /* do not override system IDLE task */
     
    302340#endif
    303341
    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  );
    322366}
Note: See TracChangeset for help on using the changeset viewer.