svn commit: r293051 - head/sys/powerpc/aim
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Sat Jan 2 18:10:55 UTC 2016
Author: nwhitehorn
Date: Sat Jan 2 18:10:53 2016
New Revision: 293051
URL: https://svnweb.freebsd.org/changeset/base/293051
Log:
Switch setting MSR[SF] to C code. This removes any CPU-specific code
(MSF[SF] is a Book 3-S thing) in the 64-bit locore64.S.
Modified:
head/sys/powerpc/aim/aim_machdep.c
head/sys/powerpc/aim/locore64.S
Modified: head/sys/powerpc/aim/aim_machdep.c
==============================================================================
--- head/sys/powerpc/aim/aim_machdep.c Sat Jan 2 17:14:22 2016 (r293050)
+++ head/sys/powerpc/aim/aim_machdep.c Sat Jan 2 18:10:53 2016 (r293051)
@@ -179,6 +179,17 @@ aim_cpu_init(vm_offset_t toc)
trap_offset = 0;
cacheline_warn = 0;
+ #ifdef __powerpc64__
+ /*
+ * Switch to 64-bit mode, if the bootloader didn't, before we start
+ * using memory beyond what the bootloader might have set up.
+ * Guaranteed not to cause an implicit branch since we either (a)
+ * started with a 32-bit bootloader below 4 GB or (b) were already in
+ * 64-bit mode, making this a no-op.
+ */
+ mtmsrd(mfmsr() | PSL_SF);
+ #endif
+
/* Various very early CPU fix ups */
switch (mfpvr() >> 16) {
/*
Modified: head/sys/powerpc/aim/locore64.S
==============================================================================
--- head/sys/powerpc/aim/locore64.S Sat Jan 2 17:14:22 2016 (r293050)
+++ head/sys/powerpc/aim/locore64.S Sat Jan 2 18:10:53 2016 (r293051)
@@ -157,13 +157,6 @@ ASENTRY_NOPROF(__start)
ld %r5,64(%r1)
ld %r6,72(%r1)
- /* Switch to 64-bit mode */
- mfmsr %r9
- li %r8,1
- insrdi %r9,%r8,1,0
- mtmsrd %r9
- isync
-
/* Begin CPU init */
mr %r4,%r2 /* Replace ignored r4 with tocbase for trap handlers */
bl powerpc_init
More information about the svn-src-all
mailing list