From: Jamie Lokier <lk@tantalophile.demon.co.uk>
To: Parity Error <bootup@mail.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: switch_to()/doesnt %esp get replaced with %ebp on ret
Date: Tue, 20 Mar 2001 12:23:53 +0100 [thread overview]
Message-ID: <20010320122353.A7373@pcep-jamie.cern.ch> (raw)
In-Reply-To: <20010319150425.D19104@pcep-jamie.cern.ch> <E14fJjA-000Pf0-00@f6.mail.ru>
In-Reply-To: <E14fJjA-000Pf0-00@f6.mail.ru>; from bootup@mail.ru on Tue, Mar 20, 2001 at 01:51:00PM +0300
Parity Error wrote:
> I dont know if you understood my doubt, but your pointer
> to bp accidentally or otherwise solved the mystery.
We agree, and I like your explanation.
> Still, could some one enlighten me on why esi and edi are
> also similarly saved and restored ?
The compiler _may_ cache other values in those registers across the call
to switch_to. Although this doesn't happen in your kernel, it does
sometimes happen and switch_to must be coded to assume that it does.
You can safely remove the esi & edi pushes and pops, if you put those
registers in the "clobber" list of the asm. In theory that's best,
because then the compiler will save the register values itself only if
it needs to.
In practice, putting them in the clobber list sometimes results in worse
code, at least when I tried this in the 2.2 series.
You can't put ebp in the clobber list for some reason: GCC silently
ignores it. (Maybe that's fixed now too, I don't know).
-- Jamie
prev parent reply other threads:[~2001-03-20 11:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-19 13:19 Parity Error
2001-03-19 14:04 ` Jamie Lokier
2001-03-20 10:51 ` Re[2]: " Parity Error
2001-03-20 11:23 ` Jamie Lokier [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=20010320122353.A7373@pcep-jamie.cern.ch \
--to=lk@tantalophile.demon.co.uk \
--cc=bootup@mail.ru \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®