GDB (xrefs)
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
/tmp/gdb-7.10/gdb/memattr.h
Go to the documentation of this file.
1
/* Memory attributes support, for GDB.
2
3
Copyright (C) 2001-2015 Free Software Foundation, Inc.
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
9
the Free Software Foundation; either version 3 of the License, or
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
18
along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20
#ifndef MEMATTR_H
21
#define MEMATTR_H
22
23
#include "
vec.h
"
24
25
enum
mem_access_mode
26
{
27
MEM_NONE
,
/* Memory that is not physically present. */
28
MEM_RW
,
/* read/write */
29
MEM_RO
,
/* read only */
30
MEM_WO
,
/* write only */
31
32
/* Read/write, but special steps are required to write to it. */
33
MEM_FLASH
34
};
35
36
enum
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
55
struct
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
;
71
72
/* Block size. Only valid if mode == MEM_FLASH. */
73
int
blocksize
;
74
};
75
76
struct
mem_region
77
{
78
/* Lowest address in the region. */
79
CORE_ADDR
lo
;
80
/* Address past the highest address of the region.
81
If 0, upper bound is "infinity". */
82
CORE_ADDR
hi
;
83
84
/* Item number of this memory region. */
85
int
number
;
86
87
/* Status of this memory region (enabled if non-zero, otherwise
88
disabled). */
89
int
enabled_p
;
90
91
/* Attributes for this region. */
92
struct
mem_attrib
attrib
;
93
};
94
95
/* Declare a vector type for a group of mem_region structures. The
96
typedef is necessary because vec.h can not handle a struct tag.
97
Except during construction, these vectors are kept sorted. */
98
typedef
struct
mem_region
mem_region_s
;
99
DEF_VEC_O
(
mem_region_s
);
100
101
extern
struct
mem_region
*
lookup_mem_region
(
CORE_ADDR
);
102
103
void
invalidate_target_mem_regions
(
void
);
104
105
void
mem_region_init
(
struct
mem_region
*);
106
107
int
mem_region_cmp
(
const
void
*,
const
void
*);
108
109
#endif
/* MEMATTR_H */
MEM_RO
Definition:
memattr.h:29
CORE_ADDR
bfd_vma CORE_ADDR
Definition:
common-types.h:41
DEF_VEC_O
DEF_VEC_O(mem_region_s)
MEM_NONE
Definition:
memattr.h:27
mem_region::enabled_p
int enabled_p
Definition:
memattr.h:89
MEM_WIDTH_32
Definition:
memattr.h:41
mem_attrib
Definition:
memattr.h:55
mem_region::lo
CORE_ADDR lo
Definition:
memattr.h:79
MEM_WO
Definition:
memattr.h:30
invalidate_target_mem_regions
void invalidate_target_mem_regions(void)
Definition:
memattr.c:295
mem_attrib::cache
int cache
Definition:
memattr.h:66
MEM_WIDTH_16
Definition:
memattr.h:40
mem_region::attrib
struct mem_attrib attrib
Definition:
memattr.h:92
mem_region_init
void mem_region_init(struct mem_region *)
Definition:
memattr.c:115
mem_attrib::hwbreak
int hwbreak
Definition:
memattr.h:63
mem_region::number
int number
Definition:
memattr.h:85
mem_attrib::blocksize
int blocksize
Definition:
memattr.h:73
mem_region_cmp
int mem_region_cmp(const void *, const void *)
Definition:
memattr.c:99
MEM_RW
Definition:
memattr.h:28
MEM_WIDTH_8
Definition:
memattr.h:39
mem_attrib::verify
int verify
Definition:
memattr.h:70
mem_region::hi
CORE_ADDR hi
Definition:
memattr.h:82
mem_access_mode
mem_access_mode
Definition:
memattr.h:25
mem_access_width
mem_access_width
Definition:
memattr.h:36
lookup_mem_region
struct mem_region * lookup_mem_region(CORE_ADDR)
Definition:
memattr.c:226
MEM_WIDTH_UNSPECIFIED
Definition:
memattr.h:38
MEM_FLASH
Definition:
memattr.h:33
MEM_WIDTH_64
Definition:
memattr.h:42
mem_attrib::width
enum mem_access_width width
Definition:
memattr.h:60
vec.h
mem_region
Definition:
memattr.h:76
mem_attrib::mode
enum mem_access_mode mode
Definition:
memattr.h:58
Generated by
1.8.10