From cba7fd1f49f5719ee792885942ec3fa28a8b85e0 Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Fri, 30 May 2014 07:39:14 -0500 Subject: [PATCH] insn: get it to compile in create-diff-object --- kpatch-build/Makefile | 8 +++++--- kpatch-build/insn/insn.c | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/kpatch-build/Makefile b/kpatch-build/Makefile index c783509..8f70c34 100644 --- a/kpatch-build/Makefile +++ b/kpatch-build/Makefile @@ -1,14 +1,16 @@ include ../Makefile.inc -CFLAGS += -I../kmod/patch -Wall -g +CFLAGS += -I../kmod/patch -Iinsn -Wall -g LDFLAGS = -lelf TARGETS = create-diff-object all: $(TARGETS) -create-diff-object: create-diff-object.c list.h lookup.c lookup.h - $(CC) $(CFLAGS) create-diff-object.c lookup.c -o $@ $(LDFLAGS) +create-diff-object: create-diff-object.c list.h lookup.c lookup.h insn/insn.c \ + 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) -d $(LIBEXECDIR) diff --git a/kpatch-build/insn/insn.c b/kpatch-build/insn/insn.c index 54fcffe..7acdc96 100644 --- a/kpatch-build/insn/insn.c +++ b/kpatch-build/insn/insn.c @@ -26,6 +26,8 @@ #include #include +#define unlikely(a) a + /* Verify next sizeof(t) bytes can be on the same instruction */ #define validate_next(t, insn, n) \ ((insn)->next_byte + sizeof(t) + n - (insn)->kaddr <= MAX_INSN_SIZE)