1 # $NetBSD: Makefile.rumpkern,v 1.154 2015/02/04 12:48:05 pooka Exp $ 2 # 3 4 .include "${RUMPTOP}/Makefile.rump" 5 6 .include <bsd.own.mk> 7 8 LIB= rump 9 10 MAN= rump.3 rump_lwproc.3 11 12 .PATH: ${RUMPTOP}/librump/rumpkern \ 13 ${RUMPTOP}/librump/rumpkern/arch/generic \ 14 ${RUMPTOP}/../kern \ 15 ${RUMPTOP}/../uvm \ 16 ${RUMPTOP}/../conf \ 17 ${RUMPTOP}/../dev \ 18 ${RUMPTOP}/../crypto/nist_ctr_drbg \ 19 ${RUMPTOP}/../crypto/rijndael \ 20 ${RUMPTOP}/../crypto/cprng_fast \ 21 ${RUMPTOP}/../secmodel \ 22 ${RUMPTOP}/../secmodel/suser \ 23 ${RUMPTOP}/../compat/common 24 25 # 26 # Source modules, first the ones specifically implemented for librump. 27 # 28 SRCS+= rump.c rumpcopy.c cons.c emul.c etfs_wrap.c intr.c \ 29 lwproc.c klock.c kobj_rename.c ltsleep.c scheduler.c \ 30 signals.c sleepq.c threads.c vm.c hyperentropy.c \ 31 accessors.c 32 33 SRCS+= rumpkern_syscalls.c 34 35 # autogenerated into the correct namespace 36 RUMPOBJ_NORENAME= rump_syscalls.o rump_syscalls.pico rump_syscalls.po 37 38 .ifdef RUMP_KERNEL_IS_LIBC 39 CPPFLAGS+= -DRUMP_KERNEL_IS_LIBC 40 .endif 41 42 # optional hypervisor interfaces 43 #SRCS+= hyperstubs.c 44 45 # Multiprocessor or uniprocessor locking. TODO: select right 46 # locking at runtime. 47 .if ${RUMP_LOCKS_UP:Uno} == "yes" 48 SRCS+= locks_up.c 49 .else 50 SRCS+= locks.c 51 .endif 52 53 vers.c: ${RUMPTOP}/../conf/newvers.sh ${RUMPTOP}/../conf/osrelease.sh \ 54 ${RUMPTOP}/../sys/param.h ${_NETBSD_VERSION_DEPENDS} 55 ${_MKMSG_CREATE} vers.c 56 ${HOST_SH} ${RUMPTOP}/../conf/newvers.sh -i RUMP-ROAST -n -r 57 SRCS+= vers.c 58 CLEANFILES+= vers.c version 59 60 # autogenerated 61 # 62 SRCS+= rump_syscalls.c rumpkern_if_wrappers.c 63 64 # "auto"generated 65 SRCS+= devsw.c 66 67 # 68 # std kernel sources 69 # 70 # sys/kern 71 SRCS+= init_sysctl_base.c \ 72 kern_auth.c \ 73 kern_cfglock.c \ 74 kern_descrip.c \ 75 kern_event.c \ 76 kern_hook.c \ 77 kern_ksyms.c \ 78 kern_malloc.c \ 79 kern_module.c \ 80 kern_mutex_obj.c \ 81 kern_ntptime.c \ 82 kern_proc.c \ 83 kern_prot.c \ 84 kern_rate.c \ 85 kern_resource.c \ 86 kern_rndpool.c \ 87 kern_rndq.c \ 88 kern_rndsink.c \ 89 kern_stub.c \ 90 kern_syscall.c \ 91 kern_sysctl.c \ 92 kern_tc.c \ 93 kern_time.c \ 94 kern_timeout.c \ 95 kern_uidinfo.c \ 96 kern_xxx.c \ 97 param.c \ 98 subr_devsw.c \ 99 subr_callback.c \ 100 subr_copy.c \ 101 subr_cprng.c \ 102 subr_device.c \ 103 subr_evcnt.c \ 104 subr_extent.c \ 105 subr_hash.c \ 106 subr_humanize.c \ 107 subr_iostat.c \ 108 subr_kcpuset.c \ 109 subr_kobj.c \ 110 subr_log.c \ 111 subr_lwp_specificdata.c \ 112 subr_once.c \ 113 subr_pcq.c \ 114 subr_percpu.c \ 115 subr_prf.c \ 116 subr_pserialize.c \ 117 subr_specificdata.c \ 118 subr_time.c \ 119 subr_vmem.c \ 120 subr_workqueue.c \ 121 subr_xcall.c \ 122 sys_descrip.c \ 123 sys_generic.c \ 124 sys_module.c \ 125 sys_pipe.c \ 126 sys_select.c \ 127 syscalls.c \ 128 uipc_sem.c 129 130 # sys/uvm 131 SRCS+= uvm_aobj.c uvm_readahead.c uvm_object.c uvm_swapstub.c 132 133 # 4.4BSD secmodel. selection is hardcoded for now 134 SRCS+= secmodel.c 135 SRCS+= secmodel_suser.c 136 137 # the funny bit. this doesn't really belong here, but helps with the 138 # needs of kern_descrip.c. And since it's a fully dynamic interface, 139 # it doesn't pull in other gunk. 140 SRCS+= vnode_if.c 141 142 # sys/dev 143 SRCS+= clock_subr.c 144 145 # sys/dev/crypto 146 # Note: these are here only for cprng. More crypto algos for drivers 147 # are available from the rumpkern_crypto component 148 SRCS+= nist_ctr_drbg.c 149 SRCS+= rijndael-alg-fst.c 150 SRCS+= rijndael-api-fst.c 151 SRCS+= rijndael.c 152 SRCS+= cprng_fast.c 153 154 # compat 155 SRCS+= kern_select_50.c 156 SRCS+= kern_time_50.c 157 158 # Set RUMP_UNREAL_ALLOCATORS to "yes" to use memory allocation hypercalls 159 # directly instead of the kmem/pool allocators backed by hypercalls. 160 # Direct hypercalls may be a few percent faster, but don't emulate 161 # all kernel corner cases as well (not to mention if you want to debug the 162 # allocators themselves). 163 .if defined(RUMP_UNREAL_ALLOCATORS) && ${RUMP_UNREAL_ALLOCATORS} == "yes" 164 SRCS+= memalloc.c 165 .else 166 SRCS+= subr_kmem.c subr_pool.c 167 .endif 168 169 .ifdef RUMP_LOCKDEBUG 170 SRCS+= subr_lockdebug.c 171 .endif 172 173 .if ${RUMP_KTRACE} == "yes" 174 SRCS+= kern_ktrace.c 175 .endif 176 177 CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs 178 CPPFLAGS+= -I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev 179 AFLAGS+= -D_LOCORE -Wa,--fatal-warnings 180 181 # 182 # If archdir exists, it is required to provide: 183 # 1) kobj_reloc() and kobj_machdep() 184 # 2) rump_cpu_bootstrap() 185 # 3) ...? 186 # 4) PROFIT! 187 # 188 189 # 190 # Check if we are building compat. In compat mode we need to provide 191 # the kernel of our compat target (amd64->i386 & sparc64->sparc), so 192 # take MD stuff from the right arch. 193 # 194 .if defined(COMPAT_MACHINE_CPU) \ 195 && exists(${RUMPTOP}/librump/rumpkern/arch/${COMPAT_MACHINE_CPU}) 196 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${COMPAT_MACHINE_CPU} 197 LIBKERN_ARCH= ${COMPAT_MACHINE_CPU} 198 .elif defined(MLIBDIR) 199 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR} 200 LIBKERN_ARCH= ${MLIBDIR} 201 .elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}) 202 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU} 203 .else 204 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH} 205 .endif 206 .if !exists(${ARCHDIR}) 207 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/generic 208 .endif 209 210 .include "${ARCHDIR}/Makefile.inc" 211 .PATH: ${ARCHDIR} 212 213 .if ${MACHINE} == "sun3" 214 CPPFLAGS+= -Dsun3 215 .endif 216 217 # include libkern source files 218 KERNDIR=${RUMPTOP}/../lib/libkern 219 .if "${_RUMP_NATIVEABI}" == "yes" 220 KERNMISCCPPFLAGS+= -D_RUMPKERNEL 221 .endif 222 .include "${RUMPTOP}/../lib/libkern/Makefile.libkern" 223 224 # Some architectures require a little special massage with atomic 225 # compare-and-swap. This is because the kernel version is using 226 # instructions or routines unavailable to us in userspace. 227 # 228 .if (${MACHINE_CPU} == "arm" && "${FEAT_LDREX}" != "yes") \ 229 || ${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "hppa" \ 230 || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \ 231 || ${MACHINE_ARCH} == "vax" || ${MACHINE_ARCH} == "m68000" 232 CPPFLAGS+= -I${RUMPTOP}/../../common/lib/libc/atomic 233 SRCS+= atomic_cas_generic.c 234 #SRCS+= rump_atomic_cas_up.c 235 .endif 236 237 .include <bsd.lib.mk> 238 .include <bsd.klinks.mk> 239