+2011-07-01 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (cb_linux_stat_map_32, cb_linux_stat_map_64): Rename from
+ stat_map_32 and stat_map_64.
+ (cb_libgloss_stat_map_32): New stat map.
+ (stat_map_32, stat_map_64): New stat map pointers.
+ (bfin_user_init): Assign stat_map_32 to cb_linux_stat_map_32 and
+ stat_map_64 to cb_linux_stat_map_64.
+ (bfin_virtual_init): New function.
+ (sim_create_inferior): Call bfin_virtual_init for all other envs.
+
2011-06-22 Mike Frysinger <vapier@gentoo.org>
* interp.c (bfin_syscall): Delete old comment. Set dreg 1 to
# define setgid(gid) -1
#endif
-static const char stat_map_32[] =
+static const char cb_linux_stat_map_32[] =
/* Linux kernel 32bit layout: */
"st_dev,2:space,2:st_ino,4:st_mode,2:st_nlink,2:st_uid,2:st_gid,2:st_rdev,2:"
"space,2:st_size,4:st_blksize,4:st_blocks,4:st_atime,4:st_atimensec,4:"
"st_rdev,8:space,2:space,2:st_size,4:st_blksiez,4:st_blocks,4:st_atime,4:"
"st_atimensec,4:st_mtime,4:st_mtimensec,4:st_ctime,4:st_ctimensec,4:space,4:"
"space,4"; */
-static const char stat_map_64[] =
+static const char cb_linux_stat_map_64[] =
"st_dev,8:space,4:space,4:st_mode,4:st_nlink,4:st_uid,4:st_gid,4:st_rdev,8:"
"space,4:st_size,8:st_blksize,4:st_blocks,8:st_atime,4:st_atimensec,4:"
"st_mtime,4:st_mtimensec,4:st_ctime,4:st_ctimensec,4:st_ino,8";
+static const char cb_libgloss_stat_map_32[] =
+"st_dev,2:st_ino,2:st_mode,4:st_nlink,2:st_uid,2:st_gid,2:st_rdev,2:"
+"st_size,4:st_atime,4:space,4:st_mtime,4:space,4:st_ctime,4:"
+"space,4:st_blksize,4:st_blocks,4:space,8";
+static const char *stat_map_32, *stat_map_64;
/* Count the number of arguments in an argv. */
static int
cb->errno_map = cb_linux_errno_map;
cb->open_map = cb_linux_open_map;
cb->signal_map = cb_linux_signal_map;
- cb->stat_map = stat_map_32;
+ cb->stat_map = stat_map_32 = cb_linux_stat_map_32;
+ stat_map_64 = cb_linux_stat_map_64;
}
static void
sim_write (sd, cmdline, &byte, 1);
}
+static void
+bfin_virtual_init (SIM_DESC sd, SIM_CPU *cpu)
+{
+ host_callback *cb = STATE_CALLBACK (sd);
+
+ cb->stat_map = stat_map_32 = cb_libgloss_stat_map_32;
+ stat_map_64 = NULL;
+}
+
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
char **argv, char **env)
bfin_os_init (sd, cpu, (void *)argv);
break;
default:
- /* Nothing to do for virtual/all envs. */
+ bfin_virtual_init (sd, cpu);
break;
}