summaryrefslogtreecommitdiffstats
path: root/sys/boot/ofw
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2005-05-24 21:43:49 +0000
committergrehan <grehan@FreeBSD.org>2005-05-24 21:43:49 +0000
commit59b5bfef855bbefd3e6fafaa39f8287eb80cb0e0 (patch)
tree865018a172213cb7bc745c41e1f841c25a101047 /sys/boot/ofw
parent6f02d3277d8d18208c83c27cc056232358992ac8 (diff)
downloadFreeBSD-src-59b5bfef855bbefd3e6fafaa39f8287eb80cb0e0.zip
FreeBSD-src-59b5bfef855bbefd3e6fafaa39f8287eb80cb0e0.tar.gz
Since the BAT mapping was removed a long time back, it can't
be assumed that modules are contiguous in memory (they're not) so don't blindly __syncicache start/end. In fact, don't bother syncing the icache for modules since the kernel will do it after fixing up relocations. This fixes the trap when loading modules at boot time. Reported by: orlando at break dot net
Diffstat (limited to 'sys/boot/ofw')
-rw-r--r--sys/boot/ofw/libofw/elf_freebsd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/boot/ofw/libofw/elf_freebsd.c b/sys/boot/ofw/libofw/elf_freebsd.c
index 4a8855b..624e9fa 100644
--- a/sys/boot/ofw/libofw/elf_freebsd.c
+++ b/sys/boot/ofw/libofw/elf_freebsd.c
@@ -54,7 +54,12 @@ __elfN(ofw_loadfile)(char *filename, u_int64_t dest,
return (r);
#if defined(__powerpc__)
- __syncicache((void *) (*result)->f_addr, (*result)->f_size);
+ /*
+ * No need to sync the icache for modules: this will
+ * be done by the kernel after relocation.
+ */
+ if (!strcmp((*result)->f_type, "elf kernel"))
+ __syncicache((void *) (*result)->f_addr, (*result)->f_size);
#endif
return (0);
}
OpenPOWER on IntegriCloud