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 The OF_test_method() function takes...



details:   https://anonhg.NetBSD.org/src/rev/96a04c15b594
branches:  trunk
changeset: 329065:96a04c15b594
user:      martin <martin%NetBSD.org@localhost>
date:      Sun May 04 09:05:39 2014 +0000

description:
The OF_test_method() function takes an instance handle, not a phandle,
and returns 0 on success.
Pointed out by Mark Cave-Ayland.

diffstat:

 sys/arch/sparc64/sparc64/ofw_machdep.c |  25 +++++--------------------
 1 files changed, 5 insertions(+), 20 deletions(-)

diffs (51 lines):

diff -r 54e7a85c8484 -r 96a04c15b594 sys/arch/sparc64/sparc64/ofw_machdep.c
--- a/sys/arch/sparc64/sparc64/ofw_machdep.c    Sat May 03 23:19:56 2014 +0000
+++ b/sys/arch/sparc64/sparc64/ofw_machdep.c    Sun May 04 09:05:39 2014 +0000
@@ -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 @@
                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;



Home | Main Index | Thread Index | Old Index