From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1It2tz-0003Bh-2i for qemu-devel@nongnu.org; Fri, 16 Nov 2007 10:14:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1It2tx-00036c-29 for qemu-devel@nongnu.org; Fri, 16 Nov 2007 10:14:38 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1It2tw-000364-Tn for qemu-devel@nongnu.org; Fri, 16 Nov 2007 10:14:36 -0500 Received: from atlas.informatik.uni-freiburg.de ([132.230.150.3]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1It2tw-000738-Ef for qemu-devel@nongnu.org; Fri, 16 Nov 2007 10:14:36 -0500 Received: from mafia.informatik.uni-freiburg.de ([132.230.150.87]) by atlas.informatik.uni-freiburg.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1It2ts-0000b9-ST for qemu-devel@nongnu.org; Fri, 16 Nov 2007 16:14:32 +0100 Message-ID: <473DB3D6.5030301@gmx.net> Date: Fri, 16 Nov 2007 16:14:30 +0100 From: Thorsten Zitterell MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050601040108010100090309" Subject: [Qemu-devel] [PATCH] hw/pxa2xx_gpio.c Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------050601040108010100090309 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This patch avoids crashing of QEMU when applications (e.g pxaregs) read the GPCR register. --------------050601040108010100090309 Content-Type: text/plain; name="qemu-pxa-gpio-fix" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-pxa-gpio-fix" Index: pxa2xx_gpio.c =================================================================== RCS file: /sources/qemu/qemu/hw/pxa2xx_gpio.c,v retrieving revision 1.5 diff -u -r1.5 pxa2xx_gpio.c --- pxa2xx_gpio.c 4 Oct 2007 19:41:17 -0000 1.5 +++ pxa2xx_gpio.c 16 Nov 2007 15:08:00 -0000 @@ -157,6 +157,11 @@ printf("%s: Read from a write-only register " REG_FMT "\n", __FUNCTION__, offset); return s->gpsr[bank]; /* Return last written value. */ + + case GPCR: /* GPIO Pin-Output Clear registers */ + printf("%s: Read from a write-only register " REG_FMT "\n", + __FUNCTION__, offset); + return 0; /* Reading specified as unpredictable in documentation */ case GRER: /* GPIO Rising-Edge Detect Enable registers */ return s->rising[bank]; --------------050601040108010100090309--