{
device_property_entry *entry = find_property_entry(me, property);
TRACE(trace_devices,
- ("device_find_ihandle_runtime_property(me=0x%lx, property=%s)\n",
- (long)me, property));
+ ("device_find_ihandle_runtime_property(me=%p, property=%s)\n",
+ me, property));
if (entry == NULL
|| entry->value->type != ihandle_property
|| entry->value->disposition != permenant_object)
const device_property *node;
signed_cell integer;
TRACE(trace_devices,
- ("device_find_integer(me=0x%lx, property=%s)\n",
- (long)me, property));
+ ("device_find_integer(me=%p, property=%s)\n",
+ me, property));
node = device_find_property(me, property);
if (node == (device_property*)0
|| node->type != integer_property)
int sizeof_integer = sizeof(*integer);
signed_cell *cell;
TRACE(trace_devices,
- ("device_find_integer(me=0x%lx, property=%s)\n",
- (long)me, property));
+ ("device_find_integer(me=%p, property=%s)\n",
+ me, property));
/* check things sane */
node = device_find_property(me, property);
{
device_property_entry *master;
TRACE(trace_devices,
- ("device_add_duplicate_property(me=0x%lx, property=%s, ...)\n",
- (long)me, property));
+ ("device_add_duplicate_property(me=%p, property=%s, ...)\n",
+ me, property));
if (original->disposition != permenant_object)
device_error(me, "Can only duplicate permenant objects");
/* find the original's master */
if (chirp_read_t2h_args(&args, sizeof(args), 1, 1, data, processor, cia))
return -1;
phandle = external_to_device(data->root, args.phandle);
- TRACE(trace_os_emul, ("peer - in - phandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("peer - in - phandle=0x%lx(%p`%s')\n",
(unsigned long)args.phandle,
- (unsigned long)phandle,
+ phandle,
(phandle == NULL ? "" : device_name(phandle))));
/* find the peer */
if (args.phandle == 0) {
args.sibling_phandle = device_to_external(sibling_phandle);
}
/* write the arguments back out */
- TRACE(trace_os_emul, ("peer - out - sibling_phandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("peer - out - sibling_phandle=0x%lx(%p`%s')\n",
(unsigned long)args.sibling_phandle,
- (unsigned long)sibling_phandle,
+ sibling_phandle,
(sibling_phandle == NULL ? "" : device_name(sibling_phandle))));
chirp_write_h2t_args(&args,
sizeof(args),
if (chirp_read_t2h_args(&args, sizeof(args), 1, 1, data, processor, cia))
return -1;
phandle = external_to_device(data->root, args.phandle);
- TRACE(trace_os_emul, ("child - in - phandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("child - in - phandle=0x%lx(%p`%s')\n",
(unsigned long)args.phandle,
- (unsigned long)phandle,
+ phandle,
(phandle == NULL ? "" : device_name(phandle))));
/* find a child */
if (args.phandle == 0
args.child_phandle = device_to_external(child_phandle);
}
/* write the result out */
- TRACE(trace_os_emul, ("child - out - child_phandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("child - out - child_phandle=0x%lx(%p`%s')\n",
(unsigned long)args.child_phandle,
- (unsigned long)child_phandle,
+ child_phandle,
(child_phandle == NULL ? "" : device_name(child_phandle))));
chirp_write_h2t_args(&args,
sizeof(args),
if (chirp_read_t2h_args(&args, sizeof(args), 1, 1, data, processor, cia))
return -1;
phandle = external_to_device(data->root, args.phandle);
- TRACE(trace_os_emul, ("parent - in - phandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("parent - in - phandle=0x%lx(%p`%s')\n",
(unsigned long)args.phandle,
- (unsigned long)phandle,
+ phandle,
(phandle == NULL ? "" : device_name(phandle))));
/* find a parent */
if (args.phandle == 0
args.parent_phandle = device_to_external(parent_phandle);
}
/* return the result */
- TRACE(trace_os_emul, ("parent - out - parent_phandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("parent - out - parent_phandle=0x%lx(%p`%s')\n",
(unsigned long)args.parent_phandle,
- (unsigned long)parent_phandle,
+ parent_phandle,
(parent_phandle == NULL ? "" : device_name(parent_phandle))));
chirp_write_h2t_args(&args,
sizeof(args),
if (chirp_read_t2h_args(&args, sizeof(args), 1, 1, data, processor, cia))
return -1;
ihandle = external_to_device_instance(data->root, args.ihandle);
- TRACE(trace_os_emul, ("instance-to-package - in - ihandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("instance-to-package - in - ihandle=0x%lx(%p`%s')\n",
(unsigned long)args.ihandle,
- (unsigned long)ihandle,
+ ihandle,
ihandle_name(ihandle)));
/* find the corresponding phandle */
if (ihandle == NULL) {
args.phandle = device_to_external(phandle);
}
/* return the result */
- TRACE(trace_os_emul, ("instance-to-package - out - phandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("instance-to-package - out - phandle=0x%lx(%p`%s')\n",
(unsigned long)args.phandle,
- (unsigned long)phandle,
+ phandle,
(phandle == NULL ? "" : device_name(phandle))));
chirp_write_h2t_args(&args,
sizeof(args),
args.name,
sizeof(name),
processor, cia);
- TRACE(trace_os_emul, ("getproplen - in - phandle=0x%lx(0x%lx`%s') name=`%s'\n",
+ TRACE(trace_os_emul, ("getproplen - in - phandle=0x%lx(%p`%s') name=`%s'\n",
(unsigned long)args.phandle,
- (unsigned long)phandle,
+ phandle,
(phandle == NULL ? "" : device_name(phandle)),
name));
/* find our prop and get its length */
args.name,
sizeof(name),
processor, cia);
- TRACE(trace_os_emul, ("getprop - in - phandle=0x%lx(0x%lx`%s') name=`%s' buf=0x%lx buflen=%ld\n",
+ TRACE(trace_os_emul, ("getprop - in - phandle=0x%lx(%p`%s') name=`%s' buf=0x%lx buflen=%ld\n",
(unsigned long)args.phandle,
- (unsigned long)phandle,
+ phandle,
(phandle == NULL ? "" : device_name(phandle)),
name,
(unsigned long)args.buf,
device_find_string_property(phandle, name)));
break;
case ihandle_property:
- TRACE(trace_os_emul, ("getprop - ihandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("getprop - ihandle=0x%lx(%p`%s')\n",
(unsigned long)BE2H_cell(*(unsigned_cell*)prop->array),
- (unsigned long)device_find_ihandle_property(phandle, name),
+ device_find_ihandle_property(phandle, name),
ihandle_name(device_find_ihandle_property(phandle, name))));
break;
default:
/* If previous is NULL, make it look like the empty string. The
next property after the empty string is the first property. */
strcpy (previous, "");
- TRACE(trace_os_emul, ("nextprop - in - phandle=0x%lx(0x%lx`%s') previous=`%s' buf=0x%lx\n",
+ TRACE(trace_os_emul, ("nextprop - in - phandle=0x%lx(%p`%s') previous=`%s' buf=0x%lx\n",
(unsigned long)args.phandle,
- (unsigned long)phandle,
+ phandle,
(phandle == NULL ? "" : device_name(phandle)),
previous,
(unsigned long)args.buf));
else
args.phandle = device_to_external(phandle);
/* return its phandle */
- TRACE(trace_os_emul, ("finddevice - out - phandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("finddevice - out - phandle=0x%lx(%p`%s')\n",
(unsigned long)args.phandle,
- (unsigned long)phandle,
+ phandle,
(phandle == NULL ? "" : device_name(phandle))));
chirp_write_h2t_args(&args,
sizeof(args),
if (chirp_read_t2h_args(&args, sizeof(args), 3, 1, data, processor, cia))
return -1;
ihandle = external_to_device_instance(data->root, args.ihandle);
- TRACE(trace_os_emul, ("instance-to-path - in - ihandle=0x%lx(0x%lx`%s') buf=0x%lx buflen=%ld\n",
+ TRACE(trace_os_emul, ("instance-to-path - in - ihandle=0x%lx(%p`%s') buf=0x%lx buflen=%ld\n",
(unsigned long)args.ihandle,
- (unsigned long)ihandle,
+ ihandle,
ihandle_name(ihandle),
(unsigned long)args.buf,
(unsigned long)args.buflen));
if (chirp_read_t2h_args(&args, sizeof(args), 3, 1, data, processor, cia))
return -1;
phandle = external_to_device(data->root, args.phandle);
- TRACE(trace_os_emul, ("package-to-path - in - phandle=0x%lx(0x%lx`%s') buf=0x%lx buflen=%ld\n",
+ TRACE(trace_os_emul, ("package-to-path - in - phandle=0x%lx(%p`%s') buf=0x%lx buflen=%ld\n",
(unsigned long)args.phandle,
- (unsigned long)phandle,
+ phandle,
(phandle == NULL ? "" : device_name(phandle)),
(unsigned long)args.buf,
(unsigned long)args.buflen));
n_stack_returns = data->n_returns - 1;
stack_catch_result = n_stack_args;
stack_returns = stack_catch_result + 1;
- TRACE(trace_os_emul, ("call-method - in - n_args=%ld n_returns=%ld method=`%s' ihandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("call-method - in - n_args=%ld n_returns=%ld method=`%s' ihandle=0x%lx(%p`%s')\n",
(unsigned long)data->n_args,
(unsigned long)data->n_returns,
method,
(unsigned long)args.ihandle,
- (unsigned long)ihandle,
+ ihandle,
ihandle_name(ihandle)));
/* see if we can emulate this method */
if (ihandle == NULL) {
else
args.ihandle = device_instance_to_external(ihandle);
/* return the ihandle result */
- TRACE(trace_os_emul, ("open - out - ihandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("open - out - ihandle=0x%lx(%p`%s')\n",
(unsigned long)args.ihandle,
- (unsigned long)ihandle,
+ ihandle,
ihandle_name(ihandle)));
chirp_write_h2t_args(&args,
sizeof(args),
if (chirp_read_t2h_args(&args, sizeof(args), 1, 0, data, processor, cia))
return -1;
ihandle = external_to_device_instance(data->root, args.ihandle);
- TRACE(trace_os_emul, ("close - in - ihandle=0x%lx(0x%lx`%s')\n",
+ TRACE(trace_os_emul, ("close - in - ihandle=0x%lx(%p`%s')\n",
(unsigned long)args.ihandle,
- (unsigned long)ihandle,
+ ihandle,
ihandle_name(ihandle)));
/* close the device */
if (ihandle == NULL) {
if (chirp_read_t2h_args(&args, sizeof(args), 3, 1, data, processor, cia))
return -1;
ihandle = external_to_device_instance(data->root, args.ihandle);
- TRACE(trace_os_emul, ("read - in - ihandle=0x%lx(0x%lx`%s') addr=0x%lx len=%ld\n",
+ TRACE(trace_os_emul, ("read - in - ihandle=0x%lx(%p`%s') addr=0x%lx len=%ld\n",
(unsigned long)args.ihandle,
- (unsigned long)ihandle,
+ ihandle,
ihandle_name(ihandle),
(unsigned long)args.addr,
(unsigned long)args.len));
processor, cia);
buf[actual] = '\0';
ihandle = external_to_device_instance(data->root, args.ihandle);
- TRACE(trace_os_emul, ("write - in - ihandle=0x%lx(0x%lx`%s') `%s' (%ld)\n",
+ TRACE(trace_os_emul, ("write - in - ihandle=0x%lx(%p`%s') `%s' (%ld)\n",
(unsigned long)args.ihandle,
- (unsigned long)ihandle,
+ ihandle,
ihandle_name(ihandle),
buf, (long)actual));
if (ihandle == NULL) {
if (chirp_read_t2h_args(&args, sizeof(args), 3, 1, data, processor, cia))
return -1;
ihandle = external_to_device_instance(data->root, args.ihandle);
- TRACE(trace_os_emul, ("seek - in - ihandle=0x%lx(0x%lx`%s') pos.hi=0x%lx pos.lo=0x%lx\n",
+ TRACE(trace_os_emul, ("seek - in - ihandle=0x%lx(%p`%s') pos.hi=0x%lx pos.lo=0x%lx\n",
(unsigned long)args.ihandle,
- (unsigned long)ihandle,
+ ihandle,
ihandle_name(ihandle),
(unsigned long)args.pos_hi,
(unsigned long)args.pos_lo));
event != NULL;
event = event->next, i++)
{
- TRACE(trace_events, ("event time-from-event - time %ld, delta %ld - event %d, tag 0x%lx, time %ld, handler 0x%lx, data 0x%lx\n",
- (long)current_time,
- (long)events->time_from_event,
+ TRACE(trace_events, ("event time-from-event - time %" PRIi64 ", delta %ld - event %d, tag %p, time %" PRIi64 ", handler %p, data %p\n",
+ current_time,
+ events->time_from_event,
i,
- (long)event,
- (long)event->time_of_event,
- (long)event->handler,
- (long)event->data));
+ event,
+ event->time_of_event,
+ event->handler,
+ event->data));
}
}
ASSERT(current_time == event_queue_time(events));
new_event->data = data;
new_event->handler = handler;
insert_event_entry(events, new_event, delta_time);
- TRACE(trace_events, ("event scheduled at %ld - tag 0x%lx - time %ld, handler 0x%lx, data 0x%lx\n",
- (long)event_queue_time(events),
- (long)new_event,
- (long)new_event->time_of_event,
- (long)new_event->handler,
- (long)new_event->data));
+ TRACE(trace_events, ("event scheduled at %" PRIi64 " - tag %p - time %" PRIi64 ", handler %p, data %p\n",
+ event_queue_time(events),
+ new_event,
+ new_event->time_of_event,
+ new_event->handler,
+ new_event->data));
return (event_entry_tag)new_event;
}
#endif
}
- TRACE(trace_events, ("event scheduled at %ld - tag 0x%lx - time %ld, handler 0x%lx, data 0x%lx\n",
- (long)event_queue_time(events),
- (long)new_event,
- (long)new_event->time_of_event,
- (long)new_event->handler,
- (long)new_event->data));
+ TRACE(trace_events, ("event scheduled at %" PRIi64 " - tag %p - time %" PRIi64 ", handler %p, data %p\n",
+ event_queue_time(events),
+ new_event,
+ new_event->time_of_event,
+ new_event->handler,
+ new_event->data));
return (event_entry_tag)new_event;
}
ptr_to_current = ¤t->next, current = *ptr_to_current);
if (current == to_remove) {
*ptr_to_current = current->next;
- TRACE(trace_events, ("event descheduled at %ld - tag 0x%lx - time %ld, handler 0x%lx, data 0x%lx\n",
- (long)event_queue_time(events),
- (long)event_to_remove,
- (long)current->time_of_event,
- (long)current->handler,
- (long)current->data));
+ TRACE(trace_events, ("event descheduled at %" PRIi64 " - tag %p - time %" PRIi64 ", handler %p, data %p\n",
+ event_queue_time(events),
+ event_to_remove,
+ current->time_of_event,
+ current->handler,
+ current->data));
free(current);
update_time_from_event(events);
}
else {
- TRACE(trace_events, ("event descheduled at %ld - tag 0x%lx - not found\n",
- (long)event_queue_time(events),
- (long)event_to_remove));
+ TRACE(trace_events, ("event descheduled at %" PRIi64 " - tag %p - not found\n",
+ event_queue_time(events),
+ event_to_remove));
}
}
ASSERT((events->time_from_event >= 0) == (events->queue != NULL));
event_handler *handler = to_do->handler;
void *data = to_do->data;
events->queue = to_do->next;
- TRACE(trace_events, ("event issued at %ld - tag 0x%lx - time %ld, handler 0x%lx, data 0x%lx\n",
- (long)event_time,
- (long)to_do,
- (long)to_do->time_of_event,
- (long)handler,
- (long)data));
+ TRACE(trace_events, ("event issued at %" PRIi64 " - tag %p - time %" PRIi64 ", handler %p, data %p\n",
+ event_time,
+ to_do,
+ to_do->time_of_event,
+ handler,
+ data));
free(to_do);
/* Always re-compute the time to the next event so that HANDLER()
can safely insert new events into the queue. */
if (simulator == NULL || regname == NULL)
return -1;
- TRACE(trace_gdb, ("sim_fetch_register(regno=%d(%s), buf=0x%lx)\n",
- regno, regname, (long)buf));
+ TRACE(trace_gdb, ("sim_fetch_register(regno=%d(%s), buf=%p)\n",
+ regno, regname, buf));
return psim_read_register(simulator, MAX_NR_PROCESSORS,
buf, regname, raw_transfer);
}
if (simulator == NULL || regname == NULL)
return 0;
- TRACE(trace_gdb, ("sim_store_register(regno=%d(%s), buf=0x%lx)\n",
- regno, regname, (long)buf));
+ TRACE(trace_gdb, ("sim_store_register(regno=%d(%s), buf=%p)\n",
+ regno, regname, buf));
return psim_write_register(simulator, MAX_NR_PROCESSORS,
buf, regname, raw_transfer);
}
unsigned_word end_arg)
{
DTRACE(stack,
- ("write_stack_arguments(device=%s, arg=0x%lx, start_block=0x%lx, end_block=0x%lx, start_arg=0x%lx, end_arg=0x%lx)\n",
- device_name(me), (long)arg, (long)start_block, (long)end_block, (long)start_arg, (long)end_arg));
+ ("write_stack_arguments(device=%s, arg=%p, start_block=0x%lx, end_block=0x%lx, start_arg=0x%lx, end_arg=0x%lx)\n",
+ device_name(me), arg, (long)start_block, (long)end_block, (long)start_arg, (long)end_arg));
if (arg == NULL)
device_error(me, "Attempt to write a null array onto the stack\n");
/* only copy in arguments, memory is already zero */
char **envp = va_arg(ap, char **);
const char *stack_type;
DTRACE(stack,
- ("stack_ioctl_callback(me=0x%lx:%s processor=0x%lx cia=0x%lx argv=0x%lx envp=0x%lx)\n",
- (long)me, device_name(me),
- (long)processor,
+ ("stack_ioctl_callback(me=%p:%s processor=%p cia=0x%lx argv=%p envp=%p)\n",
+ me, device_name(me),
+ processor,
(long)cia,
- (long)argv,
- (long)envp));
+ argv,
+ envp));
stack_type = device_find_string_property(me, "stack-type");
if (strcmp(stack_type, "ppc-elf") == 0)
create_ppc_elf_stack_frame(me, stack_pointer, argv, envp);
#endif
default:
- printf_filtered("psim_read_register(processor=0x%lx,buf=0x%lx,reg=%s) %s\n",
- (unsigned long)processor, (unsigned long)buf, reg,
- "read of this register unimplemented");
+ printf_filtered("psim_read_register(processor=%p,buf=%p,reg=%s) %s\n",
+ processor, buf, reg, "read of this register unimplemented");
break;
}
#endif
default:
- printf_filtered("psim_write_register(processor=0x%lx,cooked_buf=0x%lx,reg=%s) %s\n",
- (unsigned long)processor, (unsigned long)cooked_buf, reg,
+ printf_filtered("psim_write_register(processor=%p,cooked_buf=%p,reg=%s) %s\n",
+ processor, cooked_buf, reg,
"read of this register unimplemented");
break;
{
int result = psim_read_memory(simulator, MAX_NR_PROCESSORS,
buf, mem, length);
- TRACE(trace_gdb, ("sim_read(mem=0x%lx, buf=0x%lx, length=%d) = %d\n",
- (long)mem, (long)buf, length, result));
+ TRACE(trace_gdb, ("sim_read(mem=0x%lx, buf=%p, length=%d) = %d\n",
+ (long)mem, buf, length, result));
return result;
}
int result = psim_write_memory(simulator, MAX_NR_PROCESSORS,
buf, mem, length,
1/*violate_ro*/);
- TRACE(trace_gdb, ("sim_write(mem=0x%lx, buf=0x%lx, length=%d) = %d\n",
- (long)mem, (long)buf, length, result));
+ TRACE(trace_gdb, ("sim_write(mem=0x%lx, buf=%p, length=%d) = %d\n",
+ (long)mem, buf, length, result));
return result;
}
break;
}
- TRACE(trace_gdb, ("sim_stop_reason(reason=0x%lx(%ld), sigrc=0x%lx(%ld))\n",
- (long)reason, (long)*reason, (long)sigrc, (long)*sigrc));
+ TRACE(trace_gdb, ("sim_stop_reason(reason=%p(%ld), sigrc=%p(%ld))\n",
+ reason, (long)*reason, sigrc, (long)*sigrc));
}
tree_init(device *root,
psim *system)
{
- TRACE(trace_device_tree, ("tree_init(root=0x%lx, system=0x%lx)\n",
- (long)root,
- (long)system));
+ TRACE(trace_device_tree, ("tree_init(root=%p, system=%p)\n",
+ root,
+ system));
/* remove the old, rebuild the new */
tree_traverse(root, device_clean, NULL, system);
tree_traverse(root, device_init_static_properties, NULL, system);
== segment_tlb_entry->masked_virtual_segment_id)
&& (page_tlb_entry->masked_page
== om_ea_masked_page(ea))) {
- TRACE(trace_vm, ("ea=0x%lx - tlb hit - tlb=0x%lx\n",
- (long)ea, (long)page_tlb_entry));
+ TRACE(trace_vm, ("ea=0x%lx - tlb hit - tlb=%p\n",
+ (long)ea, page_tlb_entry));
return page_tlb_entry;
}
pte_1 | BIT(55),
processor, cia);
TRACE(trace_vm,
- ("ea=0x%lx - htab hit - set ref - tlb=0x%lx &pte1=0x%lx\n",
- (long)ea, (long)page_tlb_entry, (long)real_address_of_pte_1));
+ ("ea=0x%lx - htab hit - set ref - tlb=%p &pte1=0x%lx\n",
+ (long)ea, page_tlb_entry, (long)real_address_of_pte_1));
}
else {
TRACE(trace_vm,
- ("ea=0x%lx - htab hit - tlb=0x%lx &pte1=0x%lx\n",
- (long)ea, (long)page_tlb_entry, (long)real_address_of_pte_1));
+ ("ea=0x%lx - htab hit - tlb=%p &pte1=0x%lx\n",
+ (long)ea, page_tlb_entry, (long)real_address_of_pte_1));
}
return page_tlb_entry;
}
page_tlb_entry->real_address_of_pte_1,
pte_1 | BIT(56),
processor, cia);
- TRACE(trace_vm, ("ea=0x%lx - set change bit - tlb=0x%lx &pte1=0x%lx\n",
- (long)ea, (long)page_tlb_entry,
+ TRACE(trace_vm, ("ea=0x%lx - set change bit - tlb=%p &pte1=0x%lx\n",
+ (long)ea, page_tlb_entry,
(long)page_tlb_entry->real_address_of_pte_1));
}