~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to debian/patches/84_rtl8139.patch

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-07 06:20:34 UTC
  • mfrom: (1.1.9 upstream)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20090307062034-i3pead4mw653v2el
Tags: 0.10.0-1
[ Aurelien Jarno ]
* New upstream release:
  - Fix fr-be keyboard mapping (closes: bug#514462).
  - Fix stat64 structure on ppc-linux-user (closes: bug#470231).
  - Add a chroot option (closes: bug#415996).
  - Add evdev support (closes: bug#513210).
  - Fix loop on symlinks in user mode (closes: bug#297572).
  - Bump depends on openbios-sparc.
  - Depends on openbios-ppc.
  - Update 12_signal_powerpc_support.patch.
  - Update 21_net_soopts.patch.
  - Drop 44_socklen_t_check.patch (merged upstream).
  - Drop 49_null_check.patch (merged upstream).
  - Update 64_ppc_asm_constraints.patch.
  - Drop security/CVE-2008-0928-fedora.patch (merged upstream).
  - Drop security/CVE-2007-5730.patch (merged upstream).
* patches/80_stable-branch.patch: add patches from stable branch:
  - Fix race condition between signal handler/execution loop (closes:
    bug#474386, bug#501731).
* debian/copyright: update.
* Compile and install .dtb files:
  - debian/control: build-depends on device-tree-compiler.
  - debian/patches/81_compile_dtb.patch: new patch from upstream.
  - debian/rules: compile and install bamboo.dtb and mpc8544.dtb.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
commit 1104c4b774c263da3d9f6e463d20bbc096e72b00
2
 
Author: aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
3
 
Date:   Thu Mar 13 19:17:40 2008 +0000
4
 
 
5
 
    rtl8139: fix endianness on big endian targets
6
 
    
7
 
    On big endian targets with mmio accesses, the values are not always
8
 
    swapped, depending on the accessed register. The Linux 8139too module
9
 
    was able to cope with that, but not the 8139cp one.
10
 
    
11
 
    
12
 
    git-svn-id: svn+ssh://svn.savannah.nongnu.org/qemu/trunk@4045 c046a42c-6fe2-441c-8c8c-71466251a162
13
 
 
14
 
Index: qemu-0.9.1/hw/rtl8139.c
15
 
===================================================================
16
 
--- qemu-0.9.1.orig/hw/rtl8139.c        2008-01-06 20:38:42.000000000 +0100
17
 
+++ qemu-0.9.1/hw/rtl8139.c     2008-04-14 11:26:14.000000000 +0200
18
 
@@ -2735,13 +2735,8 @@
19
 
         default:
20
 
             DEBUG_PRINT(("RTL8139: ioport write(w) addr=0x%x val=0x%04x via write(b)\n", addr, val));
21
 
 
22
 
-#ifdef TARGET_WORDS_BIGENDIAN
23
 
-            rtl8139_io_writeb(opaque, addr, (val >> 8) & 0xff);
24
 
-            rtl8139_io_writeb(opaque, addr + 1, val & 0xff);
25
 
-#else
26
 
             rtl8139_io_writeb(opaque, addr, val & 0xff);
27
 
             rtl8139_io_writeb(opaque, addr + 1, (val >> 8) & 0xff);
28
 
-#endif
29
 
             break;
30
 
     }
31
 
 }
32
 
@@ -2802,17 +2797,10 @@
33
 
 
34
 
         default:
35
 
             DEBUG_PRINT(("RTL8139: ioport write(l) addr=0x%x val=0x%08x via write(b)\n", addr, val));
36
 
-#ifdef TARGET_WORDS_BIGENDIAN
37
 
-            rtl8139_io_writeb(opaque, addr, (val >> 24) & 0xff);
38
 
-            rtl8139_io_writeb(opaque, addr + 1, (val >> 16) & 0xff);
39
 
-            rtl8139_io_writeb(opaque, addr + 2, (val >> 8) & 0xff);
40
 
-            rtl8139_io_writeb(opaque, addr + 3, val & 0xff);
41
 
-#else
42
 
             rtl8139_io_writeb(opaque, addr, val & 0xff);
43
 
             rtl8139_io_writeb(opaque, addr + 1, (val >> 8) & 0xff);
44
 
             rtl8139_io_writeb(opaque, addr + 2, (val >> 16) & 0xff);
45
 
             rtl8139_io_writeb(opaque, addr + 3, (val >> 24) & 0xff);
46
 
-#endif
47
 
             break;
48
 
     }
49
 
 }
50
 
@@ -2958,13 +2946,8 @@
51
 
         default:
52
 
             DEBUG_PRINT(("RTL8139: ioport read(w) addr=0x%x via read(b)\n", addr));
53
 
 
54
 
-#ifdef TARGET_WORDS_BIGENDIAN
55
 
-            ret  = rtl8139_io_readb(opaque, addr) << 8;
56
 
-            ret |= rtl8139_io_readb(opaque, addr + 1);
57
 
-#else
58
 
             ret  = rtl8139_io_readb(opaque, addr);
59
 
             ret |= rtl8139_io_readb(opaque, addr + 1) << 8;
60
 
-#endif
61
 
 
62
 
             DEBUG_PRINT(("RTL8139: ioport read(w) addr=0x%x val=0x%04x\n", addr, ret));
63
 
             break;
64
 
@@ -3031,17 +3014,10 @@
65
 
         default:
66
 
             DEBUG_PRINT(("RTL8139: ioport read(l) addr=0x%x via read(b)\n", addr));
67
 
 
68
 
-#ifdef TARGET_WORDS_BIGENDIAN
69
 
-            ret  = rtl8139_io_readb(opaque, addr) << 24;
70
 
-            ret |= rtl8139_io_readb(opaque, addr + 1) << 16;
71
 
-            ret |= rtl8139_io_readb(opaque, addr + 2) << 8;
72
 
-            ret |= rtl8139_io_readb(opaque, addr + 3);
73
 
-#else
74
 
             ret  = rtl8139_io_readb(opaque, addr);
75
 
             ret |= rtl8139_io_readb(opaque, addr + 1) << 8;
76
 
             ret |= rtl8139_io_readb(opaque, addr + 2) << 16;
77
 
             ret |= rtl8139_io_readb(opaque, addr + 3) << 24;
78
 
-#endif
79
 
 
80
 
             DEBUG_PRINT(("RTL8139: read(l) addr=0x%x val=%08x\n", addr, ret));
81
 
             break;
82
 
@@ -3091,11 +3067,17 @@
83
 
 
84
 
 static void rtl8139_mmio_writew(void *opaque, target_phys_addr_t addr, uint32_t val)
85
 
 {
86
 
+#ifdef TARGET_WORDS_BIGENDIAN
87
 
+    val = bswap16(val);
88
 
+#endif
89
 
     rtl8139_io_writew(opaque, addr & 0xFF, val);
90
 
 }
91
 
 
92
 
 static void rtl8139_mmio_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
93
 
 {
94
 
+#ifdef TARGET_WORDS_BIGENDIAN
95
 
+    val = bswap32(val);
96
 
+#endif
97
 
     rtl8139_io_writel(opaque, addr & 0xFF, val);
98
 
 }
99
 
 
100
 
@@ -3106,12 +3088,20 @@
101
 
 
102
 
 static uint32_t rtl8139_mmio_readw(void *opaque, target_phys_addr_t addr)
103
 
 {
104
 
-    return rtl8139_io_readw(opaque, addr & 0xFF);
105
 
+    uint32_t val = rtl8139_io_readw(opaque, addr & 0xFF);
106
 
+#ifdef TARGET_WORDS_BIGENDIAN
107
 
+    val = bswap16(val);
108
 
+#endif
109
 
+    return val;
110
 
 }
111
 
 
112
 
 static uint32_t rtl8139_mmio_readl(void *opaque, target_phys_addr_t addr)
113
 
 {
114
 
-    return rtl8139_io_readl(opaque, addr & 0xFF);
115
 
+    uint32_t val = rtl8139_io_readl(opaque, addr & 0xFF);
116
 
+#ifdef TARGET_WORDS_BIGENDIAN
117
 
+    val = bswap32(val);
118
 
+#endif
119
 
+    return val;
120
 
 }
121
 
 
122
 
 /* */