Date: Sun, 22 May 2011 02:13:56 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r222168 - projects/pseries/powerpc/ofw Message-ID: <201105220213.p4M2DuZm054605@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Sun May 22 02:13:55 2011 New Revision: 222168 URL: http://svn.freebsd.org/changeset/base/222168 Log: IBM firmware is odd. Make RTAS initialization actually work correctly on SLOF systems. Modified: projects/pseries/powerpc/ofw/rtas.c Modified: projects/pseries/powerpc/ofw/rtas.c ============================================================================== --- projects/pseries/powerpc/ofw/rtas.c Sun May 22 01:07:54 2011 (r222167) +++ projects/pseries/powerpc/ofw/rtas.c Sun May 22 02:13:55 2011 (r222168) @@ -73,11 +73,15 @@ rtas_setup(void *junk) { ihandle_t rtasi; cell_t rtas_size = 0, rtas_ptr; + char path[31]; int result; - rtasi = OF_open("/rtas"); rtas = OF_finddevice("/rtas"); - if (rtasi == 0 || rtas == -1) + if (rtas == -1) + return; + OF_package_to_path(rtas, path, sizeof(path)); + rtasi = OF_open(path); + if (rtasi == -1 || rtasi == 0) return; mtx_init(&rtas_mtx, "RTAS", MTX_DEF, 0); @@ -116,7 +120,7 @@ rtas_setup(void *junk) (cell_t)rtas_private_data, &rtas_ptr); OF_close(rtasi); - if (result == -1) { + if (result != 0) { rtas = 0; rtas_ptr = 0; printf("Error initializing RTAS\n"); @@ -188,7 +192,7 @@ rtas_call_method(cell_t token, int nargs } args; int n, result; - if (!rtas_exists() || nargs > 6) + if (!rtas_exists() || nargs + nreturns > 12) return (-1); args.token = token;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105220213.p4M2DuZm054605>