4.115
Last change
on this file since bd9baa81 was
bd9baa81,
checked in by Joel Sherrill <joel.sherrill@…>, on 04/04/11 at 18:44:16
|
2010-07-28 Gedare Bloom <giddyup44@…>
PR 1641/cpukit
- sapi/Makefile.am, sapi/preinstall.am, score/Makefile.am,
score/preinstall.am: Add Red Black Tree data structure to score.
- sapi/include/rtems/rbtree.h, sapi/inline/rtems/rbtree.inl,
score/include/rtems/score/rbtree.h, score/inline/rtems/score/rbtree.inl,
score/src/rbtree.c, score/src/rbtreeextract.c,
score/src/rbtreefind.c, score/src/rbtreefindheader.c,
score/src/rbtreeget.c, score/src/rbtreeinsert.c,
score/src/rbtreepeek.c: New files.
|
-
Property mode set to
100644
|
File size:
1.0 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 | * $Id$ |
---|
9 | */ |
---|
10 | |
---|
11 | #if HAVE_CONFIG_H |
---|
12 | #include "config.h" |
---|
13 | #endif |
---|
14 | |
---|
15 | #include <rtems/system.h> |
---|
16 | #include <rtems/score/address.h> |
---|
17 | #include <rtems/score/rbtree.h> |
---|
18 | #include <rtems/score/isr.h> |
---|
19 | |
---|
20 | /* |
---|
21 | * _RBTree_Get |
---|
22 | * |
---|
23 | * This kernel routine returns a pointer to a node taken from the |
---|
24 | * given rbtree. |
---|
25 | * |
---|
26 | * Input parameters: |
---|
27 | * the_rbtree - pointer to rbtree header |
---|
28 | * dir - specifies min (0) or max (1) |
---|
29 | * |
---|
30 | * Output parameters: |
---|
31 | * return_node - pointer to node in rbtree allocated |
---|
32 | * NULL - if no nodes available |
---|
33 | * |
---|
34 | * INTERRUPT LATENCY: |
---|
35 | * only case |
---|
36 | */ |
---|
37 | |
---|
38 | RBTree_Node *_RBTree_Get( |
---|
39 | RBTree_Control *the_rbtree, |
---|
40 | RBTree_Direction dir |
---|
41 | ) |
---|
42 | { |
---|
43 | ISR_Level level; |
---|
44 | RBTree_Node *return_node; |
---|
45 | |
---|
46 | return_node = NULL; |
---|
47 | _ISR_Disable( level ); |
---|
48 | return_node = _RBTree_Get_unprotected( the_rbtree, dir ); |
---|
49 | _ISR_Enable( level ); |
---|
50 | return return_node; |
---|
51 | } |
---|
52 | |
---|
Note: See
TracBrowser
for help on using the repository browser.