svn commit: r222168 - projects/pseries/powerpc/ofw

Nathan Whitehorn nwhitehorn at FreeBSD.org
Sun May 22 02:13:56 UTC 2011


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;


More information about the svn-src-projects mailing list