Include libkern contents in librump.

This commit is contained in:
pooka 2009-01-04 20:30:21 +00:00
parent 2aeb32481a
commit b319317906
4 changed files with 23 additions and 45 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.rumpkern,v 1.30 2009/01/02 14:03:15 pooka Exp $
# $NetBSD: Makefile.rumpkern,v 1.31 2009/01/04 20:30:21 pooka Exp $
#
.include "${RUMPTOP}/Makefile.rump"
@ -7,12 +7,9 @@ LIB= rump
LDFLAGS+= -Wl,--wrap=malloc
.PATH: ${RUMPTOP}/librump/rumpkern \
${RUMPTOP}/../kern ${RUMPTOP}/../lib/libkern \
${RUMPTOP}/../conf ${RUMPTOP}/../dev \
${RUMPTOP}/../../common/lib/libutil \
${RUMPTOP}/../../common/lib/libutil \
${RUMPTOP}/../../common/lib/libc/gen \
${RUMPTOP}/../../common/lib/libc/stdlib
${RUMPTOP}/../kern \
${RUMPTOP}/../conf \
${RUMPTOP}/../dev
#
# Source modules, first the ones specifically implemented for librump.
@ -49,12 +46,6 @@ SRCS+= vnode_if.c
# sys/dev
SRCS+= clock_subr.c
# sys/lib/libkern
SRCS+= __assert.c scanc.c skpc.c
# src/common
SRCS+= snprintb.c rb.c heapsort.c
# uncomment these lines if you want to use the real kmem code
#CPPFLAGS+= -DRUMP_USE_REAL_KMEM
#SRCS+= subr_kmem.c subr_vmem.c
@ -84,6 +75,7 @@ CFLAGS+= -Wno-pointer-sign
#
.ifdef(LD32DIR)
ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${LD32DIR}
LIBKERN_ARCH= ${LD32DIR}
.else
ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH}
.endif
@ -94,5 +86,9 @@ ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH}
SRCS+= kobj_stubs.c
.endif
# include libkern source files
KERNDIR=${RUMPTOP}/../lib/libkern
.include "${RUMPTOP}/../lib/libkern/Makefile.libkern"
.include <bsd.lib.mk>
.include <bsd.klinks.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: emul.c,v 1.69 2009/01/02 16:18:59 pooka Exp $ */
/* $NetBSD: emul.c,v 1.70 2009/01/04 20:30:21 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.69 2009/01/02 16:18:59 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.70 2009/01/04 20:30:21 pooka Exp $");
#define malloc(a,b,c) __wrap_malloc(a,b,c)
@ -58,7 +58,6 @@ __KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.69 2009/01/02 16:18:59 pooka Exp $");
#include <dev/cons.h>
#include <machine/bswap.h>
#include <machine/stdarg.h>
#include <rump/rumpuser.h>
@ -579,33 +578,6 @@ proc_crmod_leave(kauth_cred_t c1, kauth_cred_t c2, bool sugid)
panic("%s: not implemented", __func__);
}
/*
* Byteswap is in slightly bad taste linked directly against libc.
* In case our machine uses namespace-renamed symbols, provide
* an escape route. We really should be including libkern, but
* leave that to a later date.
*/
#ifdef __BSWAP_RENAME
#undef bswap16
#undef bswap32
uint16_t __bswap16(uint16_t);
uint32_t __bswap32(uint32_t);
uint16_t
bswap16(uint16_t v)
{
return __bswap16(v);
}
uint32_t
bswap32(uint32_t v)
{
return __bswap32(v);
}
#endif /* __BSWAP_RENAME */
void
module_init_md()
{

View File

@ -0,0 +1,2 @@
/* $NetBSD: rnd.h,v 1.1 2009/01/04 20:30:21 pooka Exp $ */
#define NRND 0 /* XXXbad */

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm.c,v 1.48 2008/12/18 00:24:12 pooka Exp $ */
/* $NetBSD: vm.c,v 1.49 2009/01/04 20:30:21 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.48 2008/12/18 00:24:12 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.49 2009/01/04 20:30:21 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@ -279,6 +279,14 @@ uvm_pageunwire(struct vm_page *pg)
/* nada */
}
int
uvm_mmap(struct vm_map *map, vaddr_t *addr, vsize_t size, vm_prot_t prot,
vm_prot_t maxprot, int flags, void *handle, voff_t off, vsize_t locklim)
{
panic("%s: unimplemented", __func__);
}
vaddr_t
uvm_pagermapin(struct vm_page **pps, int npages, int flags)
{