convert to_flash_erase
2014-02-19 Tom Tromey <tromey@redhat.com> * target-delegates.c: Rebuild. * target.c (target_flash_erase): Unconditionally delegate. * target.h (struct target_ops) <to_flash_erase>: Use TARGET_DEFAULT_NORETURN.
This commit is contained in:
parent
7e35c012fb
commit
e8a6c6ace9
4 changed files with 29 additions and 14 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2014-02-19 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* target-delegates.c: Rebuild.
|
||||||
|
* target.c (target_flash_erase): Unconditionally delegate.
|
||||||
|
* target.h (struct target_ops) <to_flash_erase>: Use
|
||||||
|
TARGET_DEFAULT_NORETURN.
|
||||||
|
|
||||||
2014-02-19 Tom Tromey <tromey@redhat.com>
|
2014-02-19 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* target-delegates.c: Rebuild.
|
* target-delegates.c: Rebuild.
|
||||||
|
|
|
@ -723,6 +723,19 @@ tdefault_xfer_partial (struct target_ops *self, enum target_object arg1, const
|
||||||
return TARGET_XFER_E_IO;
|
return TARGET_XFER_E_IO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
delegate_flash_erase (struct target_ops *self, ULONGEST arg1, LONGEST arg2)
|
||||||
|
{
|
||||||
|
self = self->beneath;
|
||||||
|
self->to_flash_erase (self, arg1, arg2);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
tdefault_flash_erase (struct target_ops *self, ULONGEST arg1, LONGEST arg2)
|
||||||
|
{
|
||||||
|
tcomplain ();
|
||||||
|
}
|
||||||
|
|
||||||
static ptid_t
|
static ptid_t
|
||||||
delegate_get_ada_task_ptid (struct target_ops *self, long arg1, long arg2)
|
delegate_get_ada_task_ptid (struct target_ops *self, long arg1, long arg2)
|
||||||
{
|
{
|
||||||
|
@ -1350,6 +1363,8 @@ install_delegators (struct target_ops *ops)
|
||||||
ops->to_goto_bookmark = delegate_goto_bookmark;
|
ops->to_goto_bookmark = delegate_goto_bookmark;
|
||||||
if (ops->to_xfer_partial == NULL)
|
if (ops->to_xfer_partial == NULL)
|
||||||
ops->to_xfer_partial = delegate_xfer_partial;
|
ops->to_xfer_partial = delegate_xfer_partial;
|
||||||
|
if (ops->to_flash_erase == NULL)
|
||||||
|
ops->to_flash_erase = delegate_flash_erase;
|
||||||
if (ops->to_get_ada_task_ptid == NULL)
|
if (ops->to_get_ada_task_ptid == NULL)
|
||||||
ops->to_get_ada_task_ptid = delegate_get_ada_task_ptid;
|
ops->to_get_ada_task_ptid = delegate_get_ada_task_ptid;
|
||||||
if (ops->to_can_execute_reverse == NULL)
|
if (ops->to_can_execute_reverse == NULL)
|
||||||
|
@ -1498,6 +1513,7 @@ install_dummy_methods (struct target_ops *ops)
|
||||||
ops->to_get_bookmark = tdefault_get_bookmark;
|
ops->to_get_bookmark = tdefault_get_bookmark;
|
||||||
ops->to_goto_bookmark = tdefault_goto_bookmark;
|
ops->to_goto_bookmark = tdefault_goto_bookmark;
|
||||||
ops->to_xfer_partial = tdefault_xfer_partial;
|
ops->to_xfer_partial = tdefault_xfer_partial;
|
||||||
|
ops->to_flash_erase = tdefault_flash_erase;
|
||||||
ops->to_get_ada_task_ptid = default_get_ada_task_ptid;
|
ops->to_get_ada_task_ptid = default_get_ada_task_ptid;
|
||||||
ops->to_can_execute_reverse = tdefault_can_execute_reverse;
|
ops->to_can_execute_reverse = tdefault_can_execute_reverse;
|
||||||
ops->to_execution_direction = default_execution_direction;
|
ops->to_execution_direction = default_execution_direction;
|
||||||
|
|
17
gdb/target.c
17
gdb/target.c
|
@ -1757,19 +1757,10 @@ target_memory_map (void)
|
||||||
void
|
void
|
||||||
target_flash_erase (ULONGEST address, LONGEST length)
|
target_flash_erase (ULONGEST address, LONGEST length)
|
||||||
{
|
{
|
||||||
struct target_ops *t;
|
if (targetdebug)
|
||||||
|
fprintf_unfiltered (gdb_stdlog, "target_flash_erase (%s, %s)\n",
|
||||||
for (t = current_target.beneath; t != NULL; t = t->beneath)
|
hex_string (address), phex (length, 0));
|
||||||
if (t->to_flash_erase != NULL)
|
current_target.to_flash_erase (¤t_target, address, length);
|
||||||
{
|
|
||||||
if (targetdebug)
|
|
||||||
fprintf_unfiltered (gdb_stdlog, "target_flash_erase (%s, %s)\n",
|
|
||||||
hex_string (address), phex (length, 0));
|
|
||||||
t->to_flash_erase (t, address, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
tcomplain ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -676,7 +676,8 @@ struct target_ops
|
||||||
Precondition: both ADDRESS and ADDRESS+LENGTH should be aligned
|
Precondition: both ADDRESS and ADDRESS+LENGTH should be aligned
|
||||||
on flash block boundaries, as reported by 'to_memory_map'. */
|
on flash block boundaries, as reported by 'to_memory_map'. */
|
||||||
void (*to_flash_erase) (struct target_ops *,
|
void (*to_flash_erase) (struct target_ops *,
|
||||||
ULONGEST address, LONGEST length);
|
ULONGEST address, LONGEST length)
|
||||||
|
TARGET_DEFAULT_NORETURN (tcomplain ());
|
||||||
|
|
||||||
/* Finishes a flash memory write sequence. After this operation
|
/* Finishes a flash memory write sequence. After this operation
|
||||||
all flash memory should be available for writing and the result
|
all flash memory should be available for writing and the result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue