source: rtems/cpukit/score/src/rbtreepeek.c @ 8712622

4.115
Last change on this file since 8712622 was 8712622, checked in by Gedare Bloom <gedare@…>, on May 2, 2012 at 3:13:22 PM

score/rbtree: replace _RBTree_Peek_unprotected with _RBTree_First.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  Copyright (c) 2010-2012 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_Get
20 *
21 *  This kernel routine returns a pointer to the min or max node on the tree,
22 *  without removing that node.
23 *
24 *  Input parameters:
25 *    the_rbtree - pointer to rbtree header
26 *    dir - specifies whether to return minimum (0) or maximum (1)
27 *
28 *  Output parameters:
29 *    return_node - pointer to node in rbtree allocated
30 *    NULL   - if no nodes available
31 *
32 *  INTERRUPT LATENCY:
33 *    only case
34 */
35
36RBTree_Node *_RBTree_Peek(
37  const RBTree_Control *the_rbtree,
38  RBTree_Direction dir
39)
40{
41  ISR_Level          level;
42  RBTree_Node *return_node;
43
44  return_node = NULL;
45  _ISR_Disable( level );
46      return_node = _RBTree_First( the_rbtree, dir );
47  _ISR_Enable( level );
48  return return_node;
49}
Note: See TracBrowser for help on using the repository browser.