Use suword16/fuword16 instead of susword/fusword - this has two different
definitions so far.. 16 bit on x86 and appears to be 32 bit on sparc64. Be explicit to avoid suprises.
This commit is contained in:
parent
49d54362f1
commit
e8aef1d3b5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=98482
@ -201,7 +201,7 @@ load_store_instr(char type)
|
||||
break;
|
||||
case 024: /* fldcw */
|
||||
REENTRANT_CHECK(OFF);
|
||||
control_word = fusword((unsigned short *) FPU_data_address);
|
||||
control_word = fuword16((unsigned short *) FPU_data_address);
|
||||
REENTRANT_CHECK(ON);
|
||||
#ifdef NO_UNDERFLOW_TRAP
|
||||
if (!(control_word & EX_Underflow)) {
|
||||
@ -242,7 +242,7 @@ load_store_instr(char type)
|
||||
case 034: /* fstcw m16int */
|
||||
REENTRANT_CHECK(OFF);
|
||||
/* verify_area(VERIFY_WRITE, FPU_data_address, 2);*/
|
||||
susword( (short *) FPU_data_address,control_word);
|
||||
suword16( (short *) FPU_data_address,control_word);
|
||||
REENTRANT_CHECK(ON);
|
||||
/* We want no net effect: */
|
||||
FPU_data_address = (void *) (intptr_t ) data_operand_offset;
|
||||
@ -258,7 +258,7 @@ load_store_instr(char type)
|
||||
status_word |= (top & 7) << SW_Top_Shift;
|
||||
REENTRANT_CHECK(OFF);
|
||||
/* verify_area(VERIFY_WRITE, FPU_data_address, 2);*/
|
||||
susword( (short *) FPU_data_address,status_word);
|
||||
suword16( (short *) FPU_data_address,status_word);
|
||||
REENTRANT_CHECK(ON);
|
||||
/* We want no net effect: */
|
||||
FPU_data_address = (void *) (intptr_t) data_operand_offset;
|
||||
|
@ -110,7 +110,7 @@ reg_load_extended(void)
|
||||
* hence re-entrancy problems can arise */
|
||||
sigl = fuword((unsigned long *) s);
|
||||
sigh = fuword(1 + (unsigned long *) s);
|
||||
exp = fusword(4 + (unsigned short *) s);
|
||||
exp = fuword16(4 + (unsigned short *) s);
|
||||
REENTRANT_CHECK(ON);
|
||||
|
||||
FPU_loaded_data.sigl = sigl;
|
||||
@ -361,7 +361,7 @@ reg_load_int16(void)
|
||||
|
||||
REENTRANT_CHECK(OFF);
|
||||
/* Cast as short to get the sign extended. */
|
||||
s = (short) fusword((unsigned short *) _s);
|
||||
s = (short) fuword16((unsigned short *) _s);
|
||||
REENTRANT_CHECK(ON);
|
||||
|
||||
if (s == 0) {
|
||||
@ -527,7 +527,7 @@ reg_store_extended(void)
|
||||
/* verify_area(VERIFY_WRITE, d, 10); */
|
||||
suword((unsigned long *) d, ls);
|
||||
suword(1 + (unsigned long *) d, ms);
|
||||
susword(4 + (short *) d, (unsigned short) e | sign);
|
||||
suword16(4 + (short *) d, (unsigned short) e | sign);
|
||||
REENTRANT_CHECK(ON);
|
||||
|
||||
return 1;
|
||||
@ -1001,7 +1001,7 @@ reg_store_int16(void)
|
||||
/* Put out the QNaN indefinite */
|
||||
REENTRANT_CHECK(OFF);
|
||||
/* verify_area(VERIFY_WRITE, d, 2);*/
|
||||
susword((unsigned short *) d, 0x8000);
|
||||
suword16((unsigned short *) d, 0x8000);
|
||||
REENTRANT_CHECK(ON);
|
||||
return 1;
|
||||
} else
|
||||
@ -1025,7 +1025,7 @@ reg_store_int16(void)
|
||||
|
||||
REENTRANT_CHECK(OFF);
|
||||
/* verify_area(VERIFY_WRITE, d, 2); */
|
||||
susword((short *) d, (short) t.sigl);
|
||||
suword16((short *) d, (short) t.sigl);
|
||||
REENTRANT_CHECK(ON);
|
||||
|
||||
return 1;
|
||||
@ -1164,9 +1164,9 @@ fldenv(void)
|
||||
int i;
|
||||
|
||||
REENTRANT_CHECK(OFF);
|
||||
control_word = fusword((unsigned short *) s);
|
||||
status_word = fusword((unsigned short *) (s + 4));
|
||||
tag_word = fusword((unsigned short *) (s + 8));
|
||||
control_word = fuword16((unsigned short *) s);
|
||||
status_word = fuword16((unsigned short *) (s + 4));
|
||||
tag_word = fuword16((unsigned short *) (s + 8));
|
||||
ip_offset = fuword((unsigned long *) (s + 0x0c));
|
||||
cs_selector = fuword((unsigned long *) (s + 0x10));
|
||||
data_operand_offset = fuword((unsigned long *) (s + 0x14));
|
||||
@ -1285,9 +1285,9 @@ fstenv(void)
|
||||
#endif /****/
|
||||
|
||||
REENTRANT_CHECK(OFF);
|
||||
susword((unsigned short *) d, control_word);
|
||||
susword((unsigned short *) (d + 4), (status_word & ~SW_Top) | ((top & 7) << SW_Top_Shift));
|
||||
susword((unsigned short *) (d + 8), tag_word());
|
||||
suword16((unsigned short *) d, control_word);
|
||||
suword16((unsigned short *) (d + 4), (status_word & ~SW_Top) | ((top & 7) << SW_Top_Shift));
|
||||
suword16((unsigned short *) (d + 8), tag_word());
|
||||
suword((unsigned long *) (d + 0x0c), ip_offset);
|
||||
suword((unsigned long *) (d + 0x10), cs_selector);
|
||||
suword((unsigned long *) (d + 0x14), data_operand_offset);
|
||||
@ -1378,7 +1378,7 @@ fsave(void)
|
||||
}
|
||||
e |= rp->sign == SIGN_POS ? 0 : 0x8000;
|
||||
REENTRANT_CHECK(OFF);
|
||||
susword((unsigned short *) (d + i * 10 + 8), e);
|
||||
suword16((unsigned short *) (d + i * 10 + 8), e);
|
||||
REENTRANT_CHECK(ON);
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ get_fs_byte(char *adr)
|
||||
|
||||
static unsigned short
|
||||
get_fs_word(unsigned short *adr)
|
||||
{ return(fuword(adr)); }
|
||||
{ return(fuword16(adr)); }
|
||||
|
||||
static u_int32_t
|
||||
get_fs_long(u_int32_t *adr)
|
||||
@ -83,7 +83,7 @@ put_fs_byte(unsigned char val, char *adr)
|
||||
|
||||
static void
|
||||
put_fs_word(unsigned short val, short *adr)
|
||||
{ (void)susword(adr,val); }
|
||||
{ (void)suword16(adr,val); }
|
||||
|
||||
static void
|
||||
put_fs_long(u_long val, u_int32_t *adr)
|
||||
|
@ -98,7 +98,7 @@ static __inline void
|
||||
PUSH(u_short x, struct vm86frame *vmf)
|
||||
{
|
||||
vmf->vmf_sp -= 2;
|
||||
susword(MAKE_ADDR(vmf->vmf_ss, vmf->vmf_sp), x);
|
||||
suword16(MAKE_ADDR(vmf->vmf_ss, vmf->vmf_sp), x);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
@ -111,7 +111,7 @@ PUSHL(u_int x, struct vm86frame *vmf)
|
||||
static __inline u_short
|
||||
POP(struct vm86frame *vmf)
|
||||
{
|
||||
u_short x = fusword(MAKE_ADDR(vmf->vmf_ss, vmf->vmf_sp));
|
||||
u_short x = fuword16(MAKE_ADDR(vmf->vmf_ss, vmf->vmf_sp));
|
||||
|
||||
vmf->vmf_sp += 2;
|
||||
return (x);
|
||||
|
@ -180,15 +180,15 @@ int copyin(const void *udaddr, void *kaddr, size_t len);
|
||||
int copyout(const void *kaddr, void *udaddr, size_t len);
|
||||
|
||||
int fubyte(const void *base);
|
||||
int subyte(void *base, int byte);
|
||||
long fuword(const void *base);
|
||||
int fuword16(void *base);
|
||||
int32_t fuword32(const void *base);
|
||||
int64_t fuword64(const void *base);
|
||||
long fuword(const void *base);
|
||||
int subyte(void *base, int byte);
|
||||
int suword(void *base, long word);
|
||||
int suword16(void *base, int word);
|
||||
int suword32(void *base, int32_t word);
|
||||
int suword64(void *base, int64_t word);
|
||||
int fusword(void *base);
|
||||
int susword(void *base, int word);
|
||||
|
||||
void realitexpire(void *);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user