syscalls: skip generating mrsh.c if not userspace
There is no need to generate all the *_mrsh.c files for marshalling syscall arguments when userspace is not enabled. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
641b89801a
commit
751de22ca4
2 changed files with 11 additions and 7 deletions
|
@ -735,6 +735,7 @@ add_custom_command(OUTPUT include/generated/syscall_dispatch.c ${syscall_list_h}
|
||||||
--base-output include/generated/syscalls # Write to this dir
|
--base-output include/generated/syscalls # Write to this dir
|
||||||
--syscall-dispatch include/generated/syscall_dispatch.c # Write this file
|
--syscall-dispatch include/generated/syscall_dispatch.c # Write this file
|
||||||
--syscall-list ${syscall_list_h}
|
--syscall-list ${syscall_list_h}
|
||||||
|
$<$<BOOL:${CONFIG_USERSPACE}>:--gen-mrsh-files>
|
||||||
${SYSCALL_LONG_REGISTERS_ARG}
|
${SYSCALL_LONG_REGISTERS_ARG}
|
||||||
${SYSCALL_SPLIT_TIMEOUT_ARG}
|
${SYSCALL_SPLIT_TIMEOUT_ARG}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
|
|
@ -401,6 +401,8 @@ def parse_args():
|
||||||
help="A long type that must be split/marshalled on 32-bit systems")
|
help="A long type that must be split/marshalled on 32-bit systems")
|
||||||
parser.add_argument("-x", "--long-registers", action="store_true",
|
parser.add_argument("-x", "--long-registers", action="store_true",
|
||||||
help="Indicates we are on system with 64-bit registers")
|
help="Indicates we are on system with 64-bit registers")
|
||||||
|
parser.add_argument("--gen-mrsh-files", action="store_true",
|
||||||
|
help="Generate marshalling files (*_mrsh.c)")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
@ -477,14 +479,15 @@ def main():
|
||||||
fp.write(header)
|
fp.write(header)
|
||||||
|
|
||||||
# Likewise emit _mrsh.c files for syscall inclusion
|
# Likewise emit _mrsh.c files for syscall inclusion
|
||||||
for fn in mrsh_defs:
|
if args.gen_mrsh_files:
|
||||||
mrsh_fn = os.path.join(args.base_output, fn + "_mrsh.c")
|
for fn in mrsh_defs:
|
||||||
|
mrsh_fn = os.path.join(args.base_output, fn + "_mrsh.c")
|
||||||
|
|
||||||
with open(mrsh_fn, "w") as fp:
|
with open(mrsh_fn, "w") as fp:
|
||||||
fp.write("/* auto-generated by gen_syscalls.py, don't edit */\n\n")
|
fp.write("/* auto-generated by gen_syscalls.py, don't edit */\n\n")
|
||||||
fp.write(mrsh_includes[fn] + "\n")
|
fp.write(mrsh_includes[fn] + "\n")
|
||||||
fp.write("\n")
|
fp.write("\n")
|
||||||
fp.write(mrsh_defs[fn] + "\n")
|
fp.write(mrsh_defs[fn] + "\n")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue