Commit Graph

27 Commits

Author SHA1 Message Date
Marius Melzer b5050df0ea Fix missing-prototypes warnings (#1348) 2019-01-22 07:39:44 +07:00
clslgrnc 9b9844d276 Init cs_detail (#1205)
* Update init of cs_detail for AArch64

as @aquynh requested in #1125

* Update init of cs_detail for ARM

as @aquynh requested in #1125

* Update init of cs_detail for EVM

as @aquynh requested in #1125

* Update init of cs_detail for M680X

as @aquynh requested in #1125

* Update init of cs_detail for M68K

as @aquynh requested in #1125

* Update init of cs_detail for Mips

as @aquynh requested in #1125

* Update init of cs_detail for PowerPC

as @aquynh requested in #1125

* Update init of cs_detail for Sparc

as @aquynh requested in #1125

* Update init of cs_detail for SystemZ

as @aquynh requested in #1125

* Update init of cs_detail for TMS320C64x

as @aquynh requested in #1125

* Update init of cs_detail for XCore

as @aquynh requested in #1125

* Comment on init of cs_detail

* wrap long lines
2018-07-12 11:01:34 +07:00
Travis Finkenauer 65da43d0b1 Declare global arch arrays with contents (next branch) (#1186)
* Declare global arch arrays with contents (#1171)

This eliminates the need for archs_enable() and eliminates the racey
initialization.

This makes the architecture-specific init and option functions
non-static so that they may be called from a different file.

Cherry-picked 853a2870

* Add cs_arch_disallowed_mode_mask global

Cherry-pick 94bce437:
mips: CS_MODE_MIPS32R6 implies CS_MODE_32

Cherry-pick 8998a3a1:
ppc: fix endian check (#1029)
Fixes bug where endianness could not be set for ppc.

Remove `big_endian` field of `cs_struct`.
Added a helper macro `MODE_IS_BIG_ENDIAN()` to check if
`CS_MODE_BIG_ENDIAN` is set.

Refactored `cs_open()` check for valid mode out of arch-specific code
into arch-independent code. Also added a valid mode check to
`cs_option()`.  The checks use a new global array
`cs_arch_disallowed_mode_mask[]`.

* Make global arrays static

Make all_arch uint32_t to guarantee a certain number of bits (with
adequate room for growth).
2018-06-24 21:05:04 +08:00
Catena cyber fb798d3f9b Undefined shifts (#1154)
* Fix undefined shifts

uint8 gets promoted to signed integer

in ARM, MIPS, Sparc
in AArch64, PPC and Xcore

* fix undefined shift in powerpc

* Fix undefined shift in Mips

use mulitply instead
2018-06-02 16:49:36 +08:00
Nguyen Anh Quynh 761c9c84a4 ppc: return failure when Base>=32 in decodeMemRIOperands() 2015-06-16 14:03:07 +08:00
Nguyen Anh Quynh 011bf8bf84 ppc: handle invalid CR bits with more than 8 zeros in decodeCRBitMOperand(). bug reported by @felixgr 2015-06-16 13:59:36 +08:00
Nguyen Anh Quynh b8ffb86b02 ppc: fix a bug in QPX mode & add some QPX alias instructions. 2015-03-12 16:52:31 +08:00
Nguyen Anh Quynh f4a2da5a94 ppc: fix PPC_init() 2015-03-05 00:33:29 +08:00
Nguyen Anh Quynh bfcaba5851 2015 2015-03-04 17:45:23 +08:00
Nguyen Anh Quynh 0be9eab6ba ppc: update core 2015-03-04 17:06:48 +08:00
Nguyen Anh Quynh 0c07cc9b06 zero-out instruction details, mnemonic & op_str so cs_insn doesnt have garbage in Diet mode 2014-08-27 22:31:54 +08:00
Nguyen Anh Quynh dd3deec1e9 ppc: update core. this added new instructions, groups & registers. updated Python & Java bindings accordingly 2014-08-15 13:26:12 +08:00
Nguyen Anh Quynh cae09bf543 replace offset_of with offsetof from stddef.h 2014-06-17 14:58:39 +08:00
Nguyen Anh Quynh 215e76b223 ppc: use MCInst_insert0() instead of MCInst_insert() to avoid malloc/free 2014-06-16 14:47:43 +08:00
Nguyen Anh Quynh 7f945d3655 ppc: use CreateImm0() & CreateReg0() to create MCOperand* to avoid using malloc/free 2014-06-16 12:34:02 +08:00
Nguyen Anh Quynh 69582d71ae initialize cs_insn.detail by properly zero-out right members for each arch 2014-06-09 17:50:01 +07:00
Nguyen Anh Quynh 8598a219f3 enable arch code from source with CAPSTONE_HAS_* for MSVC to pick up 2014-05-14 11:26:41 +08:00
Nguyen Anh Quynh 42706a39e2 indentation with tab 2014-05-09 07:33:35 +08:00
Axel 0vercl0k Souchet 779d4c75d9 first changes to get a successfully compiled version of capstone on VS2012 2014-05-08 23:44:49 +01:00
Nguyen Anh Quynh 958927eb56 clean up after the last removal of SubtargetFeature.h 2014-05-08 22:59:28 +08:00
Nguyen Anh Quynh a5ffdc3a80 x86: properly handle LOCK/REP in the core, so remove buch of hacks 2014-05-07 08:25:24 +08:00
Nguyen Anh Quynh 2cff6f61fc x86: handle instructions with LOCK/REP/REPNE prefix after other prefixes. bear with this until we have a better approach 2014-04-28 11:19:44 +08:00
Alex Ionescu b8a57fe285 Additional MSVC fixes, including to fixed tables (temporary so Quynh can see what to do). 2014-01-22 18:12:01 -08:00
Alex Ionescu 46018db884 Initial set of changes to support building with MSVC 2013. Right now there's a bunch fo assumptions in the .vcxproj file and some things are not as clean as they should be, but it does build a full build and works (at least the x86 side). The point of this initial checkpoint is to make sure that nothing breaks on the GCC side, that everyone is ok with the changes to the source (or if better fixes/typing can be done). 2014-01-22 09:45:00 -08:00
Nguyen Anh Quynh cef6b27e95 remove -x from PPC files 2013-12-31 23:36:12 +08:00
Nguyen Anh Quynh ec79f401b1 ppc: rename PPC_getFeatureBits() to getFeatureBits() 2013-12-31 18:00:20 +08:00
Nguyen Anh Quynh bacf4c8156 add the missing arch/PowerPC directory 2013-12-30 00:29:32 +08:00