Closed 0xWilliamWang closed 3 years ago
The variable A is a copy of the variable AA, so modifying A doesn't modify AA. This looks OK to me.
This code incidentally is dead and no longer maintained as far as I know. The u540 support was upstreamed to u-boot and is now maintained there.
It isn't clear if you ran into a problem or not. You mention infinite loops. Did you run into one?
@jim-wilson I am vary, vary sorry that i sent my issue in the wrong place.
I used the latest commit and it worked well
SiFive FSBL: 2021-08-27-24f612f
Using FSBL DTB
HiFive-U serial #: 0000032e
Loading boot payload................................
OpenSBI v0.8
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|
Platform Name : sifive,hifive-unleashed-a00
Platform Features : timer,mfdeleg
....
https://github.com/sifive/freedom-u540-c000-bootloader/blob/24f612fe7ab54f213214e0e7e1f56bf839cb3bb8/lib/memcpy.c#L23
aa
,bb
are restricted pointer and it's value cannot be modified by other pointers. but in BODY by https://github.com/sifive/freedom-u540-c000-bootloader/blob/24f612fe7ab54f213214e0e7e1f56bf839cb3bb8/lib/memcpy.c#L28 the value ofaa
is modified.I may be wrong, but this solves the problem of infinite loops in memcpy functions in some cases.