aboutsummaryrefslogtreecommitdiffstats
path: root/capstone/arch/PowerPC/PPCMapping.h
blob: a0d43318347b7901164db38d9a26361dafc97382 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* Capstone Disassembly Engine */
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */

#ifndef CS_PPC_MAP_H
#define CS_PPC_MAP_H

#include "capstone/capstone.h"

// return name of regiser in friendly string
const char *PPC_reg_name(csh handle, unsigned int reg);

// return register id, given register name
ppc_reg PPC_name_reg(const char *name);

// given internal insn id, return public instruction info
void PPC_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id);

const char *PPC_insn_name(csh handle, unsigned int id);
const char *PPC_group_name(csh handle, unsigned int id);

struct ppc_alias {
	unsigned int id;	// instruction id
	int cc;	// code condition
	const char *mnem;
};

// map instruction name to public instruction ID
ppc_insn PPC_map_insn(const char *name);

// check if this insn is relative branch
bool PPC_abs_branch(cs_struct *h, unsigned int id);

// map internal raw register to 'public' register
ppc_reg PPC_map_register(unsigned int r);

// given alias mnemonic, return instruction ID & CC
bool PPC_alias_insn(const char *name, struct ppc_alias *alias);

#endif