Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/sparc64 PR 56829: Fix "map" call to Open Fi...
details: https://anonhg.NetBSD.org/src/rev/852fd4c801bc
branches: trunk
changeset: 366086:852fd4c801bc
user: hgutch <hgutch%NetBSD.org@localhost>
date: Sat May 14 07:11:23 2022 +0000
description:
PR 56829: Fix "map" call to Open Firmware and no longer mess up OFW stack.
This unbreaks miniroot.fs.
Thanks to Björn Johannesson for originally pointing this out and to
mrg@ for pointing out the actual issue and suggesting a fix.
diffstat:
sys/arch/sparc/stand/ofwboot/Locore.c | 10 +++-------
sys/arch/sparc64/sparc64/ofw_machdep.c | 12 ++++--------
2 files changed, 7 insertions(+), 15 deletions(-)
diffs (85 lines):
diff -r 9a5dead2c84f -r 852fd4c801bc sys/arch/sparc/stand/ofwboot/Locore.c
--- a/sys/arch/sparc/stand/ofwboot/Locore.c Sat May 14 06:07:53 2022 +0000
+++ b/sys/arch/sparc/stand/ofwboot/Locore.c Sat May 14 07:11:23 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: Locore.c,v 1.16 2017/09/15 13:25:34 martin Exp $ */
+/* $NetBSD: Locore.c,v 1.17 2022/05/14 07:11:23 hgutch Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -664,8 +664,6 @@
cell_t vaddr;
cell_t paddr_hi;
cell_t paddr_lo;
- cell_t status;
- cell_t retaddr;
} args;
#ifdef __notyet
@@ -676,7 +674,7 @@
#endif
args.name = ADR2CELL("call-method");
args.nargs = 7;
- args.nreturns = 1;
+ args.nreturns = 0;
args.method = ADR2CELL("map");
args.ihandle = HDL2CELL(mmuh);
args.mode = mode;
@@ -687,9 +685,7 @@
if (openfirmware(&args) == -1)
return -1;
- if (args.status)
- return -1;
- return (vaddr_t)args.retaddr;
+ return 0;
}
diff -r 9a5dead2c84f -r 852fd4c801bc sys/arch/sparc64/sparc64/ofw_machdep.c
--- a/sys/arch/sparc64/sparc64/ofw_machdep.c Sat May 14 06:07:53 2022 +0000
+++ b/sys/arch/sparc64/sparc64/ofw_machdep.c Sat May 14 07:11:23 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_machdep.c,v 1.50 2022/03/17 08:08:03 andvar Exp $ */
+/* $NetBSD: ofw_machdep.c,v 1.51 2022/05/14 07:11:23 hgutch Exp $ */
/*
* Copyright (C) 1996 Wolfgang Solfrank.
@@ -34,7 +34,7 @@
#include "opt_multiprocessor.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.50 2022/03/17 08:08:03 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.51 2022/05/14 07:11:23 hgutch Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -339,8 +339,6 @@
cell_t vaddr;
cell_t phys_hi;
cell_t phys_lo;
- cell_t status;
- cell_t retaddr;
} args;
if (mmuh == -1 && ((mmuh = get_mmu_handle()) == -1)) {
@@ -349,7 +347,7 @@
}
args.name = ADR2CELL(&"call-method");
args.nargs = 7;
- args.nreturns = 1;
+ args.nreturns = 0;
args.method = ADR2CELL(&"map");
args.ihandle = HDL2CELL(mmuh);
args.mode = mode;
@@ -360,9 +358,7 @@
if (openfirmware(&args) == -1)
return -1;
- if (args.status)
- return -1;
- return (int)args.retaddr;
+ return 0;
}
Home |
Main Index |
Thread Index |
Old Index