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
This commit is contained in:
Peter Grehan 2005-05-24 21:43:49 +00:00
parent fdc05f7913
commit 530d1c7646
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146593

View File

@ -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);
}