Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

#	$NetBSD: Makefile.rumpkern,v 1.175.2.1 2019/09/03 07:47:59 martin Exp $
#

IOCONFDIR:=	${.PARSEDIR}
IOCONF=		MAINBUS.ioconf

LIB=		rump
COMMENT=	Rump kernel base

MAN=		rump.3 rump_lwproc.3

.PATH:	${RUMPTOP}/librump/rumpkern				\
	${RUMPTOP}/librump/rumpkern/arch/generic		\
	${RUMPTOP}/../kern					\
	${RUMPTOP}/../uvm					\
	${RUMPTOP}/../conf					\
	${RUMPTOP}/../dev					\
	${RUMPTOP}/../crypto/nist_hash_drbg			\
	${RUMPTOP}/../crypto/cprng_fast				\
	${RUMPTOP}/../secmodel					\
	${RUMPTOP}/../secmodel/suser				\
	${RUMPTOP}/../compat/common

#
# Source modules, first the ones specifically implemented for librump.
# 
SRCS+=	rump.c rumpcopy.c cons.c emul.c etfs_wrap.c intr.c	\
	lwproc.c klock.c kobj_rename.c ltsleep.c scheduler.c	\
	signals.c sleepq.c threads.c vm.c hyperentropy.c	\
	accessors.c

SRCS+=	rump_autoconf.c rumpkern_syscalls.c

# autogenerated into the correct namespace
RUMPOBJ_NORENAME= rump_syscalls.o rump_syscalls.pico rump_syscalls.po

.ifdef RUMP_KERNEL_IS_LIBC
CPPFLAGS+= -DRUMP_KERNEL_IS_LIBC
.endif

# Multiprocessor or uniprocessor locking.  TODO: select right
# locking at runtime.
.if ${RUMP_LOCKS_UP:Uno} == "yes"
SRCS+=	locks_up.c
.else
SRCS+=	locks.c
.endif

vers.c: ${RUMPTOP}/../conf/newvers.sh ${RUMPTOP}/../conf/osrelease.sh \
		${RUMPTOP}/../sys/param.h ${_NETBSD_VERSION_DEPENDS}
	${_MKMSG_CREATE} vers.c
	${HOST_SH} ${RUMPTOP}/../conf/newvers.sh -i RUMP-ROAST -n -R
SRCS+=		vers.c
CLEANFILES+=	vers.c version

# autogenerated
#
SRCS+=	rump_syscalls.c rumpkern_if_wrappers.c

# "auto"generated
SRCS+=	devsw.c

#
# std kernel sources
#
# sys/kern
SRCS+=	init_sysctl_base.c	\
	compat_stub.c		\
	kern_auth.c		\
	kern_cfglock.c		\
	kern_clock.c		\
	kern_descrip.c		\
	kern_event.c		\
	kern_hook.c		\
	kern_ksyms.c		\
	kern_malloc.c		\
	kern_module.c		\
	kern_mutex_obj.c	\
	kern_ntptime.c		\
	kern_proc.c		\
	kern_prot.c		\
	kern_rate.c		\
	kern_reboot.c		\
	kern_resource.c		\
	kern_rndpool.c		\
	kern_rndq.c		\
	kern_rndsink.c		\
	kern_rwlock_obj.c	\
	kern_scdebug.c		\
	kern_stub.c		\
	kern_ssp.c		\
	kern_syscall.c		\
	kern_sysctl.c		\
	kern_tc.c		\
	kern_threadpool.c	\
	kern_time.c		\
	kern_timeout.c		\
	kern_uidinfo.c		\
	param.c			\
	subr_autoconf.c		\
	subr_callback.c		\
	subr_copy.c		\
	subr_cprng.c		\
	subr_device.c		\
	subr_devsw.c		\
	subr_evcnt.c		\
	subr_extent.c		\
	subr_hash.c		\
	subr_humanize.c		\
	subr_iostat.c		\
	subr_kcpuset.c		\
	subr_kmem.c		\
	subr_kobj.c		\
	subr_localcount.c	\
	subr_log.c		\
	subr_lwp_specificdata.c	\
	subr_once.c		\
	subr_pcq.c		\
	subr_percpu.c		\
	subr_pool.c		\
	subr_prf.c		\
	subr_pserialize.c	\
	subr_psref.c		\
	subr_specificdata.c	\
	subr_time.c		\
	subr_thmap.c		\
	subr_vmem.c		\
	subr_workqueue.c	\
	subr_xcall.c		\
	sys_descrip.c		\
	sys_generic.c		\
	sys_module.c		\
	sys_pipe.c		\
	sys_select.c		\
	syscalls.c		\
	uipc_sem.c

# sys/uvm
SRCS+=	uvm_aobj.c uvm_readahead.c uvm_object.c uvm_swapstub.c

# 4.4BSD secmodel.  selection is hardcoded for now
SRCS+=	secmodel.c
SRCS+=	secmodel_suser.c

# the funny bit.  this doesn't really belong here, but helps with the
# needs of kern_descrip.c.  And since it's a fully dynamic interface,
# it doesn't pull in other gunk.
SRCS+=	vnode_if.c

# sys/dev
SRCS+=	clock_subr.c

# sys/dev/crypto
# Note: these are here only for cprng.  More crypto algos for drivers
# are available from the rumpkern_crypto component
SRCS+=	nist_hash_drbg.c
SRCS+=	cprng_fast.c

.include "${RUMPTOP}/Makefile.rump"
.include <bsd.own.mk>

# compat
.if !empty(RUMP_NBCOMPAT:M50)
SRCS+=	kern_select_50.c
SRCS+=	kern_time_50.c
SRCS+=	rndpseudo_50.c
.endif


.ifdef RUMP_LOCKDEBUG
SRCS+=		subr_lockdebug.c
.endif

.if ${RUMP_KTRACE} == "yes"
SRCS+=		kern_ktrace.c
.endif

CPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern
AFLAGS+=	-D_LOCORE -Wa,--fatal-warnings

#
# If archdir exists, it is required to provide:
# 1) kobj_reloc() and kobj_machdep()
# 2) rump_cpu_bootstrap()
# 3) ...?
# 4) PROFIT!
#

#
# Check if we are building compat.  In compat mode we need to provide
# the kernel of our compat target (amd64->i386 & sparc64->sparc), so
# take MD stuff from the right arch.
#
.if defined(COMPAT_MACHINE_CPU) \
    && exists(${RUMPTOP}/librump/rumpkern/arch/${COMPAT_MACHINE_CPU})
ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${COMPAT_MACHINE_CPU}
LIBKERN_ARCH=	${COMPAT_MACHINE_CPU}
.elif defined(MLIBDIR)
ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR}
LIBKERN_ARCH=	${MLIBDIR}
.elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU})
ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}
.else
ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH}
.endif
.if !exists(${ARCHDIR})
ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/generic
.endif

.include "${ARCHDIR}/Makefile.inc"
.PATH:	${ARCHDIR}

.if ${MACHINE} == "sun3"
CPPFLAGS+=	-Dsun3
.endif

# include libkern source files
KERNDIR=${RUMPTOP}/../lib/libkern
.if "${_RUMP_NATIVEABI}" == "yes"
KERNMISCCPPFLAGS+=	-D_RUMPKERNEL
.endif
.include "${RUMPTOP}/../lib/libkern/Makefile.libkern"

# Some architectures require a little special massage with atomic
# compare-and-swap.  This is because the kernel version is using
# instructions or routines unavailable to us in userspace.
#
.if (${MACHINE_CPU} == "arm" && "${FEAT_LDREX}" != "yes") \
    || ${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "hppa" \
    || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \
    || ${MACHINE_ARCH} == "vax" || ${MACHINE_ARCH} == "m68000"
CPPFLAGS+=	-I${RUMPTOP}/../../common/lib/libc/atomic
SRCS+=		atomic_cas_generic.c
#SRCS+=		rump_atomic_cas_up.c
.endif

.include <bsd.lib.mk>
.include <bsd.klinks.mk>