Skip to content

Commit 387425b

Browse files
authored
Merge pull request F-Stack#304 from DonBearH/f_stack_aarch64
Support aarch64
2 parents e427a09 + 31b0387 commit 387425b

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

freebsd/arm64/include/pcpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ get_curthread(void)
6464
}
6565

6666
#define curthread get_curthread()
67+
#undef curthread
6768

6869
#define PCPU_GET(member) (get_pcpu()->pc_ ## member)
6970
#define PCPU_ADD(member, value) (get_pcpu()->pc_ ## member += (value))

lib/Makefile

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,30 @@ FF_KNI=1
2323
#FF_NETGRAPH=1
2424
#FF_IPFW=1
2525

26+
include ${TOPDIR}/mk/kern.pre.mk
27+
2628
ifeq ($(FF_DPDK),)
29+
ifeq (${MACHINE_CPUARCH},aarch64)
30+
FF_DPDK=${TOPDIR}/dpdk/build
31+
else
2732
FF_DPDK=${TOPDIR}/dpdk/x86_64-native-linuxapp-gcc
2833
endif
34+
endif
2935

3036
ifdef RTE_SDK
37+
ifeq (${MACHINE_CPUARCH},aarch64)
38+
FF_DPDK=${RTE_SDK}/build
39+
else
3140
FF_DPDK=${RTE_SDK}/x86_64-native-linuxapp-gcc
3241
endif
42+
endif
3343

3444
DPDK_CFLAGS= -Wall -Werror -include ${FF_DPDK}/include/rte_config.h
3545
DPDK_CFLAGS+= -march=native -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
3646
DPDK_CFLAGS+= -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2
3747
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
3848
DPDK_CFLAGS+= -I${FF_DPDK}/include
3949

40-
include ${TOPDIR}/mk/kern.pre.mk
41-
4250
KERNPREINCLUDES:= ${INCLUDES}
4351
INCLUDES= -I${OVERRIDE_INCLUDES_ROOT} ${KERNPREINCLUDES}
4452
INCLUDES+= -I./machine_include
@@ -92,6 +100,13 @@ endif
92100

93101
endif
94102

103+
#
104+
# fix the MACHINE_CPUARCH to match the FreeBSD directory name
105+
#
106+
ifeq (${MACHINE_CPUARCH},aarch64)
107+
MACHINE_CPUARCH=arm64
108+
endif
109+
95110

96111
#
97112
# Distilled from FreeBSD src/sys/conf/Makefile.i386
@@ -262,15 +277,27 @@ KERN_MHEADERS+= \
262277
KERN_MSRCS+= \
263278
linker_if.m
264279

265-
280+
ifeq (${MACHINE_CPUARCH},arm64)
266281
LIBKERN_SRCS+= \
267282
bcd.c \
268283
crc32.c \
269284
inet_ntoa.c \
270285
jenkins_hash.c \
271286
strlcpy.c \
272287
strnlen.c \
273-
zlib.c
288+
zlib.c \
289+
fls.c \
290+
flsl.c
291+
else
292+
LIBKERN_SRCS+= \
293+
bcd.c \
294+
crc32.c \
295+
inet_ntoa.c \
296+
jenkins_hash.c \
297+
strlcpy.c \
298+
strnlen.c \
299+
zlib.c
300+
endif
274301

275302

276303
MACHINE_SRCS+= \

mk/compiler.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
ifndef COMPILER_TYPE
66
ifeq ($(patsubst gcc%,gcc,$(notdir ${CC})),gcc)
7-
COMPILER_TYPE:= gcc
7+
COMPILER_TYPE:= gcc
88
else ifeq ($(notdir ${CC}), clang)
99
COMPILER_TYPE:= clang
1010
else

mk/kern.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ CFLAGS+=
101101
INLINE_LIMIT?= 8000
102102
endif
103103

104+
ifeq (${MACHINE_CPUARCH},arm64)
105+
INLINE_LIMIT?= 15000
106+
endif
107+
104108
#
105109
# GCC SSP support
106110
#

0 commit comments

Comments
 (0)