]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Use movw instead of movl (or plain mov) when moving segment registers
authorjhb <jhb@FreeBSD.org>
Thu, 29 Oct 2015 21:25:46 +0000 (21:25 +0000)
committerjhb <jhb@FreeBSD.org>
Thu, 29 Oct 2015 21:25:46 +0000 (21:25 +0000)
into memory.  This is a nop on clang's assembler, but some assemblers
complain if the size suffix is incorrect.

Submitted by: bde

sys/i386/i386/exception.s
sys/i386/include/asmacros.h

index 70c6d9d007585d206a987a7584abb7ea6fea9cdb..f91f51612269dc0c9ea7d75687264a4f8a1d3123 100644 (file)
@@ -158,11 +158,11 @@ IDTVEC(xmm)
 alltraps:
        pushal
        pushl   $0
-       movl    %ds,(%esp)
+       movw    %ds,(%esp)
        pushl   $0
-       movl    %es,(%esp)
+       movw    %es,(%esp)
        pushl   $0
-       movl    %fs,(%esp)
+       movw    %fs,(%esp)
 alltraps_with_regs_pushed:
        SET_KERNEL_SREGS
        cld
@@ -237,11 +237,11 @@ IDTVEC(lcall_syscall)
        subl    $4,%esp                 /* skip over tf_trapno */
        pushal
        pushl   $0
-       movl    %ds,(%esp)
+       movw    %ds,(%esp)
        pushl   $0
-       movl    %es,(%esp)
+       movw    %es,(%esp)
        pushl   $0
-       movl    %fs,(%esp)
+       movw    %fs,(%esp)
        SET_KERNEL_SREGS
        cld
        FAKE_MCOUNT(TF_EIP(%esp))
@@ -266,11 +266,11 @@ IDTVEC(int0x80_syscall)
        subl    $4,%esp                 /* skip over tf_trapno */
        pushal
        pushl   $0
-       movl    %ds,(%esp)
+       movw    %ds,(%esp)
        pushl   $0
-       movl    %es,(%esp)
+       movw    %es,(%esp)
        pushl   $0
-       movl    %fs,(%esp)
+       movw    %fs,(%esp)
        SET_KERNEL_SREGS
        cld
        FAKE_MCOUNT(TF_EIP(%esp))
@@ -426,15 +426,15 @@ doreti_iret_fault:
        subl    $8,%esp
        pushal
        pushl   $0
-       movl    %ds,(%esp)
+       movw    %ds,(%esp)
        .globl  doreti_popl_ds_fault
 doreti_popl_ds_fault:
        pushl   $0
-       movl    %es,(%esp)
+       movw    %es,(%esp)
        .globl  doreti_popl_es_fault
 doreti_popl_es_fault:
        pushl   $0
-       movl    %fs,(%esp)
+       movw    %fs,(%esp)
        .globl  doreti_popl_fs_fault
 doreti_popl_fs_fault:
        sti
index 91c25f725dfa0d800f755a6edf719edc664f95a0..d14f0794dc0f0ae7121ed3430c766e7aa8dcffd4 100644 (file)
        pushl   $0 ;            /* dummy trap type */                   \
        pushal ;                /* 8 ints */                            \
        pushl   $0 ;            /* save data and extra segments ... */  \
-       mov     %ds,(%esp) ;                                            \
+       movw    %ds,(%esp) ;                                            \
        pushl   $0 ;                                                    \
-       mov     %es,(%esp) ;                                            \
+       movw    %es,(%esp) ;                                            \
        pushl   $0 ;                                                    \
-       mov     %fs,(%esp)
+       movw    %fs,(%esp)
        
 #define        POP_FRAME                                                       \
        popl    %fs ;                                                   \