Changeset 72d2ec4d in rtems


Ignore:
Timestamp:
Jul 3, 2008, 1:37:38 AM (11 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
6a58ad7
Parents:
b9c38ed
Message:

2008-07-03 Chris Johns <chrisj@…>

  • cpukit/libcsupport/include/chain.h: Removed. Use the SAPI interface that is supported.
  • cpukit/libcsupport/Makefile.am, cpukit/libcsupport/preinstall.am: Remove chain.h header references.
  • cpukit/sapi/include/rtems/chain.h, cpukit/sapi/inline/rtems/chain.inl: New. A supported chains interface.
  • cpukit/sapi/Makefile.am, cpukit/sapi/preinstall.am: Updated to include the new chains interface.
  • cpukit/libfs/src/imfs/imfs.h, cpukit/libfs/src/imfs/imfs_creat.c, cpukit/libfs/src/imfs/imfs_debug.c, cpukit/libfs/src/imfs/imfs_directory.c, cpukit/libfs/src/imfs/imfs_fsunmount.c, cpukit/libfs/src/imfs/imfs_getchild.c, cpukit/libfs/src/imfs/imfs_load_tar.c, cpukit/libfs/src/imfs/imfs_rmnod.c, cpukit/libfs/src/imfs/memfile.c, cpukit/libfs/src/nfsclient/src/nfs.c, cpukit/libcsupport/include/rtems/libio.h, cpukit/libcsupport/src/malloc_deferred.c, cpukit/libcsupport/src/mount.c, cpukit/libcsupport/src/privateenv.c, cpukit/libcsupport/src/unmount.c: Change to the new chains interface.
  • cpukit/libcsupport/src/malloc_boundary.c: Remove warning.
Location:
cpukit
Files:
2 added
22 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rb9c38ed r72d2ec4d  
     12008-07-03      Chris Johns <chrisj@rtems.org>
     2
     3        * cpukit/libcsupport/include/chain.h: Removed. Use the SAPI
     4        interface that is supported.
     5
     6        * cpukit/libcsupport/Makefile.am,
     7        cpukit/libcsupport/preinstall.am: Remove chain.h header
     8        references.
     9
     10        * cpukit/sapi/include/rtems/chain.h,
     11        cpukit/sapi/inline/rtems/chain.inl: New. A supported chains
     12        interface.
     13
     14        * cpukit/sapi/Makefile.am, cpukit/sapi/preinstall.am: Updated to
     15        include the new chains interface.
     16
     17        * cpukit/libfs/src/imfs/imfs.h,
     18        cpukit/libfs/src/imfs/imfs_creat.c,
     19        cpukit/libfs/src/imfs/imfs_debug.c,
     20        cpukit/libfs/src/imfs/imfs_directory.c,
     21        cpukit/libfs/src/imfs/imfs_fsunmount.c,
     22        cpukit/libfs/src/imfs/imfs_getchild.c,
     23        cpukit/libfs/src/imfs/imfs_load_tar.c,
     24        cpukit/libfs/src/imfs/imfs_rmnod.c,
     25        cpukit/libfs/src/imfs/memfile.c,
     26        cpukit/libfs/src/nfsclient/src/nfs.c,
     27        cpukit/libcsupport/include/rtems/libio.h,
     28        cpukit/libcsupport/src/malloc_deferred.c,
     29        cpukit/libcsupport/src/mount.c,
     30        cpukit/libcsupport/src/privateenv.c,
     31        cpukit/libcsupport/src/unmount.c: Change to the new chains
     32        interface.
     33
     34        * cpukit/libcsupport/src/malloc_boundary.c: Remove warning.
     35
    1362008-07-02      Ralf Corsépius <ralf.corsepius@rtems.org>
    237
  • cpukit/libblock/src/bdbuf.c

    rb9c38ed r72d2ec4d  
    688688    p->tree = NULL;
    689689
    690     Chain_Initialize_empty(&p->free);
    691     Chain_Initialize_empty(&p->lru);
     690    rtems_chain_initialize_empty(&p->free);
     691    rtems_chain_initialize_empty(&p->lru);
    692692
    693693    /* Allocate memory for buffer descriptors */
     
    721721        b->use_count = 0;
    722722        b->pool = pool;
    723         _Chain_Append(&p->free, &b->link);
     723        rtems_chain_append(&p->free, &b->link);
    724724    }
    725725
     
    796796    }
    797797
    798     Chain_Initialize_empty(&rtems_bdbuf_ctx.mod);
     798    rtems_chain_initialize_empty(&rtems_bdbuf_ctx.mod);
    799799
    800800    /* Initialize buffer pools and roll out if something failed */
     
    928928    {
    929929        /* Assign new buffer descriptor */
    930         if (_Chain_Is_empty(&bd_pool->free))
    931         {
    932             bd_buf = (bdbuf_buffer *)Chain_Get(&bd_pool->lru);
     930        if (rtems_chain_is_empty(&bd_pool->free))
     931        {
     932            bd_buf = (bdbuf_buffer *)rtems_chain_get(&bd_pool->lru);
    933933            if (bd_buf != NULL)
    934934            {
     
    944944        else
    945945        {
    946             bd_buf = (bdbuf_buffer *)Chain_Get(&(bd_pool->free));
     946            bd_buf = (bdbuf_buffer *)rtems_chain_get(&(bd_pool->free));
    947947        }
    948948
     
    10101010            /* Buffer descriptor is linked to the lru or mod chain. Remove
    10111011               it from there. */
    1012             Chain_Extract(&bd_buf->link);
     1012            rtems_chain_extract(&bd_buf->link);
    10131013        }
    10141014        bd_buf->use_count++;
     
    14541454            /* Buffer was modified. Insert buffer to the modified buffers
    14551455             * list and initiate flushing. */
    1456             Chain_Append(&rtems_bdbuf_ctx.mod, &bd_buf->link);
     1456            rtems_chain_append(&rtems_bdbuf_ctx.mod, &bd_buf->link);
    14571457
    14581458            /* Release the flush_sema */
     
    14631463            /* Buffer was not modified. Add this descriptor to the
    14641464             * end of lru chain and make it available for reuse. */
    1465             Chain_Append(&bd_pool->lru, &bd_buf->link);
     1465            rtems_chain_append(&bd_pool->lru, &bd_buf->link);
    14661466            rc = rtems_semaphore_release(bd_pool->bufget_sema);
    14671467        }
     
    16911691                                        0);
    16921692            if (rc == RTEMS_SUCCESSFUL) {
    1693               nxt_bd_buf = (bdbuf_buffer *)Chain_Get(&rtems_bdbuf_ctx.mod);
     1693              nxt_bd_buf = (bdbuf_buffer *)rtems_chain_get(&rtems_bdbuf_ctx.mod);
    16941694          if (nxt_bd_buf != NULL) {
    16951695                nxt_bd_buf->in_progress = TRUE;
     
    17851785              if (bd_buf->modified)
    17861786                {
    1787                   Chain_Append(&rtems_bdbuf_ctx.mod, &bd_buf->link);
     1787                  rtems_chain_append(&rtems_bdbuf_ctx.mod, &bd_buf->link);
    17881788                  rc = rtems_semaphore_release(rtems_bdbuf_ctx.flush_sema);
    17891789                }
    17901790              else
    17911791                {
    1792                   Chain_Append(&bd_pool->lru, &bd_buf->link);
     1792                  rtems_chain_append(&bd_pool->lru, &bd_buf->link);
    17931793                  rc = rtems_semaphore_release(bd_pool->bufget_sema);
    17941794                }
  • cpukit/libcsupport/Makefile.am

    rb9c38ed r72d2ec4d  
    1111
    1212include_rtemsdir = $(includedir)/rtems
    13 include_rtems_HEADERS = include/chain.h include/console.h include/clockdrv.h \
     13include_rtems_HEADERS = include/console.h include/clockdrv.h \
    1414    include/iosupp.h include/ringbuf.h include/rtc.h include/spurious.h \
    1515    include/timerdrv.h include/vmeintr.h
  • cpukit/libcsupport/include/rtems/libio.h

    rb9c38ed r72d2ec4d  
    2525
    2626#include <rtems.h>
     27#include <rtems/chain.h>
    2728#include <sys/types.h>
    2829#include <sys/stat.h>
     
    309310
    310311struct rtems_filesystem_mount_table_entry_tt {
    311   Chain_Node                             Node;
     312  rtems_chain_node                       Node;
    312313  rtems_filesystem_location_info_t       mt_point_node;
    313314  rtems_filesystem_location_info_t       mt_fs_root;
  • cpukit/libcsupport/preinstall.am

    rb9c38ed r72d2ec4d  
    3232        @: > $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    3333PREINSTALL_DIRS += $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    34 
    35 $(PROJECT_INCLUDE)/rtems/chain.h: include/chain.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    36         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/chain.h
    37 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/chain.h
    3834
    3935$(PROJECT_INCLUDE)/rtems/console.h: include/console.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
  • cpukit/libcsupport/src/malloc_boundary.c

    rb9c38ed r72d2ec4d  
    160160    if (mp->memory != (mp + 1))
    161161        ind += sprintf(cbuf+ind, "mp+1:%p  ", mp + 1);
    162     ind += sprintf(cbuf+ind, "mp->memory:%p  mp->size:%d\n", mp->memory, mp->size);
     162    ind += sprintf(cbuf+ind, "mp->memory:%p  mp->size:%li\n", mp->memory, mp->size);
    163163    if (memcmp((char *)mp->memory + mp->size, SENTINEL, SENTINELSIZE) != 0) {
    164164        ind += sprintf(cbuf+ind, "mp->sentinel: ");
  • cpukit/libcsupport/src/malloc_deferred.c

    rb9c38ed r72d2ec4d  
    2323#include "malloc_p.h"
    2424
    25 Chain_Control RTEMS_Malloc_GC_list;
     25rtems_chain_control RTEMS_Malloc_GC_list;
    2626
    2727boolean malloc_is_system_state_OK(void)
     
    3838void malloc_deferred_frees_initialize(void)
    3939{
    40   Chain_Initialize_empty(&RTEMS_Malloc_GC_list);
     40  rtems_chain_initialize_empty(&RTEMS_Malloc_GC_list);
    4141}
    4242
    4343void malloc_deferred_frees_process(void)
    4444{
    45   Chain_Node  *to_be_freed;
     45  rtems_chain_node  *to_be_freed;
    4646
    4747  /*
    4848   *  If some free's have been deferred, then do them now.
    4949   */
    50   while ((to_be_freed = Chain_Get(&RTEMS_Malloc_GC_list)) != NULL)
     50  while ((to_be_freed = rtems_chain_get(&RTEMS_Malloc_GC_list)) != NULL)
    5151    free(to_be_freed);
    5252}
     
    5656)
    5757{
    58   Chain_Append(&RTEMS_Malloc_GC_list, (Chain_Node *)pointer);
     58  rtems_chain_append(&RTEMS_Malloc_GC_list, (rtems_chain_node *)pointer);
    5959}
    6060#endif
  • cpukit/libcsupport/src/mount.c

    rb9c38ed r72d2ec4d  
    3434#include <rtems/libio_.h>
    3535
    36 Chain_Control rtems_filesystem_mount_table_control;
     36rtems_chain_control rtems_filesystem_mount_table_control;
    3737
    3838/*
     
    228228   */
    229229
    230   Chain_Append( &rtems_filesystem_mount_table_control, &temp_mt_entry->Node );
     230  rtems_chain_append( &rtems_filesystem_mount_table_control,
     231                      &temp_mt_entry->Node );
    231232
    232233  if ( mt_entry )
     
    256257int init_fs_mount_table()
    257258{
    258   Chain_Initialize_empty ( &rtems_filesystem_mount_table_control );
     259  rtems_chain_initialize_empty ( &rtems_filesystem_mount_table_control );
    259260  return 0;
    260261}
     
    275276)
    276277{
    277   Chain_Node                           *the_node;
     278  rtems_chain_node                     *the_node;
    278279  rtems_filesystem_mount_table_entry_t *the_mount_entry;
    279280
     
    283284
    284285  for ( the_node = rtems_filesystem_mount_table_control.first;
    285         !Chain_Is_tail( &rtems_filesystem_mount_table_control, the_node );
     286        !rtems_chain_is_tail( &rtems_filesystem_mount_table_control, the_node );
    286287        the_node = the_node->next ) {
    287288     the_mount_entry = (rtems_filesystem_mount_table_entry_t *) the_node;
  • cpukit/libcsupport/src/privateenv.c

    rb9c38ed r72d2ec4d  
    2121
    2222#include <rtems.h>
     23#include <rtems/chain.h>
    2324#include <rtems/libio.h>
    2425#include <rtems/libio_.h>
    2526
    26 extern Chain_Control rtems_filesystem_mount_table_control;
     27extern rtems_chain_control rtems_filesystem_mount_table_control;
    2728
    2829#define THE_ROOT_FS_LOC \
  • cpukit/libcsupport/src/unmount.c

    rb9c38ed r72d2ec4d  
    3838 */
    3939
    40 extern Chain_Control                    rtems_filesystem_mount_table_control;
     40extern rtems_chain_control rtems_filesystem_mount_table_control;
    4141
    4242int search_mt_for_mount_point(
     
    7070)
    7171{
    72   Chain_Node                           *the_node;
     72  rtems_chain_node                     *the_node;
    7373  rtems_filesystem_mount_table_entry_t *the_mount_entry;
    7474
     
    7979
    8080  for ( the_node = rtems_filesystem_mount_table_control.first;
    81         !Chain_Is_tail( &rtems_filesystem_mount_table_control, the_node );
     81        !rtems_chain_is_tail( &rtems_filesystem_mount_table_control, the_node );
    8282        the_node = the_node->next ) {
    8383     the_mount_entry = ( rtems_filesystem_mount_table_entry_t * )the_node;
     
    206206   */
    207207
    208   Chain_Extract( ( Chain_Node * ) mt_entry );
     208  rtems_chain_extract( ( rtems_chain_node * ) mt_entry );
    209209
    210210  /*
  • cpukit/libfs/src/imfs/imfs.h

    rb9c38ed r72d2ec4d  
    4343
    4444typedef struct {
    45   Chain_Control                          Entries;
     45  rtems_chain_control                    Entries;
    4646  rtems_filesystem_mount_table_entry_t  *mt_fs;
    4747}  IMFS_directory_t;
     
    159159
    160160struct IMFS_jnode_tt {
    161   Chain_Node          Node;                  /* for chaining them together */
     161  rtems_chain_node    Node;                  /* for chaining them together */
    162162  IMFS_jnode_t       *Parent;                /* Parent node */
    163163  char                name[IMFS_NAME_MAX+1]; /* "basename" */
  • cpukit/libfs/src/imfs/imfs_creat.c

    rb9c38ed r72d2ec4d  
    8686  switch (type) {
    8787    case IMFS_DIRECTORY:
    88       Chain_Initialize_empty(&node->info.directory.Entries);
     88      rtems_chain_initialize_empty(&node->info.directory.Entries);
    8989      break;
    9090
     
    123123
    124124  if ( parent ) {
    125     Chain_Append( &parent->info.directory.Entries, &node->Node );
     125    rtems_chain_append( &parent->info.directory.Entries, &node->Node );
    126126    node->Parent = parent;
    127127
  • cpukit/libfs/src/imfs/imfs_debug.c

    rb9c38ed r72d2ec4d  
    120120)
    121121{
    122   Chain_Node           *the_node;
    123   Chain_Control        *the_chain;
     122  rtems_chain_node     *the_node;
     123  rtems_chain_control  *the_chain;
    124124  IMFS_jnode_t         *the_jnode;
    125125  int                   i;
     
    134134
    135135  for ( the_node = the_chain->first;
    136         !_Chain_Is_tail( the_chain, the_node );
     136        !rtems_chain_is_tail( the_chain, the_node );
    137137        the_node = the_node->next ) {
    138138
  • cpukit/libfs/src/imfs/imfs_directory.c

    rb9c38ed r72d2ec4d  
    8383   *  imfs_jnode_t struct for this file descriptor.
    8484   */
    85    Chain_Node        *the_node;
    86    Chain_Control    *the_chain;
    87    IMFS_jnode_t      *the_jnode;
    88    int                bytes_transferred;
    89    int                current_entry;
    90    int                first_entry;
    91    int                last_entry;
    92    struct dirent      tmp_dirent;
     85   rtems_chain_node    *the_node;
     86   rtems_chain_control *the_chain;
     87   IMFS_jnode_t        *the_jnode;
     88   int                  bytes_transferred;
     89   int                  current_entry;
     90   int                  first_entry;
     91   int                  last_entry;
     92   struct dirent        tmp_dirent;
    9393
    9494   the_jnode = (IMFS_jnode_t *)iop->file_info;
    9595   the_chain = &the_jnode->info.directory.Entries;
    9696
    97    if ( Chain_Is_empty( the_chain ) )
     97   if ( rtems_chain_is_empty( the_chain ) )
    9898      return 0;
    9999
     
    113113      current_entry = current_entry + sizeof(struct dirent) ){
    114114
    115       if ( Chain_Is_tail( the_chain, the_node ) ){
     115      if ( rtems_chain_is_tail( the_chain, the_node ) ){
    116116         /* We hit the tail of the chain while trying to move to the first */
    117117         /* entry in the read */
     
    239239)
    240240{
    241    Chain_Node        *the_node;
    242    Chain_Control    *the_chain;
    243    IMFS_jnode_t      *the_jnode;
     241   rtems_chain_node    *the_node;
     242   rtems_chain_control *the_chain;
     243   IMFS_jnode_t        *the_jnode;
    244244
    245245
     
    266266   /* that are subordinate to this directory node                     */
    267267   for ( the_node = the_chain->first ;
    268          !_Chain_Is_tail( the_chain, the_node ) ;
     268         !rtems_chain_is_tail( the_chain, the_node ) ;
    269269         the_node = the_node->next ) {
    270270
     
    294294   */
    295295
    296   if ( ! Chain_Is_empty( &the_jnode->info.directory.Entries ) )
     296  if ( ! rtems_chain_is_empty( &the_jnode->info.directory.Entries ) )
    297297     rtems_set_errno_and_return_minus_one( ENOTEMPTY );
    298298
     
    316316
    317317  if ( the_jnode->Parent != NULL ) {
    318     Chain_Extract( (Chain_Node *) the_jnode );
     318    rtems_chain_extract( (rtems_chain_node *) the_jnode );
    319319    the_jnode->Parent = NULL;
    320320  }
  • cpukit/libfs/src/imfs/imfs_fsunmount.c

    rb9c38ed r72d2ec4d  
    3838
    3939#define jnode_has_no_children( jnode )  \
    40   Chain_Is_empty( jnode_get_control( jnode ) )
     40  rtems_chain_is_empty( jnode_get_control( jnode ) )
    4141
    4242#define jnode_has_children( jnode ) \
     
    4444
    4545#define jnode_get_first_child( jnode ) \
    46     ((IMFS_jnode_t *)( Chain_Head( jnode_get_control( jnode ) )->next))
     46    ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next))
    4747
    4848int IMFS_fsunmount(
  • cpukit/libfs/src/imfs/imfs_getchild.c

    rb9c38ed r72d2ec4d  
    3131)
    3232{
    33   Chain_Node        *the_node;
    34   Chain_Control    *the_chain;
    35   IMFS_jnode_t      *the_jnode;
     33  rtems_chain_node    *the_node;
     34  rtems_chain_control *the_chain;
     35  IMFS_jnode_t        *the_jnode;
    3636
    3737  /*
     
    6161
    6262  for ( the_node = the_chain->first;
    63         !_Chain_Is_tail( the_chain, the_node );
     63        !rtems_chain_is_tail( the_chain, the_node );
    6464        the_node = the_node->next ) {
    6565
  • cpukit/libfs/src/imfs/imfs_load_tar.c

    rb9c38ed r72d2ec4d  
    2323#include <rtems.h>
    2424#include <rtems/libio_.h>
    25 #include <rtems/chain.h>
    2625#include <rtems/imfs.h>
    2726#include <rtems/untar.h>
  • cpukit/libfs/src/imfs/imfs_rmnod.c

    rb9c38ed r72d2ec4d  
    4444
    4545  if ( the_jnode->Parent != NULL ) {
    46     Chain_Extract( (Chain_Node *) the_jnode );
     46    rtems_chain_extract( (rtems_chain_node *) the_jnode );
    4747    the_jnode->Parent = NULL;
    4848  }
     
    7474    if ( the_jnode->type == IMFS_SYM_LINK ) {
    7575      if ( the_jnode->info.sym_link.name )
    76         free( the_jnode->info.sym_link.name );
     76        free( (void*) the_jnode->info.sym_link.name );
    7777    }
    7878    free( the_jnode );
  • cpukit/libfs/src/imfs/memfile.c

    rb9c38ed r72d2ec4d  
    11181118
    11191119  if ( the_jnode->Parent != NULL ) {
    1120     Chain_Extract( (Chain_Node *) the_jnode );
     1120    rtems_chain_extract( (rtems_chain_node *) the_jnode );
    11211121    the_jnode->Parent = NULL;
    11221122  }
  • cpukit/libfs/src/nfsclient/src/nfs.c

    rb9c38ed r72d2ec4d  
    18711871
    18721872struct rtems_filesystem_mount_table_entry_tt {
    1873   Chain_Node                             Node;
     1873  rtems_chain_node                       Node;
    18741874  rtems_filesystem_location_info_t       mt_point_node;
    18751875  rtems_filesystem_location_info_t       mt_fs_root;
  • cpukit/sapi/Makefile.am

    rb9c38ed r72d2ec4d  
    99
    1010include_rtems_HEADERS = include/confdefs.h
    11 include_rtems_HEADERS += include/rtems/config.h include/rtems/extension.h \
    12     include/rtems/fatal.h include/rtems/init.h include/rtems/io.h \
    13     include/rtems/mptables.h include/rtems/sptables.h
     11include_rtems_HEADERS += include/rtems/chain.h include/rtems/config.h \
     12    include/rtems/extension.h include/rtems/fatal.h include/rtems/init.h \
     13    include/rtems/io.h include/rtems/mptables.h include/rtems/sptables.h
    1414
    1515EXTRA_DIST = include/rtems/README
    1616
    17 include_rtems_HEADERS += inline/rtems/extension.inl
     17include_rtems_HEADERS += inline/rtems/chain.inl \
     18    inline/rtems/extension.inl
    1819
    1920## src
  • cpukit/sapi/preinstall.am

    rb9c38ed r72d2ec4d  
    2222        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/confdefs.h
    2323PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/confdefs.h
     24
     25$(PROJECT_INCLUDE)/rtems/chain.h: include/rtems/chain.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
     26        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/chain.h
     27PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/chain.h
    2428
    2529$(PROJECT_INCLUDE)/rtems/config.h: include/rtems/config.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
     
    5155PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/sptables.h
    5256
     57$(PROJECT_INCLUDE)/rtems/chain.inl: inline/rtems/chain.inl $(PROJECT_INCLUDE)/rtems/$(dirstamp)
     58        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/chain.inl
     59PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/chain.inl
     60
    5361$(PROJECT_INCLUDE)/rtems/extension.inl: inline/rtems/extension.inl $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    5462        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/extension.inl
Note: See TracChangeset for help on using the changeset viewer.