Rizin
unix-like reverse engineering framework and cli tools
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rz_lib.h>
#include <rz_util.h>
#include <rz_flag.h>
#include <rz_analysis.h>
#include <rz_parse.h>
Go to the source code of this file.
Macros | |
#define | PFMT32x "lx" |
#define | SPR_MQ 0x0 |
#define | SPR_XER 0x1 |
#define | SPR_RTCU 0x4 |
#define | SPR_RTCL 0x5 |
#define | SPR_LR 0x8 |
#define | SPR_CTR 0x9 |
#define | SPR_DSISR 0x12 |
#define | SPR_DAR 0x13 |
#define | SPR_DEC 0x16 |
#define | SPR_SDR1 0x19 |
#define | SPR_SRR0 0x1a |
#define | SPR_SRR1 0x1b |
#define | SPR_VRSAVE 0x100 |
#define | SPR_TBRL 0x10c |
#define | SPR_TBRU 0x10d |
#define | SPR_SPRG0 0x110 |
#define | SPR_SPRG1 0x111 |
#define | SPR_SPRG2 0x112 |
#define | SPR_SPRG3 0x113 |
#define | SPR_EAR 0x11a |
#define | SPR_TBL 0x11c |
#define | SPR_TBU 0x11d |
#define | SPR_PVR 0x11f |
#define | SPR_SPEFSCR 0x200 |
#define | SPR_IBAT0U 0x210 |
#define | SPR_IBAT0L 0x211 |
#define | SPR_IBAT1U 0x212 |
#define | SPR_IBAT1L 0x213 |
#define | SPR_IBAT2U 0x214 |
#define | SPR_IBAT2L 0x215 |
#define | SPR_IBAT3U 0x216 |
#define | SPR_IBAT3L 0x217 |
#define | SPR_DBAT0U 0x218 |
#define | SPR_DBAT0L 0x219 |
#define | SPR_DBAT1U 0x21a |
#define | SPR_DBAT1L 0x21b |
#define | SPR_DBAT2U 0x21c |
#define | SPR_DBAT2L 0x21d |
#define | SPR_DBAT3U 0x21e |
#define | SPR_DBAT3L 0x21f |
#define | SPR_UMMCR0 0x3a8 |
#define | SPR_UMMCR1 0x3ac |
#define | SPR_UPMC1 0x3a9 |
#define | SPR_UPMC2 0x3aa |
#define | SPR_USIA 0x3ab |
#define | SPR_UPMC3 0x3ad |
#define | SPR_UPMC4 0x3ae |
#define | SPR_MMCR0 0x3b8 |
#define | SPR_PMC1 0x3b9 |
#define | SPR_PMC2 0x3ba |
#define | SPR_SIA 0x3bb |
#define | SPR_MMCR1 0x3bc |
#define | SPR_PMC3 0x3bd |
#define | SPR_PMC4 0x3be |
#define | SPR_SDA 0x3bf |
#define | SPR_DMISS 0x3d0 |
#define | SPR_DCMP 0x3d1 |
#define | SPR_HASH1 0x3d2 |
#define | SPR_HASH2 0x3d3 |
#define | SPR_IMISS 0x3d4 |
#define | SPR_ICMP 0x3d5 |
#define | SPR_RPA 0x3d6 |
#define | SPR_HID0 0x3f0 /* Hardware Implementation Register 0 */ |
#define | SPR_HID1 0x3f1 /* Hardware Implementation Register 1 */ |
#define | SPR_IABR 0x3f2 |
#define | SPR_HID2 0x3f3 /* Hardware Implementation Register 2 */ |
#define | SPR_HID4 0x3f4 /* Hardware Implementation Register 4 */ |
#define | SPR_DABR 0x3f5 |
#define | SPR_HID5 0x3f6 /* Hardware Implementation Register 5 */ |
#define | SPR_HID6 0x3f9 /* Hardware Implementation Register 6 */ |
#define | SPR_ICTC 0x3fb |
#define | SPR_THRM1 0x3fc |
#define | SPR_THRM2 0x3fd |
#define | SPR_THRM3 0x3fe |
#define | SPR_PIR 0x3ff |
#define | PPC_UT64(x) (strtol(x, NULL, 16)) |
#define | PPC_UT32(x) ((ut32)PPC_UT64(x)) |
#define | WSZ 128 |
#define | REPLACE(x, y) |
Functions | |
static ut64 | mask64 (ut64 mb, ut64 me) |
static ut32 | mask32 (ut32 mb, ut32 me) |
static int | can_replace (const char *str, int idx, int max_operands) |
static const char * | getspr (const char *reg) |
static int | replace (int argc, const char *argv[], char *newstr) |
static bool | parse (RzParse *p, const char *data, RzStrBuf *sb) |
Variables | |
RzParsePlugin | rz_parse_plugin_ppc_pseudo |
RZ_API RzLibStruct | rizin_plugin |
#define PFMT32x "lx" |
Definition at line 16 of file parse_ppc_pseudo.c.
Definition at line 96 of file parse_ppc_pseudo.c.
#define REPLACE | ( | x, | |
y | |||
) |
#define SPR_CTR 0x9 |
Definition at line 24 of file parse_ppc_pseudo.c.
#define SPR_DABR 0x3f5 |
Definition at line 86 of file parse_ppc_pseudo.c.
#define SPR_DAR 0x13 |
Definition at line 26 of file parse_ppc_pseudo.c.
#define SPR_DBAT0L 0x219 |
Definition at line 52 of file parse_ppc_pseudo.c.
#define SPR_DBAT0U 0x218 |
Definition at line 51 of file parse_ppc_pseudo.c.
#define SPR_DBAT1L 0x21b |
Definition at line 54 of file parse_ppc_pseudo.c.
#define SPR_DBAT1U 0x21a |
Definition at line 53 of file parse_ppc_pseudo.c.
#define SPR_DBAT2L 0x21d |
Definition at line 56 of file parse_ppc_pseudo.c.
#define SPR_DBAT2U 0x21c |
Definition at line 55 of file parse_ppc_pseudo.c.
#define SPR_DBAT3L 0x21f |
Definition at line 58 of file parse_ppc_pseudo.c.
#define SPR_DBAT3U 0x21e |
Definition at line 57 of file parse_ppc_pseudo.c.
#define SPR_DCMP 0x3d1 |
Definition at line 75 of file parse_ppc_pseudo.c.
#define SPR_DEC 0x16 |
Definition at line 27 of file parse_ppc_pseudo.c.
#define SPR_DMISS 0x3d0 |
Definition at line 74 of file parse_ppc_pseudo.c.
#define SPR_DSISR 0x12 |
Definition at line 25 of file parse_ppc_pseudo.c.
#define SPR_EAR 0x11a |
Definition at line 38 of file parse_ppc_pseudo.c.
#define SPR_HASH1 0x3d2 |
Definition at line 76 of file parse_ppc_pseudo.c.
#define SPR_HASH2 0x3d3 |
Definition at line 77 of file parse_ppc_pseudo.c.
#define SPR_HID0 0x3f0 /* Hardware Implementation Register 0 */ |
Definition at line 81 of file parse_ppc_pseudo.c.
#define SPR_HID1 0x3f1 /* Hardware Implementation Register 1 */ |
Definition at line 82 of file parse_ppc_pseudo.c.
#define SPR_HID2 0x3f3 /* Hardware Implementation Register 2 */ |
Definition at line 84 of file parse_ppc_pseudo.c.
#define SPR_HID4 0x3f4 /* Hardware Implementation Register 4 */ |
Definition at line 85 of file parse_ppc_pseudo.c.
#define SPR_HID5 0x3f6 /* Hardware Implementation Register 5 */ |
Definition at line 87 of file parse_ppc_pseudo.c.
#define SPR_HID6 0x3f9 /* Hardware Implementation Register 6 */ |
Definition at line 88 of file parse_ppc_pseudo.c.
#define SPR_IABR 0x3f2 |
Definition at line 83 of file parse_ppc_pseudo.c.
#define SPR_IBAT0L 0x211 |
Definition at line 44 of file parse_ppc_pseudo.c.
#define SPR_IBAT0U 0x210 |
Definition at line 43 of file parse_ppc_pseudo.c.
#define SPR_IBAT1L 0x213 |
Definition at line 46 of file parse_ppc_pseudo.c.
#define SPR_IBAT1U 0x212 |
Definition at line 45 of file parse_ppc_pseudo.c.
#define SPR_IBAT2L 0x215 |
Definition at line 48 of file parse_ppc_pseudo.c.
#define SPR_IBAT2U 0x214 |
Definition at line 47 of file parse_ppc_pseudo.c.
#define SPR_IBAT3L 0x217 |
Definition at line 50 of file parse_ppc_pseudo.c.
#define SPR_IBAT3U 0x216 |
Definition at line 49 of file parse_ppc_pseudo.c.
#define SPR_ICMP 0x3d5 |
Definition at line 79 of file parse_ppc_pseudo.c.
#define SPR_ICTC 0x3fb |
Definition at line 90 of file parse_ppc_pseudo.c.
#define SPR_IMISS 0x3d4 |
Definition at line 78 of file parse_ppc_pseudo.c.
#define SPR_LR 0x8 |
Definition at line 23 of file parse_ppc_pseudo.c.
#define SPR_MMCR0 0x3b8 |
Definition at line 66 of file parse_ppc_pseudo.c.
#define SPR_MMCR1 0x3bc |
Definition at line 70 of file parse_ppc_pseudo.c.
#define SPR_MQ 0x0 |
Definition at line 19 of file parse_ppc_pseudo.c.
#define SPR_PIR 0x3ff |
Definition at line 94 of file parse_ppc_pseudo.c.
#define SPR_PMC1 0x3b9 |
Definition at line 67 of file parse_ppc_pseudo.c.
#define SPR_PMC2 0x3ba |
Definition at line 68 of file parse_ppc_pseudo.c.
#define SPR_PMC3 0x3bd |
Definition at line 71 of file parse_ppc_pseudo.c.
#define SPR_PMC4 0x3be |
Definition at line 72 of file parse_ppc_pseudo.c.
#define SPR_PVR 0x11f |
Definition at line 41 of file parse_ppc_pseudo.c.
#define SPR_RPA 0x3d6 |
Definition at line 80 of file parse_ppc_pseudo.c.
#define SPR_RTCL 0x5 |
Definition at line 22 of file parse_ppc_pseudo.c.
#define SPR_RTCU 0x4 |
Definition at line 21 of file parse_ppc_pseudo.c.
#define SPR_SDA 0x3bf |
Definition at line 73 of file parse_ppc_pseudo.c.
#define SPR_SDR1 0x19 |
Definition at line 28 of file parse_ppc_pseudo.c.
#define SPR_SIA 0x3bb |
Definition at line 69 of file parse_ppc_pseudo.c.
#define SPR_SPEFSCR 0x200 |
Definition at line 42 of file parse_ppc_pseudo.c.
#define SPR_SPRG0 0x110 |
Definition at line 34 of file parse_ppc_pseudo.c.
#define SPR_SPRG1 0x111 |
Definition at line 35 of file parse_ppc_pseudo.c.
#define SPR_SPRG2 0x112 |
Definition at line 36 of file parse_ppc_pseudo.c.
#define SPR_SPRG3 0x113 |
Definition at line 37 of file parse_ppc_pseudo.c.
#define SPR_SRR0 0x1a |
Definition at line 29 of file parse_ppc_pseudo.c.
#define SPR_SRR1 0x1b |
Definition at line 30 of file parse_ppc_pseudo.c.
#define SPR_TBL 0x11c |
Definition at line 39 of file parse_ppc_pseudo.c.
#define SPR_TBRL 0x10c |
Definition at line 32 of file parse_ppc_pseudo.c.
#define SPR_TBRU 0x10d |
Definition at line 33 of file parse_ppc_pseudo.c.
#define SPR_TBU 0x11d |
Definition at line 40 of file parse_ppc_pseudo.c.
#define SPR_THRM1 0x3fc |
Definition at line 91 of file parse_ppc_pseudo.c.
#define SPR_THRM2 0x3fd |
Definition at line 92 of file parse_ppc_pseudo.c.
#define SPR_THRM3 0x3fe |
Definition at line 93 of file parse_ppc_pseudo.c.
#define SPR_UMMCR0 0x3a8 |
Definition at line 59 of file parse_ppc_pseudo.c.
#define SPR_UMMCR1 0x3ac |
Definition at line 60 of file parse_ppc_pseudo.c.
#define SPR_UPMC1 0x3a9 |
Definition at line 61 of file parse_ppc_pseudo.c.
#define SPR_UPMC2 0x3aa |
Definition at line 62 of file parse_ppc_pseudo.c.
#define SPR_UPMC3 0x3ad |
Definition at line 64 of file parse_ppc_pseudo.c.
#define SPR_UPMC4 0x3ae |
Definition at line 65 of file parse_ppc_pseudo.c.
#define SPR_USIA 0x3ab |
Definition at line 63 of file parse_ppc_pseudo.c.
#define SPR_VRSAVE 0x100 |
Definition at line 31 of file parse_ppc_pseudo.c.
#define SPR_XER 0x1 |
Definition at line 20 of file parse_ppc_pseudo.c.
#define WSZ 128 |
Definition at line 1618 of file parse_ppc_pseudo.c.
Definition at line 111 of file parse_ppc_pseudo.c.
References setup::idx, and cmd_descs_generate::str.
Referenced by replace().
Definition at line 124 of file parse_ppc_pseudo.c.
References NULL, reg, snprintf, SPR_CTR, SPR_DABR, SPR_DAR, SPR_DBAT0L, SPR_DBAT0U, SPR_DBAT1L, SPR_DBAT1U, SPR_DBAT2L, SPR_DBAT2U, SPR_DBAT3L, SPR_DBAT3U, SPR_DCMP, SPR_DEC, SPR_DMISS, SPR_DSISR, SPR_EAR, SPR_HASH1, SPR_HASH2, SPR_HID0, SPR_HID1, SPR_HID2, SPR_HID4, SPR_HID5, SPR_HID6, SPR_IABR, SPR_IBAT0L, SPR_IBAT0U, SPR_IBAT1L, SPR_IBAT1U, SPR_IBAT2L, SPR_IBAT2U, SPR_IBAT3L, SPR_IBAT3U, SPR_ICMP, SPR_ICTC, SPR_IMISS, SPR_LR, SPR_MMCR0, SPR_MMCR1, SPR_MQ, SPR_PIR, SPR_PMC1, SPR_PMC2, SPR_PMC3, SPR_PMC4, SPR_PVR, SPR_RPA, SPR_RTCL, SPR_RTCU, SPR_SDA, SPR_SDR1, SPR_SIA, SPR_SPEFSCR, SPR_SPRG0, SPR_SPRG1, SPR_SPRG2, SPR_SPRG3, SPR_SRR0, SPR_SRR1, SPR_TBL, SPR_TBRL, SPR_TBRU, SPR_TBU, SPR_THRM1, SPR_THRM2, SPR_THRM3, SPR_UMMCR0, SPR_UMMCR1, SPR_UPMC1, SPR_UPMC2, SPR_UPMC3, SPR_UPMC4, SPR_USIA, SPR_VRSAVE, and SPR_XER.
Referenced by replace().
Definition at line 99 of file parse_ppc_pseudo.c.
References ut64(), and UT64_MAX.
Referenced by replace().
Definition at line 1619 of file parse_ppc_pseudo.c.
References a, b, free(), i, len, malloc(), memcpy(), p, replace(), REPLACE, rz_str_replace(), rz_str_replace_char(), rz_str_trim(), rz_strbuf_set(), sb, cmd_descs_generate::str, strdup(), w0, w1, w2, w3, w4, w5, and WSZ.
Definition at line 295 of file parse_ppc_pseudo.c.
References argv, can_replace(), getspr(), i, k, mask32(), mask64(), MB, newstr(), NULL, op, ops, PFMT32x, PFMT64x, PPC_UT32, PPC_UT64, snprintf, cmd_descs_generate::str, autogen_x86imm::tmp, to, ut64(), and w.
Referenced by parse().
RZ_API RzLibStruct rizin_plugin |
Definition at line 1764 of file parse_ppc_pseudo.c.
RzParsePlugin rz_parse_plugin_ppc_pseudo |
Definition at line 1757 of file parse_ppc_pseudo.c.