summaryrefslogtreecommitdiff
path: root/include/sim
Commit message (Collapse)AuthorAgeFilesLines
* sim: info: convert verbose field to a boolMike Frysinger2023-01-181-2/+3
| | | | | | | 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.
* Update year range in copyright notice of binutils filesAlan Modra2023-01-0117-17/+17
| | | | | | The newer update-copyright.py fixes file encoding too, removing cr/lf on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
* sim: drop unused SIM_ADDR type [PR sim/7504]Mike Frysinger2022-12-221-6/+0
| | | | | | | | Now that sim APIs either use 64-bit addresses all the time, or more appropriate target-specific types, drop this now-unused 32-bit-only address type. Bug: https://sourceware.org/PR7504
* sim: switch sim_{read,write} APIs to 64-bit all the time [PR sim/7504]Mike Frysinger2022-12-221-2/+4
| | | | | | | | | | | | | | 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
* sim: move register headers into sim/ namespace [PR sim/29869]Mike Frysinger2022-12-2015-0/+1852
| | | | | | | These headers define the register numbers for each port to implement the sim_fetch_register & sim_store_register interfaces. While gdb uses these, the APIs are part of the sim, not gdb. Move the headers out of the gdb/ include namespace and into sim/ instead.
* sim: drop unused CORE_ADDR_TYPEMike Frysinger2022-11-081-7/+0
| | | | | | This hasn't been used by gdb in decades, and doesn't make sense with a standalone sim program/library where the ABI is fixed. So punt it to simplify the code.
* sim: common: change sim_{fetch,store}_register helpers to use void* buffersMike Frysinger2022-11-021-3/+2
| | | | | | | When reading/writing arbitrary data to the system's memory, the unsigned char pointer type doesn't make that much sense. Switch it to void so we align a bit with standard C library read/write functions, and to avoid having to sprinkle casts everywhere.
* sim: reg: constify store helperMike Frysinger2022-10-311-1/+2
| | | | These functions only read from memory, so mark the pointer as const.
* sim: common: change sim_read & sim_write to use void* buffersMike Frysinger2022-10-311-2/+2
| | | | | | | When reading/writing arbitrary data to the system's memory, the unsigned char pointer type doesn't make that much sense. Switch it to void so we align a bit with standard C library read/write functions, and to avoid having to sprinkle casts everywhere.
* Update year range in copyright notice of binutils filesAlan Modra2022-01-022-2/+2
| | | | | | | | | | The result of running etc/update-copyright.py --this-year, fixing all the files whose mode is changed by the script, plus a build with --enable-maintainer-mode --enable-cgen-maint=yes, then checking out */po/*.pot which we don't update frequently. The copy of cgen was with commit d1dd5fcc38ead reverted as that commit breaks building of bfp opcodes files.
* sim: reorder header includesMike Frysinger2021-12-041-2/+3
| | | | | | | | | | | | We're including system headers after local headers in a bunch of places, but this leads to conflicts when our local headers happen to define symbols that show up in the system headers. Use the more standard order of: * config.h (via defs.h) * system headers * local library headers (e.g. bfd & libiberty) * sim specific headers
* sim: callback: expose argv & environMike Frysinger2021-11-161-0/+6
| | | | | Pass the existing strings data to the callbacks so that common libgloss syscalls can be implemented (which we'll do shortly).
* sim: rename ChangeLog files to ChangeLog-2021Mike Frysinger2021-08-171-0/+0
| | | | | | | | | | | | | | Now that ChangeLog entries are no longer used for sim patches, this commit renames all relevant sim ChangeLog to ChangeLog-2021, similar to what we would do in the context of the "Start of New Year" procedure. The purpose of this change is to avoid people merging ChangeLog entries by mistake when applying existing commits that they are currently working on. Also throw in a .gitignore entry to keep people from adding new ChangeLog files anywhere in the sim tree.
* sim: callback: add printf attributesMike Frysinger2021-06-292-4/+13
| | | | | | | | | This helps these funcs get printf format checking coverage. The sim-io.c hack as a result is a bit unfortunate, but the compiler throws warnings when printing with empty strings. In this one case, we actually want that due to the side-effect of the callback halting execution for us.
* sim: callback: extend syscall interface to handle 7 argsMike Frysinger2021-06-242-1/+6
| | | | | The Linux syscall interface, depending on architecture, handles up to 7 arguments. Extend the callback API to handle those.
* sim: callback: add a kill interfaceMike Frysinger2021-06-232-0/+5
| | | | | | | 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.
* sim: callback: add a getpid interfaceMike Frysinger2021-06-222-0/+5
| | | | | Rather than hit the OS interface directly, use the existing callback layer so the instantiator can decide behavior.
* sim: callback: convert FS interfaces to 64-bitMike Frysinger2021-05-142-3/+8
| | | | | | Rather than rely on off_t being the right size between the host & target, have the interface always be 64-bit. We can figure out if we need to truncate when actually outputting it to the right target.
* sim: callback: convert time interface to 64-bitMike Frysinger2021-05-142-1/+8
| | | | | | | PR sim/27705 Rather than rely on time_t being the right size between the host & target, have the interface always be 64-bit. We can figure out if we need to truncate when actually outputting it to the right target.
* sim: callback: inline PTR defineMike Frysinger2021-05-142-3/+8
| | | | | We require C11 now, so no need for these pre-ANSI C hacks. PTR is simply void*, so use that directly.
* sim: callback: use ATTRIBUTE_NORETURNMike Frysinger2021-05-142-5/+5
| | | | This define is handled by ansidecl.h, so no need to duplicate effort.
* sim: callback: always include necessary headersMike Frysinger2021-05-142-4/+4
| | | | We use types from these headers, so always include them.
* sim: create header namespaceMike Frysinger2021-05-143-0/+650
The gdb/callback.h & gdb/remote-sim.h headers have nothing to do with gdb and are really definitions for the libsim API under the sim/ tree. While gdb uses those headers as a client, it's not specific to it. So create a new sim/ namespace and move the headers there.