qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] hw/pxa2xx_gpio.c


From: Thorsten Zitterell
Subject: [Qemu-devel] [PATCH] hw/pxa2xx_gpio.c
Date: Fri, 16 Nov 2007 16:14:30 +0100
User-agent: Icedove 1.5.0.14pre (X11/20071018)

This patch avoids crashing of QEMU when applications (e.g pxaregs) read the GPCR
register.

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];


reply via email to

[Prev in Thread] Current Thread [Next in Thread]