From: Paul Mackerras <paulus@samba.org>
To: <acurtis@onz.com>
Cc: <linuxppc-dev@lists.linuxppc.org>
Subject: RE: eieio rule-of-thumb?
Date: Thu, 23 May 2002 14:26:29 +1000 (EST) [thread overview]
Message-ID: <15596.28533.954307.94549@argo.ozlabs.ibm.com> (raw)
In-Reply-To: <NCBBIINEHIPFGJPLBEIFOEHMDHAA.acurtis@onz.com>
Allen Curtis writes:
> Could you provide an example of when you should insert this instruction into
> your code. From you description it is a wonder that "var += 2;" works if I
> am accessing dual-port on an 8260.
That works because the value stored has a data dependency on the value
loaded, i.e. the processor can't do the store until it has the value
back from the load.
In general it is sufficient to do an eieio before each non-cacheable
load, and between two non-cacheable stores if you need to prevent any
possibility of the two stores being combined into a single transaction
(e.g. if you have PCI and a PCI host bridge that can do write
combining). At present the I/O macros do an eieio after each
non-cacheable load and store, which works but is overkill.
In device driver code I much prefer not to see explicit "eieio()"
calls unless it is absolutely necessary. There are sets of macros
provided for access to I/O devices and it is almost always cleaner to
use them instead of explicitly putting "eieio()" in your code. It
cuts down on the "Old Macdonald" jokes too. :)
For access to PCI devices, use:
{in,out}{b,w,l} access to PCI I/O space (little endian)
{read,write}{b,w,l} access to PCI memory space (little endian)
For access to non-PCI devices on PPC platforms, use:
{in,out}_8
{in,out}_{le,be}{16,32}
These all take a kernel virtual address, i.e. the result of an
ioremap. The little-endian variants use the byte-reversed load and
store instructions.
Paul.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2002-05-23 4:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-22 4:43 eieio rule-of-thumb? Allen Curtis
2002-05-22 6:01 ` Paul Mackerras
2002-05-23 2:25 ` Allen Curtis
2002-05-23 4:26 ` Paul Mackerras [this message]
2002-05-23 13:38 ` Allen Curtis
2002-05-23 13:54 ` Dan Brennan
2002-05-23 14:42 ` Allen Curtis
2002-05-23 17:28 ` Dan Malek
2002-05-23 17:45 ` Chris Thomson
2002-05-23 19:02 ` Dan Malek
2002-05-23 22:36 ` Paul Mackerras
2002-05-23 18:44 ` benh
2002-05-23 18:02 ` Dan Malek
2002-05-23 22:58 ` Paul Mackerras
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=15596.28533.954307.94549@argo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=acurtis@onz.com \
--cc=linuxppc-dev@lists.linuxppc.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;
as well as URLs for NNTP newsgroup(s).