Update copyright year range in all GDB files.
[deliverable/binutils-gdb.git] / sim / common / sim-arange.h
CommitLineData
c906108c 1/* Address ranges.
b811d2c2 2 Copyright (C) 1998-2020 Free Software Foundation, Inc.
c906108c
SS
3 Contributed by Cygnus Solutions.
4
5This file is part of the GNU Simulators.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
4744ac1b
JB
9the Free Software Foundation; either version 3 of the License, or
10(at your option) any later version.
c906108c
SS
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
4744ac1b
JB
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>. */
c906108c
SS
19
20/* This file is meant to be included by sim-basics.h. */
21
22#ifndef SIM_ARANGE_H
23#define SIM_ARANGE_H
24
25/* A list of address ranges. */
26
27typedef struct _addr_subrange {
28 struct _addr_subrange *next;
29
30 /* Range of addresses to be traced is [start,end]. */
31 address_word start,end;
32} ADDR_SUBRANGE;
33
34/* For speed, searching is done on a tree. */
35
36typedef struct _addr_range_tree {
37 struct _addr_range_tree *lower;
38 struct _addr_range_tree *higher;
39
40 /* Range of addresses to be traced is [start,end]. */
41 address_word start,end;
42} ADDR_RANGE_TREE;
43
44/* The top level struct. */
45
46typedef struct _addr_range {
47 ADDR_SUBRANGE *ranges;
48#define ADDR_RANGE_RANGES(ar) ((ar)->ranges)
49 ADDR_RANGE_TREE *range_tree;
50#define ADDR_RANGE_TREE(ar) ((ar)->range_tree)
51} ADDR_RANGE;
52
53/* Add address range START,END to AR. */
ef986697
SH
54INLINE_SIM_ARANGE (void) sim_addr_range_add (ADDR_RANGE * /*ar*/,
55 address_word /*start*/,
56 address_word /*end*/);
c906108c
SS
57
58/* Delete address range START,END from AR. */
ef986697
SH
59INLINE_SIM_ARANGE (void) sim_addr_range_delete (ADDR_RANGE * /*ar*/,
60 address_word /*start*/,
61 address_word /*end*/);
92fc6153 62
c906108c
SS
63/* Return non-zero if ADDR is in range AR, traversing the entire tree.
64 If no range is specified, that is defined to mean "everything". */
ef986697
SH
65INLINE_SIM_ARANGE (int) sim_addr_range_hit_p (ADDR_RANGE * /*ar*/,
66 address_word /*addr*/);
c906108c
SS
67#define ADDR_RANGE_HIT_P(ar, addr) \
68 ((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr)))
69
ef986697 70#if H_REVEALS_MODULE_P (SIM_ARANGE_INLINE)
c906108c 71#include "sim-arange.c"
c906108c 72#endif
c906108c
SS
73
74#endif /* SIM_ARANGE_H */
This page took 0.953204 seconds and 4 git commands to generate.