+2011-02-14 Mike Frysinger <vapier@gentoo.org>
+
+ * hw-alloc.c (hw_alloc_data): Delete zalloc_p.
+ (hw_zalloc, hw_malloc): Delete zalloc_p reference.
+ (hw_free): Drop zfree logic and always call free.
+ * hw-base.c (hw_delete): Change zfree to free.
+ * hw-handles.c (hw_handle_remove_ihandle): Likewise.
+ (hw_handle_remove_phandle): Likewise.
+ * hw-instances.c (hw_instance_delete): Likewise.
+ * hw-tree.c (parse_reg_property): Likewise.
+ (parse_ranges_property): Likewise.
+ (parse_string_property): Likewise.
+ * sim-core.c (sim_core_uninstall): Likewise.
+ * sim-cpu.c (sim_cpu_free_all): Likewise.
+ * sim-hw.c (sim_hw_uninstall): Likewise.
+ * sim-memopt.c (do_memopt_delete): Likewise.
+ (sim_memory_uninstall): Likewise.
+ * sim-module.c (sim_module_uninstall): Likewise.
+ * sim-options.c (sim_parse_args): Likewise.
+ * sim-profile.c (profile_pc_cleanup): Likewise.
+ (profile_uninstall): Likewise.
+ * sim-watch.c (do_watchpoint_delete): Likewise.
+ * sim-utils.c (zfree): Delete.
+ (sim_state_free): Change zfree to free.
+ * sim-utils.h (zfree): Delete.
+
2011-02-13 Mike Frysinger <vapier@gentoo.org>
* sim-events.h (_sim_events.time_from_event): Change type to signed64.
struct hw_alloc_data {
void *alloc;
- int zalloc_p;
struct hw_alloc_data *next;
};
{
struct hw_alloc_data *memory = ZALLOC (struct hw_alloc_data);
memory->alloc = zalloc (size);
- memory->zalloc_p = 1;
memory->next = me->alloc_of_hw;
me->alloc_of_hw = memory;
return memory->alloc;
{
struct hw_alloc_data *memory = ZALLOC (struct hw_alloc_data);
memory->alloc = zalloc (size);
- memory->zalloc_p = 0;
memory->next = me->alloc_of_hw;
me->alloc_of_hw = memory;
return memory->alloc;
{
struct hw_alloc_data *die = (*memory);
(*memory) = die->next;
- if (die->zalloc_p)
- zfree (die->alloc);
- else
- free (die->alloc);
- zfree (die);
+ free (die->alloc);
+ free (die);
return;
}
}
delete_hw_alloc_data (me);
/* finally */
- zfree (me);
+ free (me);
}
void
{
struct hw_handle_mapping *delete = *current_map;
*current_map = delete->next;
- zfree (delete);
+ free (delete);
return;
}
current_map = &(*current_map)->next;
{
struct hw_handle_mapping *delete = *current_map;
*current_map = delete->next;
- zfree (delete);
+ free (delete);
return;
}
current_map = &(*current_map)->next;
hw_abort (me, "no delete method");
instance->method->delete(instance);
if (instance->args != NULL)
- zfree (instance->args);
+ free (instance->args);
if (instance->path != NULL)
- zfree (instance->path);
+ free (instance->path);
if (instance->child == NULL)
{
/* only remove leaf nodes */
instance->child->parent = NULL;
}
cap_remove (me->ihandles, instance);
- zfree (instance);
+ free (instance);
#endif
}
hw_add_reg_array_property (current, property_name,
regs, nr_regs);
- zfree (regs);
+ free (regs);
}
/* create it */
hw_add_range_array_property (current, property_name, ranges, nr_ranges);
- zfree (ranges);
+ free (ranges);
}
while (nr_strings > 0)
{
nr_strings--;
- zfree (strings[nr_strings]);
+ free (strings[nr_strings]);
}
- zfree(strings);
+ free(strings);
}
curr = curr->next;
if (tbd->free_buffer != NULL) {
SIM_ASSERT(tbd->buffer != NULL);
- zfree(tbd->free_buffer);
+ free(tbd->free_buffer);
}
- zfree(tbd);
+ free(tbd);
}
core->common.map[map].first = NULL;
}
sim_core_mapping *dead = (*entry);
(*entry) = dead->next;
if (dead->free_buffer != NULL)
- zfree (dead->free_buffer);
- zfree (dead);
+ free (dead->free_buffer);
+ free (dead);
return;
}
}
void
sim_cpu_free (sim_cpu *cpu)
{
- zfree (cpu);
+ free (cpu);
}
\f
/* PC utilities. */
sim_hw_uninstall (struct sim_state *sd)
{
hw_tree_delete (STATE_HW (sd)->tree);
- zfree (STATE_HW (sd));
+ free (STATE_HW (sd));
STATE_HW (sd) = NULL;
}
munmap ((*entry)->buffer, (*entry)->munmap_length);
else
#endif
- zfree ((*entry)->buffer);
+ free ((*entry)->buffer);
}
/* delete it and its aliases */
sim_memopt *dead = alias;
alias = alias->alias;
sim_core_detach (sd, NULL, dead->level, dead->space, dead->addr);
- zfree (dead);
+ free (dead);
}
return SIM_RC_OK;
}
munmap ((*entry)->buffer, (*entry)->munmap_length);
else
#endif
- zfree ((*entry)->buffer);
+ free ((*entry)->buffer);
}
/* delete it and its aliases */
sim_memopt *dead = alias;
alias = alias->alias;
sim_core_detach (sd, NULL, dead->level, dead->space, dead->addr);
- zfree (dead);
+ free (dead);
}
}
}
for (d = modules->init_list; d != NULL; d = n)
{
n = d->next;
- zfree (d);
+ free (d);
}
}
for (d = modules->resume_list; d != NULL; d = n)
{
n = d->next;
- zfree (d);
+ free (d);
}
}
for (d = modules->suspend_list; d != NULL; d = n)
{
n = d->next;
- zfree (d);
+ free (d);
}
}
for (d = modules->uninstall_list; d != NULL; d = n)
{
n = d->next;
- zfree (d);
+ free (d);
}
}
for (d = modules->info_list; d != NULL; d = n)
{
n = d->next;
- zfree (d);
+ free (d);
}
}
- zfree (modules);
+ free (modules);
STATE_MODULES (sd) = NULL;
}
}
}
- zfree (long_options);
- zfree (short_options);
- zfree (handlers);
- zfree (opt_cpu);
- zfree (orig_val);
+ free (long_options);
+ free (short_options);
+ free (handlers);
+ free (opt_cpu);
+ free (orig_val);
return result;
}
sim_cpu *cpu = STATE_CPU (sd, n);
PROFILE_DATA *data = CPU_PROFILE_DATA (cpu);
if (PROFILE_PC_COUNT (data) != NULL)
- zfree (PROFILE_PC_COUNT (data));
+ free (PROFILE_PC_COUNT (data));
PROFILE_PC_COUNT (data) = NULL;
if (PROFILE_PC_EVENT (data) != NULL)
sim_events_deschedule (sd, PROFILE_PC_EVENT (data));
}
if (PROFILE_INSN_COUNT (data) != NULL)
- zfree (PROFILE_INSN_COUNT (data));
+ free (PROFILE_INSN_COUNT (data));
}
}
return xcalloc (1, size);
}
-void
-zfree (void *data)
-{
- free (data);
-}
-
/* Allocate a sim_state struct. */
SIM_DESC
SIM_STATE_FREE (sd);
#endif
- zfree (sd);
+ free (sd);
}
/* Return a pointer to the cpu data for CPU_NAME, or NULL if not found. */
#define ZALLOC(TYPE) (TYPE*)zalloc(sizeof (TYPE))
#define NZALLOC(TYPE,N) (TYPE*)zalloc(sizeof (TYPE) * (N))
-void zfree(void*);
-
/* Turn VALUE into a string with commas. */
char *sim_add_commas (char *, int, unsigned long);
sim_watch_point *dead = (*entry);
(*entry) = (*entry)->next;
sim_events_deschedule (sd, dead->event);
- zfree (dead);
+ free (dead);
status = SIM_RC_OK;
}
else
+2011-02-14 Mike Frysinger <vapier@gentoo.org>
+
+ * table.c (table_push): Change zfree to free.
+
2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* config.in: Regenerate.
ff = fopen (dup_name, "rb");
if (ff)
break;
- /* zfree (dup_name); */
+ /* free (dup_name); */
if (include->next == NULL)
{
if (line != NULL)
+2011-02-14 Mike Frysinger <vapier@gentoo.org>
+
+ * iq2000.c (do_syscall): Change zfree to free.
+
2010-02-11 Doug Evans <dje@sebabeach.org>
* cpu.h, * decode.c, * model.c, * sem-switch.c, * sem.c: Regenerate.
SET_H_GR (ret_reg,
sim_io_write (CPU_STATE (current_cpu),
PARM1, buf, PARM3));
- zfree (buf);
+ free (buf);
break;
case SYS_lseek:
sim_io_read (CPU_STATE (current_cpu),
PARM1, buf, PARM3));
sim_write (CPU_STATE (current_cpu), CPU2DATA(PARM2), buf, PARM3);
- zfree (buf);
+ free (buf);
break;
case SYS_open:
SET_H_GR (ret_reg,
sim_io_open (CPU_STATE (current_cpu),
buf, PARM2));
- zfree (buf);
+ free (buf);
break;
case SYS_close:
+2011-02-14 Mike Frysinger <vapier@gentoo.org>
+
+ * dv-tx3904sio.c (tx3904sio_fifo_push): Change zfree to free.
+ (tx3904sio_fifo_reset): Likewise.
+ * interp.c (sim_monitor): Likewise.
+
2010-04-14 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_write): Add const to buffer arg.
char* next_buf = zalloc(next_size);
memcpy(next_buf, fifo->buffer, fifo->used);
- if(fifo->buffer != NULL) zfree(fifo->buffer);
+ if(fifo->buffer != NULL) free(fifo->buffer);
fifo->buffer = next_buf;
fifo->size = next_size;
}
/* HW_TRACE ((me, "reset fifo")); */
fifo->used = 0;
fifo->size = 0;
- zfree(fifo->buffer);
+ free(fifo->buffer);
fifo->buffer = 0;
}
{
char *path = fetch_str (sd, A0);
V0 = sim_io_open (sd, path, (int)A1);
- zfree (path);
+ free (path);
break;
}
char *buf = zalloc (nr);
V0 = sim_io_read (sd, fd, buf, nr);
sim_write (sd, A1, buf, nr);
- zfree (buf);
+ free (buf);
}
break;
sim_io_flush_stdout (sd);
else if (fd == 2)
sim_io_flush_stderr (sd);
- zfree (buf);
+ free (buf);
break;
}
+2011-02-14 Mike Frysinger <vapier@gentoo.org>
+
+ * cap.c (cap_remove): Change zfree to free.
+ * corefile.c (core_init): Likewise.
+ * device.c (detach_device_interrupt_edge): Likewise.
+ (clean_device_interrupt_edges): Likewise.
+ (device_instance_delete): Likewise.
+ (device_set_property): Likewise.
+ (clean_device_properties): Likewise.
+ (device_add_range_array_property): Likewise.
+ (device_add_reg_array_property): Likewise.
+ * emul_bugapi.c (emul_bugapi_do_read): Likewise.
+ (emul_bugapi_do_write)
+ * emul_netbsd.c (write_direntries): Likewise.
+ (do_read): Likewise.
+ (do_write): Likewise.
+ (do_getdirentries): Likewise.
+ * emul_unix.c (do_unix_read): Likewise.
+ (do_unix_write): Likewise.
+ * events.c (event_queue_init): Likewise.
+ (event_queue_deschedule): Likewise.
+ (event_queue_process): Likewise.
+ * hw_disk.c (open_disk_image): Likewise.
+ (hw_disk_instance_delete): Likewise.
+ * hw_eeprom.c (hw_eeprom_instance_delete): Likewise.
+ * hw_htab.c (htab_dma_binary): Likewise.
+ * hw_init.c (update_for_binary_section): Likewise.
+ * hw_memory.c (hw_memory_set_available): Likewise.
+ (hw_memory_init_address): Likewise.
+ (hw_memory_instance_release): Likewise.
+ * pk_disklabel.c (disklabel_delete): Likewise.
+ * table.c (table_push): Likewise.
+ * tree.c (parse_reg_property): Likewise.
+ (parse_ranges_property): Likewise.
+ (parse_string_property): Likewise.
+ * main.c (zfree): Delete.
+ * sim_calls.c (zfree): Likewise.
+ * sim_callbacks.h (zfree): Likewise.
+
2011-01-11 Andrew Burgess <aburgess@broadcom.com>
* gdb-sim.c (sim_store_register): Update return value to
if ((*current_map)->internal == internal) {
cap_mapping *delete = *current_map;
*current_map = delete->next;
- zfree(delete);
+ free(delete);
return;
}
current_map = &(*current_map)->next;
curr = curr->next;
if (tbd->free_buffer != NULL) {
ASSERT(tbd->buffer != NULL);
- zfree(tbd->free_buffer);
+ free(tbd->free_buffer);
}
- zfree(tbd);
+ free(tbd);
}
map->first = NULL;
}
if (old_edge->disposition == permenant_object)
device_error(me, "attempt to delete permenant interrupt");
*list = old_edge->next;
- zfree(old_edge);
+ free(old_edge);
return;
}
}
break;
case tempoary_object:
*list = old_edge->next;
- zfree(old_edge);
+ free(old_edge);
break;
}
}
device_error(me, "no delete method");
instance->callback->delete(instance);
if (instance->args != NULL)
- zfree(instance->args);
+ free(instance->args);
if (instance->path != NULL)
- zfree(instance->path);
+ free(instance->path);
if (instance->child == NULL) {
/* only remove leaf nodes */
device_instance **curr = &me->instances;
instance->child->parent = NULL;
}
cap_remove(me->ihandles, instance);
- zfree(instance);
+ free(instance);
}
INLINE_DEVICE\
device_error(me, "conflict between type of new and old value for property %s", property);
/* replace its value */
if (value->array != NULL)
- zfree((void*)value->array);
+ free((void*)value->array);
new_array = (sizeof_array > 0
? zalloc(sizeof_array)
: (void*)0);
/* zap the current value, will be initialized later */
ASSERT(current->init_array != NULL);
if (current->value->array != NULL) {
- zfree((void*)current->value->array);
+ free((void*)current->value->array);
current->value->array = NULL;
}
delete_point = &(*delete_point)->next;
ASSERT(current->init_array == NULL);
*delete_point = current->next;
if (current->value->array != NULL)
- zfree((void*)current->value->array);
- zfree(current->value);
- zfree(current);
+ free((void*)current->value->array);
+ free(current->value);
+ free(current);
break;
}
}
cells, sizeof_cells,
NULL, permenant_object);
- zfree(cells);
+ free(cells);
}
INLINE_DEVICE\
cells, sizeof_cells,
NULL, permenant_object);
- zfree(cells);
+ free(cells);
}
INLINE_DEVICE\
status--;
}
- zfree(scratch_buffer);
+ free(scratch_buffer);
return status;
}
/* write */
device_instance_write(bugapi->output, scratch_buffer, nbytes);
- zfree(scratch_buffer);
+ free(scratch_buffer);
}
if (suffix)
nbytes -= in->d_reclen;
addr += in->d_reclen;
buf += in->d_reclen;
- zfree(out);
+ free(out);
}
}
#endif
if (status > 0)
emul_write_buffer(scratch_buffer, buf, status, processor, cia);
- zfree(scratch_buffer);
+ free(scratch_buffer);
}
/* write */
status = write(d, scratch_buffer, nbytes);
emul_write_status(processor, status, errno);
- zfree(scratch_buffer);
+ free(scratch_buffer);
flush_stdoutput();
}
if (status > 0)
write_direntries(buf_addr, buf, status, processor, cia);
if (buf != NULL)
- zfree(buf);
+ free(buf);
}
#endif
if (status > 0)
emul_write_buffer(scratch_buffer, buf, status, processor, cia);
- zfree(scratch_buffer);
+ free(scratch_buffer);
}
/* write */
status = write(d, scratch_buffer, nbytes);
emul_write_status(processor, status, errno);
- zfree(scratch_buffer);
+ free(scratch_buffer);
flush_stdoutput();
}
while (event != NULL) {
event_entry *dead = event;
event = event->next;
- zfree(dead);
+ free(dead);
}
queue->held = NULL;
queue->held_end = &queue->held;
while (event != NULL) {
event_entry *dead = event;
event = event->next;
- zfree(dead);
+ free(dead);
}
queue->queue = NULL;
(long)current->time_of_event,
(long)current->handler,
(long)current->data));
- zfree(current);
+ free(current);
update_time_from_event(events);
}
else {
(long)to_do->time_of_event,
(long)handler,
(long)data));
- zfree(to_do);
+ free(to_do);
/* Always re-compute the time to the next event so that HANDLER()
can safely insert new events into the queue. */
update_time_from_event(events);
if (disk->image != NULL)
fclose(disk->image);
if (disk->name != NULL)
- zfree(disk->name);
+ free(disk->name);
disk->name = strdup(name);
disk->image = fopen(disk->name, disk->read_only ? "r" : "r+");
if (disk->image == NULL) {
hw_disk_instance *data = device_instance_data(instance);
DITRACE(disk, ("delete - instance=%ld\n",
(unsigned long)device_instance_to_external(instance)));
- zfree(data);
+ free(data);
}
static int
hw_eeprom_instance_delete(device_instance *instance)
{
hw_eeprom_instance *data = device_instance_data(instance);
- zfree(data);
+ free(data);
}
static int
1 /*violate_read_only*/)
!= section_size)
device_error(me, "broken dma transfer");
- zfree(section_init); /* only free if load */
+ free(section_init); /* only free if load */
}
/* create a memory map from a binaries virtual addresses to a copy of
1 /*violate_read_only*/)
!= section_size)
device_error(me, "broken transfer\n");
- zfree(section_init); /* only free if load */
+ free(section_init); /* only free if load */
}
}
}
/* update */
device_set_array_property(me, "available", available, sizeof_available);
- zfree(available);
+ free(available);
}
hw_memory_chunk *dead_chunk = curr_chunk;
curr_chunk = dead_chunk->next;
dead_chunk->next = NULL;
- zfree(dead_chunk);
+ free(dead_chunk);
}
}
ASSERT(chunk->address + chunk->size == delete->address);
chunk->size += delete->size;
chunk->next = delete->next;
- zfree(delete);
+ free(delete);
}
else {
chunk = chunk->next;
return memory;
}
-void
-zfree(void *chunk)
-{
- free(chunk);
-}
-
/* When a CNTRL-C occures, queue an event to shut down the simulation */
static RETSIGTYPE
{
disklabel *label = device_instance_data(instance);
device_instance_delete(label->raw_disk);
- zfree(label);
+ free(label);
}
#define ZALLOC(TYPE) (TYPE*)zalloc(sizeof (TYPE))
-void zfree(void*);
-
#endif
memset(memory, 0, size);
return memory;
}
-
-void zfree(void *data)
-{
- free(data);
-}
fd = open (dup_name, O_RDONLY, 0);
if (fd >= 0)
break;
- /* zfree (dup_name); */
+ /* free (dup_name); */
if (include->next == NULL)
{
error ("Problem opening file `%s'\n", file_name);
device_add_reg_array_property(current, property_name,
regs, nr_regs);
- zfree(regs);
+ free(regs);
}
/* create it */
device_add_range_array_property(current, property_name, ranges, nr_ranges);
- zfree(ranges);
+ free(ranges);
}
/* flush the created string */
while (nr_strings > 0) {
nr_strings--;
- zfree(strings[nr_strings]);
+ free(strings[nr_strings]);
}
- zfree(strings);
+ free(strings);
}
+2011-02-14 Mike Frysinger <vapier@gentoo.org>
+
+ * sh64.c (trap_handler): Change zfree to free.
+
2010-10-09 Alan Modra <amodra@gmail.com>
* sh-desc.h: Regenerate.
SET_H_GR (ret_reg,
sim_io_write (CPU_STATE (current_cpu),
PARM1, buf, PARM3));
- zfree (buf);
+ free (buf);
break;
case SYS_lseek:
sim_io_read (CPU_STATE (current_cpu),
PARM1, buf, PARM3));
sim_write (CPU_STATE (current_cpu), PARM2, buf, PARM3);
- zfree (buf);
+ free (buf);
break;
case SYS_open:
SET_H_GR (ret_reg,
sim_io_open (CPU_STATE (current_cpu),
buf, PARM2));
- zfree (buf);
+ free (buf);
break;
case SYS_close:
+2011-02-14 Mike Frysinger <vapier@gentoo.org>
+
+ * simops.c (OP_10007E0): Change zfree to free.
+
2011-01-11 Andrew Burgess <aburgess@broadcom.com>
* interp.c (sim_store_register): Update return value to
char **argv = fetch_argv (simulator, PARM2);
char **envp = fetch_argv (simulator, PARM3);
RETVAL = execve (path, argv, envp);
- zfree (path);
+ free (path);
freeargv (argv);
freeargv (envp);
break;
char *path = fetch_str (simulator, PARM1);
char **argv = fetch_argv (simulator, PARM2);
RETVAL = execv (path, argv);
- zfree (path);
+ free (path);
freeargv (argv);
break;
}
char *buf = zalloc (PARM3);
RETVAL = sim_io_read (simulator, PARM1, buf, PARM3);
sim_write (simulator, PARM2, buf, PARM3);
- zfree (buf);
+ free (buf);
break;
}
#endif
RETVAL = sim_io_write_stdout (simulator, buf, PARM3);
else
RETVAL = sim_io_write (simulator, PARM1, buf, PARM3);
- zfree (buf);
+ free (buf);
break;
}
#endif
{
char *buf = fetch_str (simulator, PARM1);
RETVAL = sim_io_open (simulator, buf, PARM2);
- zfree (buf);
+ free (buf);
break;
}
#endif
RETVAL = stat (path, &host_stat);
- zfree (path);
+ free (path);
buf = PARM2;
/* Just wild-assed guesses. */
{
char *path = fetch_str (simulator, PARM1);
RETVAL = chown (path, PARM2, PARM3);
- zfree (path);
+ free (path);
}
break;
#endif
{
char *path = fetch_str (simulator, PARM1);
RETVAL = chmod (path, PARM2);
- zfree (path);
+ free (path);
}
break;
#endif