From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miguel Bolanos Subject: Re: Experimental fix for my memcpy_{to,from}fs problem Date: Thu, 03 Jun 2004 08:02:18 -0600 Sender: linux-8086-owner@vger.kernel.org Message-ID: <1086271338.3227.3.camel@talena.hsol.net> References: <20040601213231.GT21172@duckman.distro.conectiva> <20040601220235.GU21172@duckman.distro.conectiva> <20040601223034.GW21172@duckman.distro.conectiva> <1086145026.3220.41.camel@talena.hsol.net> <20040602162521.GC26330@duckman.distro.conectiva> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20040602162521.GC26330@duckman.distro.conectiva> List-Id: Content-Type: text/plain; charset="us-ascii" To: Eduardo Pereira Habkost Cc: linux-8086@vger.kernel.org Applied, but i did some changes on the patch, please read bellow. On Wed, 2004-06-02 at 10:25, Eduardo Pereira Habkost wrote: > On Tue, Jun 01, 2004 at 08:57:06PM -0600, Miguel Bolanos wrote: > > > > > 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 This was already applied on a the previous patch > @@ -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 This was already done as well. > @@ -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 > This part was applied. thanks a lot. -- --------------------miguel bolanos, systems administrator, linuxlabs ... ........ ..... .... 230 peachtree st nw ste 2701 the original linux labs atlanta.ga.us 30303 -since 1995 http://www.linuxlabs.com office 404.577.7747 fax 404.577.7743 --------------------------------------------------------------------