Commit d538e8f50d89a66ae14a2cf351d2e0e5365d463b

Authored by malc
1 parent dc28c732

Fix tswap size

p in this case is uint32_t *

e1/e2 are unsigned ints initialized from arithmetics performed on
unsigned longs

The mistake was, probably, never noticed due to the absence of any
big endian linux-user host. The types e1/e2 and p begs the quesiton
why this function takes longs at all.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5036 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 2 additions and 2 deletions
linux-user/main.c
... ... @@ -278,8 +278,8 @@ static void write_dt(void *ptr, unsigned long addr, unsigned long limit,
278 278 e2 = ((addr >> 16) & 0xff) | (addr & 0xff000000) | (limit & 0x000f0000);
279 279 e2 |= flags;
280 280 p = ptr;
281   - p[0] = tswapl(e1);
282   - p[1] = tswapl(e2);
  281 + p[0] = tswap32(e1);
  282 + p[1] = tswap32(e2);
283 283 }
284 284  
285 285 #if TARGET_X86_64
... ...