public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Pereira Habkost <ehabkost@conectiva.com.br>
To: linux-8086@vger.kernel.org
Subject: Re: Experimental fix for my memcpy_{to,from}fs problem
Date: Wed, 2 Jun 2004 13:25:21 -0300	[thread overview]
Message-ID: <20040602162521.GC26330@duckman.distro.conectiva> (raw)
In-Reply-To: <1086145026.3220.41.camel@talena.hsol.net>

[-- Attachment #1: Type: text/plain, Size: 2807 bytes --]

On Tue, Jun 01, 2004 at 08:57:06PM -0600, Miguel Bolanos wrote:
<snip>
> 
> Yes the fix is ok.. but it will break dev86 <= 0.16.0 versions... this
> fact makes me hesitate a bit because Bruce does warn that 0.16.15 can
> behave a bit unstable.
> But we will see.

Yes, and bcc >= 0.16.8 variable offset macros are broken, anyway.

The original code didn't used the offset macros for accessing the
variables. It will work only on:

- dev86 < 0.16.8
- any dev86 version if not using optimization

And it will not work if the bcc variable offset macros bug is fixed,
because the offsets really changed, with the optimized code.

The fix I've sent before really broke systems with dev86 <= 0.16.8.

The following patch against the current CVS code (that already has the
"wrong" fix) change the asm code to access the variables using the
"right way", that is: the variable offset macros.

It will work for:
- dev86 < 0.16.8
- any dev86 version if not using optimization
- dev86 >= 0.16.8 with the previous patch I sent (Fix variable offset macros)
- dev86 with the patch Robert sent

So please apply.

--
Eduardo


--- elks/arch/i86/mm/user.c	2 Jun 2004 03:06:01 -0000	1.16
+++ elks/arch/i86/mm/user.c	2 Jun 2004 15:10:16 -0000
@@ -39,11 +39,11 @@
 	mov	dx,es
 	mov	bx,ds
 	mov	es,bx
-	mov	ax,[bp-2]	! source segment (local variable)
+	mov	ax,[bp+.memcpy_fromfs.ds]	! source segment (local variable)
 	mov	ds,ax
-	mov	di,[bp+4]	! destination address
-	mov	si,[bp+6]	! source address
-	mov	cx,[bp+8]	! number of bytes to copy
+	mov	di,[bp+.memcpy_fromfs.daddr]	! destination address
+	mov	si,[bp+.memcpy_fromfs.saddr]	! source address
+	mov	cx,[bp+.memcpy_fromfs.len]	! number of bytes to copy
 	cld
 	rep
 	movsb
@@ -77,11 +77,11 @@
 	push	si
 	push	di
 	mov	dx,es
-	mov	ax,[bp-2]	! source segment (local variable)
+	mov	ax,[bp+.memcpy_tofs.es]	! source segment (local variable)
 	mov	es,ax
-	mov	di,[bp+4]	! destination address
-	mov	si,[bp+6]	! source address
-	mov	cx,[bp+8]	! number of bytes to copy
+	mov	di,[bp+.memcpy_tofs.daddr]	! destination address
+	mov	si,[bp+.memcpy_tofs.saddr]	! source address
+	mov	cx,[bp+.memcpy_tofs.len]	! number of bytes to copy
 	cld
 	rep
 	movsb
@@ -167,17 +167,17 @@
 #ifndef S_SPLINT_S
 #asm
 
-	mov	ax,[bp-6]	! source segment (local variable)
+	mov	ax,[bp+.strlen_fromfs.ds]	! source segment (local variable)
 	mov	es,ax
-	mov	di,[bp+4]	! source address
+	mov	di,[bp+.strlen_fromfs.saddr]	! source address
 	cld
 	xor	al,al		! search for NULL byte
 	mov	cx,#-1
 	rep
 	scasb
-	sub	di,[bp+4]	! calc len +1
+	sub	di,[bp+.strlen_fromfs.saddr]	! calc len +1
 	dec	di
-	mov	[bp-6],di	! save in local var ds
+	mov	[bp+.strlen_fromfs.ds],di	! save in local var ds
 #endasm
 #endif
 

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-06-02 16:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-01 21:32 memcpy_fromfs() failing. Wrong variable offsets Eduardo Pereira Habkost
2004-06-01 22:02 ` Experimental fix for my memcpy_{to,from}fs problem Eduardo Pereira Habkost
2004-06-01 22:30   ` Eduardo Pereira Habkost
2004-06-02  2:57     ` Miguel Bolanos
2004-06-02 16:25       ` Eduardo Pereira Habkost [this message]
2004-06-03 14:02         ` Miguel Bolanos
2004-06-03 14:14           ` Eduardo Pereira Habkost
2004-06-03 14:37             ` Paul Nasrat
2004-06-02  1:33   ` claudio
2004-06-02 20:53     ` Miguel Bolanos
2004-06-02  3:05   ` Miguel Bolanos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040602162521.GC26330@duckman.distro.conectiva \
    --to=ehabkost@conectiva.com.br \
    --cc=linux-8086@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox