source: rtems/cpukit/score/src/chain.c @ b72e847b

4.8
Last change on this file since b72e847b was c3db01d0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/09/07 at 18:27:26

2007-05-09 Joel Sherrill <joel.sherrill@…>

  • libcsupport/include/rtems/libcsupport.h, libcsupport/src/newlibc.c, sapi/Makefile.am, sapi/include/confdefs.h, sapi/src/exinit.c, score/Makefile.am, score/preinstall.am, score/include/rtems/score/userext.h, score/src/chain.c, score/src/userext.c: Switch to newlib reentrancy extension being installed in the initial set instead of using rtems_extension_create. While implementing this, noticed that user extensions and chain code had multiple functions in a single file which is not desirable in the SuperCore? and API portions of RTEMS, so split these into multiple files with one function per file. Also noticed that some of user extension code was inlined for no particular reason so moved that to C bodies. Split executive shutdown from initialization since not every application shuts down. Moved fini call to executive shutdown to be more symmetrical with where it is called at startup.
  • sapi/src/exshutdown.c, score/src/chainappend.c, score/src/chainextract.c, score/src/chainget.c, score/src/chaininsert.c, score/src/userextaddapiset.c, score/src/userextaddset.c, score/src/userextremoveset.c, score/src/userextthreadbegin.c, score/src/userextthreadcreate.c, score/src/userextthreaddelete.c, score/src/userextthreadrestart.c, score/src/userextthreadstart.c, score/src/userextthreadswitch.c: New files.
  • score/inline/rtems/score/userext.inl: Removed.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2007.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <rtems/system.h>
17#include <rtems/score/address.h>
18#include <rtems/score/chain.h>
19#include <rtems/score/isr.h>
20
21/*PAGE
22 *
23 *  _Chain_Initialize
24 *
25 *  This kernel routine initializes a doubly linked chain.
26 *
27 *  Input parameters:
28 *    the_chain        - pointer to chain header
29 *    starting_address - starting address of first node
30 *    number_nodes     - number of nodes in chain
31 *    node_size        - size of node in bytes
32 *
33 *  Output parameters:  NONE
34 */
35
36void _Chain_Initialize(
37  Chain_Control *the_chain,
38  void           *starting_address,
39  size_t         number_nodes,
40  size_t         node_size
41)
42{
43  size_t      count;
44  Chain_Node *current;
45  Chain_Node *next;
46
47  count                     = number_nodes;
48  current                   = _Chain_Head( the_chain );
49  the_chain->permanent_null = NULL;
50  next                      = starting_address;
51  while ( count-- ) {
52    current->next  = next;
53    next->previous = current;
54    current        = next;
55    next           = (Chain_Node *)
56                        _Addresses_Add_offset( (void *) next, node_size );
57  }
58  current->next    = _Chain_Tail( the_chain );
59  the_chain->last  = current;
60}
Note: See TracBrowser for help on using the repository browser.