aboutsummaryrefslogtreecommitdiff
path: root/gdb/memattr.h
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-09-21 13:48:29 +0000
committerDaniel Jacobowitz <drow@false.org>2006-09-21 13:48:29 +0000
commitc96fc75e9e90e0781789095b842495bbcdbb037a (patch)
tree070da01214c2209c501e537cf650b7c6c4205d59 /gdb/memattr.h
parent350da6eece0dc73ae5a74a81064f8d26f9d429d8 (diff)
downloadgdb-c96fc75e9e90e0781789095b842495bbcdbb037a.zip
gdb-c96fc75e9e90e0781789095b842495bbcdbb037a.tar.gz
gdb-c96fc75e9e90e0781789095b842495bbcdbb037a.tar.bz2
* 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 cbb2aba..72c5887 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 */