Fixed some Solaris specific assembler problems.
diff --git a/include/selectors.h b/include/selectors.h index fa2fb1d..ff8a4cc 100644 --- a/include/selectors.h +++ b/include/selectors.h
@@ -23,7 +23,7 @@ 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 5c58166..0a1251a 100644 --- a/memory/selector.c +++ b/memory/selector.c
@@ -820,12 +820,12 @@ } #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