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
kernel: Implement a syscall proc macro #65
Conversation
This patch introduces a procedural macro that takes care of validating input buffers and paths automagically for us :^) There is still a bit of clean up/bug fixing to do, but for the most part it does what it's supposed to be doing.
When you state |
Oh my bad, it's just that I was in the middle of writing the PR message when I realized what was causing the proc macro to panic when emitting the code for &Path and I fixed it without realizing I left the comment there 😅 Edit: fixed! |
* The current code parsed the array by parsing it as a slice and then getting a reference `N` elements which does *not* make it an array (it will still be a slice). * Update the macro to use `validate_array_mut` to validate and construct the array. * Remove the length param from ArgType::Array since the `validate_array_mut` method takes the length as a const generic param which means that the compiler can automagically get us the length :^) * Remove all of the useless diagnostic since now we automagically get the array length. Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
Thanks @czapek1337! |
This patch introduces a procedural macro that takes care of validating input buffers and paths automagically for us :^) There is still a bit of clean up to do, but for the most part it does what it's supposed to be doing.