aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
AgeCommit message (Collapse)AuthorFilesLines
2024-01-02sim: ppc: switch to AS_HELP_STRING for automatic formattingMike Frysinger2-36/+51
2024-01-02sim: ppc: drop now unused config.inMike Frysinger1-19/+0
2024-01-02sim: ppc: move defines.h generation to the top-levelMike Frysinger2-8/+11
Since we rely on the top-level config.h now, the defines.h generation step should live here too.
2024-01-02sim: ppc: drop configure compiler checksMike Frysinger2-1118/+1
Now that the ppc script only checks configure options and sets up variables in the Makefile from those, delete all the compile related logic to greatly simplify the configure script.
2024-01-02sim: ppc: drop custom config.h headerMike Frysinger4-255/+50
Now that everything has moved to the top-level, we can drop the custom ppc config.h and reuse the common one.
2024-01-02sim: ppc: stop including headers from gdb/Mike Frysinger1-2/+1
The common sim code doesn't snoop in gdb/, and the ppc code doesn't need to either. Any common code we pull from gnulib/ now only.
2024-01-02sim: ppc: move termios probes to top-levelMike Frysinger3-273/+0
This is the last compile-time logic in the ppc subdir.
2024-01-02sim: ppc: switch to AC_CACHE_CHECKMike Frysinger2-61/+65
This macro replaces the AC_MSG_CHECKING+AC_CACHE_VAL+AC_MSG_RESULT which reduces the boilerplate in here a little bit.
2024-01-02sim: ppc: switch struct member checks to AC_CHECK_MEMBERMike Frysinger2-68/+99
This covers a lot of the AC_MSG_CHECKING+AC_TRY_COMPILE+AC_MSG_RESULT boilerplate and matches what we do in the top-level platform checks.
2024-01-02sim: ppc: move termio defines to config.hMike Frysinger4-15/+28
Move the defines from explicit -D options to config.h defines to simplify the build and make it easier to move to the top-level configure.
2024-01-02sim: ppc: move struct statfs to top-levelMike Frysinger3-71/+0
2024-01-02sim: ppc: move long long test to top-levelMike Frysinger3-651/+2
While the sim code doesn't utilize HAVE_LONG_LONG itself, other code (like libiberty) seem to, so check for it in the top-level for all ports to leverage.
2024-01-02sim: ppc: hoist sysv tests to top-levelMike Frysinger3-189/+1
Now that the sysv tests turn into config.h defines and everything checks that, we can move the tests to the top-level and out of the ppc subdir.
2024-01-02sim: ppc: always compile in the sysv sem & shm device filesMike Frysinger5-14/+46
Move the stub logic to the device files themselves. This makes the configure & build logic more static which will make it easier to move to the top-level build, and matches what we did with the common/ hw tree already. This also decouples the logic from the two -- in the past, you needed both sem & shm in order to enable the device models, but now each one is tied to its own independent knob. Practically speaking, this will probably not make a difference, but it simplifies the build a bit.
2024-01-02sim: ppc: change SysV sem & shm tests to compile-timeMike Frysinger2-110/+87
Instead of executing code to see if SysV semaphores & shared memory are available, switch to just a compile-time test. The system used to compile might not match the system used to run the code wrt the current kernel & OS settings, but the library APIs should. So move the failures from compile-time to runtime so the program is more portable, and works correctly even when cross-compiling.
2024-01-02sim: ppc: merge System V semaphores checksMike Frysinger2-83/+13
Compile tests can use earlier defines, so hoist the HAVE_UNION_SEMUN define to before the semaphore check, and use it in the test so that we can merge the 2 versions into one. This also defines HAVE_UNION_SEMUN even when ac_cv_sysv_sem is not set, but that's OK as this define is only about a type existing, not about whether the overall code is usable.
2024-01-02sim: ppc: fix bad AC_CACHE_CHECK call with semunMike Frysinger2-9/+4
The first arg is the cache var name, and this one was typoed relative to what the call actually set. We also don't need the manual call to AC_MSG_RESULT as the AC_CACHE_CHECK takes care of it for us.
2024-01-02sim: ppc: delete unused build compile & link settingsMike Frysinger1-3/+0
These should have been removed as part of the ppc/igen merging into the top-level, but they were missed. Clean up now.
2024-01-01sim: ppc: merge misc igen APIsMike Frysinger9-286/+73
The common igen code provides the same misc APIs as the ppc version, so delete the ppc code and pull in the common one. There is one minor difference: the ppc code has a unique dumpf function. The common code switched to lf_printf for the same functionality, but since that requires changes throughout the igen codebase, delay that cleanup for now so we can merge the rest.
2024-01-01sim: ppc: rework igen error to match commonMike Frysinger10-22/+25
Switch to an ERROR macro and tweak the error signature to match the common igen version in preparation for merging the two implementations.
2024-01-01sim: ppc: rename igen max_insn_bit_sizeMike Frysinger3-5/+5
We want to avoid conflicts with the common igen enums. This should get migrated over to the common parsing logic, but for now, switch the name to avoid redefinition.
2024-01-01sim: ppc: unify igen filter_filename implementationsMike Frysinger6-84/+4
Now that both igen implementations are in the top-level, we can unify the filter_filename implementation between them since they're the same (literally the same code).
2024-01-01sim: ppc: replace filter_filename with lbasenameMike Frysinger2-15/+8
The lbasename function from libiberty provides the same API as this custom function. The common/ code already made the switch, so make the same change to the ppc code to avoid target duplication.
2024-01-01sim: ppc: hoist igen compilation into top-levelMike Frysinger2-60/+64
This simplifies the build a bit (especially for deps in port subdirs), and avoids recursive make. This in turn speeds up the build, and lets us reuse existing build-time vs host-time logic from Makefile.am.
2024-01-01sim: ppc: drop build-config.h usageMike Frysinger8-73/+0
This header is only used by the igen tool, and none of the igen code depends on the configure-time checks. Delete the logic to simplify to prepare for moving it to the local.mk code.
2024-01-01sim: ppc: simplify filter_host.c logicMike Frysinger2-7/+19
Switch this from a build-time generation to a static include. This makes the build rules a bit simpler, especially as we move them to Automake from hand-written makefiles.
2024-01-01sim: ppc: drop unused host bitsize settingsMike Frysinger3-5/+0
This is never set anywhere, so it's always empty. Scrub it.
2024-01-01sim: fix pervasive typoTom Tromey4-21/+21
I noticed a typo in a sim constant. This patch fixes it. permenant -> permanent
2023-12-22sim: ppc: fix -Wshadow=local warningsMike Frysinger1-3/+3
Use a local name in the macro to avoid shadowing wherever it's used.
2023-12-21sim: ppc: igen: fix -G handlingMike Frysinger1-2/+9
We weren't using the enable_p flag to see whether the option should be enabled or disabled, and we weren't breaking out when done parsing.
2023-12-21sim: ppc: fix -Wimplicit-fallthrough warningsMike Frysinger1-1/+1
Replace some fall through comments with the attribute.
2023-12-21sim: add ATTRIBUTE_FALLTHROUGH for local codeMike Frysinger1-0/+3
We'll replace various /* fall through */ comments so compilers can actually understand what the code is doing.
2023-12-21sim: ppc: phb: add missing break to address decoderMike Frysinger1-0/+1
I don't know what this emulation does exactly, but it missing a break statement seems kind of obvious based on the 32-bit case above it.
2023-12-21sim: ppc: mark halt & restart funcs as noreturnMike Frysinger3-6/+6
This helps the compiler with optimization and fixes fallthru warnings.
2023-12-07sim: ppc: fix -Wunused-but-set-variable warningsMike Frysinger1-2/+0
2023-12-04sim: ppc: fix implicit enum conversionMike Frysinger1-3/+3
This code tries to use attach_type enums as hw_phb_decode, and while they're setup to have compatible values, the compiler doesn't like it when the cast is missing. So cast it explicitly and then use that. sim/ppc/hw_phb.c:322:28: error: implicit conversion from enumeration type 'attach_type' (aka 'enum _attach_type') to different enumeration type 'hw_phb_decode' [-Werror,-Wenum-conversion]
2023-12-04sim: ppc: fix -Wmisleading-indentation warningsMike Frysinger1-1/+1
Fix building with -Wmisleading-indentation.
2023-12-04sim: ppc: cleanup getrusage declsMike Frysinger3-17/+2
Don't conflate HAVE_GETRUSAGE & HAVE_SYS_RESOURCE_H. Use the latter to include the header and nothing else. Use the former to determine whether to use the function and nothing else. If we find a system that doesn't follow POSIX and provides only one of these, we can figure out how to support it then. The manual local definition is clashing with the system ones and leading to build failures with newer C standards. sim/ppc/emul_netbsd.c:51:5: error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a previous declaration [-Werror,-Wdeprecated-non-prototype]
2023-01-18sim: info: convert verbose field to a boolMike Frysinger1-1/+1
The verbose argument has always been an int treated as a bool, so convert it to an explicit bool. Further, update the API docs to match the reality that the verbose value is actually used by some of the internal modules.
2023-01-17sim: ppc: drop local psim linkMike Frysinger1-4/+1
This has never been installed, and it's not clear anyone cares about it in the local build dir (when the main program is sim/ppc/run), so drop all the logic to simplify.
2023-01-16sim: assume sys/stat.h always exists (via gnulib)Mike Frysinger1-4/+0
We have many uses of sys/stat.h that are unprotected by HAVE_SYS_STAT_H, so this is more formalizing the reality that we require this header. Since we switched to gnulib, it guarantees that a sys/stat.h exists for us to include, so we're doubly OK.
2023-01-16sim: formally assume unistd.h always exists (via gnulib)Mike Frysinger10-21/+0
We have many uses of unistd.h that are unprotected by HAVE_UNISTD_H, so this is more formalizing the reality that we require this header. Since we switched to gnulib, it guarantees that a unistd.h exists for us to include, so we're doubly OK.
2023-01-14sim: common: move libcommon.a dep to ppc codeMike Frysinger1-0/+6
Rather than force this to be built ahead of time for all targets, move the dep to the ppc code since it's the only user of it now.
2023-01-04sim: Regenerate using the maintainer modeTsukasa OI1-1/+1
Those files have changed by regenerating using the maintainer mode. The first line of sim/ppc/pk.h have changed by an effect of the commit 319e41e83a40 ("sim: ppc: inline the sim-packages option").
2023-01-01sim: refresh copyright dates a bitMike Frysinger2-2/+2
Update a few files that were missed, and revert the generated Automake output that uses dates from Automake itself.
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker14-14/+14
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-24sim: igen: drop move-if-changed usageMike Frysinger1-24/+12
Now that igen itself has this logic, drop these custom build rules to greatly simplify.
2022-12-24sim: igen: support in-place updates ourselfMike Frysinger1-9/+76
Every file that igen outputs is then processed with the move-if-changed shell script. This creates a lot of boilerplate in the build and not an insignificant amount of build-time overhead. Move the simple "is the file changed" logic into igen itself.
2022-12-23sim: ppc: drop unused types from sim-main.hMike Frysinger1-7/+0
The common sim headers should define these for us already, so there's no need for the ppc header to set them up.
2022-12-22sim: switch sim_{read,write} APIs to 64-bit all the time [PR sim/7504]Mike Frysinger1-8/+10
We've been using SIM_ADDR which has always been 32-bit. This means the upper 32-bit address range in 64-bit sims is inaccessible. Use 64-bit addresses all the time since we want the APIs to be stable regardless of the active arch backend (which can be 32 or 64-bit). The length is also 64-bit because it's completely feasible to have a program that is larger than 4 GiB in size/image/runtime. Forcing the caller to manually chunk those accesses up into 4 GiB at a time doesn't seem useful to anyone. Bug: https://sourceware.org/PR7504