public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
From: Miguel Bolanos <mike@linuxlabs.com>
To: Robert de Bath <robert$@mayday.cix.co.uk>
Cc: Eduardo Pereira Habkost <ehabkost@conectiva.com.br>,
	Linux-8086 <linux-8086@vger.kernel.org>
Subject: Re: ELKS memcpy_fromfs() failing. Wrong variable offsets
Date: Thu, 03 Jun 2004 08:19:45 -0600	[thread overview]
Message-ID: <1086272385.3227.6.camel@talena.hsol.net> (raw)
In-Reply-To: <609c173af82cc283@mayday.cix.co.uk>

I can't apply this patch as this is for dev86.. this should go to Bruce
Evans...

I will forward it to him.

Thanks

Mike

On Wed, 2004-06-02 at 02:47, Robert de Bath wrote:
> On Tue, 1 Jun 2004, Eduardo Pereira Habkost wrote:
> 
> > I am forwarding these messages to you, to check if you have any clue on
> > why this happened, and why the function worked on older versions.
> >
> > I've changed the function to use [bp-2] for the 'ds' variable, and now
> > the kernel works flawlessly.
> >
> > Do you have an explanation on how this function.off stuff works, and if
> > this have changed on older versions?
> 
> Oh my, confusion reigns.
> 
> Okay first the si and di variables are usually defined as callee saves
> unless you're compiling with the '-Mc' option.
> 
> The "memcpy_fromfs.off" stuff is generated for optimising the push/pop
> of the si and di variables. It's a reasonably recent addition so all
> accesses of si and si can be eliminated if they are unused. However,
> it's only turned on if you use '-O'.
> 
> Ie: this is working as it should.
> 
> You have highlighted a bug though, the definition some of the 'set'
> variables is actually wrong, they should have memcpy_fromfs.off added
> when it might be non-zero.
> 
> BTW: You should really be using those variables to access C arguments
> and locals, the '_memcpy_fromfs.ds' is for stack pointer relative the
> '.memcpy_fromfs.ds' is for 'bp' relative.
> 
> I can fix the bug in one of two ways; either actually add the
> 'memcpy_fromfs.off' variable to the 'set' variables or simply
> have the compiler assume that any '#asm' will use si and di.
> (The asm("...") function will not however.)
> 
> Actually I think assuming that #asm uses si/di is best because as this
> example has shown it is quite likely to be true, plus, it's the failsafe
> option.
> 
> (PS: It's also very easy to do :-) see attached. )
> 
> So do you want me to make it like it was before? :-)
-- 
--------------------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
--------------------------------------------------------------------


      parent reply	other threads:[~2004-06-03 14:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040601222140.GV21172@duckman.distro.conectiva>
2004-06-02  8:47 ` ELKS memcpy_fromfs() failing. Wrong variable offsets Robert de Bath
2004-06-02 12:52   ` Eduardo Pereira Habkost
2004-06-02 16:10   ` [bcc patch] Fix variable offset macros for #asm (was: Re: ELKS memcpy_fromfs() failing. Wrong variable offsets) Eduardo Pereira Habkost
2004-06-03 14:20     ` Miguel Bolanos
2004-06-03 14:19   ` Miguel Bolanos [this message]

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=1086272385.3227.6.camel@talena.hsol.net \
    --to=mike@linuxlabs.com \
    --cc=ehabkost@conectiva.com.br \
    --cc=linux-8086@vger.kernel.org \
    --cc=robert$@mayday.cix.co.uk \
    /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