aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-events.h
AgeCommit message (Collapse)AuthorFilesLines
2022-01-06sim: common: migrate to standard uintXX_t typesMike Frysinger1-14/+14
Drop the sim-specific unsignedXX types and move to the standard uintXX_t types that C11 provides.
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-12-04sim: include ansidecl.h when neededMike Frysinger1-0/+2
Avoid implicit include deps with this to help untangle sim headers so we can get rid of arch-specific sim-main.h.
2021-12-04sim: include stdarg.h when usedMike Frysinger1-0/+1
Avoid implicit include deps with this to help untangle sim headers so we can get rid of arch-specific sim-main.h.
2021-04-22sim: sprinkle some ATTRIBUTE_PRINTFSimon Marchi1-2/+2
Add some ATTRIBUTE_PRINTF attributes to functions that take a format string, to fix a few -Wformat-nonliteral warnings. Use the ATTRIBUTE_PRINTF macro like we use in GDB, instead of spelling out __attribute__((format...)). Use ATTRIBUTE_NULL_PRINTF at one place, because callers expect to be able to pass NULL. sim/common/ChangeLog: * callback.c (os_printf_filtered, os_vprintf_filtered, os_evprintf_filtered, os_error): Use ATTRIBUTE_PRINTF. * sim-engine.h (sim_engine_abort, sim_engine_vabort): Likewise. * sim-events.h (sim_events_schedule_tracef, sim_events_schedule_vtracef): Use ATTRIBUTE_NULL_PRINTF. Change-Id: Icd206f7b2c325e8b144f72eb129fb2a6b5af2fa3
2021-02-06sim: watchpoints: use common sim_pc_getMike Frysinger1-0/+11
Few arches implement STATE_WATCHPOINTS()->pc while all of them implement sim_pc_get. Lets switch the sim-watch core for monitoring pc events to the sim_pc_get API so this module works for all ports, and then we can delete this old back channel of snooping in the port's cpu state -- the code needs the pointer to the pc storage so that it can read out bytes and compare them to the watchrange. This also fixes the logic on multi-cpu sims by removing the limitation of only being able to watch CPU0's state.
2021-01-13sim: watch: fix pc watchpoints on little endian host systemsMike Frysinger1-2/+2
My change 1ac72f0659d64d6a14da862242db0d841d2878d0 ("sim: convert to bfd_endian") subtly broke the watchpoint module on little endian host systems. The old code used 0 to mean "whatever the host endian is", and while that was changed to use BFD_ENDIAN_UNKNOWN, this caller was missed. Since its API used an int instead of an enum, the coercion from 0 to the BFD endian enum was silently missed, and 0 happens to be BFD_ENDIAN_BIG. Instead of restoring the old logic by passing in BFD_ENDIAN_UNKNOWN, we know the right host endian at compile time, so use that directly.
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-03sim: convert to bfd_endianMike Frysinger1-2/+4
Rather than re-invent endian defines, as well as maintain our own list of OS & arch-specific includes, punt all that logic in favor of the bfd ones already set up and maintained elsewhere. We already rely on the bfd library, so leveraging the endian aspect should be fine.
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-06-11sim: trace: centralize the system tracingMike Frysinger1-1/+0
First we convert the ETRACE_P to STRACE_EVENTS_P. This means we move from using the sim_events.trace storage to the common sim_state_base.trace_data array. With that deleted, the common trace init code can be simplified so the sim state works the same as the sim cpu.
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-1/+1
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2011-03-15sim: common: trim trailing whitespaceMike Frysinger1-1/+1
2011-02-14sim: change to 64bit time keeping to avoid 32bit overflowsMike Frysinger1-1/+1
The sim-events code jumps through some hoops to avoid using 64bit math to manage the current time. One fundamental assumption here is that by constantly scheduling the sim poll event a short time into the future, the 64bit difference will always fall into a signed 32bit value. This does work most of the time, except for when processing the sim poll event itself. Normally, sim_events_process() will dequeue the sim poll event, update the current time (time_from_event) according to the next pending event, process the sim poll event (which will then requeue the sim poll event), and then continue on. The problem here of course is that the current time is updated in that small window before the sim poll event gets a chance to reschedule itself. So if the 64bit difference between the current time and the next event does not fit into the signed 32bit value, time_from_event overflows, and the internal assert at the end of update_time_from_event() triggers. Since attempts at tweaking sim_events_process() logic introduced other subtle bugs (due to tangled assumptions between most pieces of the sim time keeping code), change the time_from_event to a real 64bit value. Tests on my system between a 32bit ELF and a 64bit ELF show no practical difference (it's all lost in the system noise). Basically, I booted a Linux kernel to userspace and then paniced it; this gave me a constant sample size of about 18 million insns. This was noticed when simulating Blackfin Das U-Boot. The simulated core timer is given the max unsigned timeout value possible on a 32bit processor (0xffffffff). This timeout value is used directly to schedule a hw event in the sim future (the IRQ firing). Once the sim poll event is kicked off, the next pending event is the core timer event which is more than 2^31 ticks in the future, and the sim aborts with: sim-events.c:435: assertion failed - current_time == sim_events_time (sd) Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-01-01run copyright.sh for 2011.Joel Brobecker1-1/+1
2010-01-01Update copyright notices to add year 2010.Joel Brobecker1-1/+1
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-4/+2
to GPLv3.
2007-01-09Copyright updates for 2007.Daniel Jacobowitz1-1/+1
2002-11-232002-11-22 Andrew Cagney <ac131313@redhat.com>Andrew Cagney1-19/+22
* dv-core.c: Update copyright. sim/common contributed to the FSF. * dv-glue.c, dv-pal.c, hw-base.c, hw-base.h, hw-device.c: Ditto. * hw-device.h, hw-handles.c, hw-handles.h: Ditto. * hw-instances.c, hw-instances.h, hw-properties.c: Ditto. * hw-properties.h, hw-tree.c, hw-tree.h, sim-alu.h: Ditto. * sim-basics.h, sim-bits.c, sim-bits.h, sim-config.c: Ditto. * sim-config.h, sim-core.c, sim-core.h, sim-endian.c: Ditto. * sim-endian.h, sim-events.c, sim-events.h, sim-inline.c: Ditto. * sim-inline.h, sim-io.c, sim-io.h, sim-n-bits.h: Ditto. * sim-n-core.h, sim-n-endian.h, sim-types.h: Ditto.
2002-02-102002-02-10 Chris Demetriou <cgd@broadcom.com>Chris Demetriou1-1/+1
* callback.c: Fix some spelling errors. * hw-device.h: Likewise. * hw-tree.c: Likewise. * sim-abort.c: Likewise. * sim-alu.h: Likewise. * sim-core.h: Likewise. * sim-events.c: Likewise. * sim-events.h: Likewise. * sim-fpu.h: Likewise. * sim-profile.h: Likewise. * sim-utils.c: Likewise.
2000-07-272000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>Andrew Cagney1-0/+6
* sim-events.c (sim_events_remain_time): New function returning the time that remains before the event is raised. * hw-events.c (hw_event_remain_time): Likewise. * sim-events.h (sim_events_remain_time): Declare. * hw-events.h (hw_event_remain_time): Declare.
1999-04-16Initial creation of sourceware repositorygdb-4_18-branchpointStan Shebs1-0/+271
1999-04-16Initial creation of sourceware repositoryStan Shebs1-243/+0
1997-09-03Add support for suspending/resumeing the simulator in sim-modules.Andrew Cagney1-15/+2
Use in sim-events.
1997-08-30Passify GCC. Convert 0x0LL to something more portable in the FP code.Andrew Cagney1-6/+10
1997-05-21Watchpoint interface.Andrew Cagney1-10/+28
1997-05-19o Implement generic halt/restart/abort module.Andrew Cagney1-64/+98
Use in tic80 and d30v simulators. o Add signal hook to sim-core module
1997-05-12c80 simulator fixes.Andrew Cagney1-33/+127
1997-03-17remove defunct variable from event structAndrew Cagney1-0/+106