1 1.45.2.6 yamt # $NetBSD: Makefile.rumpkern,v 1.45.2.6 2010/08/11 22:55:06 yamt Exp $ 2 1.45.2.2 yamt # 3 1.45.2.2 yamt 4 1.45.2.2 yamt .include "${RUMPTOP}/Makefile.rump" 5 1.45.2.2 yamt 6 1.45.2.2 yamt LIB= rump 7 1.45.2.2 yamt 8 1.45.2.2 yamt .PATH: ${RUMPTOP}/librump/rumpkern \ 9 1.45.2.2 yamt ${RUMPTOP}/../kern \ 10 1.45.2.5 yamt ${RUMPTOP}/../uvm \ 11 1.45.2.2 yamt ${RUMPTOP}/../conf \ 12 1.45.2.2 yamt ${RUMPTOP}/../dev \ 13 1.45.2.5 yamt ${RUMPTOP}/../secmodel/suser 14 1.45.2.2 yamt 15 1.45.2.2 yamt # 16 1.45.2.2 yamt # Source modules, first the ones specifically implemented for librump. 17 1.45.2.2 yamt # 18 1.45.2.6 yamt SRCS= rump.c rumpcopy.c emul.c intr.c klock.c kobj_rename.c \ 19 1.45.2.6 yamt ltsleep.c memalloc.c scheduler.c signals.c sleepq.c \ 20 1.45.2.6 yamt sysproxy_socket.c threads.c vm.c 21 1.45.2.6 yamt SRCS+= compat.c 22 1.45.2.6 yamt 23 1.45.2.6 yamt # Multiprocessor or uniprocessor locking. TODO: select right 24 1.45.2.6 yamt # locking at runtime. 25 1.45.2.6 yamt SRCS+= locks.c 26 1.45.2.6 yamt #SRCS+= locks_up.c 27 1.45.2.5 yamt 28 1.45.2.6 yamt vers.c: ${RUMPTOP}/../conf/newvers.sh ${RUMPTOP}/../conf/osrelease.sh ${RUMPTOP}/../sys/param.h 29 1.45.2.5 yamt ${_MKMSG_CREATE} vers.c 30 1.45.2.5 yamt ${HOST_SH} ${RUMPTOP}/../conf/newvers.sh -i RUMP-ROAST -n 31 1.45.2.5 yamt SRCS+= vers.c 32 1.45.2.5 yamt CLEANFILES+= vers.c version 33 1.45.2.2 yamt 34 1.45.2.6 yamt # use MI pmap for archs not conforming to kernel ABI 35 1.45.2.6 yamt .ifndef RUMPKMOD 36 1.45.2.5 yamt SRCS+= pmap_stub.c 37 1.45.2.6 yamt .endif 38 1.45.2.2 yamt 39 1.45.2.2 yamt # autogenerated 40 1.45.2.2 yamt # 41 1.45.2.5 yamt SRCS+= rump_syscalls.c rumpkern_if_wrappers.c 42 1.45.2.2 yamt 43 1.45.2.6 yamt # "auto"generated 44 1.45.2.6 yamt SRCS+= devsw.c 45 1.45.2.6 yamt 46 1.45.2.2 yamt # 47 1.45.2.2 yamt # Rest are from the std kernel sources. 48 1.45.2.2 yamt # 49 1.45.2.2 yamt # sys/kern 50 1.45.2.5 yamt SRCS+= init_sysctl_base.c kern_auth.c kern_descrip.c kern_event.c \ 51 1.45.2.5 yamt kern_hook.c kern_ksyms.c kern_malloc_stdtype.c kern_module.c \ 52 1.45.2.6 yamt kern_mutex_obj.c kern_ntptime.c kern_proc.c kern_rate.c \ 53 1.45.2.6 yamt kern_resource.c kern_stub.c kern_syscall.c kern_sysctl.c \ 54 1.45.2.6 yamt kern_tc.c kern_timeout.c kern_uidinfo.c param.c sys_descrip.c \ 55 1.45.2.6 yamt sys_generic.c sys_module.c sys_pipe.c sys_select.c syscalls.c 56 1.45.2.2 yamt 57 1.45.2.2 yamt # sys/kern subr (misc) 58 1.45.2.5 yamt SRCS+= subr_devsw.c subr_callback.c subr_copy.c subr_device.c \ 59 1.45.2.5 yamt subr_evcnt.c subr_extent.c subr_hash.c subr_humanize.c \ 60 1.45.2.6 yamt subr_iostat.c subr_kobj.c subr_log.c subr_lwp_specificdata.c \ 61 1.45.2.6 yamt subr_once.c subr_prf.c subr_specificdata.c subr_time.c \ 62 1.45.2.6 yamt subr_workqueue.c subr_xcall.c 63 1.45.2.5 yamt 64 1.45.2.5 yamt # sys/uvm 65 1.45.2.5 yamt SRCS+= uvm_readahead.c 66 1.45.2.2 yamt 67 1.45.2.2 yamt # 4.4BSD secmodel. selection is hardcoded for now 68 1.45.2.5 yamt SRCS+= secmodel_suser.c 69 1.45.2.2 yamt 70 1.45.2.2 yamt # the funny bit. this doesn't really belong here, but helps with the 71 1.45.2.2 yamt # needs of kern_descrip.c. And since it's a fully dynamic interface, 72 1.45.2.2 yamt # it doesn't pull in other gunk. 73 1.45.2.2 yamt SRCS+= vnode_if.c 74 1.45.2.2 yamt 75 1.45.2.2 yamt # sys/dev 76 1.45.2.2 yamt SRCS+= clock_subr.c 77 1.45.2.2 yamt 78 1.45.2.5 yamt # Flip the comment to the other line if you want to use malloc(3) 79 1.45.2.5 yamt # directly instead of the kernel allocators backed by malloc(3)/mmap(2). 80 1.45.2.5 yamt # Libc malloc is a few percent faster, but doesn't emulate all kernel 81 1.45.2.5 yamt # corner cases as well (not to mention if you want to debug the 82 1.45.2.5 yamt # allocators themselves). 83 1.45.2.5 yamt #CPPFLAGS+= -DRUMP_USE_UNREAL_ALLOCATORS 84 1.45.2.5 yamt SRCS+= subr_kmem.c subr_percpu.c subr_pool.c subr_vmem.c 85 1.45.2.2 yamt 86 1.45.2.2 yamt # no shlib_version because this is automatically in sync with lib/librump 87 1.45.2.2 yamt SHLIB_MAJOR= 0 88 1.45.2.2 yamt SHLIB_MINOR= 0 89 1.45.2.2 yamt 90 1.45.2.4 yamt CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs 91 1.45.2.4 yamt CPPFLAGS+= -I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev 92 1.45.2.2 yamt AFLAGS+= -D_LOCORE -Wa,-fatal-warnings 93 1.45.2.2 yamt 94 1.45.2.2 yamt # 95 1.45.2.2 yamt # If archdir exists, it is required to provide: 96 1.45.2.2 yamt # 1) kobj_reloc() and kobj_machdep() 97 1.45.2.5 yamt # 2) rump_cpu_bootstrap() 98 1.45.2.5 yamt # 3) ...? 99 1.45.2.5 yamt # 4) PROFIT! 100 1.45.2.2 yamt # 101 1.45.2.2 yamt 102 1.45.2.2 yamt # 103 1.45.2.2 yamt # Check if we are building compat. In compat mode we need to provide 104 1.45.2.2 yamt # the kernel of our compat target (amd64->i386 & sparc64->sparc), so 105 1.45.2.2 yamt # take MD stuff from the right arch. 106 1.45.2.2 yamt # 107 1.45.2.5 yamt .ifdef MLIBDIR 108 1.45.2.5 yamt ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR} 109 1.45.2.5 yamt LIBKERN_ARCH= ${MLIBDIR} 110 1.45.2.5 yamt .elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}) 111 1.45.2.5 yamt ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU} 112 1.45.2.2 yamt .else 113 1.45.2.2 yamt ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH} 114 1.45.2.2 yamt .endif 115 1.45.2.2 yamt .if exists(${ARCHDIR}) 116 1.45.2.2 yamt .include "${ARCHDIR}/Makefile.inc" 117 1.45.2.2 yamt .PATH: ${ARCHDIR} 118 1.45.2.2 yamt .else 119 1.45.2.5 yamt SRCS+= kobj_stubs.c rumpcpu_generic.c 120 1.45.2.2 yamt .endif 121 1.45.2.2 yamt 122 1.45.2.6 yamt .if ${MACHINE} == "sun3" 123 1.45.2.6 yamt CPPFLAGS+= -Dsun3 124 1.45.2.6 yamt .endif 125 1.45.2.6 yamt 126 1.45.2.2 yamt # include libkern source files 127 1.45.2.2 yamt KERNDIR=${RUMPTOP}/../lib/libkern 128 1.45.2.6 yamt .ifdef RUMPKMOD 129 1.45.2.6 yamt KERNMISCCPPFLAGS+= -D_RUMPKERNEL 130 1.45.2.6 yamt .endif 131 1.45.2.2 yamt .include "${RUMPTOP}/../lib/libkern/Makefile.libkern" 132 1.45.2.2 yamt 133 1.45.2.2 yamt # Some architectures require a little special massage with atomic 134 1.45.2.2 yamt # compare-and-swap. This is because the kernel version is using 135 1.45.2.2 yamt # instructions or routines unavailable to us in userspace. We 136 1.45.2.2 yamt # use effectively the multiprocessor version of the userspace ops. 137 1.45.2.2 yamt # 138 1.45.2.2 yamt .if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \ 139 1.45.2.2 yamt || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \ 140 1.45.2.5 yamt || ${MACHINE_CPU} == "vax" || ${MACHINE_ARCH} == "m68000" 141 1.45.2.2 yamt CPPFLAGS+= -I${RUMPTOP}/../../common/lib/libc/atomic 142 1.45.2.2 yamt SRCS+= atomic_cas_generic.c 143 1.45.2.2 yamt .endif 144 1.45.2.2 yamt 145 1.45.2.2 yamt .include <bsd.lib.mk> 146 1.45.2.2 yamt .include <bsd.klinks.mk> 147