sim: cris: override getpid callback
authorMike Frysinger <vapier@gentoo.org>
Mon, 21 Jun 2021 03:42:20 +0000 (23:42 -0400)
committerMike Frysinger <vapier@gentoo.org>
Thu, 24 Jun 2021 00:10:08 +0000 (20:10 -0400)
The cris linux syscall layers assume getpid returns a constant,
so add a custom function to provide that.

sim/cris/ChangeLog
sim/cris/traps.c

index 78b106535ba81dd33957984d0eb4166352234094..1f4bd8bb3c30715343ccca7df74ed432496ab3f5 100644 (file)
@@ -1,3 +1,8 @@
+2021-06-23  Mike Frysinger  <vapier@gentoo.org>
+
+       * traps.c (cris_getpid): New function.
+       (cris_set_callbacks): Assign cris_getpid.
+
 2021-06-22  Mike Frysinger  <vapier@gentoo.org>
 
        * sim-if.c: Include sim-hw.h.
index f92bb7cdebe2b63d2bac51567ebedc0af2bb679d..fd7f9bc7ae29e7638aa28f2f076f57ab92dc6090 100644 (file)
@@ -3336,6 +3336,12 @@ cris_time (host_callback *cb ATTRIBUTE_UNUSED)
   return TARGET_TIME (current_cpu_for_cb_callback);
 }
 
+static int
+cris_getpid (host_callback *cb ATTRIBUTE_UNUSED)
+{
+  return TARGET_PID;
+}
+
 /* Set target-specific callback data. */
 
 void
@@ -3345,6 +3351,8 @@ cris_set_callbacks (host_callback *cb)
   cb->syscall_map = (CB_TARGET_DEFS_MAP *) syscall_map;
   cb->errno_map = (CB_TARGET_DEFS_MAP *) errno_map;
 
+  cb->getpid = cris_getpid;
+
   /* The kernel stat64 layout.  If we see a file > 2G, the "long"
      parameter to cb_store_target_endian will make st_size negative.
      Similarly for st_ino.  FIXME: Find a 64-bit type, and use it
This page took 0.02636 seconds and 4 git commands to generate.