aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year range in header of all files managed by GDBAndrew Burgess2024-01-1214-15/+15
| | | | | | | | | | | | | | | | | | | | | 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.
* sim: ppc: return register error when unhandledMike Frysinger2024-01-111-4/+2
| | | | | We don't want to fallthru and use cooked_buf when we haven't initialized it to anything. Returning 0 indicates the register wasn't recognized.
* sim: ppc: rework defines.h to handle HAVE symbols defined to 0Mike Frysinger2024-01-101-1/+1
| | | | | | | The HAVE_DECL_xxx defines are always defined to 0 or 1. The current defines.h logic assumes every HAVE_xxx symbol is only defined iff it's defined to 1 which causes this to break. Tweak the sed logic to only match defines of 1.
* sim: ppc: workaround uninitialized variable compiler warningsMike Frysinger2024-01-081-2/+2
| | | | | | | | | Some compilers don't understand the semctl API and think it's an input argument even when it's used as an output, and then complains that it is being used uninitialized. Zero it out explicitly to workaround it. This adds some runtime overhead, but should be fairly minor as it's a small stack buffer, and shouldn't be that relevant relative to all the other logic in these functions.
* sim: ppc: unify igen filter modulesMike Frysinger2024-01-0310-171/+60
| | | | | | | | | | | The common igen code was forked from the ppc long ago. The filter module is still pretty similar in API, so we can unfork them with a little bit of effort. The filter.c module is still here because of the unique it_is API. The common igen code doesn't seem to have an equiv API as this only operates on two strings and not an actual filter object, and it's easy enough to leave behind to unfork the rest.
* sim: ppc: unify igen line number output modulesMike Frysinger2024-01-0312-665/+145
| | | | | | | | | | | | | | The common igen code was forked from the ppc long ago. The lf module is still pretty similar in API, so we can unfork them with a little bit of effort. Some of the generated ppc code is now slightly different, but that's because of fixes the common igen code has gained, but not the ppc igen code (e.g. fixing of #line numbers). The ppc code retains lf_print__c_code because the common igen code rewrote the logic to a new table.c API. Let's delay that in the ppc code to at least unfork all this code.
* sim: ppc: switch to common endian codeMike Frysinger2024-01-034-438/+0
| | | | | | | The common sim-endian is a forked & updated version of the ppc code. Fortunately, they didn't diverge from the basic APIs, so they are still compatible, which means we can just delete the ppc version now that the build env is merged at the top-level.
* sim: ppc: rename local ALU SIGNED64 macrosMike Frysinger2024-01-031-6/+6
| | | | | | | The common/ code has macros with the same name but different behavior: it's for declaring integer constants as 64-bit, not for casting them. Rename ppc's local variant since it's only used in this file in order to avoid conflicts.
* sim: ppc: sync WITH_TARGET_{ADDRESS,CELL}_BITSIZE with common/Mike Frysinger2024-01-031-0/+8
| | | | | This will make it easier to share common/ code that rely on these additional defines.
* sim: ppc: hoist compilation up to top-levelMike Frysinger2024-01-032-581/+2
| | | | This removes all recursive makes from the ppc port.
* sim: ppc: move libsim.a creation to top-levelMike Frysinger2024-01-032-14/+49
| | | | | | | | | | The objects are still compiled in the subdir, but the creation of the archive itself is in the top-level. This is a required step before we can move compilation itself up, and makes it easier to review. The downside is that each object compile is a recursive make instead of a single one. It adds some overhead, so it's not great, but it shouldn't be a big deal. This will go away once compilation is hoisted up.
* sim: ppc: move main.o compilation to top-levelMike Frysinger2024-01-032-14/+14
|
* sim: ppc: hoist pk.h creation to top-levelMike Frysinger2024-01-023-33/+30
|
* sim: ppc: hoist hw.[ch] creation to top-levelMike Frysinger2024-01-022-35/+45
|
* sim: ppc: hoist igen execution to top-levelMike Frysinger2024-01-022-62/+64
| | | | Invoke ppc's igen from the top-level like we do for all other ports.
* sim: ppc: merge configure logic into top-levelMike Frysinger2024-01-024-3261/+6
| | | | | | Now that the ppc configure script is just namespaced options, we can move it to ppc/acinclude.m4 and include it directly in the top-level configure script and kill off the last subdir configure script.
* sim: ppc: scope configure options to --enable-sim-ppc-xxxMike Frysinger2024-01-023-395/+398
| | | | | To prepare for moving these into the top-level configure, namespace then with the port name like we do with all other ports.
* sim: ppc: standardize configure option processingMike Frysinger2024-01-022-248/+161
| | | | | | Switch from ad-hoc $silent checks & echo calls to standard AC_MSG_CHECKING & AC_MSG_RESULT calls. Also delete pointless variable setting after calling AC_MSG_ERROR.
* sim: ppc: switch to AS_HELP_STRING for automatic formattingMike Frysinger2024-01-022-36/+51
|
* sim: ppc: drop now unused config.inMike Frysinger2024-01-021-19/+0
|
* sim: ppc: move defines.h generation to the top-levelMike Frysinger2024-01-022-8/+11
| | | | | Since we rely on the top-level config.h now, the defines.h generation step should live here too.
* sim: ppc: drop configure compiler checksMike Frysinger2024-01-022-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.
* sim: ppc: drop custom config.h headerMike Frysinger2024-01-024-255/+50
| | | | | Now that everything has moved to the top-level, we can drop the custom ppc config.h and reuse the common one.
* sim: ppc: stop including headers from gdb/Mike Frysinger2024-01-021-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.
* sim: ppc: move termios probes to top-levelMike Frysinger2024-01-023-273/+0
| | | | This is the last compile-time logic in the ppc subdir.
* sim: ppc: switch to AC_CACHE_CHECKMike Frysinger2024-01-022-61/+65
| | | | | This macro replaces the AC_MSG_CHECKING+AC_CACHE_VAL+AC_MSG_RESULT which reduces the boilerplate in here a little bit.
* sim: ppc: switch struct member checks to AC_CHECK_MEMBERMike Frysinger2024-01-022-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.
* sim: ppc: move termio defines to config.hMike Frysinger2024-01-024-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.
* sim: ppc: move struct statfs to top-levelMike Frysinger2024-01-023-71/+0
|
* sim: ppc: move long long test to top-levelMike Frysinger2024-01-023-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.
* sim: ppc: hoist sysv tests to top-levelMike Frysinger2024-01-023-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.
* sim: ppc: always compile in the sysv sem & shm device filesMike Frysinger2024-01-025-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.
* sim: ppc: change SysV sem & shm tests to compile-timeMike Frysinger2024-01-022-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.
* sim: ppc: merge System V semaphores checksMike Frysinger2024-01-022-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.
* sim: ppc: fix bad AC_CACHE_CHECK call with semunMike Frysinger2024-01-022-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.
* sim: ppc: delete unused build compile & link settingsMike Frysinger2024-01-021-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.
* sim: ppc: merge misc igen APIsMike Frysinger2024-01-019-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.
* sim: ppc: rework igen error to match commonMike Frysinger2024-01-0110-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.
* sim: ppc: rename igen max_insn_bit_sizeMike Frysinger2024-01-013-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.
* sim: ppc: unify igen filter_filename implementationsMike Frysinger2024-01-016-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).
* sim: ppc: replace filter_filename with lbasenameMike Frysinger2024-01-012-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.
* sim: ppc: hoist igen compilation into top-levelMike Frysinger2024-01-012-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.
* sim: ppc: drop build-config.h usageMike Frysinger2024-01-018-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.
* sim: ppc: simplify filter_host.c logicMike Frysinger2024-01-012-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.
* sim: ppc: drop unused host bitsize settingsMike Frysinger2024-01-013-5/+0
| | | | This is never set anywhere, so it's always empty. Scrub it.
* sim: fix pervasive typoTom Tromey2024-01-014-21/+21
| | | | | I noticed a typo in a sim constant. This patch fixes it. permenant -> permanent
* sim: ppc: fix -Wshadow=local warningsMike Frysinger2023-12-221-3/+3
| | | | Use a local name in the macro to avoid shadowing wherever it's used.
* sim: ppc: igen: fix -G handlingMike Frysinger2023-12-211-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.
* sim: ppc: fix -Wimplicit-fallthrough warningsMike Frysinger2023-12-211-1/+1
| | | | Replace some fall through comments with the attribute.
* sim: add ATTRIBUTE_FALLTHROUGH for local codeMike Frysinger2023-12-211-0/+3
| | | | | We'll replace various /* fall through */ comments so compilers can actually understand what the code is doing.