aboutsummaryrefslogtreecommitdiff
path: root/sim/m32r/traps.c
AgeCommit message (Collapse)AuthorFilesLines
2024-01-12Update copyright year range in header of all files managed by GDBAndrew Burgess1-1/+1
This commit is the result of the following actions: - Running gdb/copyright.py to update all of the copyright headers to include 2024, - Manually updating a few files the copyright.py script told me to update, these files had copyright headers embedded within the file, - Regenerating gdbsupport/Makefile.in to refresh it's copyright date, - Using grep to find other files that still mentioned 2023. If these files were updated last year from 2022 to 2023 then I've updated them this year to 2024. I'm sure I've probably missed some dates. Feel free to fix them up as you spot them.
2024-01-10sim: m32r: fixup some of the int<->pointer castsMike Frysinger1-28/+53
The m32r trap code was written for a 32-bit Linux host (and really, one whose Linux ABI matched pretty exactly). This has lead to conversions between integers and pointers which breaks down hard on 64-bit hosts. Clean up some of the functions where possible to avoid unnecessary conversions, use uintptr_t to cast 32-bit target pointers to host pointers in some places, and just stub out a few functions that can't easily be salvaged currently when sizeof(void*) is not 32-bits. This is a bit ugly, but lets us enable warnings for the whole file.
2024-01-10sim: m32r: fix missing break statementMike Frysinger1-0/+1
The ftime syscall should not fallthrough to the sync syscall. Clearly the code was missing a break statement.
2024-01-10sim: m32r: migrate ftime() to clock_gettime()Mike Frysinger1-5/+8
The ftime() function has been deprecated since POSIX-1-2004, and removed in POSIX.1-2008. It's also been deprecated/removed in glibc since 2.33. POSIX has always said the function is not portable, and its return value, timezone, and dstflag fields are unspecified. Even if Linux/glibc & m32r had defined behavior, those aren't the host for the sim runtime. So let's stop using the function and switch to clock_gettime. gnulib already has detection support for it, and it's been around since at least POSIX-1-2004.
2024-01-10sim: m32r: cleanup unused variablesMike Frysinger1-3/+1
We've been building this file with -Wno-error, so clean up unused variable warnings.
2023-12-07sim: m32r: fix syslog callMike Frysinger1-1/+2
The function returns void, not int. We only pass one argument to syslog (the format), so use %s as the static format instead since the emulation layer doesn't handle passing additional arguments.
2023-12-07sim: m32r: include more glibc headers for the funcs we use [PR sim/29752]Mike Frysinger1-0/+5
Not exactly portable, but doesn't make the situation worse here, and fixes a lot of implicit function warnings. Bug: https://sourceware.org/PR29752
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker1-1/+1
This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
2022-12-23sim: m32r: move arch-specific settings to internal headerMike Frysinger1-0/+2
There's no need for these settings to be in sim-main.h which is shared with common/ sim code, so move it all out to the existing m32r-sim.h. Unfortunately, we can't yet drop the m32r-sim.h include from sim-main.h as many of the generated CGEN files refer only to sim-main.h. We'll have to improve the CGEN interface before we can make more progress, but this is at least a minor improvement.
2022-10-29sim/m32r: Initialize "list" variableTsukasa OI1-1/+1
The variable "list" is only initialized when arg1 > 0 and when arg1 == 0, an uninitialized value is passed to translate_endian_h2t function. Although this behavior is harmless, this commit adds initialization to avoid a GCC warning ("-Wmaybe-uninitialized").
2022-05-13sim: remove use of PTRAlan Modra1-2/+2
PTR will soon disappear from ansidecl.h. Remove uses in sim. Where a PTR cast is used in assignment or function args to a void* I've simply removed the unnecessary (in C) cast rather than replacing with (void *).
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker1-1/+1
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-10-31sim: drop unused targ-vals.h includesMike Frysinger1-1/+0
This is used in a few places where it's not needed. Drop the include to avoid the build-time generated header file as we move to drop it.
2021-08-22sim: m32r: add __linux__ hack for non-Linux hostsMike Frysinger1-0/+8
The m32r Linux syscall emulation logic assumes the host environment directly matches -- it's being run on 32-bit little endian Linux. This breaks building for non-Linux systems, so put all the code in __linux__ ifdef checks. This code needs a lot of love to make it work everywhere, but let's at least unbreak it for non-Linux hosts.
2021-07-01sim: m32r: reformat linux traps codeMike Frysinger1-1067/+1063
Do this as a sep commit to try and make the history easier to review.
2021-07-01sim: m32r: unify ELF & Linux traps logicMike Frysinger1-14/+1185
This makes the simulator work the same regardless of the target (bare metal m32r-elf or Linux m32r-linux-gnu) by unifying the traps code. It was mostly already the same with the only difference being support for trap #2 reserved for Linux syscalls. We can move that logic to runtime by checking the current environment operating mode instead.
2021-06-18sim: split sim-signal.h include outMike Frysinger1-0/+1
The sim-basics.h is too big and includes too many things. This leads to some arch's sim-main.h having circular loop issues with defs, and makes it hard to separate out common objects from arch-specific defs. By splitting up sim-basics.h and killing off sim-main.h, it'll make it easier to separate out the two.
2021-05-16sim: switch config.h usage to defs.hMike Frysinger1-0/+3
The defs.h header will take care of including the various config.h headers. For now, it's just config.h, but we'll add more when we integrate gnulib in. This header should be used instead of config.h, and should be the first include in every .c file. We won't rely on the old behavior where we expected files to include the port's sim-main.h which then includes the common sim-basics.h which then includes config.h. We have a ton of code that includes things before sim-main.h, and it sometimes needs to be that way. Creating a dedicated header avoids the ordering mess and implicit inclusion that shows up otherwise.
2021-04-08Add system includes in simTom Tromey1-0/+1
This updates various parts of the sim to include missing system headers. I made the includes unconditional, because other parts of the tree are already doing this. 2021-04-08 Tom Tromey <tom@tromey.com> * traps.c: Include stdlib.h. * cris-tmpl.c: Include stdlib.h. sim/erc32/ChangeLog 2021-04-08 Tom Tromey <tom@tromey.com> * func.c: Include sys/time.h. sim/frv/ChangeLog 2021-04-08 Tom Tromey <tom@tromey.com> * traps.c: Include stdlib.h. * registers.c: Include stdlib.h. * profile.c: Include stdlib.h. * memory.c: Include stdlib.h. * interrupts.c: Include stdlib.h. * frv.c: Include stdlib.h. * cache.c: Include stdlib.h. sim/iq2000/ChangeLog 2021-04-08 Tom Tromey <tom@tromey.com> * iq2000.c: Include stdlib.h. sim/m32r/ChangeLog 2021-04-08 Tom Tromey <tom@tromey.com> * traps.c: Include stdlib.h. * m32r.c: Include stdlib.h. sim/ppc/ChangeLog 2021-04-08 Tom Tromey <tom@tromey.com> * emul_unix.c: Include time.h.
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
This commit applies all changes made after running the gdb/copyright.py script. Note that one file was flagged by the script, due to an invalid copyright header (gdb/unittests/basic_string_view/element_access/char/empty.cc). As the file was copied from GCC's libstdc++-v3 testsuite, this commit leaves this file untouched for the time being; a patch to fix the header was sent to gcc-patches first. gdb/ChangeLog: Update copyright year range in all GDB files.
2018-01-02Update copyright year range in all GDB filesJoel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files
2017-01-01update copyright year range in GDB filesJoel Brobecker1-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.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-12-24sim: delete old breakpoint codeMike Frysinger1-12/+0
This code relies on the old sim-break module, but that was deleted in 2003. The module only existed for gdb to tell the sim to set breakpoints on its behalf, but then that logic was abandoned in favor of gdb knowing all about proper breakpoints (since it does already for non-sim targets). Some dead code lived on in the older ports though -- clean it up now.
2015-06-17sim: syscall: add common sim_syscall helpersMike Frysinger1-21/+14
Many ports have the same sim syscall logic, so add some helpers to handle all the common details. The arches still have to deal with the unpacking and packing of the syscall arguments, but the rest of the sim<->callback glue is now shared.
2015-06-17sim: syscall: unify memory helpersMike Frysinger1-24/+3
Almost every port implements these two callbacks in the same way, so unify them in the common layer.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker1-1/+1
2013-01-01Update years in copyright notice for the GDB files.Joel Brobecker1-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.
2012-01-04Copyright year update in most files of the GDB Project.Joel Brobecker1-2/+1
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2011-01-01run copyright.sh for 2011.Joel Brobecker1-1/+1
2010-01-01Update copyright notices to add year 2010.Joel Brobecker1-1/+2
2009-01-14 Update the copyright notice of some of the files I missedJoel Brobecker1-1/+1
in the previous copyright update.
2008-01-01 Updated copyright notices for most files.Daniel Jacobowitz1-1/+1
2007-08-24 Switch the license of all files explicitly copyright the FSFJoel Brobecker1-5/+4
to GPLv3.
2007-01-09Copyright updates for 2007.Daniel Jacobowitz1-1/+1
2003-12-11Add support for the m32r2 processorNick Clifton1-31/+60
2003-12-07More reversion of incomplete m32r changes. Should be back to normal.Andrew Cagney1-18/+6
2003-12-07Revert last commit, build problems.Andrew Cagney1-19/+4
2003-12-072003-12-02 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>Andrew Cagney1-4/+19
* Makefile.in : Add new machine m32r2. * m32r2.c : New file for m32r2. * mloop2.in : Ditto * model2.c : Ditto * sem2-switch.c : Ditto * m32r-sim.h : Add EVB register. * sim-if.h : Ditto * sim-main.h : Ditto * traps.c : Ditto
1999-10-05import gdb-1999-10-04 snapshotJason Molenda1-3/+6
1999-04-26import gdb-19990422 snapshotStan Shebs1-3/+12
1999-04-16Initial creation of sourceware repositorygdb-4_18-branchpointStan Shebs1-0/+170
1999-04-16Initial creation of sourceware repositoryStan Shebs1-173/+0
1998-09-09 * m32r-sim.h (m32r_trap): Update prototype.Doug Evans1-13/+12
* traps.c (m32r_trap): New arg `pc'. * sem.c,sem-switch.c: Regenerated. * cpux.h,readx.c,semx.c: Regenerated.
1998-06-11 * traps.c: New file. Trap support moved here from sim-if.c.Doug Evans1-0/+174
* Makefile.in (SIM_OBJS): Add traps.o * sim-if.c: Don't include targ-vals.h. (sim_engine_illegal_insn): Moved to traps.c * sim-main.h (SIM_CORE_SIGNAL): Define. (m32r_core_signal): Declare. * devices.c (device_io_read_buffer): Handle cache purging via MCCR register. * m32r-sim.h (M32R_MISC_PROFILE): Move here from sim-main.h. (PROFILE_COUNT_SHORTINSNS,PROFILE_COUNT_LONGINSNS): New macros. (TRAP_SYSCALL,TRAP_BREAKPOINT): New macros.