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: Tue, 01 Jun 2004 21:05:38 -0600 Sender: linux-8086-owner@vger.kernel.org Message-ID: <1086145537.3220.43.camel@talena.hsol.net> References: <20040601213231.GT21172@duckman.distro.conectiva> <20040601220235.GU21172@duckman.distro.conectiva> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20040601220235.GU21172@duckman.distro.conectiva> List-Id: Content-Type: text/plain; charset="us-ascii" To: Eduardo Pereira Habkost Cc: linux-8086@vger.kernel.org Applied. Thanks. Mike On Tue, 2004-06-01 at 16:02, Eduardo Pereira Habkost wrote: > The following patch fixes the problem on my system. Probably > with some versions of bcc the patch will break something. > > I've added code to save the contents of SI and DI, I don't know if the > callers of these functions assume that SI and DI are touched, but just > in case. > > Now the system booted and ran flawlessly. > > --- elks/arch/i86/mm/user.c 3 Jun 2002 22:22:58 -0000 1.15 > +++ elks/arch/i86/mm/user.c 1 Jun 2004 20:44:51 -0000 > @@ -34,10 +34,12 @@ > > #ifndef S_SPLINT_S > #asm > + push si > + push di > mov dx,es > mov bx,ds > mov es,bx > - mov ax,[bp-6] ! source segment (local variable) > + mov ax,[bp-2] ! source segment (local variable) > mov ds,ax > mov di,[bp+4] ! destination address > mov si,[bp+6] ! source address > @@ -47,8 +49,11 @@ > movsb > mov ds,bx > mov es,dx > + pop di > + pop si > #endasm > #endif > + > } > > int verified_memcpy_fromfs(void *daddr, void *saddr, size_t len) > @@ -69,8 +74,10 @@ > > #ifndef S_SPLINT_S > #asm > + push si > + push di > mov dx,es > - mov ax,[bp-6] ! source segment (local variable) > + mov ax,[bp-2] ! source segment (local variable) > mov es,ax > mov di,[bp+4] ! destination address > mov si,[bp+6] ! source address > @@ -79,6 +86,8 @@ > rep > movsb > mov es,dx > + pop di > + pop si > #endasm > #endif > }