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: Tue, 1 Jun 2004 19:30:34 -0300 Sender: linux-8086-owner@vger.kernel.org Message-ID: <20040601223034.GW21172@duckman.distro.conectiva> References: <20040601213231.GT21172@duckman.distro.conectiva> <20040601220235.GU21172@duckman.distro.conectiva> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GTGEtWEe6jD60dxL" Return-path: Content-Disposition: inline In-Reply-To: <20040601220235.GU21172@duckman.distro.conectiva> List-Id: To: linux-8086@vger.kernel.org --GTGEtWEe6jD60dxL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Interesting: The diff between dev86-0.16.0 and 0.16.15 shows: @@ -664,8 +693,34 @@ if( main_flag > 2 ) globl("environ"); } +#ifdef I8088 + regfuse =3D 0; +#endif lbrace(); compound(); +#ifdef I8088 + if (regfuse & callee1mask) { + outstr("! Register"); + if (regfuse & INDREG0 & callee1mask) outstr(" BX"); + if (regfuse & INDREG1 & callee1mask) outstr(" SI"); + if (regfuse & INDREG2 & callee1mask) outstr(" DI"); + outstr(" used in function "); + outnstr(funcname); + if (optimise && !callersaves) { + outstr(funcname); + outnstr(".off =3D 0"); + } + } else + if (optimise && !callersaves) { + outstr(funcname); + outstr(".off =3D "); +#ifndef I80386 + outnhex(4); +#else + outnhex(i386_32?12:4); +#endif + } +#endif clearfunclabels(); } This register-saving optmization was added after 0.16.0. The fix is valid, but probably it will break systems using dev86 <=3D 0.16.0. On Tue, Jun 01, 2004 at 07:02:35PM -0300, Eduardo Pereira Habkost wrote: >=20 > The following patch fixes the problem on my system. Probably > with some versions of bcc the patch will break something. >=20 > 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. >=20 > Now the system booted and ran flawlessly. >=20 > --- 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 @@ > =20 > #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 > + > } > =20 > int verified_memcpy_fromfs(void *daddr, void *saddr, size_t len) > @@ -69,8 +74,10 @@ > =20 > #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 > } >=20 > --=20 > Eduardo --=20 Eduardo --GTGEtWEe6jD60dxL Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAvQOKcaRJ66w1lWgRAlaXAJ96IwFv0+Q3J/JlN9zA7zR7ey8ygACdFq6f 9EOlXnqrRtv6jvwiII4jS1M= =5/uJ -----END PGP SIGNATURE----- --GTGEtWEe6jD60dxL--