Commit 84fa15d854673859736f16e92ee8c3f622f16a8b

Authored by bellard
1 parent 4add45b4

big endian/unaligned fix


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@213 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 4 additions and 4 deletions
linux-user/vm86.c
@@ -41,22 +41,22 @@ static inline int is_revectored(int nr, struct target_revectored_struct *bitmap) @@ -41,22 +41,22 @@ static inline int is_revectored(int nr, struct target_revectored_struct *bitmap)
41 41
42 static inline void vm_putw(uint8_t *segptr, unsigned int reg16, unsigned int val) 42 static inline void vm_putw(uint8_t *segptr, unsigned int reg16, unsigned int val)
43 { 43 {
44 - *(uint16_t *)(segptr + (reg16 & 0xffff)) = tswap16(val); 44 + stw(segptr + (reg16 & 0xffff), val);
45 } 45 }
46 46
47 static inline void vm_putl(uint8_t *segptr, unsigned int reg16, unsigned int val) 47 static inline void vm_putl(uint8_t *segptr, unsigned int reg16, unsigned int val)
48 { 48 {
49 - *(uint32_t *)(segptr + (reg16 & 0xffff)) = tswap32(val); 49 + stl(segptr + (reg16 & 0xffff), val);
50 } 50 }
51 51
52 static inline unsigned int vm_getw(uint8_t *segptr, unsigned int reg16) 52 static inline unsigned int vm_getw(uint8_t *segptr, unsigned int reg16)
53 { 53 {
54 - return tswap16(*(uint16_t *)(segptr + (reg16 & 0xffff))); 54 + return lduw(segptr + (reg16 & 0xffff));
55 } 55 }
56 56
57 static inline unsigned int vm_getl(uint8_t *segptr, unsigned int reg16) 57 static inline unsigned int vm_getl(uint8_t *segptr, unsigned int reg16)
58 { 58 {
59 - return tswap32(*(uint32_t *)(segptr + (reg16 & 0xffff))); 59 + return ldl(segptr + (reg16 & 0xffff));
60 } 60 }
61 61
62 void save_v86_state(CPUX86State *env) 62 void save_v86_state(CPUX86State *env)