From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Pereira Habkost Subject: Re: Experimental fix for my memcpy_{to,from}fs problem Date: Wed, 2 Jun 2004 13:25:21 -0300 Sender: linux-8086-owner@vger.kernel.org Message-ID: <20040602162521.GC26330@duckman.distro.conectiva> References: <20040601213231.GT21172@duckman.distro.conectiva> <20040601220235.GU21172@duckman.distro.conectiva> <20040601223034.GW21172@duckman.distro.conectiva> <1086145026.3220.41.camel@talena.hsol.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lCAWRPmW1mITcIfM" Return-path: Content-Disposition: inline In-Reply-To: <1086145026.3220.41.camel@talena.hsol.net> List-Id: To: linux-8086@vger.kernel.org --lCAWRPmW1mITcIfM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 01, 2004 at 08:57:06PM -0600, Miguel Bolanos wrote: >=20 > Yes the fix is ok.. but it will break dev86 <=3D 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 >=3D 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 <=3D 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 >=3D 0.16.8 with the previous patch I sent (Fix variable offset mac= ros) - 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 =20 - 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 =20 --lCAWRPmW1mITcIfM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAvf9xcaRJ66w1lWgRAoseAJ4yEEk6l/tn2IOWXHWV6aDp+MJ0tgCghI1a MyXWjncDrZW3pLHG43PgBfY= =aARr -----END PGP SIGNATURE----- --lCAWRPmW1mITcIfM--