svn commit: r206116 - in head/sys: dev/ofw powerpc/ofw

Marius Strobl marius at FreeBSD.org
Fri Apr 2 21:48:27 UTC 2010


Author: marius
Date: Fri Apr  2 21:48:27 2010
New Revision: 206116
URL: http://svn.freebsd.org/changeset/base/206116

Log:
  With r205496 in place we should ensure that nargs and nreturns are always
  set to sane values as they no longer default to 0, otherwise some OFW
  implementation might copy in or out arguments not based on what the actual
  function takes but what ever stack garbage nargs and nreturns supply.
  
  Reviewed by:	nwhitehorn

Modified:
  head/sys/dev/ofw/ofw_standard.c
  head/sys/powerpc/ofw/ofw_real.c

Modified: head/sys/dev/ofw/ofw_standard.c
==============================================================================
--- head/sys/dev/ofw/ofw_standard.c	Fri Apr  2 21:35:10 2010	(r206115)
+++ head/sys/dev/ofw/ofw_standard.c	Fri Apr  2 21:48:27 2010	(r206116)
@@ -589,6 +589,7 @@ ofw_std_close(ofw_t ofw, ihandle_t insta
 	} args = {
 		(cell_t)"close",
 		1,
+		0,
 	};
 
 	args.instance = instance;
@@ -717,6 +718,7 @@ ofw_std_release(ofw_t ofw, void *virt, s
 	} args = {
 		(cell_t)"release",
 		2,
+		0,
 	};
 
 	args.virt = (cell_t)virt;
@@ -738,6 +740,8 @@ ofw_std_enter(ofw_t ofw)
 		cell_t nreturns;
 	} args = {
 		(cell_t)"enter",
+		0,
+		0,
 	};
 
 	openfirmware(&args);
@@ -754,6 +758,8 @@ ofw_std_exit(ofw_t ofw)
 		cell_t nreturns;
 	} args = {
 		(cell_t)"exit",
+		0,
+		0,
 	};
 
 	openfirmware(&args);

Modified: head/sys/powerpc/ofw/ofw_real.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_real.c	Fri Apr  2 21:35:10 2010	(r206115)
+++ head/sys/powerpc/ofw/ofw_real.c	Fri Apr  2 21:48:27 2010	(r206116)
@@ -737,6 +737,7 @@ ofw_real_close(ofw_t ofw, ihandle_t inst
 	} args = {
 		(cell_t)"close",
 		1,
+		0,
 	};
 
 	args.instance = instance;
@@ -876,6 +877,7 @@ ofw_real_release(ofw_t ofw, void *virt, 
 	} args = {
 		(cell_t)"release",
 		2,
+		0,
 	};
 
 	args.virt = (cell_t)virt;
@@ -897,6 +899,8 @@ ofw_real_enter(ofw_t ofw)
 		cell_t nreturns;
 	} args = {
 		(cell_t)"enter",
+		0,
+		0,
 	};
 
 	openfirmware(&args);
@@ -913,6 +917,8 @@ ofw_real_exit(ofw_t ofw)
 		cell_t nreturns;
 	} args = {
 		(cell_t)"exit",
+		0,
+		0,
 	};
 
 	openfirmware(&args);


More information about the svn-src-all mailing list