* [U-Boot] Strange arm9 behaviour reading long(s) not aligned to 4 bytes boundary
@ 2009-01-24 16:18 dibacco at libero.it
2009-01-24 17:11 ` Måns Rullgård
0 siblings, 1 reply; 2+ messages in thread
From: dibacco at libero.it @ 2009-01-24 16:18 UTC (permalink / raw)
To: u-boot
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [U-Boot] Strange arm9 behaviour reading long(s) not aligned to 4 bytes boundary
2009-01-24 16:18 [U-Boot] Strange arm9 behaviour reading long(s) not aligned to 4 bytes boundary dibacco at libero.it
@ 2009-01-24 17:11 ` Måns Rullgård
0 siblings, 0 replies; 2+ messages in thread
From: Måns Rullgård @ 2009-01-24 17:11 UTC (permalink / raw)
To: u-boot
"dibacco at libero.it" <dibacco@libero.it> writes:
> 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.
ARM9 does not support unaligned load/store. Yours is apparently
configured in the round-and-rotate mode.
--
M?ns Rullg?rd
mans at mansr.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-24 17:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-24 16:18 [U-Boot] Strange arm9 behaviour reading long(s) not aligned to 4 bytes boundary dibacco at libero.it
2009-01-24 17:11 ` Måns Rullgård
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox