insn: get it to compile in create-diff-object

This commit is contained in:
Josh Poimboeuf 2014-05-30 07:39:14 -05:00
parent ecc5141676
commit cba7fd1f49
2 changed files with 7 additions and 3 deletions

View File

@ -1,14 +1,16 @@
include ../Makefile.inc include ../Makefile.inc
CFLAGS += -I../kmod/patch -Wall -g CFLAGS += -I../kmod/patch -Iinsn -Wall -g
LDFLAGS = -lelf LDFLAGS = -lelf
TARGETS = create-diff-object TARGETS = create-diff-object
all: $(TARGETS) all: $(TARGETS)
create-diff-object: create-diff-object.c list.h lookup.c lookup.h create-diff-object: create-diff-object.c list.h lookup.c lookup.h insn/insn.c \
$(CC) $(CFLAGS) create-diff-object.c lookup.c -o $@ $(LDFLAGS) insn/inat.c insn/inat-tables.c insn/asm/inat.h \
insn/asm/insn.h insn/asm/inat_types.h
$(CC) $(CFLAGS) create-diff-object.c lookup.c insn/insn.c insn/inat.c -o $@ $(LDFLAGS)
install: all install: all
$(INSTALL) -d $(LIBEXECDIR) $(INSTALL) -d $(LIBEXECDIR)

View File

@ -26,6 +26,8 @@
#include <asm/inat.h> #include <asm/inat.h>
#include <asm/insn.h> #include <asm/insn.h>
#define unlikely(a) a
/* Verify next sizeof(t) bytes can be on the same instruction */ /* Verify next sizeof(t) bytes can be on the same instruction */
#define validate_next(t, insn, n) \ #define validate_next(t, insn, n) \
((insn)->next_byte + sizeof(t) + n - (insn)->kaddr <= MAX_INSN_SIZE) ((insn)->next_byte + sizeof(t) + n - (insn)->kaddr <= MAX_INSN_SIZE)