aboutsummaryrefslogtreecommitdiff
path: root/stand
diff options
context:
space:
mode:
authorLeandro Lupori <luporl@FreeBSD.org>2021-09-21 20:22:42 +0000
committerLeandro Lupori <luporl@FreeBSD.org>2021-09-21 20:22:42 +0000
commit680ca739458ba8cba221ea74794c2cd9771c77f8 (patch)
tree27c6e03304dbc915d6c3c7c75feb871efe1f80b9 /stand
parentbd84094a51c4648a7c97ececdaccfb30bc832096 (diff)
downloadsrc-680ca739458ba8cba221ea74794c2cd9771c77f8.tar.gz
src-680ca739458ba8cba221ea74794c2cd9771c77f8.zip
powerpc64: fix loader regression
After b4cb3fe0e39a, loader started crashing on PowerPC64, with a Program Exception (700) error. The problem was that archsw was used before being initialized, with the new mount feature. This change fixes the issue by initializing archsw earlier, before setting currdev, that triggers the mount. Reviewed by: tsoome MFC after: 1 month X-MFC-With: b4cb3fe0e39a Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D32027
Diffstat (limited to 'stand')
-rw-r--r--stand/powerpc/ofw/main.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/stand/powerpc/ofw/main.c b/stand/powerpc/ofw/main.c
index e705871796b1..7b1ec384b6bd 100644
--- a/stand/powerpc/ofw/main.c
+++ b/stand/powerpc/ofw/main.c
@@ -137,6 +137,17 @@ main(int (*openfirm)(void *))
*/
cons_probe();
+ archsw.arch_getdev = ofw_getdev;
+ archsw.arch_copyin = ofw_copyin;
+ archsw.arch_copyout = ofw_copyout;
+ archsw.arch_readin = ofw_readin;
+#ifdef CAS
+ setenv("cas", "1", 0);
+ archsw.arch_autoload = ppc64_autoload;
+#else
+ archsw.arch_autoload = ofw_autoload;
+#endif
+
/* Set up currdev variable to have hooks in place. */
env_setenv("currdev", EV_VOLATILE, "", ofw_setcurrdev, env_nounset);
@@ -183,17 +194,6 @@ main(int (*openfirm)(void *))
if (!(mfmsr() & PSL_DR))
setenv("usefdt", "1", 1);
- archsw.arch_getdev = ofw_getdev;
- archsw.arch_copyin = ofw_copyin;
- archsw.arch_copyout = ofw_copyout;
- archsw.arch_readin = ofw_readin;
-#ifdef CAS
- setenv("cas", "1", 0);
- archsw.arch_autoload = ppc64_autoload;
-#else
- archsw.arch_autoload = ofw_autoload;
-#endif
-
interact(); /* doesn't return */
OF_exit();