NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: port-sparc64/45895: kernel modules not working
The following reply was made to PR port-sparc64/45895; it has been noted by
GNATS.
From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: port-sparc64/45895: kernel modules not working
Date: Sun, 5 Feb 2012 11:42:56 +0100
--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Here is a patch that seems to work for me.
Martin
--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch
Index: machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/machdep.c,v
retrieving revision 1.264
diff -u -r1.264 machdep.c
--- machdep.c 27 Jan 2012 18:53:03 -0000 1.264
+++ machdep.c 5 Feb 2012 10:39:27 -0000
@@ -75,6 +75,7 @@
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
+#include "opt_modular.h"
#include "opt_compat_netbsd.h"
#include "opt_compat_svr4.h"
#include "opt_compat_sunos.h"
@@ -152,6 +155,11 @@
#endif
extern vaddr_t avail_end;
+#ifdef MODULAR
+vaddr_t module_start, module_end;
+static struct vm_map module_map_store;
+extern struct vm_map *module_map;
+#endif
int physmem;
@@ -208,6 +216,12 @@
#if 0
pmap_redzone();
#endif
+
+#ifdef MODULAR
+ uvm_map_setup(&module_map_store, module_start, module_end, 0);
+ module_map_store.pmap = pmap_kernel();
+ module_map = &module_map_store;
+#endif
}
/*
Index: pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/pmap.c,v
retrieving revision 1.275
diff -u -r1.275 pmap.c
--- pmap.c 12 Jul 2011 07:51:34 -0000 1.275
+++ pmap.c 5 Feb 2012 10:39:28 -0000
@@ -33,6 +33,7 @@
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
+#include "opt_modular.h"
#include <sys/param.h>
#include <sys/malloc.h>
@@ -669,6 +670,9 @@
void
pmap_bootstrap(u_long kernelstart, u_long kernelend)
{
+#ifdef MODULAR
+ extern vaddr_t module_start, module_end;
+#endif
extern char etext[], data_start[]; /* start of data segment */
extern int msgbufmapped;
struct mem_region *mp, *mp1, *avail, *orig;
@@ -1176,6 +1181,18 @@
vmmap = (vaddr_t)reserve_dumppages((void *)(u_long)vmmap);
+#ifdef MODULAR
+ /*
+ * Reserve 16 MB of VA for module loading. Right now our full
+ * GENERIC kernel is about 13 MB, so this looks good enough.
+ * If we make this bigger, we should adjust the KERNEND and
+ * associated defines in param.h.
+ */
+ module_start = vmmap;
+ vmmap += 16 * 1024*1024;
+ module_end = vmmap;
+#endif
+
/*
* Set up bounds of allocatable memory for vmstat et al.
*/
--sm4nu43k4a2Rpi4c--
Home |
Main Index |
Thread Index |
Old Index