source: rtems/cpukit/score/src/rbtree.c @ 2d7ae960

4.115
Last change on this file since 2d7ae960 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  Copyright (c) 2010 Gedare Bloom.
3 *
4 *  The license and distribution terms for this file may be
5 *  found in the file LICENSE in this distribution or at
6 *  http://www.rtems.com/license/LICENSE.
7 */
8
9#if HAVE_CONFIG_H
10#include "config.h"
11#endif
12
13#include <rtems/system.h>
14#include <rtems/score/address.h>
15#include <rtems/score/rbtree.h>
16#include <rtems/score/isr.h>
17
18/*
19 *  _RBTree_Initialize
20 *
21 *  This kernel routine initializes a Red-Black Tree.
22 *
23 *  Input parameters:
24 *    the_rbtree        - pointer to rbtree header
25 *    starting_address - starting address of first node
26 *    number_nodes     - number of nodes in rbtree
27 *    node_size        - size of node in bytes
28 *
29 *  Output parameters:  NONE
30 */
31
32void _RBTree_Initialize(
33  RBTree_Control          *the_rbtree,
34  RBTree_Compare_function  compare_function,
35  void                    *starting_address,
36  size_t                   number_nodes,
37  size_t                   node_size,
38  bool                     is_unique
39)
40{
41  size_t      count;
42  RBTree_Node *next;
43
44  /* TODO: Error message? */
45  if (!the_rbtree) return;
46
47  /* could do sanity checks here */
48  _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
49
50  count = number_nodes;
51  next  = starting_address;
52  while ( count-- ) {
53    _RBTree_Insert_unprotected(the_rbtree, next);
54    next           = (RBTree_Node *)
55                        _Addresses_Add_offset( (void *) next, node_size );
56  }
57}
Note: See TracBrowser for help on using the repository browser.