use movw (not movl) with (16-bit) segment registers.

cluebat from miod@
This commit is contained in:
sthen 2013-03-21 22:23:39 +00:00
parent 37908b81a4
commit 555161d664
2 changed files with 38 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.8 2013/03/11 11:44:43 espie Exp $
# $OpenBSD: Makefile,v 1.9 2013/03/21 22:23:39 sthen Exp $
# Some assembly required
ONLY_FOR_ARCHS =i386 amd64
@ -7,6 +7,7 @@ SHARED_ONLY = Yes
COMMENT = language agnostic asynchronous web server
DISTNAME = mongrel2-1.8.0
REVISION = 0
CATEGORIES = www
HOMEPAGE = http://mongrel2.org/

View File

@ -0,0 +1,36 @@
$OpenBSD: patch-src_task_asm_S,v 1.3 2013/03/21 22:23:40 sthen Exp $
use movw with (16-bit) segment registers.
--- src/task/asm.S.orig Thu Mar 21 16:21:22 2013
+++ src/task/asm.S Thu Mar 21 16:21:35 2013
@@ -45,10 +45,10 @@
SET:
movl 4(%esp), %eax
- movl 8(%eax), %fs
- movl 12(%eax), %es
- movl 16(%eax), %ds
- movl 76(%eax), %ss
+ movw 8(%eax), %fs
+ movw 12(%eax), %es
+ movw 16(%eax), %ds
+ movw 76(%eax), %ss
movl 20(%eax), %edi
movl 24(%eax), %esi
movl 28(%eax), %ebp
@@ -65,10 +65,10 @@ SET:
GET:
movl 4(%esp), %eax
- movl %fs, 8(%eax)
- movl %es, 12(%eax)
- movl %ds, 16(%eax)
- movl %ss, 76(%eax)
+ movw %fs, 8(%eax)
+ movw %es, 12(%eax)
+ movw %ds, 16(%eax)
+ movw %ss, 76(%eax)
movl %edi, 20(%eax)
movl %esi, 24(%eax)
movl %ebp, 28(%eax)