diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-10-17 18:49:07 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-10-17 18:49:07 +0000 |
commit | cbbd1c7a3ffc3c1975b4a8a369b588a71db16f7c (patch) | |
tree | fb40064b7fe92a327a6ee6a412c5adf5f317c41b | |
parent | 2f030e15f57e12a7169c3edf427302915df03c5c (diff) |
Fix "map" OpenFirmware call. It does not return a value according to the
IEEE 1275 specification.
Based on a diff provided by Harald Gutch (hgutch@netbsd). Also see
NetBSD PR#56829.
ok miod@
-rw-r--r-- | sys/arch/sparc64/sparc64/ofw_machdep.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/arch/sparc64/sparc64/ofw_machdep.c b/sys/arch/sparc64/sparc64/ofw_machdep.c index 8d28904dab1..7833e38c867 100644 --- a/sys/arch/sparc64/sparc64/ofw_machdep.c +++ b/sys/arch/sparc64/sparc64/ofw_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_machdep.c,v 1.35 2022/10/16 01:22:39 jsg Exp $ */ +/* $OpenBSD: ofw_machdep.c,v 1.36 2022/10/17 18:49:06 kettenis Exp $ */ /* $NetBSD: ofw_machdep.c,v 1.16 2001/07/20 00:07:14 eeh Exp $ */ /* @@ -335,8 +335,6 @@ prom_map_phys(paddr_t paddr, off_t size, vaddr_t vaddr, int mode) 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)) { @@ -345,7 +343,7 @@ prom_map_phys(paddr_t paddr, off_t size, vaddr_t vaddr, int mode) } 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; @@ -353,12 +351,7 @@ prom_map_phys(paddr_t paddr, off_t size, vaddr_t vaddr, int mode) args.vaddr = ADR2CELL(vaddr); args.phys_hi = HDQ2CELL_HI(paddr); args.phys_lo = HDQ2CELL_LO(paddr); - - if (openfirmware(&args) == -1) - return -1; - if (args.status) - return -1; - return (int)args.retaddr; + return openfirmware(&args); } |