Skip to content

Commit

Permalink
Merge pull request F-Stack#304 from DonBearH/f_stack_aarch64
Browse files Browse the repository at this point in the history
Support aarch64
  • Loading branch information
whl739 authored Nov 8, 2018
2 parents e427a09 + 31b0387 commit 387425b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
1 change: 1 addition & 0 deletions freebsd/arm64/include/pcpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ get_curthread(void)
}

#define curthread get_curthread()
#undef curthread

#define PCPU_GET(member) (get_pcpu()->pc_ ## member)
#define PCPU_ADD(member, value) (get_pcpu()->pc_ ## member += (value))
Expand Down
35 changes: 31 additions & 4 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,30 @@ FF_KNI=1
#FF_NETGRAPH=1
#FF_IPFW=1

include ${TOPDIR}/mk/kern.pre.mk

ifeq ($(FF_DPDK),)
ifeq (${MACHINE_CPUARCH},aarch64)
FF_DPDK=${TOPDIR}/dpdk/build
else
FF_DPDK=${TOPDIR}/dpdk/x86_64-native-linuxapp-gcc
endif
endif

ifdef RTE_SDK
ifeq (${MACHINE_CPUARCH},aarch64)
FF_DPDK=${RTE_SDK}/build
else
FF_DPDK=${RTE_SDK}/x86_64-native-linuxapp-gcc
endif
endif

DPDK_CFLAGS= -Wall -Werror -include ${FF_DPDK}/include/rte_config.h
DPDK_CFLAGS+= -march=native -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
DPDK_CFLAGS+= -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2
DPDK_CFLAGS+= -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2
DPDK_CFLAGS+= -I${FF_DPDK}/include

include ${TOPDIR}/mk/kern.pre.mk

KERNPREINCLUDES:= ${INCLUDES}
INCLUDES= -I${OVERRIDE_INCLUDES_ROOT} ${KERNPREINCLUDES}
INCLUDES+= -I./machine_include
Expand Down Expand Up @@ -92,6 +100,13 @@ endif

endif

#
# fix the MACHINE_CPUARCH to match the FreeBSD directory name
#
ifeq (${MACHINE_CPUARCH},aarch64)
MACHINE_CPUARCH=arm64
endif


#
# Distilled from FreeBSD src/sys/conf/Makefile.i386
Expand Down Expand Up @@ -262,15 +277,27 @@ KERN_MHEADERS+= \
KERN_MSRCS+= \
linker_if.m


ifeq (${MACHINE_CPUARCH},arm64)
LIBKERN_SRCS+= \
bcd.c \
crc32.c \
inet_ntoa.c \
jenkins_hash.c \
strlcpy.c \
strnlen.c \
zlib.c
zlib.c \
fls.c \
flsl.c
else
LIBKERN_SRCS+= \
bcd.c \
crc32.c \
inet_ntoa.c \
jenkins_hash.c \
strlcpy.c \
strnlen.c \
zlib.c
endif


MACHINE_SRCS+= \
Expand Down
2 changes: 1 addition & 1 deletion mk/compiler.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

ifndef COMPILER_TYPE
ifeq ($(patsubst gcc%,gcc,$(notdir ${CC})),gcc)
COMPILER_TYPE:= gcc
COMPILER_TYPE:= gcc
else ifeq ($(notdir ${CC}), clang)
COMPILER_TYPE:= clang
else
Expand Down
4 changes: 4 additions & 0 deletions mk/kern.mk
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ CFLAGS+=
INLINE_LIMIT?= 8000
endif

ifeq (${MACHINE_CPUARCH},arm64)
INLINE_LIMIT?= 15000
endif

#
# GCC SSP support
#
Expand Down

0 comments on commit 387425b

Please sign in to comment.