1 # $NetBSD: Makefile.rumpkern,v 1.155 2015/04/14 13:32:34 riastradh 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 SRCS+= rndpseudo_50.c 158 159 # Set RUMP_UNREAL_ALLOCATORS to "yes" to use memory allocation hypercalls 160 # directly instead of the kmem/pool allocators backed by hypercalls. 161 # Direct hypercalls may be a few percent faster, but don't emulate 162 # all kernel corner cases as well (not to mention if you want to debug the 163 # allocators themselves). 164 .if defined(RUMP_UNREAL_ALLOCATORS) && ${RUMP_UNREAL_ALLOCATORS} == "yes" 165 SRCS+= memalloc.c 166 .else 167 SRCS+= subr_kmem.c subr_pool.c 168 .endif 169 170 .ifdef RUMP_LOCKDEBUG 171 SRCS+= subr_lockdebug.c 172 .endif 173 174 .if ${RUMP_KTRACE} == "yes" 175 SRCS+= kern_ktrace.c 176 .endif 177 178 CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs 179 CPPFLAGS+= -I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev 180 AFLAGS+= -D_LOCORE -Wa,--fatal-warnings 181 182 # 183 # If archdir exists, it is required to provide: 184 # 1) kobj_reloc() and kobj_machdep() 185 # 2) rump_cpu_bootstrap() 186 # 3) ...? 187 # 4) PROFIT! 188 # 189 190 # 191 # Check if we are building compat. In compat mode we need to provide 192 # the kernel of our compat target (amd64->i386 & sparc64->sparc), so 193 # take MD stuff from the right arch. 194 # 195 .if defined(COMPAT_MACHINE_CPU) \ 196 && exists(${RUMPTOP}/librump/rumpkern/arch/${COMPAT_MACHINE_CPU}) 197 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${COMPAT_MACHINE_CPU} 198 LIBKERN_ARCH= ${COMPAT_MACHINE_CPU} 199 .elif defined(MLIBDIR) 200 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR} 201 LIBKERN_ARCH= ${MLIBDIR} 202 .elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}) 203 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU} 204 .else 205 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH} 206 .endif 207 .if !exists(${ARCHDIR}) 208 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/generic 209 .endif 210 211 .include "${ARCHDIR}/Makefile.inc" 212 .PATH: ${ARCHDIR} 213 214 .if ${MACHINE} == "sun3" 215 CPPFLAGS+= -Dsun3 216 .endif 217 218 # include libkern source files 219 KERNDIR=${RUMPTOP}/../lib/libkern 220 .if "${_RUMP_NATIVEABI}" == "yes" 221 KERNMISCCPPFLAGS+= -D_RUMPKERNEL 222 .endif 223 .include "${RUMPTOP}/../lib/libkern/Makefile.libkern" 224 225 # Some architectures require a little special massage with atomic 226 # compare-and-swap. This is because the kernel version is using 227 # instructions or routines unavailable to us in userspace. 228 # 229 .if (${MACHINE_CPU} == "arm" && "${FEAT_LDREX}" != "yes") \ 230 || ${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "hppa" \ 231 || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \ 232 || ${MACHINE_ARCH} == "vax" || ${MACHINE_ARCH} == "m68000" 233 CPPFLAGS+= -I${RUMPTOP}/../../common/lib/libc/atomic 234 SRCS+= atomic_cas_generic.c 235 #SRCS+= rump_atomic_cas_up.c 236 .endif 237 238 .include <bsd.lib.mk> 239 .include <bsd.klinks.mk> 240