Module Name: src
Committed By: martin
Date: Sun May 4 09:05:39 UTC 2014
Modified Files:
src/sys/arch/sparc64/sparc64: ofw_machdep.c
Log Message:
The OF_test_method() function takes an instance handle, not a phandle,
and returns 0 on success.
Pointed out by Mark Cave-Ayland.
To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/sparc64/sparc64/ofw_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sparc64/sparc64/ofw_machdep.c
diff -u src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.41 src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.42
--- src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.41 Tue Jan 7 20:11:35 2014
+++ src/sys/arch/sparc64/sparc64/ofw_machdep.c Sun May 4 09:05:39 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_machdep.c,v 1.41 2014/01/07 20:11:35 palle Exp $ */
+/* $NetBSD: ofw_machdep.c,v 1.42 2014/05/04 09:05:39 martin 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.41 2014/01/07 20:11:35 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.42 2014/05/04 09:05:39 martin Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -500,29 +500,14 @@ prom_get_msgbuf(int len, int align)
cell_t phys_lo;
} args;
paddr_t addr;
- int rooth;
- int is_e250 = 1;
-
- /* E250s and E450s tend to have buggy PROMs that break on test-method */
- /* XXX - need to find the reason why this breaks someday */
- if ((rooth = OF_finddevice("/")) != -1) {
- char name[80];
-
- if ((OF_getprop(rooth, "name", &name, sizeof(name))) != -1) {
- if (strcmp(name, "SUNW,Ultra-250")
- && strcmp(name, "SUNW,Ultra-4"))
- is_e250 = 0;
- } else prom_printf("prom_get_msgbuf: cannot get \"name\"\r\n");
- } else prom_printf("prom_get_msgbuf: cannot open root device \r\n");
if (memh == -1 && ((memh = get_memory_handle()) == -1)) {
prom_printf("prom_get_msgbuf: cannot get memh\r\n");
return -1;
}
- if (is_e250) {
- prom_printf("prom_get_msgbuf: Cannot recover msgbuf on E250\r\n");
- } else if (OF_test("test-method") == 0) {
- if (OF_test_method(memh, "SUNW,retain") != 0) {
+ if (OF_test("test-method") == 0) {
+ if (OF_test_method(OF_instance_to_package(memh),
+ "SUNW,retain") == 0) {
args.name = ADR2CELL(&"call-method");
args.nargs = 5;
args.nreturns = 3;