From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Olof Johansson <olof@lixom.net>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH 1/4] powerpc: consolidate feature fixup code
Date: Fri, 13 Oct 2006 00:47:29 +1000 [thread overview]
Message-ID: <1160664449.4792.147.camel@localhost.localdomain> (raw)
In-Reply-To: <20061012085617.3a5d6a31@localhost.localdomain>
> > +void do_feature_fixups(unsigned long offset, unsigned long value,
> > + void *fixup_start, void *fixup_end)
> > +{
> > + struct fixup_entry {
> > + unsigned long mask;
> > + unsigned long value;
> > + unsigned int *start;
> > + unsigned int *end;
> > + } *fcur, *fend;
>
> Shouldn't there be a better place to keep this struct definition than
> in the function it's used? Some header file?
It's not used anywhere else.... which header would you put it in ?
> > +
> > + fcur = fixup_start;
> > + fend = fixup_end;
> > +
> > + for (; fcur < fend; fcur++) {
>
> for (fcur = fixup_start; fcur < fend; fcur++) {
>
> > + unsigned int *pcur, *pend;
> > +
> > + if ((value & fcur->mask) == fcur->value)
> > + continue;
> > +
> > + pcur = fcur->start - offset;
> > + pend = fcur->end - offset;
> > + for (; pcur < pend; pcur++) {
> > + *pcur = 0x60000000u;
> > + asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync"
> > + : : "r" (pcur));
> > + }
>
> Ok, now it's in C, no reason to do a dcbst/icbi for every word. We did
> it in asm for simplicity's sake. Split it in two loops, one to nop,
> second to step per line and do the flushes. :-)
Do we care ? :) But yah, I suppose I can do that.
Thanks,
Ben.
next prev parent reply other threads:[~2006-10-12 14:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-12 8:29 [PATCH 1/4] powerpc: consolidate feature fixup code Benjamin Herrenschmidt
2006-10-12 9:56 ` Michael Ellerman
2006-10-12 10:48 ` Benjamin Herrenschmidt
2006-10-12 13:56 ` Olof Johansson
2006-10-12 14:47 ` Benjamin Herrenschmidt [this message]
2006-10-12 14:56 ` Olof Johansson
2006-10-12 15:24 ` Benjamin Herrenschmidt
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=1160664449.4792.147.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=olof@lixom.net \
/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;
as well as URLs for NNTP newsgroup(s).