diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2012-02-16 03:27:38 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2012-02-16 03:27:38 +0000 |
commit | 053f8161ecf8a8efcbb8e76c8f739d5d58708d93 (patch) | |
tree | 0fcffa402791c9f0beedfbb9d059adccbeb2ee11 /sys/boot | |
parent | 57ea6b594bc793fe5ce93d1d6391e872e26a2fae (diff) | |
download | FreeBSD-src-053f8161ecf8a8efcbb8e76c8f739d5d58708d93.zip FreeBSD-src-053f8161ecf8a8efcbb8e76c8f739d5d58708d93.tar.gz |
Make sure to synchronize icache for the newly loaded loader. Not an issue
on most systems, when the relevant icache lines are not full.
MFC after: 2 weeks
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/powerpc/boot1.chrp/Makefile | 7 | ||||
-rw-r--r-- | sys/boot/powerpc/boot1.chrp/boot1.c | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/boot/powerpc/boot1.chrp/Makefile b/sys/boot/powerpc/boot1.chrp/Makefile index 71d0ce6..943d146 100644 --- a/sys/boot/powerpc/boot1.chrp/Makefile +++ b/sys/boot/powerpc/boot1.chrp/Makefile @@ -8,16 +8,17 @@ BINDIR?= /boot INSTALLFLAGS= -b FILES= boot1.hfs -SRCS= boot1.c ashldi3.c +SRCS= boot1.c ashldi3.c syncicache.c NO_MAN= CFLAGS= -ffreestanding -msoft-float -Os \ - -I${.CURDIR}/../../common -I${.CURDIR}/../../../ + -I${.CURDIR}/../../common -I${.CURDIR}/../../../ \ + -D_STANDALONE LDFLAGS=-nostdlib -static -N .include "${.CURDIR}/../Makefile.inc" -.PATH: ${.CURDIR}/../../../libkern ${.CURDIR} +.PATH: ${.CURDIR}/../../../libkern ${.CURDIR}/../../../../lib/libc/powerpc/gen ${.CURDIR} # The following inserts out objects into a template HFS # created by generate-hfs.sh diff --git a/sys/boot/powerpc/boot1.chrp/boot1.c b/sys/boot/powerpc/boot1.chrp/boot1.c index f5bc4d5..5ad405b 100644 --- a/sys/boot/powerpc/boot1.chrp/boot1.c +++ b/sys/boot/powerpc/boot1.chrp/boot1.c @@ -77,6 +77,8 @@ static int __sputc(char c, void *arg); static char *__uitoa(char *buf, u_int val, int base); static char *__ultoa(char *buf, u_long val, int base); +void __syncicache(void *, int); + /* * Open Firmware interface functions */ @@ -523,6 +525,7 @@ load(const char *fname) } if (ph.p_filesz != ph.p_memsz) bzero(p + ph.p_filesz, ph.p_memsz - ph.p_filesz); + __syncicache(p, ph.p_memsz); } ofw_close(bootdev); (*(void (*)(void *, int, ofwfp_t, char *, int))eh.e_entry)(NULL, 0, |