summaryrefslogtreecommitdiffstats
path: root/sys/modules
diff options
context:
space:
mode:
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/Makefile5
-rw-r--r--sys/modules/cloudabi/Makefile2
-rw-r--r--sys/modules/cloudabi32/Makefile42
-rw-r--r--sys/modules/cloudabi64/Makefile31
4 files changed, 77 insertions, 3 deletions
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index f3d2435..18af4ba 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -75,6 +75,7 @@ SUBDIR= \
${_cfi} \
${_ciss} \
cloudabi \
+ ${_cloudabi32} \
${_cloudabi64} \
${_cm} \
${_cmx} \
@@ -768,6 +769,10 @@ _epic= epic
_igb= igb
.endif
+.if (${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "armv6" || \
+ ${MACHINE_CPUARCH} == "i386")
+_cloudabi32= cloudabi32
+.endif
.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
_cloudabi64= cloudabi64
.endif
diff --git a/sys/modules/cloudabi/Makefile b/sys/modules/cloudabi/Makefile
index bba5036..c608580 100644
--- a/sys/modules/cloudabi/Makefile
+++ b/sys/modules/cloudabi/Makefile
@@ -5,6 +5,6 @@
KMOD= cloudabi
SRCS= cloudabi_clock.c cloudabi_errno.c cloudabi_fd.c cloudabi_file.c \
cloudabi_futex.c cloudabi_mem.c cloudabi_proc.c cloudabi_random.c \
- cloudabi_sock.c cloudabi_thread.c vnode_if.h
+ cloudabi_sock.c cloudabi_thread.c cloudabi_vdso.c vnode_if.h
.include <bsd.kmod.mk>
diff --git a/sys/modules/cloudabi32/Makefile b/sys/modules/cloudabi32/Makefile
new file mode 100644
index 0000000..61e5142
--- /dev/null
+++ b/sys/modules/cloudabi32/Makefile
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+SYSDIR?=${.CURDIR}/../..
+
+.PATH: ${SYSDIR}/compat/cloudabi32
+.PATH: ${SYSDIR}/${MACHINE_CPUARCH}/cloudabi32
+.PATH: ${SYSDIR}/${MACHINE}/cloudabi32
+
+KMOD= cloudabi32
+SRCS= cloudabi32_fd.c cloudabi32_module.c cloudabi32_poll.c \
+ cloudabi32_sock.c cloudabi32_syscalls.c cloudabi32_sysent.c \
+ cloudabi32_sysvec.c cloudabi32_thread.c
+
+OBJS= cloudabi32_vdso_blob.o
+CLEANFILES=cloudabi32_vdso.o
+
+.if ${MACHINE_CPUARCH} == "amd64"
+VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S
+OUTPUT_TARGET=elf64-x86-64-freebsd
+BINARY_ARCHITECTURE=i386
+.elif ${MACHINE_ARCH} == "armv6"
+VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_armv6.S
+OUTPUT_TARGET=elf32-littlearm
+BINARY_ARCHITECTURE=arm
+.elif ${MACHINE_CPUARCH} == "i386"
+VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_i686.S
+OUTPUT_TARGET=elf32-i386-freebsd
+BINARY_ARCHITECTURE=i386
+.endif
+
+cloudabi32_vdso.o: ${VDSO_SRCS}
+ ${CC} -x assembler-with-cpp -m32 -shared -nostdinc -nostdlib \
+ -Wl,-T${SYSDIR}/compat/cloudabi/cloudabi_vdso.lds \
+ ${VDSO_SRCS} -o ${.TARGET}
+
+cloudabi32_vdso_blob.o: cloudabi32_vdso.o
+ ${OBJCOPY} --input-target binary \
+ --output-target ${OUTPUT_TARGET} \
+ --binary-architecture ${BINARY_ARCHITECTURE} \
+ cloudabi32_vdso.o ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cloudabi64/Makefile b/sys/modules/cloudabi64/Makefile
index 3aee96d..1769854 100644
--- a/sys/modules/cloudabi64/Makefile
+++ b/sys/modules/cloudabi64/Makefile
@@ -1,11 +1,38 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../compat/cloudabi64
-.PATH: ${.CURDIR}/../../${MACHINE}/cloudabi64
+SYSDIR?=${.CURDIR}/../..
+
+.PATH: ${SYSDIR}/compat/cloudabi64
+.PATH: ${SYSDIR}/${MACHINE_CPUARCH}/cloudabi64
+.PATH: ${SYSDIR}/${MACHINE}/cloudabi64
KMOD= cloudabi64
SRCS= cloudabi64_fd.c cloudabi64_module.c cloudabi64_poll.c \
cloudabi64_sock.c cloudabi64_syscalls.c cloudabi64_sysent.c \
cloudabi64_sysvec.c cloudabi64_thread.c
+OBJS= cloudabi64_vdso_blob.o
+CLEANFILES=cloudabi64_vdso.o
+
+.if ${MACHINE_CPUARCH} == "aarch64"
+VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_aarch64.S
+OUTPUT_TARGET=elf64-littleaarch64
+BINARY_ARCHITECTURE=aarch64
+.elif ${MACHINE_CPUARCH} == "amd64"
+VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_x86_64.S
+OUTPUT_TARGET=elf64-x86-64-freebsd
+BINARY_ARCHITECTURE=i386
+.endif
+
+cloudabi64_vdso.o: ${VDSO_SRCS}
+ ${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib \
+ -Wl,-T${SYSDIR}/compat/cloudabi/cloudabi_vdso.lds \
+ ${VDSO_SRCS} -o ${.TARGET}
+
+cloudabi64_vdso_blob.o: cloudabi64_vdso.o
+ ${OBJCOPY} --input-target binary \
+ --output-target ${OUTPUT_TARGET} \
+ --binary-architecture ${BINARY_ARCHITECTURE} \
+ cloudabi64_vdso.o ${.TARGET}
+
.include <bsd.kmod.mk>
OpenPOWER on IntegriCloud