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