Skip to content

Commit

Permalink
initial support for PPC
Browse files Browse the repository at this point in the history
  • Loading branch information
aquynh committed Dec 29, 2013
1 parent 4ca8511 commit 42c6b1a
Show file tree
Hide file tree
Showing 17 changed files with 292 additions and 214 deletions.
6 changes: 3 additions & 3 deletions MCInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "include/capstone.h"

typedef struct MCInst MCInst;
typedef struct cs_struct cs_struct;
typedef struct MCOperand MCOperand;

/// MCOperand - Instances of this class represent operands of the MCInst class.
Expand Down Expand Up @@ -126,23 +127,22 @@ typedef struct cs_insn_flat {
cs_arm64 arm64; // ARM64 architecture (aka AArch64)
cs_arm arm; // ARM architecture (including Thumb/Thumb2)
cs_mips mips; // MIPS architecture
cs_ppc ppc; // PowerPC architecture
};
} cs_insn_flat;


/// MCInst - Instances of this class represent a single low-level machine
/// instruction.
struct MCInst {
unsigned Opcode;
MCOperand Operands[32];
unsigned size; // number of operands
cs_insn_flat flat_insn; // insn to be exposed to public
cs_mode mode; // to be referenced by internal code
unsigned OpcodePub;
cs_opt_value detail;
int insn_size; // instruction size
int x86_segment; // remove when segment mem ref hack is redundant.
uint64_t address; // address of this insn
cs_struct *csh; // save the main csh
};

void MCInst_Init(MCInst *inst);
Expand Down
30 changes: 26 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,40 @@ LIBNAME = capstone

LIBOBJ =
LIBOBJ += cs.o utils.o SStream.o MCInstrDesc.o MCRegisterInfo.o

ifneq (,$(findstring powerpc,$(CAPSTONE_ARCHS)))
LIBOBJ += arch/PowerPC/PPCDisassembler.o
LIBOBJ += arch/PowerPC/PPCInstPrinter.o
# LIBOBJ += arch/PowerPC/mapping.o
LIBOBJ += arch/PowerPC/module.o
endif
ifneq (,$(findstring arm,$(CAPSTONE_ARCHS)))
LIBOBJ += arch/ARM/ARMDisassembler.o arch/ARM/ARMInstPrinter.o arch/ARM/mapping.o arch/ARM/module.o
LIBOBJ += arch/ARM/ARMDisassembler.o
LIBOBJ += arch/ARM/ARMInstPrinter.o
LIBOBJ += arch/ARM/mapping.o
LIBOBJ += arch/ARM/module.o
endif
ifneq (,$(findstring x86,$(CAPSTONE_ARCHS)))
LIBOBJ += arch/X86/X86DisassemblerDecoder.o arch/X86/X86Disassembler.o arch/X86/X86IntelInstPrinter.o arch/X86/X86ATTInstPrinter.o arch/X86/mapping.o arch/X86/module.o
LIBOBJ += arch/X86/X86DisassemblerDecoder.o
LIBOBJ += arch/X86/X86Disassembler.o
LIBOBJ += arch/X86/X86IntelInstPrinter.o
LIBOBJ += arch/X86/X86ATTInstPrinter.o
LIBOBJ += arch/X86/mapping.o arch/X86/module.o
endif
ifneq (,$(findstring mips,$(CAPSTONE_ARCHS)))
LIBOBJ += arch/Mips/MipsDisassembler.o arch/Mips/MipsInstPrinter.o arch/Mips/mapping.o arch/Mips/module.o
LIBOBJ += arch/Mips/MipsDisassembler.o
LIBOBJ += arch/Mips/MipsInstPrinter.o
LIBOBJ += arch/Mips/mapping.o
LIBOBJ += arch/Mips/module.o
endif
ifneq (,$(findstring aarch64,$(CAPSTONE_ARCHS)))
LIBOBJ += arch/AArch64/AArch64BaseInfo.o arch/AArch64/AArch64Disassembler.o arch/AArch64/AArch64InstPrinter.o arch/AArch64/mapping.o arch/AArch64/module.o
LIBOBJ += arch/AArch64/AArch64BaseInfo.o
LIBOBJ += arch/AArch64/AArch64Disassembler.o
LIBOBJ += arch/AArch64/AArch64InstPrinter.o
LIBOBJ += arch/AArch64/mapping.o
LIBOBJ += arch/AArch64/module.o
endif

LIBOBJ += MCInst.o

# OSX?
Expand Down
Loading

0 comments on commit 42c6b1a

Please sign in to comment.