2009-01-30 Julian Brown <julian@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / memattr.h
CommitLineData
80629b1b 1/* Memory attributes support, for GDB.
c96fc75e 2
0fb0cc75 3 Copyright (C) 2001, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
80629b1b
EZ
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
a9762ec7 9 the Free Software Foundation; either version 3 of the License, or
80629b1b
EZ
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
a9762ec7 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
80629b1b 19
29e57380
C
20#ifndef MEMATTR_H
21#define MEMATTR_H
22
c96fc75e
DJ
23#include "vec.h"
24
29e57380
C
25enum mem_access_mode
26{
4b5752d0 27 MEM_NONE, /* Memory that is not physically present. */
29e57380
C
28 MEM_RW, /* read/write */
29 MEM_RO, /* read only */
fd79ecee
DJ
30 MEM_WO, /* write only */
31
32 /* Read/write, but special steps are required to write to it. */
33 MEM_FLASH
29e57380
C
34};
35
36enum mem_access_width
37{
38 MEM_WIDTH_UNSPECIFIED,
39 MEM_WIDTH_8, /* 8 bit accesses */
40 MEM_WIDTH_16, /* 16 " " */
41 MEM_WIDTH_32, /* 32 " " */
42 MEM_WIDTH_64 /* 64 " " */
43};
44
45/* The set of all attributes that can be set for a memory region.
46
47 This structure was created so that memory attributes can be passed
48 to target_ functions without exposing the details of memory region
49 list, which would be necessary if these fields were simply added to
50 the mem_region structure.
51
52 FIXME: It would be useful if there was a mechanism for targets to
53 add their own attributes. For example, the number of wait states. */
54
55struct mem_attrib
56{
57 /* read/write, read-only, or write-only */
58 enum mem_access_mode mode;
59
60 enum mem_access_width width;
61
62 /* enables hardware breakpoints */
63 int hwbreak;
64
65 /* enables host-side caching of memory region data */
66 int cache;
67
68 /* enables memory verification. after a write, memory is re-read
69 to verify that the write was successful. */
70 int verify;
fd79ecee
DJ
71
72 /* Block size. Only valid if mode == MEM_FLASH. */
73 int blocksize;
29e57380
C
74};
75
76struct mem_region
77{
4b5752d0 78 /* Lowest address in the region. */
29e57380 79 CORE_ADDR lo;
4b5752d0
VP
80 /* Address past the highest address of the region.
81 If 0, upper bound is "infinity". */
29e57380
C
82 CORE_ADDR hi;
83
84 /* Item number of this memory region. */
85 int number;
86
b5de0fa7
EZ
87 /* Status of this memory region (enabled if non-zero, otherwise disabled) */
88 int enabled_p;
29e57380
C
89
90 /* Attributes for this region */
91 struct mem_attrib attrib;
92};
93
c96fc75e
DJ
94/* Declare a vector type for a group of mem_region structures. The
95 typedef is necessary because vec.h can not handle a struct tag.
96 Except during construction, these vectors are kept sorted. */
97typedef struct mem_region mem_region_s;
98DEF_VEC_O(mem_region_s);
99
29e57380
C
100extern struct mem_region *lookup_mem_region(CORE_ADDR);
101
fd79ecee
DJ
102void invalidate_target_mem_regions (void);
103
104void mem_region_init (struct mem_region *);
105
106int mem_region_cmp (const void *, const void *);
107
29e57380 108#endif /* MEMATTR_H */
This page took 0.617913 seconds and 4 git commands to generate.