Revision 88738c09
b/bswap.h | ||
---|---|---|
132 | 132 |
#define cpu_to_le32wu(p, v) cpu_to_le32w(p, v) |
133 | 133 |
#define le16_to_cpupu(p) le16_to_cpup(p) |
134 | 134 |
#define le32_to_cpupu(p) le32_to_cpup(p) |
135 |
#define be32_to_cpupu(p) be32_to_cpup(p) |
|
135 | 136 |
|
136 | 137 |
#define cpu_to_be16wu(p, v) cpu_to_be16w(p, v) |
137 | 138 |
#define cpu_to_be32wu(p, v) cpu_to_be32w(p, v) |
... | ... | |
168 | 169 |
return p1[0] | (p1[1] << 8) | (p1[2] << 16) | (p1[3] << 24); |
169 | 170 |
} |
170 | 171 |
|
172 |
static inline uint32_t be32_to_cpupu(const uint32_t *p) |
|
173 |
{ |
|
174 |
const uint8_t *p1 = (const uint8_t *)p; |
|
175 |
return p1[3] | (p1[2] << 8) | (p1[1] << 16) | (p1[0] << 24); |
|
176 |
} |
|
177 |
|
|
171 | 178 |
static inline void cpu_to_be16wu(uint16_t *p, uint16_t v) |
172 | 179 |
{ |
173 | 180 |
uint8_t *p1 = (uint8_t *)p; |
b/hw/e1000.c | ||
---|---|---|
326 | 326 |
if (tp->tcp) { |
327 | 327 |
sofar = frames * tp->mss; |
328 | 328 |
cpu_to_be32wu((uint32_t *)(tp->data+css+4), // seq |
329 |
be32_to_cpup((uint32_t *)(tp->data+css+4))+sofar); |
|
329 |
be32_to_cpupu((uint32_t *)(tp->data+css+4))+sofar);
|
|
330 | 330 |
if (tp->paylen - sofar > tp->mss) |
331 | 331 |
tp->data[css + 13] &= ~9; // PSH, FIN |
332 | 332 |
} else // UDP |
Also available in: Unified diff