summaryrefslogtreecommitdiffstats
path: root/sys/boot/common
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2006-11-02 17:28:38 +0000
committerru <ru@FreeBSD.org>2006-11-02 17:28:38 +0000
commit72eb46ae51bea2bdc5f1deb6728f9bdd26092ed5 (patch)
tree34de91a0a0dd3ee661c12286a13ec25ee3a189de /sys/boot/common
parent42a69dcadeb2a9e395f7747f2d88a1ea76673757 (diff)
downloadFreeBSD-src-72eb46ae51bea2bdc5f1deb6728f9bdd26092ed5.zip
FreeBSD-src-72eb46ae51bea2bdc5f1deb6728f9bdd26092ed5.tar.gz
Revert the last change. Masking only 2 MSBs of the virtual address
to get the physical address doesn't work for all values of KVA_PAGES, while masking 8 MSBs works for all values of KVA_PAGES that are multiple of 4 for non-PAE and 8 for PAE. (This leaves us limited with 12MB for non-PAE kernels and 14MB for PAE kernels.) To get things right, we'd need to subtract the KERNBASE from the virtual address (but KERNBASE is not easy to figure out from here), or have physical addresses set properly in the ELF headers. Discussed with: jhb
Diffstat (limited to 'sys/boot/common')
-rw-r--r--sys/boot/common/load_elf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c
index be8f881..cd983a9 100644
--- a/sys/boot/common/load_elf.c
+++ b/sys/boot/common/load_elf.c
@@ -263,7 +263,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
#if __ELF_WORD_SIZE == 64
off = - (off & 0xffffffffff000000ull);/* x86_64 relocates after locore */
#else
- off = - (off & 0xc0000000u); /* i386 relocates after locore */
+ off = - (off & 0xff000000u); /* i386 relocates after locore */
#endif
#else
off = 0; /* other archs use direct mapped kernels */
OpenPOWER on IntegriCloud