Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpkern Add rump_kernelfsym_load(), which ...
details: https://anonhg.NetBSD.org/src/rev/86b14c11639f
branches: trunk
changeset: 749311:86b14c11639f
user: pooka <pooka%NetBSD.org@localhost>
date: Thu Nov 26 09:20:07 2009 +0000
description:
Add rump_kernelfsym_load(), which loads the kernel symbol table.
diffstat:
sys/rump/librump/rumpkern/rump.c | 26 ++++++++++++++++++++++++--
sys/rump/librump/rumpkern/rumpkern.ifspec | 3 ++-
2 files changed, 26 insertions(+), 3 deletions(-)
diffs (71 lines):
diff -r 9161958e0740 -r 86b14c11639f sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c Thu Nov 26 09:02:38 2009 +0000
+++ b/sys/rump/librump/rumpkern/rump.c Thu Nov 26 09:20:07 2009 +0000
@@ -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)
diff -r 9161958e0740 -r 86b14c11639f sys/rump/librump/rumpkern/rumpkern.ifspec
--- a/sys/rump/librump/rumpkern/rumpkern.ifspec Thu Nov 26 09:02:38 2009 +0000
+++ b/sys/rump/librump/rumpkern/rumpkern.ifspec Thu Nov 26 09:20:07 2009 +0000
@@ -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 *
Home |
Main Index |
Thread Index |
Old Index