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