Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3300: 2.1.1: Fix syscall return codes for wrong driver_number r=hudson-ayers a=alexandruradovici ### Pull Request Overview This PR is not for the master branch, but for the `release-2.1`. As there is no branch for it, I am can to reopen this towards another branch. This pull request fixes the value returned by the `subscribe` and `allow` system calls. Before this PR: - providing a wrong driver_number would return `NOMEM`. The issue is presented in #3278; - providing a wrong subscribe or allow number would return `INVAL`, now it returns `NOSUPPORT`. This PR will be superseded by #3276, it is only for releasing Tock 2.1.1. This PR will have a slightly different behavior than its successor: | |Tock 2.1.1 (this PR) | master (#3276) | | --- |-----------|---------| | `subscribe (invalid_number, invalid_callback, ...)` | `INVAL` | `NODEVICE` | | `subscribe (invalid_number, valid_callback, ...)` | `NODEVICE` | `NODEVICE` | | `allow... (invalid_number, invalid_reference, ...)` | `INVAL` | `NODEVICE` | | `allow... (invalid_number, valid_reference, ...)` | `NODEVICE` | `NODEVICE` | In #3276 the check for a valid driver is performed before the check for parameters, while in this PR the check is performed after. Checking for a valid driver before the validity of arguments will add at least 600 KB of code to the kernel, while this adds only 32 B. ### Testing Strategy This pull request was tested by... ### TODO or Help Wanted N/A ### Documentation Updated - [x] Updated the relevant files in `/docs`, or no updates are required. ### Formatting - [x] Ran `make prepush`. Co-authored-by: Alexandru RADOVICI <[email protected]> Co-authored-by: Alexandru Radovici <[email protected]>
- Loading branch information