Skip to content

Commit

Permalink
add XCore architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed May 26, 2014
1 parent 3dc080c commit c80d840
Show file tree
Hide file tree
Showing 23 changed files with 5,009 additions and 9 deletions.
11 changes: 6 additions & 5 deletions COMPILE_MSVC.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ NOTE: This requires Visual Studio 2010 or newer versions.

(0) Tailor Capstone to your need.

Out of 7 archtitectures supported by Capstone (Arm, Arm64, Mips, PPC, Sparc,
SystemZ & X86), if you just need several selected archs, choose the ones you
want to compile in by opening Visual Studio solution "msvc\capstone.sln", then
directly editing the projects "capstone_static" & "capstone_dll" for static
Out of 8 archtitectures supported by Capstone (Arm, Arm64, Mips, PPC, Sparc,
SystemZ, X86 & XCore), if you just need several selected archs, choose the ones
you want to compile in by opening Visual Studio solution "msvc\capstone.sln",
then directly editing the projects "capstone_static" & "capstone_dll" for static
and dynamic libraries, respectively. This must be done before going to the
next steps.

Expand All @@ -30,8 +30,9 @@ NOTE: This requires Visual Studio 2010 or newer versions.
- CAPSTONE_HAS_SPARC: support Sparc. Delete this to remove Sparc support.
- CAPSTONE_HAS_SYSZ: support SystemZ. Delete this to remove SystemZ support.
- CAPSTONE_HAS_X86: support X86. Delete this to remove X86 support.
- CAPSTONE_HAS_XCORE: support XCore. Delete this to remove XCore support.

By default, all 7 architectures are compiled in.
By default, all 8 architectures are compiled in.


Besides, Capstone also allows some more customization via following macros.
Expand Down
3 changes: 2 additions & 1 deletion HACK.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Capstone source is organized as followings.
│   ├── PowerPC <- PowerPC engine
│   ├── Sparc <- Sparc engine
│   ├── SystemZ <- SystemZ engine
│   └── X86 <- X86 engine
│   ├── X86 <- X86 engine
│   └── XCore <- XCore engine
├── bindings <- all bindings are under this dir
│   ├── java <- Java bindings + test code
│   ├── ocaml <- Ocaml bindings + test code
Expand Down
1 change: 1 addition & 0 deletions MCInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ typedef struct cs_insn_flat {
cs_ppc ppc; // PowerPC architecture
cs_sparc sparc; // Sparc architecture
cs_sysz sysz; // SystemZ architecture
cs_xcore xcore; // XCore architecture
};
} cs_insn_flat;

Expand Down
20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,26 @@ endif
LIBOBJ_X86 += $(OBJDIR)/arch/X86/X86Module.o
endif


DEP_XCORE =
DEP_XCORE += arch/XCore/XCoreGenAsmWriter.inc
DEP_XCORE += arch/XCore/XCoreGenInstrInfo.inc
DEP_XCORE += arch/XCore/XCoreGenDisassemblerTables.inc
DEP_XCORE += arch/XCore/XCoreGenRegisterInfo.inc

LIBOBJ_XCORE =
ifneq (,$(findstring xcore,$(CAPSTONE_ARCHS)))
CFLAGS += -DCAPSTONE_HAS_XCORE
LIBOBJ_XCORE += $(OBJDIR)/arch/XCore/XCoreDisassembler.o
LIBOBJ_XCORE += $(OBJDIR)/arch/XCore/XCoreInstPrinter.o
LIBOBJ_XCORE += $(OBJDIR)/arch/XCore/XCoreMapping.o
LIBOBJ_XCORE += $(OBJDIR)/arch/XCore/XCoreModule.o
endif


LIBOBJ =
LIBOBJ += $(OBJDIR)/cs.o $(OBJDIR)/utils.o $(OBJDIR)/SStream.o $(OBJDIR)/MCInstrDesc.o $(OBJDIR)/MCRegisterInfo.o
LIBOBJ += $(LIBOBJ_ARM) $(LIBOBJ_ARM64) $(LIBOBJ_MIPS) $(LIBOBJ_PPC) $(LIBOBJ_SPARC) $(LIBOBJ_SYSZ) $(LIBOBJ_X86)
LIBOBJ += $(LIBOBJ_ARM) $(LIBOBJ_ARM64) $(LIBOBJ_MIPS) $(LIBOBJ_PPC) $(LIBOBJ_SPARC) $(LIBOBJ_SYSZ) $(LIBOBJ_X86) $(LIBOBJ_XCORE)
LIBOBJ += $(OBJDIR)/MCInst.o


Expand Down Expand Up @@ -296,6 +313,7 @@ $(LIBOBJ_PPC): $(DEP_PPC)
$(LIBOBJ_SPARC): $(DEP_SPARC)
$(LIBOBJ_SYSZ): $(DEP_SYSZ)
$(LIBOBJ_X86): $(DEP_X86)
$(LIBOBJ_XCORE): $(DEP_XCORE)

ifeq ($(CAPSTONE_STATIC),yes)
$(ARCHIVE): $(LIBOBJ)
Expand Down
Loading

0 comments on commit c80d840

Please sign in to comment.