aboutsummaryrefslogtreecommitdiff
path: root/emulators/qemu/files/patch-smc-fix
blob: 0fb2a1ae7adbe90956ed83fa758779d7efa33c75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
diff --git a/hw/smc91c111.c b/hw/smc91c111.c
index c1a88c9..e4a2447 100644
--- qemu/hw/smc91c111.c
+++ qemu/hw/smc91c111.c
@@ -250,6 +250,7 @@ static void smc91c111_writeb(void *opaque, target_phys_addr_t offset,
 {
     smc91c111_state *s = (smc91c111_state *)opaque;
 
+    offset = offset & 0xf;
     if (offset == 14) {
         s->bank = value;
         return;
@@ -276,6 +277,8 @@ static void smc91c111_writeb(void *opaque, target_phys_addr_t offset,
         case 10: case 11: /* RPCR */
             /* Ignored */
             return;
+        case 12: case 13: /* Reserved */
+            return;
         }
         break;
 
@@ -421,6 +424,7 @@ static uint32_t smc91c111_readb(void *opaque, target_phys_addr_t offset)
 {
     smc91c111_state *s = (smc91c111_state *)opaque;
 
+    offset = offset & 0xf;
     if (offset == 14) {
         return s->bank;
     }
@@ -461,6 +465,8 @@ static uint32_t smc91c111_readb(void *opaque, target_phys_addr_t offset)
         case 10: case 11: /* RPCR */
             /* Not implemented.  */
             return 0;
+        case 12: case 13: /* Reserved */
+            return 0;
         }
         break;