Module Name: src Committed By: pooka Date: Thu Nov 26 09:20:07 UTC 2009
Modified Files: src/sys/rump/librump/rumpkern: rump.c rumpkern.ifspec Log Message: Add rump_kernelfsym_load(), which loads the kernel symbol table. To generate a diff of this commit: cvs rdiff -u -r1.136 -r1.137 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.2 -r1.3 src/sys/rump/librump/rumpkern/rumpkern.ifspec Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.136 src/sys/rump/librump/rumpkern/rump.c:1.137 --- src/sys/rump/librump/rumpkern/rump.c:1.136 Tue Nov 10 17:02:36 2009 +++ src/sys/rump/librump/rumpkern/rump.c Thu Nov 26 09:20:07 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.136 2009/11/10 17:02:36 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.137 2009/11/26 09:20:07 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.136 2009/11/10 17:02:36 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.137 2009/11/26 09:20:07 pooka Exp $"); #include <sys/param.h> #include <sys/atomic.h> @@ -38,6 +38,7 @@ #include <sys/cpu.h> #include <sys/evcnt.h> #include <sys/event.h> +#include <sys/exec_elf.h> #include <sys/filedesc.h> #include <sys/iostat.h> #include <sys/kauth.h> @@ -622,6 +623,27 @@ return rv; } +int +rump_kernelfsym_load(void *symtab, uint64_t symsize, + char *strtab, uint64_t strsize) +{ + static int inited = 0; + Elf64_Ehdr ehdr; + + if (inited) + return EBUSY; + inited = 1; + + /* + * Use 64bit header since it's bigger. Shouldn't make a + * difference, since we're passing in all zeroes anyway. + */ + memset(&ehdr, 0, sizeof(ehdr)); + ksyms_addsyms_explicit(&ehdr, symtab, symsize, strtab, strsize); + + return 0; +} + static int rump_sysproxy_local(int num, void *arg, uint8_t *data, size_t dlen, register_t *retval) Index: src/sys/rump/librump/rumpkern/rumpkern.ifspec diff -u src/sys/rump/librump/rumpkern/rumpkern.ifspec:1.2 src/sys/rump/librump/rumpkern/rumpkern.ifspec:1.3 --- src/sys/rump/librump/rumpkern/rumpkern.ifspec:1.2 Thu Oct 15 16:39:22 2009 +++ src/sys/rump/librump/rumpkern/rumpkern.ifspec Thu Nov 26 09:20:07 2009 @@ -1,4 +1,4 @@ -; $NetBSD: rumpkern.ifspec,v 1.2 2009/10/15 16:39:22 pooka Exp $ +; $NetBSD: rumpkern.ifspec,v 1.3 2009/11/26 09:20:07 pooka Exp $ NAME|kern PUBHDR|include/rump/rumpkern_if_pub.h @@ -13,6 +13,7 @@ int |module_init |struct modinfo *, prop_dictionary_t int |module_fini |struct modinfo * +int |kernelfsym_load|void *, uint64_t, char *, uint64_t struct uio * |uio_setup |void *, size_t, off_t, enum rump_uiorw size_t |uio_getresid |struct uio *