From: Mike Frysinger Date: Sat, 2 Jan 2016 16:11:09 +0000 (-0500) Subject: sim: cris: use standard output helpers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b3fbb288afd9071523b61b3222869cfed0f95ab8;p=binutils-gdb.git sim: cris: use standard output helpers The sim-io module provides output helpers, so no need to define local ones anymore. --- diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog index df428e7f774..1e28c12b937 100644 --- a/sim/cris/ChangeLog +++ b/sim/cris/ChangeLog @@ -1,3 +1,9 @@ +2016-01-02 Mike Frysinger + + * sim-if.c (xprintf, eprintf): Delete. + (cris_load_elf_file): Delete callback. Change xprintf to + sim_io_printf and eprintf to sim_io_eprintf. + 2016-01-02 Mike Frysinger * sim-if.c (current_state): Delete. diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c index cf680cf5136..ac4ab458240 100644 --- a/sim/cris/sim-if.c +++ b/sim/cris/sim-if.c @@ -229,32 +229,6 @@ cris_option_handler (SIM_DESC sd, sim_cpu *cpu ATTRIBUTE_UNUSED, int opt, return sim_profile_set_option (sd, "-model", PROFILE_MODEL_IDX, "on"); } -/* FIXME: Remove these, globalize those in sim-load.c, move elsewhere. */ - -static void -xprintf (host_callback *callback, const char *fmt, ...) -{ - va_list ap; - - va_start (ap, fmt); - - (*callback->vprintf_filtered) (callback, fmt, ap); - - va_end (ap); -} - -static void -eprintf (host_callback *callback, const char *fmt, ...) -{ - va_list ap; - - va_start (ap, fmt); - - (*callback->evprintf_filtered) (callback, fmt, ap); - - va_end (ap); -} - /* An ELF-specific simplified ../common/sim-load.c:sim_load_file, using the program headers, not sections, in order to make sure that the program headers themeselves are also loaded. The caller is @@ -267,7 +241,6 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write) int n_hdrs; int i; bfd_boolean verbose = STATE_OPEN_KIND (sd) == SIM_OPEN_DEBUG; - host_callback *callback = STATE_CALLBACK (sd); phdr = elf_tdata (abfd)->phdr; n_hdrs = elf_elfheader (abfd)->e_phnum; @@ -286,24 +259,24 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write) buf = xmalloc (phdr[i].p_filesz); if (verbose) - xprintf (callback, "Loading segment at 0x%lx, size 0x%lx\n", - lma, phdr[i].p_filesz); + sim_io_printf (sd, "Loading segment at 0x%lx, size 0x%lx\n", + lma, phdr[i].p_filesz); if (bfd_seek (abfd, phdr[i].p_offset, SEEK_SET) != 0 || (bfd_bread (buf, phdr[i].p_filesz, abfd) != phdr[i].p_filesz)) { - eprintf (callback, - "%s: could not read segment at 0x%lx, size 0x%lx\n", - STATE_MY_NAME (sd), lma, phdr[i].p_filesz); + sim_io_eprintf (sd, + "%s: could not read segment at 0x%lx, size 0x%lx\n", + STATE_MY_NAME (sd), lma, phdr[i].p_filesz); free (buf); return FALSE; } if (do_write (sd, lma, buf, phdr[i].p_filesz) != phdr[i].p_filesz) { - eprintf (callback, - "%s: could not load segment at 0x%lx, size 0x%lx\n", - STATE_MY_NAME (sd), lma, phdr[i].p_filesz); + sim_io_eprintf (sd, + "%s: could not load segment at 0x%lx, size 0x%lx\n", + STATE_MY_NAME (sd), lma, phdr[i].p_filesz); free (buf); return FALSE; }