summaryrefslogtreecommitdiff
path: root/gdb/memattr.h
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2006-09-21 13:48:29 +0000
committerDaniel Jacobowitz <dan@debian.org>2006-09-21 13:48:29 +0000
commit2af1b1f7f102e67e9006debd5222302284346d14 (patch)
treeab6d20b13603f701274e6856b2effcccff61831f /gdb/memattr.h
parent2091cbba9250a6f6397c25590f9f55a29f053b53 (diff)
downloadgdb-2af1b1f7f102e67e9006debd5222302284346d14.tar.gz
* Makefile.in (memattr_h, memattr.o): Update.
* memattr.h: Include "vec.h". (struct mem_region): Remove linked list pointer. (mem_region_s): New typedef and corresponding vector. * memattr.c: Include "vec.h". (mem_region_chain): Delete. (mem_region_list): New vector pointer. (mem_region_lessthan): New function. (create_mem_region): Remove unused return value. Use vector operations. Remove linear search. (delete_mem_region): Delete. (lookup_mem_region): Use vector operations. Add a FIXME. (mem_info_command): Update to work with vectors. (mem_enable, mem_enable_command, mem_disable, mem_disable_command) (mem_free, mem_delete): Likewise.
Diffstat (limited to 'gdb/memattr.h')
-rw-r--r--gdb/memattr.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/gdb/memattr.h b/gdb/memattr.h
index cbb2abac189..72c5887a74c 100644
--- a/gdb/memattr.h
+++ b/gdb/memattr.h
@@ -1,5 +1,6 @@
/* Memory attributes support, for GDB.
- Copyright (C) 2001 Free Software Foundation, Inc.
+
+ Copyright (C) 2001, 2006 Free Software Foundation, Inc.
This file is part of GDB.
@@ -21,6 +22,8 @@
#ifndef MEMATTR_H
#define MEMATTR_H
+#include "vec.h"
+
enum mem_access_mode
{
MEM_RW, /* read/write */
@@ -67,12 +70,6 @@ struct mem_attrib
struct mem_region
{
- /* FIXME: memory regions are stored in an unsorted singly-linked
- list. This probably won't scale to handle hundreds of memory
- regions --- that many could be needed to describe the allowed
- access modes for memory mapped i/o device registers. */
- struct mem_region *next;
-
CORE_ADDR lo;
CORE_ADDR hi;
@@ -86,6 +83,12 @@ struct mem_region
struct mem_attrib attrib;
};
+/* Declare a vector type for a group of mem_region structures. The
+ typedef is necessary because vec.h can not handle a struct tag.
+ Except during construction, these vectors are kept sorted. */
+typedef struct mem_region mem_region_s;
+DEF_VEC_O(mem_region_s);
+
extern struct mem_region *lookup_mem_region(CORE_ADDR);
#endif /* MEMATTR_H */