From: dibacco at libero.it <dibacco@libero.it>
To: u-boot@lists.denx.de
Subject: [U-Boot] Strange arm9 behaviour reading long(s) not aligned to 4 bytes boundary
Date: Sat, 24 Jan 2009 17:18:48 +0100 (CET) [thread overview]
Message-ID: <26134646.40551232813928358.JavaMail.defaultUser@defaultHost> (raw)
Hi,
I have something like this on a 32 bit little endian arm9 board (SAM9
L9260):
char buffer[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
long A = * ( (long*)
buffer );
long B = * ( (long*) (buffer + 2) );
printf("A: %08x B: %08x", A,
B);
I would expect that A = 0x03020100 and B = 0x05040302
instead I get the
right value for A but B is 0x01000302 or something like this but anyway not
what I expect.
Is there something wrong on the board? It seems that only 4
bytes aligned long are read correctly.
Thank you in advance,
Antonio.
next reply other threads:[~2009-01-24 16:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-24 16:18 dibacco at libero.it [this message]
2009-01-24 17:11 ` [U-Boot] Strange arm9 behaviour reading long(s) not aligned to 4 bytes boundary Måns Rullgård
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=26134646.40551232813928358.JavaMail.defaultUser@defaultHost \
--to=dibacco@libero.it \
--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