From owner-svn-src-all@FreeBSD.ORG Fri Apr 2 21:48:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8AF5106566B; Fri, 2 Apr 2010 21:48:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5368FC0C; Fri, 2 Apr 2010 21:48:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o32LmRAe086122; Fri, 2 Apr 2010 21:48:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o32LmRD5086119; Fri, 2 Apr 2010 21:48:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201004022148.o32LmRD5086119@svn.freebsd.org> From: Marius Strobl Date: Fri, 2 Apr 2010 21:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206116 - in head/sys: dev/ofw powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 21:48:27 -0000 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);