sim: ppc: clean up printf format handling
authorMike Frysinger <vapier@gentoo.org>
Mon, 1 Nov 2021 03:32:26 +0000 (23:32 -0400)
committerMike Frysinger <vapier@gentoo.org>
Mon, 1 Nov 2021 03:49:13 +0000 (23:49 -0400)
Don't blindly cast every possible type to (long).  Change to the right
printf format specifier whether it be a 64-bit type or a pointer.

sim/ppc/device.c
sim/ppc/emul_chirp.c
sim/ppc/events.c
sim/ppc/gdb-sim.c
sim/ppc/hw_init.c
sim/ppc/psim.c
sim/ppc/sim_calls.c
sim/ppc/tree.c
sim/ppc/vm.c

index aa97e0bfdbf4f33c379395dac423f8e3c271f43c..47fa7518f7e8763054379e753362a977032850e3 100644 (file)
@@ -1034,8 +1034,8 @@ device_find_ihandle_runtime_property(device *me,
 {
   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)
@@ -1104,8 +1104,8 @@ device_find_integer_property(device *me,
   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)
@@ -1126,8 +1126,8 @@ device_find_integer_array_property(device *me,
   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);
@@ -1495,8 +1495,8 @@ device_add_duplicate_property(device *me,
 {
   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 */
index ed49169cc2385ea9cf01f4b46735a744162b937f..2c9316cf280be1113aed4794b5be7a1f75aa0c1a 100644 (file)
@@ -260,9 +260,9 @@ chirp_emul_peer(os_emul_data *data,
   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) {
@@ -281,9 +281,9 @@ chirp_emul_peer(os_emul_data *data,
       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),
@@ -309,9 +309,9 @@ chirp_emul_child(os_emul_data *data,
   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
@@ -327,9 +327,9 @@ chirp_emul_child(os_emul_data *data,
       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),
@@ -355,9 +355,9 @@ chirp_emul_parent(os_emul_data *data,
   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
@@ -373,9 +373,9 @@ chirp_emul_parent(os_emul_data *data,
       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),
@@ -401,9 +401,9 @@ chirp_emul_instance_to_package(os_emul_data *data,
   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) {
@@ -415,9 +415,9 @@ chirp_emul_instance_to_package(os_emul_data *data,
     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),
@@ -448,9 +448,9 @@ chirp_emul_getproplen(os_emul_data *data,
                   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 */
@@ -501,9 +501,9 @@ chirp_emul_getprop(os_emul_data *data,
                   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,
@@ -532,9 +532,9 @@ chirp_emul_getprop(os_emul_data *data,
                              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:
@@ -585,9 +585,9 @@ chirp_emul_nextprop(os_emul_data *data,
     /* 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));
@@ -728,9 +728,9 @@ chirp_emul_finddevice(os_emul_data *data,
   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),
@@ -759,9 +759,9 @@ chirp_emul_instance_to_path(os_emul_data *data,
   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));
@@ -809,9 +809,9 @@ chirp_emul_package_to_path(os_emul_data *data,
   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));
@@ -872,12 +872,12 @@ chirp_emul_call_method(os_emul_data *data,
   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) {
@@ -935,9 +935,9 @@ chirp_emul_open(os_emul_data *data,
   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),
@@ -961,9 +961,9 @@ chirp_emul_close(os_emul_data *data,
   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) {
@@ -1001,9 +1001,9 @@ chirp_emul_read(os_emul_data *data,
   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));
@@ -1093,9 +1093,9 @@ chirp_emul_write(os_emul_data *data,
                   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) {
@@ -1139,9 +1139,9 @@ chirp_emul_seek(os_emul_data *data,
   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));
index 130b28b6d2ab5f1e6699532cf6c474816dfd4d65..e40e1b4d56c5f38038e28a58421d6a9107d67714 100644 (file)
@@ -169,14 +169,14 @@ update_time_from_event(event_queue *events)
           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));
@@ -229,12 +229,12 @@ event_queue_schedule(event_queue *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;
 }
 
@@ -272,12 +272,12 @@ event_queue_schedule_after_signal(event_queue *events,
 #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;
 }
@@ -298,19 +298,19 @@ event_queue_deschedule(event_queue *events,
         ptr_to_current = &current->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));
@@ -386,12 +386,12 @@ event_queue_process(event_queue *events)
     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. */
index 7217d9c9c5276204949078c864c745f81d3bbaab..0025024eb03d6fec2c2b794630797f13496c68e1 100644 (file)
@@ -1276,8 +1276,8 @@ sim_fetch_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
   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);
 }
@@ -1291,8 +1291,8 @@ sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
   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);
 }
index e46643c9b49b186880a9154ee314a176f42386e7..3d58833bb3d40ac358fe7ac2bdc501b13ad849d5 100644 (file)
@@ -517,8 +517,8 @@ write_stack_arguments(device *me,
                      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 */
@@ -671,12 +671,12 @@ hw_stack_ioctl(device *me,
       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);
index e8c29fff46040e0d05f5081ca9894d124647935e..34291b40cf8f026c798f5f1961e8711b163d81bc 100644 (file)
@@ -882,9 +882,8 @@ psim_read_register(psim *system,
 #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;
 
   }
@@ -1070,8 +1069,8 @@ psim_write_register(psim *system,
 #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;
 
index ee9d123b1872bf0458b3494c4eb1619b95896d31..fbc327c94e0996abb56a2fa84904d97f4c26d664 100644 (file)
@@ -129,8 +129,8 @@ sim_read (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
 {
   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;
 }
 
@@ -141,8 +141,8 @@ sim_write (SIM_DESC sd, SIM_ADDR mem, const unsigned char *buf, int length)
   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;
 }
 
@@ -208,8 +208,8 @@ sim_stop_reason (SIM_DESC sd, enum sim_stop *reason, int *sigrc)
     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));
 }
 
 
index 5c35d32f3c5cfa691ea7938847f32fdb0a7b6a71..4df862bb2867ce55fe035ffc739276022f39c434 100644 (file)
@@ -392,9 +392,9 @@ INLINE_TREE\
 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);
index 00f5f55e537f3c9e8ffbec769609815b1493fa0f..b5ef75876973966c9aa249e3883870160b364253 100644 (file)
@@ -610,8 +610,8 @@ om_virtual_to_real(om_map *map,
        == 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;
   }
       
@@ -662,13 +662,13 @@ om_virtual_to_real(om_map *map,
                          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;
        }
@@ -798,8 +798,8 @@ om_translate_effective_to_real(om_map *map,
                  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));
   }