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
Syscall one-off refactoring #1310
Syscall one-off refactoring #1310
Conversation
a35cc8d
to
6ae9049
Compare
Updated branch because I failed to rebase on top of roc's recent changes. Also adding some handling for things I missed the first time around. I'm seeing consistent test failures in my VM for the cpuid tests; I assume that's related to the changes to check for the existence of the |
What do you mean? |
// ${SYSCALL} must exist on the given architecture. | ||
|
||
#define HAS_SYSCALL(_name) \ | ||
inline bool has_ ## _name(SupportedArch arch) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, I think this should be has_##_name##_syscall
Generally this looks really good, by the way. |
Older systems like x86 had an mmap syscall that took a byte offset for the sixth argument. However, doing so meant that large files (> 4GB) couldn't be mmap'd. To address this, a replacement mmap2 syscall was created that took its offset in units of pages, rather than bytes. x86-64, however, has no problem with using byte offsets, and therefore has no mmap2 syscall. So we need to use the appropriate syscall for the architecture of the process we're tracing when making remote syscalls.
05ba075
to
caaebd8
Compare
This series implements some of @rocallahan's earlier ideas on architecture-neutral replacements for
SYS_foo
constants. It handles just about everything, except for someSYS_socketcall
constants that need some better infrastructure insyscall_defs.h
(we need to be able to talk about syscalls defined on x86-64 that aren't defined on x86--right now we only go the other direction) and some weird checks inemufs.cc
that I'm not immediately sure how to architecturialize (sp?).