Relocate the preload module info from machdep specifically rather than

trying to do it in locore.  We also walk through the module table
and relocate any MODINFO_ADDR pointers so that they become KVM relative
rather than physical addresses.  This means that hacks for adding
0xf0000000 in places like MFS go away.
This commit is contained in:
Peter Wemm 1998-10-09 23:36:26 +00:00
parent c6b72a39e9
commit df9e84e0c0
5 changed files with 19 additions and 59 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)locore.s 7.3 (Berkeley) 5/13/91
* $Id: locore.s,v 1.113 1998/09/28 03:26:22 tegge Exp $
* $Id: locore.s,v 1.114 1998/10/08 21:03:41 msmith Exp $
*
* originally from: locore.s, by William F. Jolitz
*
@ -569,22 +569,6 @@ got_common_bi_size:
rep
movsb
/*
* Fix up the module data and kernel environment pointers.
*/
movl R(_bootinfo+BI_ENVP),%eax
testl %eax,%eax
je no_envp
movl $KERNBASE,%eax
addl %eax,R(_bootinfo+BI_ENVP)
no_envp:
movl R(_bootinfo+BI_MODULEP),%eax
testl %eax,%eax
je no_modulep
movl $KERNBASE,%eax
addl %eax,R(_bootinfo+BI_MODULEP)
no_modulep:
#ifdef NFS_ROOT
#ifndef BOOTP_NFSV3
/*

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)locore.s 7.3 (Berkeley) 5/13/91
* $Id: locore.s,v 1.113 1998/09/28 03:26:22 tegge Exp $
* $Id: locore.s,v 1.114 1998/10/08 21:03:41 msmith Exp $
*
* originally from: locore.s, by William F. Jolitz
*
@ -569,22 +569,6 @@ got_common_bi_size:
rep
movsb
/*
* Fix up the module data and kernel environment pointers.
*/
movl R(_bootinfo+BI_ENVP),%eax
testl %eax,%eax
je no_envp
movl $KERNBASE,%eax
addl %eax,R(_bootinfo+BI_ENVP)
no_envp:
movl R(_bootinfo+BI_MODULEP),%eax
testl %eax,%eax
je no_modulep
movl $KERNBASE,%eax
addl %eax,R(_bootinfo+BI_MODULEP)
no_modulep:
#ifdef NFS_ROOT
#ifndef BOOTP_NFSV3
/*

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.311 1998/09/29 11:20:16 abial Exp $
* $Id: machdep.c,v 1.312 1998/10/09 00:31:06 msmith Exp $
*/
#include "apm.h"
@ -1613,9 +1613,13 @@ init386(first)
proc0.p_addr->u_pcb.pcb_ext = 0;
#endif
/* Export kernel environment and module metadata information */
module_metadata = (caddr_t)bootinfo.bi_modulep;
kern_envp = (caddr_t)bootinfo.bi_envp;
/* Sigh, relocate physical addresses left from bootstrap */
if (bootinfo.bi_modulep) {
preload_metadata = (caddr_t)bootinfo.bi_modulep + KERNBASE;
preload_bootstrap_relocate(KERNBASE);
}
if (bootinfo.bi_envp)
kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE;
}
#if defined(I586_CPU) && !defined(NO_F00F_HACK)

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)locore.s 7.3 (Berkeley) 5/13/91
* $Id: locore.s,v 1.113 1998/09/28 03:26:22 tegge Exp $
* $Id: locore.s,v 1.114 1998/10/08 21:03:41 msmith Exp $
*
* originally from: locore.s, by William F. Jolitz
*
@ -569,22 +569,6 @@ got_common_bi_size:
rep
movsb
/*
* Fix up the module data and kernel environment pointers.
*/
movl R(_bootinfo+BI_ENVP),%eax
testl %eax,%eax
je no_envp
movl $KERNBASE,%eax
addl %eax,R(_bootinfo+BI_ENVP)
no_envp:
movl R(_bootinfo+BI_MODULEP),%eax
testl %eax,%eax
je no_modulep
movl $KERNBASE,%eax
addl %eax,R(_bootinfo+BI_MODULEP)
no_modulep:
#ifdef NFS_ROOT
#ifndef BOOTP_NFSV3
/*

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.311 1998/09/29 11:20:16 abial Exp $
* $Id: machdep.c,v 1.312 1998/10/09 00:31:06 msmith Exp $
*/
#include "apm.h"
@ -1613,9 +1613,13 @@ init386(first)
proc0.p_addr->u_pcb.pcb_ext = 0;
#endif
/* Export kernel environment and module metadata information */
module_metadata = (caddr_t)bootinfo.bi_modulep;
kern_envp = (caddr_t)bootinfo.bi_envp;
/* Sigh, relocate physical addresses left from bootstrap */
if (bootinfo.bi_modulep) {
preload_metadata = (caddr_t)bootinfo.bi_modulep + KERNBASE;
preload_bootstrap_relocate(KERNBASE);
}
if (bootinfo.bi_envp)
kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE;
}
#if defined(I586_CPU) && !defined(NO_F00F_HACK)