target_struct_allocsize * sizeof (*target_structs));
}
target_structs[target_struct_size++] = t;
- cleanup_target (t);
+/* cleanup_target (t);*/
if (targetlist == NULL)
add_prefix_cmd ("target", class_run, target_command,
/* We have removed all targets in our stratum, now add the new one. */
- tmp = xmalloc (sizeof (struct target_stack_item));
+ tmp = (struct target_stack_item *)
+ xmalloc (sizeof (struct target_stack_item));
tmp->next = cur;
tmp->target_ops = t;
{
struct target_stack_item *cur, *prev;
- t->to_close (0); /* Let it clean up */
+ if (t->to_close)
+ t->to_close (0); /* Let it clean up */
/* Look for the specified target. Note that we assume that a target
can only occur once in the target stack. */
for (item = target_stack; item; item = item->next)
{
t = item->target_ops;
+ if (!t->to_has_memory)
+ continue;
res = t->to_xfer_memory (memaddr, myaddr, curlen, write, t);
if (res > 0)
{
t = item->target_ops;
+ if (!t->to_has_memory)
+ continue;
+
if ((int)(t->to_stratum) <= (int)dummy_stratum)
continue;
if (has_all_mem)