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

pk: Fix __clear_cache() compilation issue with recent compilers #240

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

cmuellner
Copy link
Contributor

Using recent compilers we get the following error message:

../pk/pk.c: In function 'run_loaded_program.constprop':
../pk/pk.c:177:3: error: both arguments to '__builtin___clear_cache'
must be pointers
177 | __clear_cache(0, 0);
| ^~~~~~~~~~~~~~~~~~~

Let's use the existing function __riscv_flush_icache(),
give it a header with a prototype and use it to
emits the FENCE.I instruction directly.

See #239

Suggested-by: Andrew Waterman andrew@sifive.com
Signed-off-by: Christoph Muellner cmuellner@linux.com

Using recent compilers we get the following error message:

  ../pk/pk.c: In function 'run_loaded_program.constprop':
  ../pk/pk.c:177:3: error: both arguments to '__builtin___clear_cache'
  must be pointers
    177 |   __clear_cache(0, 0);
        |   ^~~~~~~~~~~~~~~~~~~

Let's use the existing function __riscv_flush_icache(),
give it a header with a prototype and use it to
emits the FENCE.I instruction directly.

See riscv-software-src#239

Suggested-by: Andrew Waterman <andrew@sifive.com>
Signed-off-by: Christoph Muellner <cmuellner@linux.com>
@aswaterman
Copy link
Collaborator

Forgot about that function. LGTM!

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

Successfully merging this pull request may close these issues.

None yet

2 participants