aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2021-06-27sim: frv: add missing const typeMike Frysinger2-1/+5
2021-06-27sim: frv: fix engine hookMike Frysinger2-1/+5
This hook doesn't return a value, so don't define it to 0 to avoid the compiler warning about it not being used.
2021-06-27sim: frv: fix up various missing prototype warningsMike Frysinger6-1/+22
Some of these were missing includes, some were unused funcs we can cleanup, and some were missing prototypes for use in other files.
2021-06-27sim: frv: fix some printf type mismatch warningsMike Frysinger3-2/+7
The %p usage was a real bug that would probably cause a crash.
2021-06-27sim: frv: fix uninitialized variable warningMike Frysinger2-2/+6
This variable isn't set anywhere, so pass down NULL_CIA to indicate we don't have a pc to pass.
2021-06-27sim: frv: fix return type for post_wait_for funcsMike Frysinger3-19/+31
These functions never return anything, so change the int return type to void to fix a bunch of compiler warnings about missing return.
2021-06-27sim: frv: fix ambiguous else compiler warningsMike Frysinger4-25/+43
Add explicit braces to if bodies when the body is another if/else to fix a bunch of compiler warnings.
2021-06-27sim: bpf/cris: include cgen-mem in decodersMike Frysinger6-0/+16
These arches use cgen memory functions, so make sure to include the header in the modules.
2021-06-27sim: bpf: include more local headers & fix broken funcsMike Frysinger5-10/+25
Various files were not including the relevant headers, or some funcs were missing prototypes entirely, leading to mismatch between the actual definition of the functions. Add includes to a few places and fix the broken functions that are uncovered as a result. Fixing some compile warnings (e.g. missing prototypes) often find real bugs.
2021-06-27sim: cgen: suppress trace non-literal printf warningMike Frysinger2-0/+10
The cgen trace macros are a bit ugly in that they specify a series of format strings & arguments in a single call. This means we pass a non-literal string to printf and the compiler warns about it. Use the diagnostic macros to suppress that in this one place.
2021-06-27sim: cgen: add asserts to fix unused engine warningsMike Frysinger2-1/+8
If the user passed in values outside the range of [0, MAX_NR_PROCESSORS), it would cause the code to access out-of-bind engine function pointers. Add some asserts to catch that and to fix the related compiler warnings.
2021-06-27sim: cgen: add printf attributes in a few more callsMike Frysinger2-2/+7
This helps the compiler process calls to these functions and emit warnings about mismatched format arguments.
2021-06-27sim: cgen: constify trace stringsMike Frysinger3-8/+17
Shouldn't be any functional changes here.
2021-06-27sim: cgen: always leverage the mem prototypesMike Frysinger2-14/+55
This fixes missing prototype warnings, and guarantees the prototypes stay in sync with the function definitions. One of the macros had fallen out by declaring the wrong return type.
2021-06-27sim: cgen: always leverage the ops prototypesMike Frysinger2-50/+50
This fixes missing prototype warnings, and guarantees the prototypes stay in sync with the function definitions.
2021-06-27sim: cgen: sync prototypes with implementationMike Frysinger2-17/+27
These prototype blocks are not normally used, so they've fallen out of sync with the actual function definitions. Resync them all.
2021-06-27sim: bpf: add explicit casts when using explicit formatsMike Frysinger2-12/+16
Since the value variable usually has an incompatible type for the wide variety of types it is printed as, add explicit casts to them all.
2021-06-27sim: bpf: fix mixed decls & code warnings (and style)Mike Frysinger3-3/+12
2021-06-27sim: erc32: merge with common configure scriptMike Frysinger11-4305/+213
Move the unique library tests to the common code so we can delete the erc32 configure logic entirely.
2021-06-27sim: bfin: move pkg-config & SDL checks to common codeMike Frysinger12-1196/+319
This reduces the unique logic in bfin/configure to make it easier to (eventually) unify it entirely.
2021-06-24sim: cris: fix a few missing prototype warningsMike Frysinger3-32/+11
Add a stub prototype for the dump function meant to be called by devs from gdb, and trim unused functions that aren't supposed to be used.
2021-06-24sim: callback: extend syscall interface to handle 7 argsMike Frysinger4-4/+16
The Linux syscall interface, depending on architecture, handles up to 7 arguments. Extend the callback API to handle those.
2021-06-23sim: syscall: handle killing the sim itselfMike Frysinger2-2/+18
If code tries to send a signal to itself, the callback layer ignores it and forces the caller to handle it. This allows the sim to turn that into an engine halt rather than actually killing the sim.
2021-06-23sim: cris: override getpid callbackMike Frysinger2-0/+13
The cris linux syscall layers assume getpid returns a constant, so add a custom function to provide that.
2021-06-23sim: callback: add a kill interfaceMike Frysinger3-0/+35
This will make it easier to emulate the syscall. If the kill target is the sim itself, don't do anything. This forces the higher layers to make a decision as to how to handle this event: like halting the overall engine process.
2021-06-23sim: switch common srcdir to abs_srcdirMike Frysinger5-20/+29
We rewrite srcdir in subdir Makefiles that we generate from the common parent dir since it points to the parent dir. Since @srcdir@ can be a variety of formats (relative & absolute), switch to @abs_srcdir@ which is a lot easier to adjust. Our use of srcdir in here should handle it.
2021-06-22sim: cris: fix a few warningsMike Frysinger2-2/+9
Include header for hw funcs called, adjust prototype to match the args given to it, and adjust cast to match the function.
2021-06-22sim: callback: add missing cb_target_to_host_signalMike Frysinger2-0/+17
There's been a prototype for this forever, but the implementation was missing. Probably because there weren't any callers, but we'll start using it to implement the kill function.
2021-06-22sim: callback: generate signal mapMike Frysinger3-0/+36
We've been generating the syscall/errno/open maps, but not the signal map, even though we've been including them in the source constants.
2021-06-22sim: callback: add a getpid interfaceMike Frysinger3-1/+21
Rather than hit the OS interface directly, use the existing callback layer so the instantiator can decide behavior.
2021-06-22sim: rx: merge with common configure scriptMike Frysinger9-2947/+76
Move the unique configure flag to acinclude.m4 so the common code can include it, then delete the rx configure logic entirely.
2021-06-22sim: drop configure scripts for simple portsMike Frysinger104-49374/+809
These ports only use the pieces that have been unified, so we can merge them into the common configure script and get rid of their unique one entirely. We still compile & link separate run programs, and have dedicated subdir Makefiles, but the configure script portion is merged.
2021-06-21sim: unify hardware settingsMike Frysinger103-1627/+230
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-21sim: hw: rework configure option & device selectionMike Frysinger82-1324/+1052
The sim-hardware configure option allows builders to select a set of device models to enable. But this seems like unnecessary overkill: the existence of individual device models doesn't affect performance at all as they are only enabled at runtime if the config uses them, and individually these are all <5KB a piece. Stripping off a total of ~50KB from a ~1MB binary doesn't seem useful, and it's extremely unlikely anyone will ever bother. So let's simplify the configure/make logic by turning sim-hardware into a boolean option like many of the other sim options. Any ports that have unique device models will declare them in their Makefile instead of at configure time. This will allow us to (eventually) unify the setting into the common dir.
2021-06-20sim: cris: clean up printf & abort usage a bitMike Frysinger2-40/+43
Inline the stats printf calls to avoid compiler warnings about non-literal format strings. This in turn highlights bad type sizes being passed in, so fix the strings to use the right size type. This in turn highlights the rest of the func using casts rather than the right type directly, so adjust all of those. Finally, replace a few abort+sim_engine_halt calls with the common sim_engine_abort. This provides good output while still aborting as we want.
2021-06-20sim: rx: scope the unique configure flagMike Frysinger4-22/+34
This will make it possible to merge into the common configure by making sure we never collide with other arches.
2021-06-20sim: delete SIM_AC_COMMON macroMike Frysinger127-188/+160
Now that we've moved all content out to the common file, this is empty and can be deleted it entirely.
2021-06-20sim: unify general maintainer settingsMike Frysinger77-3849/+64
Move these options up to the common dir so we only test & export them once across all ports. This takes a page from the cgen maint logic to make $(MAINT) work for non-automake Makefiles which will allow us to merge it together.
2021-06-20sim: unify cgen maintainer settingsMike Frysinger43-318/+104
Move these options up to the common dir so we only test & export them once across all ports. It makes it available to targets that aren't cgen-based, but those will just ignore the settings, so it shouldn't be an issue.
2021-06-20sim: m68hc11: fix unused function warnings with -O0Mike Frysinger2-22/+26
Mark these functions as unused in case they don't get inlined when building with -O0.
2021-06-20sim: move sim-inline to the common codeMike Frysinger108-1207/+230
This will allow us to build the common code with the same inline settings as the arch subdirs, and only do the test once.
2021-06-19sim: move UNUSED before TYPE in SIM_ENDIAN_INLINE's definitionSimon Marchi2-27/+31
I get this when building with gcc 11: CC common/common_libcommon_a-sim-load.o In file included from /home/simark/src/binutils-gdb/sim/common/sim-n-bits.h:27, from /home/simark/src/binutils-gdb/sim/common/sim-bits.c:259, from /home/simark/src/binutils-gdb/sim/common/sim-bits.h:599, from /home/simark/src/binutils-gdb/sim/common/sim-basics.h:122, from /home/simark/src/binutils-gdb/sim/common/sim-load.c:30: /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:39:27: error: 'offset_16' defined but not used [-Werror=unused-function] 39 | #define offset_N XCONCAT2(offset_,N) | ^~~~~~~ /home/simark/src/binutils-gdb/sim/../include/symcat.h:23:26: note: in definition of macro 'CONCAT2' 23 | #define CONCAT2(a,b) a##b | ^ /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:39:18: note: in expansion of macro 'XCONCAT2' 39 | #define offset_N XCONCAT2(offset_,N) | ^~~~~~~~ /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:138:1: note: in expansion of macro 'offset_N' 138 | offset_N (unsigned_N *x, | ^~~~~~~~ offset_N uses INLINE_SIM_ENDIAN, which uses UNUSED to put the "unused" attribute. However, it appears after the function's return type, which seems to make it not apply to the function. Moving it to before the return type fixes the error. Change all instances found in that file. sim/common/ChangeLog: * sim-inline.h: Move UNUSED before TYPE. Change-Id: Ide20106683ed7a9ebf35d484dabf70b309cb1ba6
2021-06-19sim: unify dtc tool checksMike Frysinger9-100/+112
Only one arch uses this currently, but others could too. By moving it up to the common checks, it'll also let us simplify the moxie code significantly.
2021-06-19sim: ppc: rename inline defines to match common codeMike Frysinger6-52/+64
Use the same basic names as the common sim inline logic so we can merge the two. We don't do that here, just prepare for it. The common code seems to be based on the ppc version but with slightly different names as it was cleaned up & generalized. I *think* these concepts are the same, so binding them together is OK, but maybe I'm misreading them. If so, can always tweak them later. REVEAL_MODULE -> H_REVEALS_MODULE INLINE_MODULE -> C_REVEALS_MODULE
2021-06-19sim: drop old BUILT_SRC_FROM_COMMON refMike Frysinger2-3/+4
The code that set & used this variable was deleted long ago, but the clean target was missed. Clean that up now.
2021-06-19sim: unify gettext/intl probing logicMike Frysinger77-2744/+132
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-19sim: unify toolchain dependency logicMike Frysinger69-33282/+814
The common dir is already probing this info since it's using automake, so pass it down to the subdirs so they don't have to probe it at all.
2021-06-19sim: unify toolchain probing logicMike Frysinger71-42429/+1131
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-19sim: unify bfd library dependency testing logicMike Frysinger109-238842/+8112
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-19sim: mips: drop unused AC_PATH_X callMike Frysinger3-210/+8
We don't use anything from X, so no sense in probing the env.