@@ -247,6 +247,7 @@ entry-y = 0x$(shell $(NM) vmlinux 2>/dev/null \
| grep "\bkernel_entry\b" | cut -f1 -d \ )
cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic
+LINUXINCLUDE += -I$(srctree)/arch/mips/include/asm/mach-generic
drivers-$(CONFIG_PCI) += arch/mips/pci/
#
@@ -4,4 +4,7 @@
platform-$(CONFIG_CAVIUM_OCTEON_SOC) += cavium-octeon/
cflags-$(CONFIG_CAVIUM_OCTEON_SOC) += \
-I$(srctree)/arch/mips/include/asm/mach-cavium-octeon
+ifdef CONFIG_CAVIUM_OCTEON_SOC
+LINUXINCLUDE += -I$(srctree)/arch/mips/include/asm/mach-cavium-octeon
+endif
load-$(CONFIG_CAVIUM_OCTEON_SOC) += 0xffffffff81100000
@@ -12,7 +12,7 @@
#ifndef _ASM_CHECKSUM_H
#define _ASM_CHECKSUM_H
-#ifdef CONFIG_GENERIC_CSUM
+#if defined(CONFIG_GENERIC_CSUM) || defined(__EMITTING_BPF__)
#include <asm-generic/checksum.h>
#else
@@ -13,7 +13,7 @@
#define __SWAB_64_THRU_32__
-#if !defined(__mips16) && \
+#if !defined(__mips16) && !defined(__EMITTING_BPF__) && \
((defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \
defined(_MIPS_ARCH_LOONGSON3A))
When building for the eBPF target archecture. Inline asm cannot be used as MIPS instructions are fundamentally incompatible with eBPF bytecode. The preprocessor symbol __EMITTING_BPF__ is used to gate the inclusion of inline asm in constructs used the by the BPF programs. Also make the Makefile symbol LINUXINCLUDE contain the asm/mach-MACHINE directory so that the BPF compilation process can pull in the necessary include files. Signed-off-by: David Daney <david.daney@cavium.com> --- arch/mips/Makefile | 1 + arch/mips/cavium-octeon/Platform | 3 +++ arch/mips/include/asm/checksum.h | 2 +- arch/mips/include/uapi/asm/swab.h | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-)