aboutsummaryrefslogtreecommitdiff
path: root/sim/arm/armos.c
AgeCommit message (Collapse)AuthorFilesLines
2023-12-21sim: arm: fix -Wimplicit-fallthrough warningsMike Frysinger1-0/+1
Replace some fall through comments with the attribute.
2023-12-21sim: arm: add missing breaks to SWI processingMike Frysinger1-0/+2
Seems unlikely we want the remove syscall to fallthrough into the rename syscall since we can't rename files that have been removed.
2023-12-07sim: arm: fix -Wunused-but-set-variable warningsMike Frysinger1-2/+0
2023-01-16sim: formally assume unistd.h always exists (via gnulib)Mike Frysinger1-3/+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.
2021-10-31sim: nltvals: localize TARGET_<open> definesMike Frysinger1-6/+11
Code should not be using these directly, instead they should be resolving these dynamically via the open_map. Rework the common callback code that was using the defines to use symbolic names instead, and localize some of the defines in the ARM code (since it's a bit unclear how many different APIs it supports currently), then remove the defines out of the header so no new code can rely on them.
2021-05-16sim: switch config.h usage to defs.hMike Frysinger1-1/+3
The defs.h header will take care of including the various config.h headers. For now, it's just config.h, but we'll add more when we integrate gnulib in. This header should be used instead of config.h, and should be the first include in every .c file. We won't rely on the old behavior where we expected files to include the port's sim-main.h which then includes the common sim-basics.h which then includes config.h. We have a ton of code that includes things before sim-main.h, and it sometimes needs to be that way. Creating a dedicated header avoids the ordering mess and implicit inclusion that shows up otherwise.
2021-05-14sim: callback: convert time interface to 64-bitMike Frysinger1-3/+3
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.
2021-05-14sim: create header namespaceMike Frysinger1-1/+1
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.
2020-10-22Fix printf formatting errors where "0x" is used as a prefix for a decimal ↵Dr. David Alan Gilbert1-2/+2
number. bfd * po/es.po: Fix printf format binutils * windmc.c: Fix printf format gas * config/tc-arc.c: Fix printf format opcodes * po/es.po: Fix printf format sim * arm/armos.c: Fix printf format * ppc/emul_netbsd.c: Fix printf format -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
2017-02-13sim: use ARRAY_SIZE instead of ad-hoc sizeof calculationsMike Frysinger1-1/+2
2016-07-14Small improvements to the ARM simulator to cope with illegal binaries.Nick Clifton1-1/+4
* armemu.c (Multiply64): Only issue error messages about invalid arguments if debugging is enabled. * armos.c (ARMul_OSHandleSWI): Ignore invalid flags.
2015-12-25sim: arm: delete unused codeMike Frysinger1-82/+0
These vestiges of the 20 year old emulator are just getting in the way. Punt all the dead code we either don't compile or don't use.
2015-07-14Remove extraneous whitespace from ARM sim sources.Nick Clifton1-11/+11
* armcopro.c: Remove extraneous whitespace. * armdefs.h: Likewise. * armfpe.h: Likewise. * arminit.c: Likewise. * armopts.h: Likewise. * armos.c: Likewise. * armos.h: Likewise. * armrdi.c: Likewise. * armsupp.c: Likewise. * armvirt.c: Likewise. * bag.c: Likewise. * bag.h: Likewise. * communicate.c: Likewise. * communicate.h: Likewise. * dbg_conf.h: Likewise. * dbg_cp.h: Likewise. * dbg_hif.h: Likewise. * dbg_rdi.h: Likewise. * gdbhost.c: Likewise. * gdbhost.h: Likewise. * iwmmxt.c: Likewise. * iwmmxt.h: Likewise. * kid.c: Likewise. * main.c: Likewise. * maverick.c: Likewise. * parent.c: Likewise. * thumbemu.c: Likewise. * wrapper.c: Likewise.
2015-06-28Add support for ARM v6 instructions.Nick Clifton1-2/+1
* Makefile.in (SIM_EXTRA_CFLAGS): Add -lm. * armdefs.h (ARMdval, ARMfval): New types. (ARM_VFP_reg): New union. (struct ARMul_State): Add VFP_Reg and FPSCR fields. (VFP_fval, VFP_uword, VFP_sword, VFP_dval, VFP_dword): Accessor macros for the new VFP_Reg field. * armemu.c (handle_v6_insn): Add code to handle MOVW, MOVT, QADD16, QASX, QSAX, QSUB16, QADD8, QSUB8, UADD16, USUB16, UADD8, USUB8, SEL, REV, REV16, RBIT, BFC, BFI, SBFX and UBFX instructions. (handle_VFP_move): New function. (ARMul_Emulate16): Add checks for newly supported v6 instructions. Add support for VMRS, VMOV and MRC instructions. (Multiply64): Allow nRdHi == nRm and/or nRdLo == nRm when operating in v6 mode. * armemu.h (t_resolved): Define. * armsupp.c: Include math.h. (handle_VFP_xfer): New function. Handles VMOV, VSTM, VSTR, VPUSH, VSTM, VLDM and VPOP instructions. (ARMul_LDC): Test for co-processor 10 or 11 and pass call to the new handle_VFP_xfer function. (ARMul_STC): Likewise. (handle_VFP_op): New function. Handles VMLA, VMLS, VNMLA, VNMLS, VNMUL, VMUL, VADD, VSUB, VDIV, VMOV, VABS, VNEG, VSQRT, VCMP, VCMPE and VCVT instructions. (ARMul_CDP): Test for co-processor 10 or 11 and pass call to the new handle_VFP_op function. * thumbemu.c (tBIT, tBITS, ntBIT, ntBITS): New macros. (test_cond): New function. Tests a condition and returns non-zero if the condition has been met. (handle_IT_block): New function. (in_IT_block): New function. (IT_block_allow): New function. (ThumbExpandImm): New function. (handle_T2_insn): New function. Handles T2 thumb instructions. (handle_v6_thumb_insn): Add next_instr and pc parameters. (ARMul_ThumbDecode): Add support for IT blocks. Add support for v6 instructions. * wrapper.c (sim_create_inferior): Detect a thumb address and call SETT appropriately.
2012-12-19[sim] Update old contact info in GPL license noticesJoel Brobecker1-2/+1
sim/ChangeLog: Update old contact info in GPL license notices.
2012-12-19Update sim copyright headers from GPLv2-or-later to GPLv3-or-later.Joel Brobecker1-1/+1
gdb/sim/ChangeLog: Update the non-FSF-copyrighted files in sim to GPLv3 or later.
2007-02-27 * armos.c (SWIflen): Do not treate file descriptor zero asMark Mitchell1-1/+1
special.
2006-03-072006-03-07 Paul Brook <paul@codesourcery.com>Paul Brook1-2/+2
* elfos.c (ARMul_OSHandleSWI): Call correct function for IsTTY.
2006-02-02 * armos.c (ARMul_OSHandleSWI): Handle the RedBoot systemDaniel Jacobowitz1-2/+19
call meminfo. Return ENOSYS for unhandled RedBoot syscalls.
2005-11-172005-11-16 Shaun Jackman <sjackman@gmail.com>Daniel Jacobowitz1-13/+89
* sim/arm/armos.c: Include limits.h (unlink): Remove this macro. It is unused in this file and conflicts with sim_callback->unlink. (PATH_MAX): Define as 1024 if not already defined. (ReadFileName): New function. (SWIopen): Fix a potential buffer overflow. (SWIremove): New function. (SWIrename): Ditto. (ARMul_OSHandleSWI): Handle the RDP calls SWI_IsTTY, SWI_Remove, and SWI_Rename, as well as the RDI calls AngelSWI_Reason_IsTTY, AngelSWI_Reason_Remove, and AngelSWI_Reason_Rename.
2005-05-12Update the address of the FSF organizationNick Clifton1-1/+1
2003-12-29 * armos.c (fcntl.h): Do not include it.Mark Mitchell1-25/+16
(O_RDONLY): Do not define. (O_WRONLY): Likewise. (O_RDWR): Likewise. (targ-vals.h): Include it. (translate_open_mode): Use TARGET_O_* instead of O_*. (SWIopen): Likewise. * Makefile.in (armos.o): Depend on targ-vals.h.
2003-03-27Add iWMMXt support to ARM simulatorNick Clifton1-10/+39
2003-03-02(SWIWrite0): Catch big-endian bug when printing charactersNick Clifton1-1/+7
2002-08-16oops - fix typo in previous deltaNick Clifton1-2/+2
2002-08-15Catch and ignore SWIs of -1, they can be caused by an interrupted systemNick Clifton1-0/+14
call being resumed by GDB.
2002-06-09Move include/callback.h and include/remote-sim.h to include/gdb/.Andrew Cagney1-1/+1
Update accordingly.
2002-05-27Only perform access checks if 'check' is set.Nick Clifton1-2/+2
Report unknown machine numbers. Formatting tidy ups.
2002-05-20Add support for target specific command line switches to old-style simualtors.Nick Clifton1-249/+296
Make use of this support in the ARM simulator to add a --swi-support= switch to select whcih SWI protocols to emulate.
2002-05-09Uses sim callback interface for system calls in RedBoot SWI support.Nick Clifton1-8/+13
2002-05-09Support the RedBoot SWI in ARM mode and some of its system calls.Nick Clifton1-30/+104
2002-02-21 * armos.c (SWIWrite0): Use generic host_callback mechanismKeith Seitz1-31/+40
for supported OS functions "open", "close", "write", etc. (SWIopen): Likewise. (SWIread): Likewise. (SWIwrite): Likewise. (SWIflen): Likewise. (ARMul_OSHandleSWI): Likewise.
2001-02-28Add support for disabling alignment checks when performing GDB interfaceNick Clifton1-20/+7
calls or SWI emulaiton routines. (Alignment checking code has not yet been contributed).
2001-02-14remove spurious whitespaceNick Clifton1-6/+6
2001-02-14Prevent Aborts from happening whilst emulating a SWINick Clifton1-62/+76
2001-02-01Detect installation of SWI vector by running program as well as loading program.Nick Clifton1-2/+2
2000-12-11Add 0x91 as an FPE SWI.Nick Clifton1-0/+1
2000-12-03Suppress support of DEMON swi's in XScale mode.Nick Clifton1-71/+103
2000-11-30Add support for ARM's v5TE architecture and Intel's XScale extenstionsNick Clifton1-18/+49
2000-05-30Add support for v4 SystemMode.Nick Clifton1-0/+1
2000-02-08Fix compile time warning messages.Nick Clifton1-612/+18
2000-02-05import gdb-2000-02-04 snapshotJason Molenda1-696/+757
1999-12-07import gdb-1999-12-06 snapshotJason Molenda1-2/+13
1999-10-12import gdb-1999-10-11 snapshotJason Molenda1-1/+1
1999-10-05import gdb-1999-10-04 snapshotJason Molenda1-3/+3
1999-04-16Initial creation of sourceware repositorygdb-4_18-branchpointStan Shebs1-0/+1136
1999-04-16Initial creation of sourceware repositoryStan Shebs1-968/+0
1998-06-02Allow simulator to work with Angel SWIs.Nick Clifton1-0/+7
1998-06-02Mon Jun 1 17:14:19 1998 Anthony Thompson (athompso@cambridge.arm.com)Jason Molenda1-0/+961
* armos.c (ARMul_OSHandleSWI::SWI_Open): Handle special case of ":tt" to catch stdin in addition to stdout. (ARMul_OSHandleSWI::SWI_Seek): Return 0 or 1 to indicate failure or success of lseek(). From PR 15839, modified a bit by me to appease my sense of style--but not too much because I am lazy.