Autogenerate syscall table based on other files #214
Merged
+947
−274
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.
This PR make it easier to maintain the syscall table used to match syscall number to their corresponding function.
For that, this script
syscall_gen.shis added. It will take as input the new filesyscall.tblandarch/ARCH/syscall.h.inand generate the filesinclude/generated/syscall_number.handinclude/generated/syscall_table.h.in.This script is called by the build system in the first steps.
syscall.tblis a custom file which list all syscall available in SO3 and a configuration requirements if there is any. This file isn't arch dependent and all new syscall implementation needs to be added there.arch/ARCH/syscall.h.inis an exact copy from muslarch/ARCH/bits/syscall.h.inwhich list all syscall available on Linux why there corresponding number.include/generated/syscall_number.hwill contain the all syscalls that are listed in bothsyscall.tblandsyscall.h.in, with#ifdef CONFIG_...around if necessary. This means that now ifSYSYCALL_xxxis defined in the kernel, then the syscall is activated. It can allow to remove undeed syscall implementation to reduce the kernel code size.include/generated/syscall_table.h.inwill contain all syscall fromsyscall.tblin the following format:This file can then be included in the syscall table initialisation list to get the correct list of used syscall function with their correct number.
Those changes allow for a more easily maintainable list of syscall as only
syscall.tblneeds to be updated when implmenting a new one, without having to add a lot of#ifaround syscall table elements.