Skip to contentSkip to conversation

hw/pxa2xx_gpio.c

PATCH New Thorsten Zitterell 1 participant 1 message Nov 16, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/pxa2xx_gpio.c

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

pxa2xx_gpio.c +5 -0
diff -u -r1.5 pxa2xx_gpio.c
@@ -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];