flamenco, vm: syscall err code refactor #3655
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
README
Highly, HIGHLY recommend reviewing this in individual commits, especially commits 2 and 3. This is a (largely) cosmetic PR, so diffs are going to look horrendous if looked all at once.
For your convenience:
FD_VM_ERR_SYSCALL*
toFD_VM_SYSCALL_ERR*
for clarityflamenco/vm/fd_vm_private.h
flamenco/vm/fd_vm_private.h
to a new fileflamenco/vm/syscall/fd_vm_syscall_macros.h
Motivation
SIMD-0182* requires us to distinguish syscall errors from non-syscall errors during VM execution. We thus want to have a separate set of error codes for errors that occur inside syscalls, even if they are technically VM errors (i.e., segfaults, compute budget overruns, etc.,).
I also took this opportunity to move certain Syscall-specific VM interfacing macros that were defined in
fd_vm_private.h
to a new folder withinflamenco/vm/syscalls
so that the scope of these macros are clearly defined (i.e., to be used within Syscalls only). This clearly delineates where syscall and VM error codes are emitted.*this is not an implementation of SIMD-0182, rather a pre-requisite