diff options
author | peter <peter@FreeBSD.org> | 1998-10-09 23:36:26 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-10-09 23:36:26 +0000 |
commit | 482ceee22c477d3bc84a11ec49bdea6f5aafff88 (patch) | |
tree | 0df29421a9a2db3bdd63705db43fa6ca6995d4f6 /sys/amd64 | |
parent | 887fa28cea396ffa01e57a2f72bedbddef48ae12 (diff) | |
download | FreeBSD-src-482ceee22c477d3bc84a11ec49bdea6f5aafff88.zip FreeBSD-src-482ceee22c477d3bc84a11ec49bdea6f5aafff88.tar.gz |
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.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/locore.S | 18 | ||||
-rw-r--r-- | sys/amd64/amd64/locore.s | 18 | ||||
-rw-r--r-- | sys/amd64/amd64/machdep.c | 12 |
3 files changed, 10 insertions, 38 deletions
diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 0d6ba18..e45cdef 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -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 /* diff --git a/sys/amd64/amd64/locore.s b/sys/amd64/amd64/locore.s index 0d6ba18..e45cdef 100644 --- a/sys/amd64/amd64/locore.s +++ b/sys/amd64/amd64/locore.s @@ -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 /* diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 75698ca..06db070 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -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) |