From ea4f831d99d8f8c6ef2bb82724a3c3c4158e6507 Mon Sep 17 00:00:00 2001
From: Patrik Stridvall <ps@leissner.se>
Date: Sun, 27 Feb 2000 16:39:48 +0000
Subject: [PATCH] Fixed some Solaris specific assembler problems.

---
 include/selectors.h |  2 +-
 memory/selector.c   | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/selectors.h b/include/selectors.h
index fa2fb1d2311..ff8a4cc9367 100644
--- a/include/selectors.h
+++ b/include/selectors.h
@@ -23,7 +23,7 @@ extern void SELECTOR_FreeBlock( WORD sel, WORD count );
     extern inline unsigned short __get_##seg(void) \
     { unsigned short res; __asm__("movw %%" #seg ",%w0" : "=r"(res)); return res; }
 #  define __DEFINE_SET_SEG(seg) \
-    extern inline void __set_##seg(int val) { __asm__("movl %0,%%" #seg : : "r" (val)); }
+    extern inline void __set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); }
 # else  /* __GNUC__ */
 #  define __DEFINE_GET_SEG(seg) extern unsigned short __get_##seg(void);
 #  define __DEFINE_SET_SEG(seg) extern void __set_##seg(unsigned int);
diff --git a/memory/selector.c b/memory/selector.c
index 5c5816654a8..0a1251a5ed8 100644
--- a/memory/selector.c
+++ b/memory/selector.c
@@ -820,12 +820,12 @@ SEGPTR WINAPI UTLinearToSelectorOffset16(LPVOID lptr)
 }
 
 #ifdef __i386__
-__ASM_GLOBAL_FUNC( __get_cs, "movl %cs,%eax\n\tret" );
-__ASM_GLOBAL_FUNC( __get_ds, "movl %ds,%eax\n\tret" );
-__ASM_GLOBAL_FUNC( __get_es, "movl %es,%eax\n\tret" );
-__ASM_GLOBAL_FUNC( __get_fs, "movl %fs,%eax\n\tret" );
-__ASM_GLOBAL_FUNC( __get_gs, "movl %gs,%eax\n\tret" );
-__ASM_GLOBAL_FUNC( __get_ss, "movl %ss,%eax\n\tret" );
-__ASM_GLOBAL_FUNC( __set_fs, "movl 4(%esp),%eax\n\tmovl %eax,%fs\n\tret" );
-__ASM_GLOBAL_FUNC( __set_gs, "movl 4(%esp),%eax\n\tmovl %eax,%gs\n\tret" );
+__ASM_GLOBAL_FUNC( __get_cs, "movw %cs,%ax\n\tret" )
+__ASM_GLOBAL_FUNC( __get_ds, "movw %ds,%ax\n\tret" )
+__ASM_GLOBAL_FUNC( __get_es, "movw %es,%ax\n\tret" )
+__ASM_GLOBAL_FUNC( __get_fs, "movw %fs,%ax\n\tret" )
+__ASM_GLOBAL_FUNC( __get_gs, "movw %gs,%ax\n\tret" )
+__ASM_GLOBAL_FUNC( __get_ss, "movw %ss,%ax\n\tret" )
+__ASM_GLOBAL_FUNC( __set_fs, "movl 4(%esp),%eax\n\tmovw %ax,%fs\n\tret" )
+__ASM_GLOBAL_FUNC( __set_gs, "movl 4(%esp),%eax\n\tmovw %ax,%gs\n\tret" )
 #endif
-- 
GitLab