Changeset ac97074f in rtems


Ignore:
Timestamp:
Mar 15, 2002, 2:32:22 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
2de2bec
Parents:
082972a
Message:

2001-03-15 Joel Sherrill <joel@…>

  • src/extension.c: Split to reduce minimum code size per PR134.
  • src/extensioncreate.c, src/extensiondelete.c, src/extensionident.c: New files. src/Makefile.am: Modified to reflect above.
Files:
6 added
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/sapi/ChangeLog

    r082972a rac97074f  
     12001-03-15      Joel Sherrill <joel@OARcorp.com>
     2
     3        * src/extension.c: Split to reduce minimum code size per PR134.
     4        * src/extensioncreate.c, src/extensiondelete.c, src/extensionident.c:
     5        New files.
     6        src/Makefile.am: Modified to reflect above.
     7
    182002-01-07      Joel Sherrill <joel@OARcorp.com>
    29
  • c/src/exec/sapi/src/Makefile.am

    r082972a rac97074f  
    55AUTOMAKE_OPTIONS = foreign 1.4
    66
    7 C_FILES = debug.c entrytable.c extension.c fatal.c exinit.c io.c itronapi.c \
    8     posixapi.c rtemsapi.c
     7EXTENSION_FILES = extension.c extensioncreate.c extensiondelete.c \
     8    extensionident.c
     9C_FILES = debug.c entrytable.c $(EXTENSION_FILES)  fatal.c exinit.c io.c \
     10    itronapi.c posixapi.c rtemsapi.c
    911C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
    1012
  • c/src/exec/sapi/src/extension.c

    r082972a rac97074f  
    33 *
    44 *
    5  *  COPYRIGHT (c) 1989-1999.
     5 *  COPYRIGHT (c) 1989-2002.
    66 *  On-Line Applications Research Corporation (OAR).
    77 *
     
    4646  );
    4747}
    48 
    49 /*PAGE
    50  *
    51  *  rtems_extension_create
    52  *
    53  *  This directive creates a extension and performs some initialization.
    54  *
    55  *  Input parameters:
    56  *    name            - extension name
    57  *    extension_table - pointer to extension set information
    58  *    id              - pointer to extension id
    59  *
    60  *  Output parameters:
    61  *    id                - extension id
    62  *    RTEMS_SUCCESSFUL - if successful
    63  *    error code        - if unsuccessful
    64  */
    65 
    66 rtems_status_code rtems_extension_create(
    67   rtems_name              name,
    68   rtems_extensions_table *extension_table,
    69   Objects_Id             *id
    70 )
    71 {
    72   Extension_Control *the_extension;
    73 
    74   if ( !rtems_is_name_valid( name ) )
    75     return RTEMS_INVALID_NAME;
    76 
    77   _Thread_Disable_dispatch();         /* to prevent deletion */
    78 
    79   the_extension = _Extension_Allocate();
    80 
    81   if ( !the_extension ) {
    82     _Thread_Enable_dispatch();
    83     return RTEMS_TOO_MANY;
    84   }
    85 
    86   _User_extensions_Add_set( &the_extension->Extension, extension_table );
    87 
    88   _Objects_Open( &_Extension_Information, &the_extension->Object, &name );
    89 
    90   *id = the_extension->Object.id;
    91   _Thread_Enable_dispatch();
    92   return RTEMS_SUCCESSFUL;
    93 }
    94 
    95 /*PAGE
    96  *
    97  *  rtems_extension_ident
    98  *
    99  *  This directive returns the system ID associated with
    100  *  the extension name.
    101  *
    102  *  Input parameters:
    103  *    name - user defined message queue name
    104  *    id   - pointer to extension id
    105  *
    106  *  Output parameters:
    107  *    *id               - message queue id
    108  *    RTEMS_SUCCESSFUL - if successful
    109  *    error code        - if unsuccessful
    110  */
    111 
    112 rtems_status_code rtems_extension_ident(
    113   rtems_name    name,
    114   Objects_Id   *id
    115 )
    116 {
    117   Objects_Name_to_id_errors  status;
    118 
    119   status = _Objects_Name_to_id(
    120     &_Extension_Information,
    121     &name,
    122     OBJECTS_SEARCH_LOCAL_NODE,
    123     id
    124   );
    125 
    126   return _Status_Object_name_errors_to_status[ status ];
    127 }
    128 
    129 /*PAGE
    130  *
    131  *  rtems_extension_delete
    132  *
    133  *  This directive allows a thread to delete a extension.
    134  *
    135  *  Input parameters:
    136  *    id - extension id
    137  *
    138  *  Output parameters:
    139  *    RTEMS_SUCCESSFUL - if successful
    140  *    error code - if unsuccessful
    141  */
    142 
    143 rtems_status_code rtems_extension_delete(
    144   Objects_Id id
    145 )
    146 {
    147   Extension_Control   *the_extension;
    148   Objects_Locations    location;
    149 
    150   the_extension = _Extension_Get( id, &location );
    151   switch ( location ) {
    152     case OBJECTS_ERROR:
    153     case OBJECTS_REMOTE:            /* should never return this */
    154       return RTEMS_INVALID_ID;
    155     case OBJECTS_LOCAL:
    156       _User_extensions_Remove_set( &the_extension->Extension );
    157       _Objects_Close( &_Extension_Information, &the_extension->Object );
    158       _Extension_Free( the_extension );
    159       _Thread_Enable_dispatch();
    160       return RTEMS_SUCCESSFUL;
    161   }
    162 
    163   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
    164 }
  • cpukit/sapi/ChangeLog

    r082972a rac97074f  
     12001-03-15      Joel Sherrill <joel@OARcorp.com>
     2
     3        * src/extension.c: Split to reduce minimum code size per PR134.
     4        * src/extensioncreate.c, src/extensiondelete.c, src/extensionident.c:
     5        New files.
     6        src/Makefile.am: Modified to reflect above.
     7
    182002-01-07      Joel Sherrill <joel@OARcorp.com>
    29
  • cpukit/sapi/src/Makefile.am

    r082972a rac97074f  
    55AUTOMAKE_OPTIONS = foreign 1.4
    66
    7 C_FILES = debug.c entrytable.c extension.c fatal.c exinit.c io.c itronapi.c \
    8     posixapi.c rtemsapi.c
     7EXTENSION_FILES = extension.c extensioncreate.c extensiondelete.c \
     8    extensionident.c
     9C_FILES = debug.c entrytable.c $(EXTENSION_FILES)  fatal.c exinit.c io.c \
     10    itronapi.c posixapi.c rtemsapi.c
    911C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
    1012
  • cpukit/sapi/src/extension.c

    r082972a rac97074f  
    33 *
    44 *
    5  *  COPYRIGHT (c) 1989-1999.
     5 *  COPYRIGHT (c) 1989-2002.
    66 *  On-Line Applications Research Corporation (OAR).
    77 *
     
    4646  );
    4747}
    48 
    49 /*PAGE
    50  *
    51  *  rtems_extension_create
    52  *
    53  *  This directive creates a extension and performs some initialization.
    54  *
    55  *  Input parameters:
    56  *    name            - extension name
    57  *    extension_table - pointer to extension set information
    58  *    id              - pointer to extension id
    59  *
    60  *  Output parameters:
    61  *    id                - extension id
    62  *    RTEMS_SUCCESSFUL - if successful
    63  *    error code        - if unsuccessful
    64  */
    65 
    66 rtems_status_code rtems_extension_create(
    67   rtems_name              name,
    68   rtems_extensions_table *extension_table,
    69   Objects_Id             *id
    70 )
    71 {
    72   Extension_Control *the_extension;
    73 
    74   if ( !rtems_is_name_valid( name ) )
    75     return RTEMS_INVALID_NAME;
    76 
    77   _Thread_Disable_dispatch();         /* to prevent deletion */
    78 
    79   the_extension = _Extension_Allocate();
    80 
    81   if ( !the_extension ) {
    82     _Thread_Enable_dispatch();
    83     return RTEMS_TOO_MANY;
    84   }
    85 
    86   _User_extensions_Add_set( &the_extension->Extension, extension_table );
    87 
    88   _Objects_Open( &_Extension_Information, &the_extension->Object, &name );
    89 
    90   *id = the_extension->Object.id;
    91   _Thread_Enable_dispatch();
    92   return RTEMS_SUCCESSFUL;
    93 }
    94 
    95 /*PAGE
    96  *
    97  *  rtems_extension_ident
    98  *
    99  *  This directive returns the system ID associated with
    100  *  the extension name.
    101  *
    102  *  Input parameters:
    103  *    name - user defined message queue name
    104  *    id   - pointer to extension id
    105  *
    106  *  Output parameters:
    107  *    *id               - message queue id
    108  *    RTEMS_SUCCESSFUL - if successful
    109  *    error code        - if unsuccessful
    110  */
    111 
    112 rtems_status_code rtems_extension_ident(
    113   rtems_name    name,
    114   Objects_Id   *id
    115 )
    116 {
    117   Objects_Name_to_id_errors  status;
    118 
    119   status = _Objects_Name_to_id(
    120     &_Extension_Information,
    121     &name,
    122     OBJECTS_SEARCH_LOCAL_NODE,
    123     id
    124   );
    125 
    126   return _Status_Object_name_errors_to_status[ status ];
    127 }
    128 
    129 /*PAGE
    130  *
    131  *  rtems_extension_delete
    132  *
    133  *  This directive allows a thread to delete a extension.
    134  *
    135  *  Input parameters:
    136  *    id - extension id
    137  *
    138  *  Output parameters:
    139  *    RTEMS_SUCCESSFUL - if successful
    140  *    error code - if unsuccessful
    141  */
    142 
    143 rtems_status_code rtems_extension_delete(
    144   Objects_Id id
    145 )
    146 {
    147   Extension_Control   *the_extension;
    148   Objects_Locations    location;
    149 
    150   the_extension = _Extension_Get( id, &location );
    151   switch ( location ) {
    152     case OBJECTS_ERROR:
    153     case OBJECTS_REMOTE:            /* should never return this */
    154       return RTEMS_INVALID_ID;
    155     case OBJECTS_LOCAL:
    156       _User_extensions_Remove_set( &the_extension->Extension );
    157       _Objects_Close( &_Extension_Information, &the_extension->Object );
    158       _Extension_Free( the_extension );
    159       _Thread_Enable_dispatch();
    160       return RTEMS_SUCCESSFUL;
    161   }
    162 
    163   return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
    164 }
Note: See TracChangeset for help on using the changeset viewer.