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

Add no-op futex syscall implementation #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abejgonzalez
Copy link

This allows simple programs compiled with modern versions of GLIBC to work with pk. For example:

hello.cc:

#include <iostream>
int main(void) {
  std::cout << "Hello!" << std::endl;
  return 0;
}

Compile/test:

riscv64-unknown-linux-gnu-gcc hello.cc -lstdc++ -static -o hello
spike pk hello

Solution was previously given in:
#207
riscv-software-src/riscv-isa-sim#1443
riscv-software-src/riscv-isa-sim#1605

@@ -770,6 +770,7 @@ long do_syscall(long a0, long a1, long a2, long a3, long a4, long a5, unsigned l
[SYS_readlinkat] = sys_readlinkat,
[SYS_readv] = sys_readv,
[SYS_riscv_hwprobe] = sys_riscv_hwprobe,
[SYS_futex] = sys_stub_success,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-using sys_stub_success instead of creating a new function.

Copy link

@jerryz123 jerryz123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine.... it doesn't behave exactly the same as sys_futex, but that should be ok

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.

2 participants