Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a memcpy bug(possibly) #31

Closed
0xWilliamWang opened this issue Aug 23, 2021 · 2 comments
Closed

a memcpy bug(possibly) #31

0xWilliamWang opened this issue Aug 23, 2021 · 2 comments

Comments

@0xWilliamWang
Copy link

memcpy(void *__restrict aa, const void *__restrict bb, size_t n)

aa,bb are restricted pointer and it's value cannot be modified by other pointers.
but in BODY by

the value of aa is modified.

I may be wrong, but this solves the problem of infinite loops in memcpy functions in some cases.

memcpy(void * aa, const void * bb, size_t n)
@jim-wilson
Copy link
Contributor

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?

@0xWilliamWang
Copy link
Author

@jim-wilson I am vary, vary sorry that i sent my issue in the wrong place.

  1. The program I was running was keystone's code, they forked this project, but they didn't modify memcpy, so I open the issue.
  2. 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
    ....
  3. See this PR for more info if you are interested.
  4. Thank you vary much for your reply and I am very sorry to disturb you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants