From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Struct SoC access
Date: Mon, 16 Aug 2010 15:21:28 -0500 [thread overview]
Message-ID: <20100816202128.GA2016@schlenkerla.am.freescale.net> (raw)
In-Reply-To: <4C671581.9040804@emk-elektronik.de>
On Sun, Aug 15, 2010 at 12:15:29AM +0200, Reinhard Meyer wrote:
> >> Would the toolchain "gulp" when one defines the whole 4 GB that way?
> >
> > Why not?
>
> Since the AT91s have no base address registers at all, the memory layout
> is completely fixed. Even chip selects have a fixed address and fixed
> size of 256MB each. Therefore it _might_ make sense to completely
> define the 4GB in the soc struct.
> Then assign struct soc *soc = (struct soc *)0;
One snag you might hit is that dereferencing a NULL pointer is undefined,
and some versions of GCC assume you won't do this when optimizing. Not sure
if this simple usage would be affected (it seems to mainly be an issue when
comparing a pointer to NULL after dereferencing), and
-fno-delete-null-pointer-checks may help.
> Did you read Mike's comment of hardware dependent direct usage of
> struct members to access hardware? I thought that was generally
> discouraged for several reasons (cache and access sequencing)?
>
> Whats a IOCCC?
The International Obfuscated C Code Contest, possibly a more appropriate
venue for code that defines a 4GB struct. :-)
-Scott
next prev parent reply other threads:[~2010-08-16 20:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-14 9:07 [U-Boot] Make preparatory patches that initially have no effect? Reinhard Meyer
2010-08-14 14:30 ` Wolfgang Denk
2010-08-14 17:05 ` Reinhard Meyer
2010-08-14 18:46 ` Wolfgang Denk
2010-08-14 19:30 ` [U-Boot] Struct SoC access (was:Make preparatory patches that initially have no effect?) Reinhard Meyer
2010-08-14 19:36 ` Mike Frysinger
2010-08-14 19:40 ` [U-Boot] Struct SoC access Reinhard Meyer
2010-08-14 20:48 ` Mike Frysinger
2010-08-14 19:41 ` [U-Boot] Struct SoC access (was:Make preparatory patches that initially have no effect?) Wolfgang Denk
2010-08-14 19:58 ` [U-Boot] Struct SoC access Reinhard Meyer
2010-08-14 20:47 ` Reinhard Meyer
2010-08-14 21:49 ` Wolfgang Denk
2010-08-14 21:47 ` Wolfgang Denk
2010-08-14 22:15 ` Reinhard Meyer
2010-08-16 20:21 ` Scott Wood [this message]
2010-08-17 6:58 ` Reinhard Meyer
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=20100816202128.GA2016@schlenkerla.am.freescale.net \
--to=scottwood@freescale.com \
--cc=u-boot@lists.denx.de \
/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