summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-10-29 21:25:46 +0000
committerjhb <jhb@FreeBSD.org>2015-10-29 21:25:46 +0000
commit727afb6dcdbec7ebcfef37be2fe578c7bc74ac39 (patch)
tree7ce39376306a2827029e81bb5929d3a009cb3513 /sys/i386
parent56c8c3d4b33b718282dfdeb1cb2e551c7552e5f7 (diff)
downloadFreeBSD-src-727afb6dcdbec7ebcfef37be2fe578c7bc74ac39.zip
FreeBSD-src-727afb6dcdbec7ebcfef37be2fe578c7bc74ac39.tar.gz
Use movw instead of movl (or plain mov) when moving segment registers
into memory. This is a nop on clang's assembler, but some assemblers complain if the size suffix is incorrect. Submitted by: bde
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/exception.s24
-rw-r--r--sys/i386/include/asmacros.h6
2 files changed, 15 insertions, 15 deletions
diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s
index 70c6d9d..f91f516 100644
--- a/sys/i386/i386/exception.s
+++ b/sys/i386/i386/exception.s
@@ -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
diff --git a/sys/i386/include/asmacros.h b/sys/i386/include/asmacros.h
index 91c25f7..d14f079 100644
--- a/sys/i386/include/asmacros.h
+++ b/sys/i386/include/asmacros.h
@@ -147,11 +147,11 @@
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 ; \
OpenPOWER on IntegriCloud