summaryrefslogtreecommitdiff
path: root/sim/cris/sim-if.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year range in all GDB filesJoel Brobecker2018-01-021-1/+1
| | | | | | gdb/ChangeLog: Update copyright year range in all GDB files
* sim: use ARRAY_SIZE instead of ad-hoc sizeof calculationsMike Frysinger2017-02-131-2/+2
|
* update copyright year range in GDB filesJoel Brobecker2017-01-011-1/+1
| | | | | | | | | This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
* sim: sim_{create_inferior,open,parse_args}: constify argv/env slightlyMike Frysinger2016-01-061-3/+3
| | | | | | | 2016-01-03 Mike Frysinger <vapier@gentoo.org> * sim-options.c (sim_parse_args): Mark argv array const. * sim-options.h (sim_parse_args): Likewise.
* sim: parse_args: display getopt error ourselvesMike Frysinger2016-01-031-3/+1
| | | | | | Fix a long standing todo where we let getopt write directly to stderr when an invalid option is passed. Use the sim io funcs instead as they go through the filtered callbacks that gdb wants.
* sim: cris: use standard output helpersMike Frysinger2016-01-021-35/+8
| | | | | The sim-io module provides output helpers, so no need to define local ones anymore.
* sim: delete dead current_state globalsMike Frysinger2016-01-021-8/+0
| | | | | | | | | | | | | The global current_state handle to the current simulator state is a design idea that was half implemented, but never really cleaned up. The point was to have a global variable pointing to the state so that funcs could more quickly & easily access the state anywhere. We've instead moved in the direction of passing state around everywhere and don't have any intention of moving back. I also can't find any references to gdb using this variable, or to cgen related "dump_regs" functions, both of which were used in the comments related to this code.
* GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker2016-01-011-1/+1
| | | | | | gdb/ChangeLog: Update year range in copyright notice of all files.
* sim: cris/m68hc11: move default endian/alignment to configureMike Frysinger2015-12-301-6/+0
|
* sim: unify sim-hloadMike Frysinger2015-12-271-46/+0
| | | | | | | Pretty much all targets are using this module already, so add it to the common list of objects. The only oddball out here is cris and that's because it supports loading via an offset for all the phdrs. We drop support for that.
* sim: cris: do not pass cpu when writing memory during initMike Frysinger2015-12-261-5/+5
| | | | | | | | | | The point of passing down the cpu to core reads/writes is to signal which cpu is making the access. For system accesses (such as internal memory initialization), passing the cpu down doesn't make sense, and in the case of early init like cris, can cause crashes. Since the cpu isn't fully set up at this point, if the core code tries to access some fields (like the PC reg), it'll crash. While cris shouldn't be doing this setup here (it should be in the inferior stage), we'll deal with that later.
* sim: standardize sim_create_inferior handling of argv a bit moreMike Frysinger2015-12-261-5/+9
| | | | | | | | | | For targets that process argv in sim_create_inferior, improve the code: - provide more details in the comment - make the check for when to re-init more robust - clean out legacy sim_copy_argv code This will be cleaned up more in the future when we have a common inferior creation function, but at least help new ports get it right until then.
* sim: cris: migrate from WITH_DEVICES to WITH_HWMike Frysinger2015-12-251-12/+1
| | | | | | | | | | The cris port was using the device framework to handle two addresses when the --cris-900000xx flag was specified. That can be implemented using the newer hardware framework instead which allows us to drop the device logic entirely, as well as delete the tconfig.h file. Basically we create a new cris_900000xx device model and move the read logic out of devices.c and into that. The rest of the devices logic was callback to the hardware framework already.
* sim: cris: move option install to sim_openMike Frysinger2015-12-241-11/+7
| | | | | | We've moved custom option install for other targets to sim_open, so update cris too. It's the last one using MODULE_LIST, so we can drop that from the common code too.
* sim: sim-close: unify sim_close logicMike Frysinger2015-11-151-7/+0
| | | | | | | | | | | | | | | | Other than the nice advantage of all sims having to declare one fewer common function, this also fixes leakage in pretty much every sim. Many were not freeing any resources, and a few were inconsistent as to the ones they did. Now we have a single module that takes care of all the logic for us. Most of the non-cgen based ones could be deleted outright. The cgen ones required adding a callback to the arch-specific cleanup func. The few that still have close callbacks are to manage their internal state. We do not convert erc32, m32c, ppc, rl78, or rx as they do not use the common sim core.
* Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker2015-01-011-1/+1
| | | | | | gdb/ChangeLog: Update year range in copyright notice of all files.
* sim: constify prog_nameMike Frysinger2014-03-051-1/+1
| | | | | There's no need for the prog_name handed down to the core to be mutable, so add const markings to it and all the related funcs.
* Update Copyright year range in all files maintained by GDB.Joel Brobecker2014-01-011-1/+1
|
* Update years in copyright notice for the GDB files.Joel Brobecker2013-01-011-1/+1
| | | | | | | Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
* PR 14072Nick Clifton2012-05-191-0/+1
| | | | | | | | | | | | | | | | | | | | | * wrapper.c: Include config.h before system header files. * callback.c: Include config.h before system header files. * cgen-trace.c: Likewise. * cgen-utils.c: Likewise. * gentmap.c: Likewise. * sim-if.c: Include config.h before system header files. * compile.c: Include config.h before system header files. * sim-main.h: Likewise. * gdb-if.c: Include config.h before system header files. * load.c: Likewise. * syscalls.c: Likewise. * trace.c: Likewise. * interp.c: Include config.h before system header files.
* Copyright year update in most files of the GDB Project.Joel Brobecker2012-01-041-2/+1
| | | | | | gdb/ChangeLog: Copyright year update in most files of the GDB Project.
* sim: start a unified sim_do_commandMike Frysinger2011-07-051-7/+0
| | | | | | | | Since sim_do_command for many people simply calls sim_args_command, start a unified version of it. For people who handle their own options, they could switch to this by using sim_add_option_table instead. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* run copyright.sh for 2011.Joel Brobecker2011-01-011-1/+1
|
* Update copyright notices to add year 2010.Joel Brobecker2010-01-011-1/+1
|
* * cris/sim-if.c: Include errno.h.Hans-Peter Nilsson2009-01-181-5/+122
| | | | | | | | | | | | | | | | | | | (cris_start_address, cris_program_offset): New variables. (OPTION_CRIS_PROGRAM_OFFSET, OPTION_CRIS_STARTADDR): New option enums. (cris_options): New options --cris-program-offset and --cris-start-address. (cris_option_handler): Handle new options. (cris_program_offset_write, cris_set_section_offset_iterator) (cris_offset_sections, cris_offset_sections): New functions. (sim_load): Use cris_program_offset_write as function argument to cris_load_elf_file, not sim_write. (struct offsetinfo): New struct. (cris_handle_interpreter): Fix typo in comment. (sim_open): Call cris_offset_sections as soon as the bfd of the infile is available. Gate bfd validity checks on abfd non-NULL. (sim_create_inferior): Let cris_start_address when != -1 override other start-address choices.
* Update the copyright notice of some of the files I missedJoel Brobecker2009-01-141-1/+2
| | | | in the previous copyright update.
* * cris/sim-if.c (TARGET_AT_NULL, TARGET_AT_PHDR, TARGET_AT_PHENT)Hans-Peter Nilsson2009-01-031-23/+8
| | | | | | | | | | | (TARGET_AT_PHNUM, TARGET_AT_PAGESZ, TARGET_AT_BASE) (TARGET_AT_FLAGS, TARGET_AT_ENTRY, TARGET_AT_UID, TARGET_AT_EUID) (TARGET_AT_GID, TARGET_AT_EGID, TARGET_AT_HWCAP) (TARGET_AT_CLKTCK): Remove redundant macros. (AUX_ENT): Adjust to use standard ELF AT_* macros. (AUX_ENTF): Ditto. Remove always-0 middle argument. Update all callers. (sim_open): Also pass AT_SECURE.
* * cris/sim-if.c (sim_open): If sim_analyze_program fails, emitHans-Peter Nilsson2008-12-301-7/+5
| | | | | just a short CRIS-specific notice. Tweak the wording for a failing architecture test.
* * cris/Makefile.in (SIM_OBJS): Remove sim-hload.o.Hans-Peter Nilsson2008-12-301-43/+448
| | | | | | | | | | | | | | | | | | | | | | * cris/sim-if.c: Include elf-bfd.h. (struct progbounds): New members end_loadmem, start_nonloadmem. (xprintf, eprintf): New functions, copied from common/sim-load.c. (cris_load_elf_file, sim_load, cris_get_progbounds): New functions. (get_progbounds_iterator): Renamed from get_progbounds. Make static. Update head comment. Set new struct progbounds members. (exec_load_addr, interp_load_addr, interp_start_addr): New static variables. (aux_ent_phdr, aux_ent_phent, aux_ent_phnum, aux_ent_base) (aux_ent_entry, cris_write_interp, cris_handle_interpreter): New functions. (sim_open): New constant array auxv_entries. Rewrite AUX_ENT handling to use auxv_entries. Improve error message and checking for invalid programs. Use new variable abfd for the program instead of for each access reaching into sd to get it. (sim_create_inferior): If non-zero, use interp_start_addr instead of the program start address. (cris_disassemble_insn): Remove incorrect and unclear, supposedly stale comment. Always specify little-endian.
* Updated copyright notices for most files.Daniel Jacobowitz2008-01-011-1/+1
|
* Switch the license of all files explicitly copyright the FSFJoel Brobecker2007-08-241-5/+4
| | | | to GPLv3.
* Copyright updates for 2007.Daniel Jacobowitz2007-01-091-1/+1
|
* * cris/cris-sim.h (enum cris_unknown_syscall_action_type)Hans-Peter Nilsson2006-10-021-3/+27
| | | | | | | | | | | | | | (cris_unknown_syscall_action): Declare. * cris/sim-if.c (cris_unknown_syscall_action): Define. (cris_options): Add cris-unknown-syscall option. (cris_option_handler): Correct comment about and error message for invalid --cris-cycles argument. Handle --cris-unknown-syscall. * cris/traps.c: Include stdarg.h (cris_unknown_syscall): New function. (cris_break_13_handler): Instead of sim_io_eprintf and sim_engine_halt, call cris_unknown_syscall to handle more or less unknown syscalls. Adjust code as necessary to handle return value.
* * cris/dv-cris.c, cris/dv-rv.c, cris/rvdummy.c: New files.Hans-Peter Nilsson2006-04-031-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cris/Makefile.in (CONFIG_DEVICES): Remove redundant setting. (dv-cris.o, dv-rv.o rvdummy$(EXEEXT), rvdummy.o): New rules. (all): Depend on rvdummy$(EXEEXT). * cris/configure.ac: Call SIM_AC_OPTION_WARNINGS. Check for sys/socket.h and sys/select.h. Call SIM_AC_OPTION_HARDWARE, default off. * cris/configure: Regenerate. * cris/cris-sim.h (cris_have_900000xxif): Declare here. (enum cris_interrupt_type, crisv10deliver_interrupt) (crisv32deliver_interrupt: New declarations. * cris/cris-tmpl.c [WITH_HW] (MY (f_model_insn_after)): Call sim_events_tickn and set state-events member work_pending when it's time for the next event. [WITH_HW] (MY (f_specific_init)): Set CPU-model-specific interrupt-delivery function. * cris/crisv10f.c (MY (deliver_interrupt)): New function. * cris/crisv32f.c (MY (deliver_interrupt)): New function. * cris/devices.c: Include hw-device.h. (device_io_read_buffer) [WITH_HW]: Call hw_io_read_buffer. (device_io_write_buffer): Only perform 0x900000xx-functions if cris_have_900000xxif is nonzero. Else if WITH_HW defined, call hw_io_write_buffer. Add return 0 last in function. * cris/sim-if.c (cris_have_900000xxif): Now global. (sim_open) [WITH_HW]: Clear deliver_interrupt cpu member. Force "-model" option, effectively. * cris/sim-main.h (cris_interrupt_delivery_fn): New type. (struct _sim_cpu) [WITH_HW]: New member deliver_interrupt.
* * cris: New directory, simulator for Axis Communications CRISHans-Peter Nilsson2005-01-281-0/+590
including CRIS v32, CGEN-based. * configure.ac: Add corresponding configury. * configure: Regenerate.