Clean up plugin build workflow and docs
This commit is contained in:
@@ -1,15 +1,24 @@
|
||||
NAME=asm_adsp219x
|
||||
R2_PLUGINS=$(shell r2 -H R2_USER_PLUGINS)
|
||||
R2_INCDIR=$(shell r2 -H R2_INCDIR)
|
||||
R2_LIBDIR=$(shell r2 -H R2_LIBDIR)
|
||||
NAME ?= asm_adsp219x
|
||||
CC ?= gcc
|
||||
CFLAGS ?= -Wall -Wextra -O2 -fPIC
|
||||
LDFLAGS ?=
|
||||
LDLIBS ?= -lr_arch -lr_util
|
||||
|
||||
R2_PLUGINS := $(shell r2 -H R2_USER_PLUGINS)
|
||||
R2_INCDIR := $(shell r2 -H R2_INCDIR)
|
||||
R2_LIBDIR := $(shell r2 -H R2_LIBDIR)
|
||||
|
||||
CPPFLAGS += -I$(R2_INCDIR) -I$(R2_INCDIR)/sdb
|
||||
|
||||
all: $(NAME).so
|
||||
|
||||
$(NAME).so: $(NAME).c
|
||||
gcc -shared -Wall -O2 -fPIC \
|
||||
-I$(R2_INCDIR) -I$(R2_INCDIR)/sdb \
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -shared $(LDFLAGS) \
|
||||
-L$(R2_LIBDIR) \
|
||||
$(NAME).c -o $@ -lr_arch -lr_util
|
||||
$< -o $@ $(LDLIBS)
|
||||
|
||||
test: $(NAME).so
|
||||
r2 -q -a adsp219x -L ./$(NAME).so -b 24 -c "pd 48" ../examples/isa_test.bin >/dev/null
|
||||
|
||||
install: $(NAME).so
|
||||
mkdir -p $(R2_PLUGINS)
|
||||
@@ -21,4 +30,4 @@ uninstall:
|
||||
clean:
|
||||
rm -f $(NAME).so
|
||||
|
||||
.PHONY: all install uninstall clean
|
||||
.PHONY: all test install uninstall clean
|
||||
|
||||
@@ -10,6 +10,9 @@ ADSP-2191) 24-bit instructions in radare2 and iaito.
|
||||
|
||||
Requires: GCC, radare2 >= 5.8.0 (RArchPlugin API).
|
||||
|
||||
The `Makefile` also provides `make test`, which builds the plugin and
|
||||
runs a smoke test against `../examples/isa_test.bin`.
|
||||
|
||||
## Usage
|
||||
|
||||
r2 -a adsp219x -b 24 firmware.bin
|
||||
@@ -20,9 +23,16 @@ Compare against the assembler-verified test ROM:
|
||||
|
||||
r2 -a adsp219x -b 24 -q -c "pd 48" ../examples/isa_test.bin
|
||||
|
||||
Or run the local plugin without installing it:
|
||||
|
||||
make test
|
||||
|
||||
The test ROM (`isa_test.dsp`) was assembled with open21xx and
|
||||
contains known opcodes for all major instruction types.
|
||||
|
||||
For the current verification matrix and remaining structural-only
|
||||
types, see `TESTING.md`.
|
||||
|
||||
## Coding Standards
|
||||
|
||||
This plugin follows the GNU Coding Standards for C source code.
|
||||
|
||||
@@ -64,6 +64,7 @@ get_reg (int gp, int idx)
|
||||
static bool
|
||||
decode (RArchSession *as, RAnalOp *op, RAnalOpMask mask)
|
||||
{
|
||||
(void) as;
|
||||
ut32 ins, ins2 = 0;
|
||||
const ut8 *b = op->bytes;
|
||||
int avail = op->size;
|
||||
@@ -814,6 +815,7 @@ decode (RArchSession *as, RAnalOp *op, RAnalOpMask mask)
|
||||
|
||||
static int archinfo (RArchSession *s, ut32 q)
|
||||
{
|
||||
(void) s;
|
||||
switch (q) {
|
||||
case R_ARCH_INFO_CODE_ALIGN: return 3;
|
||||
case R_ARCH_INFO_MINOP_SIZE: case R_ARCH_INFO_MAXOP_SIZE: return 3;
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user