summaryrefslogtreecommitdiffstats
path: root/sys/gnu
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1994-09-21 22:22:48 +0000
committerbde <bde@FreeBSD.org>1994-09-21 22:22:48 +0000
commit690101d6131514f46c219c6dc1807888ba8f8926 (patch)
tree99881474d9504d10c596513238cd6fe3f1e58a4b /sys/gnu
parent6176de915eeb0ef012144a1aa85dd1daaca28d70 (diff)
downloadFreeBSD-src-690101d6131514f46c219c6dc1807888ba8f8926.zip
FreeBSD-src-690101d6131514f46c219c6dc1807888ba8f8926.tar.gz
Fix the consistent mistranslation of Linux's get_fs_word() and
put_fs_word() to fuword() and suword(). Linux words are 16 bits but BSD words are 32-bits, at least on vax's. Writing a too-large word trashed the neighbouring short word. Bruce
Diffstat (limited to 'sys/gnu')
-rw-r--r--sys/gnu/i386/fpemul/load_store.c8
-rw-r--r--sys/gnu/i386/fpemul/reg_ld_str.c26
2 files changed, 17 insertions, 17 deletions
diff --git a/sys/gnu/i386/fpemul/load_store.c b/sys/gnu/i386/fpemul/load_store.c
index 0192291..e45b67e 100644
--- a/sys/gnu/i386/fpemul/load_store.c
+++ b/sys/gnu/i386/fpemul/load_store.c
@@ -57,7 +57,7 @@
* W. Metzenthen June 1994.
*
*
- * $Id: load_store.c,v 1.2 1994/04/29 21:16:27 gclarkii Exp $
+ * $Id: load_store.c,v 1.3 1994/06/10 07:44:30 rich Exp $
*
*/
@@ -202,7 +202,7 @@ load_store_instr(char type)
break;
case 024: /* fldcw */
REENTRANT_CHECK(OFF);
- control_word = fuword((unsigned short *) FPU_data_address);
+ control_word = fusword((unsigned short *) FPU_data_address);
REENTRANT_CHECK(ON);
#ifdef NO_UNDERFLOW_TRAP
if (!(control_word & EX_Underflow)) {
@@ -240,7 +240,7 @@ load_store_instr(char type)
case 034: /* fstcw m16int */
REENTRANT_CHECK(OFF);
/* verify_area(VERIFY_WRITE, FPU_data_address, 2);*/
- suword( (short *) FPU_data_address,control_word);
+ susword( (short *) FPU_data_address,control_word);
REENTRANT_CHECK(ON);
FPU_data_address = (void *) data_operand_offset; /* We want no net effect */
FPU_entry_eip = ip_offset; /* We want no net effect */
@@ -255,7 +255,7 @@ load_store_instr(char type)
status_word |= (top & 7) << SW_Top_Shift;
REENTRANT_CHECK(OFF);
/* verify_area(VERIFY_WRITE, FPU_data_address, 2);*/
- suword( (short *) FPU_data_address,status_word);
+ susword( (short *) FPU_data_address,status_word);
REENTRANT_CHECK(ON);
FPU_data_address = (void *) data_operand_offset; /* We want no net effect */
FPU_entry_eip = ip_offset; /* We want no net effect */
diff --git a/sys/gnu/i386/fpemul/reg_ld_str.c b/sys/gnu/i386/fpemul/reg_ld_str.c
index b253f9c..8fde12f 100644
--- a/sys/gnu/i386/fpemul/reg_ld_str.c
+++ b/sys/gnu/i386/fpemul/reg_ld_str.c
@@ -56,7 +56,7 @@
* W. Metzenthen June 1994.
*
*
- * $Id: reg_ld_str.c,v 1.3 1994/06/10 07:44:52 rich Exp $
+ * $Id: reg_ld_str.c,v 1.4 1994/08/31 04:45:24 davidg Exp $
*
*/
@@ -111,7 +111,7 @@ reg_load_extended(void)
* hence re-entrancy problems can arise */
sigl = fuword((unsigned long *) s);
sigh = fuword(1 + (unsigned long *) s);
- exp = fuword(4 + (unsigned short *) s);
+ exp = fusword(4 + (unsigned short *) s);
REENTRANT_CHECK(ON);
FPU_loaded_data.sigl = sigl;
@@ -362,7 +362,7 @@ reg_load_int16(void)
REENTRANT_CHECK(OFF);
/* Cast as short to get the sign extended. */
- s = (short) fuword((unsigned short *) _s);
+ s = (short) fusword((unsigned short *) _s);
REENTRANT_CHECK(ON);
if (s == 0) {
@@ -528,7 +528,7 @@ reg_store_extended(void)
/* verify_area(VERIFY_WRITE, d, 10); */
suword((unsigned long *) d, ls);
suword(1 + (unsigned long *) d, ms);
- suword(4 + (short *) d, (unsigned short) e | sign);
+ susword(4 + (short *) d, (unsigned short) e | sign);
REENTRANT_CHECK(ON);
return 1;
@@ -1002,7 +1002,7 @@ reg_store_int16(void)
/* Put out the QNaN indefinite */
REENTRANT_CHECK(OFF);
/* verify_area(VERIFY_WRITE, d, 2);*/
- suword((unsigned short *) d, 0x8000);
+ susword((unsigned short *) d, 0x8000);
REENTRANT_CHECK(ON);
return 1;
} else
@@ -1026,7 +1026,7 @@ reg_store_int16(void)
REENTRANT_CHECK(OFF);
/* verify_area(VERIFY_WRITE, d, 2); */
- suword((short *) d, (short) t.sigl);
+ susword((short *) d, (short) t.sigl);
REENTRANT_CHECK(ON);
return 1;
@@ -1165,9 +1165,9 @@ fldenv(void)
int i;
REENTRANT_CHECK(OFF);
- control_word = fuword((unsigned short *) s);
- status_word = fuword((unsigned short *) (s + 4));
- tag_word = fuword((unsigned short *) (s + 8));
+ control_word = fusword((unsigned short *) s);
+ status_word = fusword((unsigned short *) (s + 4));
+ tag_word = fusword((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));
@@ -1284,9 +1284,9 @@ fstenv(void)
#endif /****/
REENTRANT_CHECK(OFF);
- suword((unsigned short *) d, control_word);
- suword((unsigned short *) (d + 4), (status_word & ~SW_Top) | ((top & 7) << SW_Top_Shift));
- suword((unsigned short *) (d + 8), tag_word());
+ 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());
suword((unsigned long *) (d + 0x0c), ip_offset);
suword((unsigned long *) (d + 0x10), cs_selector);
suword((unsigned long *) (d + 0x14), data_operand_offset);
@@ -1377,7 +1377,7 @@ fsave(void)
}
e |= rp->sign == SIGN_POS ? 0 : 0x8000;
REENTRANT_CHECK(OFF);
- suword((unsigned short *) (d + i * 10 + 8), e);
+ susword((unsigned short *) (d + i * 10 + 8), e);
REENTRANT_CHECK(ON);
}
OpenPOWER on IntegriCloud