Changeset d40da79b in rtems


Ignore:
Timestamp:
Sep 17, 2008, 4:12:04 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
d965db14
Parents:
e8fcadb
Message:

2008-09-17 Miao Yan <yanmiaobest@…>

  • Makefile.am, preinstall.am, libcsupport/Makefile.am, libcsupport/include/rtems/libcsupport.h, libcsupport/include/rtems/libio.h, libcsupport/src/base_fs.c, libcsupport/src/libio_init.c, libcsupport/src/newlibc_exit.c, libcsupport/src/newlibc_init.c, libcsupport/src/sync.c, libfs/Makefile.am, libfs/src/imfs/deviceio.c, sapi/include/confdefs.h: Merge GSOC project code to add simple device only filesystem (devfs), optionally completely drop out filesystem, and to clean up disabling newlib reentrancy support. This dropped 17K from the minimum.exe for sparc/sis and arm/rtl22xx_t now has a 15K code space.
  • libcsupport/src/usrenv.c, libcsupport/src/newlibc_reent.c, libfs/src/devfs/devclose.c, libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_eval.c, libfs/src/devfs/devfs_init.c, libfs/src/devfs/devfs_mknod.c, libfs/src/devfs/devfs_node_type.c, libfs/src/devfs/devfs_show.c, libfs/src/devfs/devioctl.c, libfs/src/devfs/devopen.c, libfs/src/devfs/devread.c, libfs/src/devfs/devstat.c, libfs/src/devfs/devwrite.c, libfs/src/imfs/deviceerrno.c: New files.
  • libcsupport/src/newlibc.c: Removed.
Location:
cpukit
Files:
14 added
14 edited
1 moved

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    re8fcadb rd40da79b  
     12008-09-17      Miao Yan <yanmiaobest@gmail.com>
     2
     3        * Makefile.am, preinstall.am, libcsupport/Makefile.am,
     4        libcsupport/include/rtems/libcsupport.h,
     5        libcsupport/include/rtems/libio.h, libcsupport/src/base_fs.c,
     6        libcsupport/src/libio_init.c, libcsupport/src/newlibc_exit.c,
     7        libcsupport/src/newlibc_init.c, libcsupport/src/sync.c,
     8        libfs/Makefile.am, libfs/src/imfs/deviceio.c,
     9        sapi/include/confdefs.h: Merge GSOC project code to add simple device
     10        only filesystem (devfs), optionally completely drop out filesystem,
     11        and to clean up disabling newlib reentrancy support. This dropped 17K
     12        from the minimum.exe for sparc/sis and arm/rtl22xx_t now has a 15K
     13        code space.
     14        * libcsupport/src/__usrenv.c, libcsupport/src/newlibc_reent.c,
     15        libfs/src/devfs/devclose.c, libfs/src/devfs/devfs.h,
     16        libfs/src/devfs/devfs_eval.c, libfs/src/devfs/devfs_init.c,
     17        libfs/src/devfs/devfs_mknod.c, libfs/src/devfs/devfs_node_type.c,
     18        libfs/src/devfs/devfs_show.c, libfs/src/devfs/devioctl.c,
     19        libfs/src/devfs/devopen.c, libfs/src/devfs/devread.c,
     20        libfs/src/devfs/devstat.c, libfs/src/devfs/devwrite.c,
     21        libfs/src/imfs/deviceerrno.c: New files.
     22        * libcsupport/src/newlibc.c: Removed.
     23
    1242008-09-16      Joel Sherrill <joel.sherrill@OARcorp.com>
    225
  • cpukit/Makefile.am

    re8fcadb rd40da79b  
    8080include_rtems_HEADERS += libfs/src/imfs/imfs.h
    8181
     82## devfs
     83include_rtems_HEADERS += libfs/src/devfs/devfs.h
     84
    8285if LIBDOSFS
    8386include_rtems_HEADERS += libfs/src/dosfs/dosfs.h
  • cpukit/libcsupport/Makefile.am

    re8fcadb rd40da79b  
    4848    src/libio_init.c \
    4949    src/libio_sockets.c src/eval.c src/fs_null_handlers.c src/privateenv.c \
    50     src/open_dev_console.c
     50    src/open_dev_console.c src/__usrenv.c
    5151
    5252TERMIOS_C_FILES = src/cfgetispeed.c src/cfgetospeed.c src/cfsetispeed.c \
     
    9595LIBC_GLUE_C_FILES = src/__getpid.c src/__gettod.c src/__times.c \
    9696    src/truncate.c src/access.c src/stat.c src/lstat.c src/pathconf.c \
    97     src/newlibc.c src/newlibc_init.c src/newlibc_exit.c src/no_posix.c \
     97    src/newlibc_reent.c src/newlibc_init.c src/newlibc_exit.c src/no_posix.c \
    9898    src/no_libc.c src/utsname.c
    9999
  • cpukit/libcsupport/include/rtems/libcsupport.h

    re8fcadb rd40da79b  
    4646 *  Prototypes required to install newlib reentrancy user extension
    4747 */
    48 bool libc_create_hook(
     48bool newlib_create_hook(
    4949  rtems_tcb *current_task,
    5050  rtems_tcb *creating_task
     
    5252
    5353#if defined(RTEMS_UNIX) && !defined(hpux)
    54   rtems_extension libc_begin_hook(rtems_tcb *current_task);
    55   #define __RTEMS_NEWLIB_BEGIN libc_begin_hook
     54  rtems_extension newlib_begin_hook(rtems_tcb *current_task);
     55  #define __RTEMS_NEWLIB_BEGIN newlib_begin_hook
    5656#else
    5757  #define __RTEMS_NEWLIB_BEGIN 0
    5858#endif
    5959
    60 rtems_extension libc_delete_hook(
     60rtems_extension newlib_delete_hook(
    6161  rtems_tcb *current_task,
    6262  rtems_tcb *deleted_task
     
    6565#define RTEMS_NEWLIB_EXTENSION \
    6666{ \
    67   libc_create_hook,                            /* rtems_task_create  */ \
    68   0,                                           /* rtems_task_start   */ \
    69   0,                                           /* rtems_task_restart */ \
    70   libc_delete_hook,                            /* rtems_task_delete  */ \
    71   0,                                           /* task_switch  */ \
    72   __RTEMS_NEWLIB_BEGIN,                        /* task_begin   */ \
    73   0,                                           /* task_exitted */ \
    74   0                                            /* fatal        */ \
     67  newlib_create_hook,     /* rtems_task_create  */ \
     68  0,                      /* rtems_task_start   */ \
     69  0,                      /* rtems_task_restart */ \
     70  newlib_delete_hook,     /* rtems_task_delete  */ \
     71  0,                      /* task_switch  */ \
     72  __RTEMS_NEWLIB_BEGIN,   /* task_begin   */ \
     73  0,                      /* task_exitted */ \
     74  0                       /* fatal        */ \
    7575}
    7676
  • cpukit/libcsupport/include/rtems/libio.h

    re8fcadb rd40da79b  
    635635extern const int                             rtems_filesystem_mount_table_size;
    636636
     637
     638typedef void (*rtems_libio_init_functions_t)(void);
     639extern  rtems_libio_init_functions_t rtems_libio_init_helper;
     640
     641void    open_dev_console(void);
     642
     643typedef void (*rtems_libio_supp_functions_t)(void);
     644extern  rtems_libio_supp_functions_t rtems_libio_supp_helper;
     645
     646typedef void (*rtems_fs_init_functions_t)(void);
     647extern  rtems_fs_init_functions_t    rtems_fs_init_helper;
     648
    637649#ifdef __cplusplus
    638650}
  • cpukit/libcsupport/src/base_fs.c

    re8fcadb rd40da79b  
    22 *  Base file system initialization
    33 *
    4  *  COPYRIGHT (c) 1989-1999.
     4 *  COPYRIGHT (c) 1989-2008.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    1919#include <rtems/libio.h>
    2020#include <rtems/libio_.h>
    21 
    22 /*
    23  *  Global information for the base file system.
    24  */
    25 
    26 rtems_user_env_t   rtems_global_user_env;
    27 rtems_user_env_t * rtems_current_user_env = &rtems_global_user_env;
    2821
    2922/*
  • cpukit/libcsupport/src/libio_init.c

    re8fcadb rd40da79b  
    8787   */
    8888
    89   rtems_filesystem_initialize();
     89  if (rtems_fs_init_helper)
     90     (* rtems_fs_init_helper)();
    9091}
  • cpukit/libcsupport/src/newlibc_exit.c

    re8fcadb rd40da79b  
    4141/* do we think we are reentrant? */
    4242extern int             libc_reentrant;
    43 extern struct _reent   libc_global_reent __ATTRIBUTE_IMPURE_PTR__;
     43extern struct _reent * const _global_impure_ptr __ATTRIBUTE_IMPURE_PTR__;
    4444
    4545/*
     
    6767   */
    6868
    69   if (_REENT != &libc_global_reent) {
    70       _wrapup_reent(&libc_global_reent);
     69  if (_REENT != _global_impure_ptr) {
     70      _wrapup_reent(_global_impure_ptr);
    7171#if 0
    7272      /*  Don't reclaim this one, just in case we do printfs
     
    7575      _reclaim_reent(&libc_global_reent);
    7676#endif
    77       _REENT = &libc_global_reent;
     77      _REENT = _global_impure_ptr;
    7878  }
    7979
  • cpukit/libcsupport/src/newlibc_init.c

    re8fcadb rd40da79b  
    1818#endif
    1919
    20 #define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
    21 #include <rtems.h>
    22 
    2320#if defined(RTEMS_NEWLIB)
    24 #include <rtems/libcsupport.h>
    25 
    26 /* Since we compile with strict ANSI we need to undef it to get
    27  * prototypes for extensions
    28  */
    29 #undef __STRICT_ANSI__
    30 
    31 #include <stdlib.h>             /* for free() */
    32 #include <string.h>             /* for memset() */
    33 
    34 #include <sys/reent.h>          /* for extern of _REENT (aka _impure_ptr) */
    35 #include <errno.h>
    3621
    3722/*
     
    4934
    5035
    51 struct _reent    libc_global_reent
    52     __ATTRIBUTE_IMPURE_PTR__ = _REENT_INIT(libc_global_reent);
    5336void
    5437libc_init(void)
    5538{
    56   _REENT = &libc_global_reent;
    57 
    58   _Thread_Set_libc_reent (&_REENT);
    5939}
    6040
  • cpukit/libcsupport/src/newlibc_reent.c

    re8fcadb rd40da79b  
    11/*
    2  *  Implementation of hooks for the CYGNUS newlib libc
    3  *  These hooks set things up so that:
    4  *       + '_REENT' is switched at task switch time.
    5  *
    6  *  COPYRIGHT (c) 1994 by Division Incorporated
    7  *
    82 *  The license and distribution terms for this file may be
    93 *  found in the file LICENSE in this distribution or at
     
    5145int _fwalk(struct _reent *ptr, int (*function) (FILE *) );
    5246
    53 extern struct _reent    libc_global_reent __ATTRIBUTE_IMPURE_PTR__;
    54 
     47extern struct _reent * const _global_impure_ptr __ATTRIBUTE_IMPURE_PTR__;
    5548/*
    5649 * reent struct allocation moved here from libc_start_hook() to avoid
     
    6053 *  -- ptorre 9/30/03
    6154 */
    62 bool libc_create_hook(
     55bool newlib_create_hook(
    6356  rtems_tcb *current_task,
    6457  rtems_tcb *creating_task
     
    6659{
    6760  struct _reent *ptr;
     61
     62  if (_Thread_libc_reent == 0)
     63  {
     64    _REENT = _global_impure_ptr;
     65
     66    _Thread_Set_libc_reent (&_REENT);
     67  }
    6868
    6969  /*  NOTE: The RTEMS malloc is reentrant without a reent ptr since
     
    8282
    8383  if (ptr) {
     84    _REENT_INIT_PTR((ptr)); /* GCC extension: structure constants */
     85    creating_task->libc_reent = ptr;
     86    return TRUE;
     87  }
    8488
    85       _REENT_INIT_PTR((ptr)); /* GCC extension: structure constants */
    86       creating_task->libc_reent = ptr;
    87       return true;
    88   }
    89   else
    90     return false;
     89  return FALSE;
    9190}
    9291
     
    9695
    9796#ifdef NEED_SETVBUF
    98 rtems_extension libc_begin_hook(rtems_tcb *current_task)
     97rtems_extension newlib_begin_hook(rtems_tcb *current_task)
    9998{
    10099  setvbuf( stdout, NULL, _IOLBF, BUFSIZ );
     
    129128}
    130129
    131 rtems_extension libc_delete_hook(
     130rtems_extension newlib_delete_hook(
    132131  rtems_tcb *current_task,
    133132  rtems_tcb *deleted_task
     
    146145  }
    147146
    148   if (ptr && ptr != &libc_global_reent) {
     147  if (ptr && ptr != _global_impure_ptr) {
    149148/*
    150149    _wrapup_reent(ptr);
  • cpukit/libcsupport/src/sync.c

    re8fcadb rd40da79b  
    88 *         fdatasync()
    99 *
    10  *  COPYRIGHT (c) 1989-2003.
     10 *  COPYRIGHT (c) 1989-2008.
    1111 *  On-Line Applications Research Corporation (OAR).
    1212 *
     
    7272
    7373/*
    74  * libc_global_reent is not prototyped in any .h files.
     74 * _global_impure_ptr is not prototyped in any .h files.
    7575 * We have to extern it here.
    7676 */
    77 extern struct _reent libc_global_reent;
     77extern struct _reent * const _global_impure_ptr __ATTRIBUTE_IMPURE_PTR__;
    7878
    7979void sync(void)
     
    8383   *  Walk the one used initially by RTEMS.
    8484   */
    85   _fwalk(&libc_global_reent, sync_wrapper);
     85  _fwalk(_global_impure_ptr, sync_wrapper);
    8686
    8787  /*
  • cpukit/libfs/Makefile.am

    re8fcadb rd40da79b  
    3232    src/imfs/imfs_readlink.c src/imfs/imfs_fdatasync.c src/imfs/imfs_fcntl.c \
    3333    src/imfs/ioman.c src/imfs/miniimfs_init.c src/imfs/imfs_load_tar.c \
    34     src/imfs/imfs.h
     34    src/imfs/imfs.h \
     35    src/imfs/deviceerrno.c \
     36    src/devfs/devfs_init.c src/devfs/devfs_eval.c src/devfs/devfs_mknod.c \
     37    src/devfs/devfs_show.c src/devfs/devfs_node_type.c \
     38    src/devfs/devopen.c src/devfs/devread.c src/devfs/devwrite.c \
     39    src/devfs/devclose.c src/devfs/devioctl.c src/devfs/devstat.c \
     40    src/devfs/devfs.h
    3541endif
    3642
  • cpukit/libfs/src/imfs/deviceio.c

    re8fcadb rd40da79b  
    55 *  IMFS device nodes onto calls to the RTEMS Classic API IO Manager.
    66 *
    7  *  COPYRIGHT (c) 1989-1999.
     7 *  COPYRIGHT (c) 1989-2008.
    88 *  On-Line Applications Research Corporation (OAR).
    99 *
  • cpukit/preinstall.am

    re8fcadb rd40da79b  
    147147PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/imfs.h
    148148
     149$(PROJECT_INCLUDE)/rtems/devfs.h: libfs/src/devfs/devfs.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
     150        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/devfs.h
     151PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/devfs.h
     152
    149153if LIBDOSFS
    150154$(PROJECT_INCLUDE)/rtems/dosfs.h: libfs/src/dosfs/dosfs.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
  • cpukit/sapi/include/confdefs.h

    re8fcadb rd40da79b  
    7373#endif
    7474
     75
     76#include <rtems/libio.h>
     77
     78#ifdef CONFIGURE_INIT
     79rtems_libio_init_functions_t rtems_libio_init_helper =
     80    #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
     81    NULL;
     82    #else
     83    rtems_libio_init;
     84    #endif
     85
     86rtems_libio_supp_functions_t rtems_libio_supp_helper =
     87    #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
     88    NULL;
     89    #else
     90    open_dev_console;
     91    #endif
     92
     93rtems_fs_init_functions_t    rtems_fs_init_helper =
     94    #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
     95    NULL;
     96    #else
     97    rtems_filesystem_initialize;
     98    #endif
     99#endif
     100
     101
     102#ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
     103  #define CONFIGURE_HAS_OWN_MOUNT_TABLE
     104#endif
     105
    75106/**
    76107 *  This macro defines the number of POSIX file descriptors allocated
     
    139170#endif
    140171
     172#ifdef CONFIGURE_INIT
     173  #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
     174    extern uint32_t rtems_device_table_size;
     175    #define CONFIGURE_MEMORY_FOR_DEVFS  0
     176  #elif defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
     177    #ifndef CONFIGURE_MAXIMUM_DEVICES
     178      #define CONFIGURE_MAXIMUM_DEVICES 4
     179    #endif
     180    #include <rtems/devfs.h>
     181    uint32_t rtems_device_table_size = CONFIGURE_MAXIMUM_DEVICES;
     182    #define CONFIGURE_MEMORY_FOR_DEVFS _Configure_Object_RAM(CONFIGURE_MAXIMUM_DEVICES, sizeof (rtems_device_name_t))
     183  #else
     184    #define CONFIGURE_MEMORY_FOR_DEVFS  0
     185  #endif
     186#endif
     187
    141188/*
    142189 *  Mount Table Configuration
     
    163210      #ifdef CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
    164211        &IMFS_ops,
     212      #elif defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
     213        &devFS_ops,
    165214      #else  /* using miniIMFS as base filesystem */
    166215        &miniIMFS_ops,
     
    575624#endif
    576625
    577 /**
    578  *  Default the number of devices per device driver.  This value may be
    579  *  overridden by the user.
    580  *
    581  *  @note This configuration parameter is obsolete. Thus we will warn the
    582  *        user that it is obsolete.
    583  */
    584 #ifdef CONFIGURE_MAXIMUM_DEVICES
    585   #warning "CONFIGURE_MAXIMUM_DEVICES is obsolete.  Do not use any longer."
    586 #endif
    587626
    588627#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
     
    16821721(( \
    16831722   CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \
     1723   CONFIGURE_MEMORY_FOR_DEVFS + \
    16841724   CONFIGURE_MEMORY_FOR_TASKS( \
    16851725     CONFIGURE_TOTAL_TASKS_AND_THREADS, CONFIGURE_TOTAL_TASKS_AND_THREADS) + \
Note: See TracChangeset for help on using the changeset viewer.