From efbadbb677b3c2f0b8c839e94a8b870b923b227a Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 11 Jul 2022 10:53:29 -0400 Subject: [PATCH] scripts: move gen_kobject_list.py to scripts/build/gen_kobject_list.py Move scripts needed by the build system and not designed to be run individually or standalone into the build subfolder. Signed-off-by: Anas Nashif --- CMakeLists.txt | 6 +++--- CODEOWNERS | 2 +- MAINTAINERS.yml | 2 +- cmake/kobj.cmake | 4 ++-- doc/build/cmake/build-postprocess-4.svg | 2 +- doc/build/cmake/index.rst | 4 ++-- doc/kernel/usermode/kernelobjects.rst | 4 ++-- include/zephyr/sys/kobject.h | 2 +- kernel/userspace.c | 2 +- scripts/{ => build}/gen_kobject_list.py | 0 10 files changed, 14 insertions(+), 14 deletions(-) rename scripts/{ => build}/gen_kobject_list.py (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54fd6f355afed3..c08a52dac109bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -753,12 +753,12 @@ add_custom_command( OUTPUT ${DRV_VALIDATION} COMMAND ${PYTHON_EXECUTABLE} - ${ZEPHYR_BASE}/scripts/gen_kobject_list.py + ${ZEPHYR_BASE}/scripts/build/gen_kobject_list.py --validation-output ${DRV_VALIDATION} ${gen_kobject_list_include_args} $<$:--verbose> DEPENDS - ${ZEPHYR_BASE}/scripts/gen_kobject_list.py + ${ZEPHYR_BASE}/scripts/build/gen_kobject_list.py ${PARSE_SYSCALLS_TARGET} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) @@ -895,7 +895,7 @@ if(CONFIG_USERSPACE) NO_COVERAGE_FLAGS "${compiler_flags_priv}" ) - set(GEN_KOBJ_LIST ${ZEPHYR_BASE}/scripts/gen_kobject_list.py) + set(GEN_KOBJ_LIST ${ZEPHYR_BASE}/scripts/build/gen_kobject_list.py) set(PROCESS_GPERF ${ZEPHYR_BASE}/scripts/process_gperf.py) endif() diff --git a/CODEOWNERS b/CODEOWNERS index 6c8dba67af90d7..922c6fb825b965 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -701,7 +701,7 @@ scripts/gen_image_info.py @tejlmand /scripts/ci/ @nashif /arch/x86/gen_gdt.py @dcpleung @nashif /arch/x86/gen_idt.py @dcpleung @nashif -/scripts/gen_kobject_list.py @dcpleung @nashif +/scripts/build/gen_kobject_list.py @dcpleung @nashif /scripts/gen_kobject_placeholders.py @dcpleung /scripts/gen_syscalls.py @dcpleung @nashif /scripts/list_boards.py @mbolivar-nordic diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 443c53d274cd76..e9b61014adbc9f 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -1972,7 +1972,7 @@ Userspace: - include/zephyr/syscall.h - kernel/userspace* - scripts/build/gen_app_partitions.py - - scripts/gen_kobject_list.py + - scripts/build/gen_kobject_list.py - scripts/gen_syscalls.py - scripts/process_gperf.py - scripts/gen_relocate_app.py diff --git a/cmake/kobj.cmake b/cmake/kobj.cmake index da71efd4fc6746..dc693509b119df 100644 --- a/cmake/kobj.cmake +++ b/cmake/kobj.cmake @@ -17,14 +17,14 @@ function(gen_kobj gen_dir_out) OUTPUT ${KOBJ_TYPES} ${KOBJ_OTYPE} ${KOBJ_SIZE} COMMAND ${PYTHON_EXECUTABLE} - ${ZEPHYR_BASE}/scripts/gen_kobject_list.py + ${ZEPHYR_BASE}/scripts/build/gen_kobject_list.py --kobj-types-output ${KOBJ_TYPES} --kobj-otype-output ${KOBJ_OTYPE} --kobj-size-output ${KOBJ_SIZE} ${gen_kobject_list_include_args} $<$:--verbose> DEPENDS - ${ZEPHYR_BASE}/scripts/gen_kobject_list.py + ${ZEPHYR_BASE}/scripts/build/gen_kobject_list.py ${PARSE_SYSCALLS_TARGET} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/doc/build/cmake/build-postprocess-4.svg b/doc/build/cmake/build-postprocess-4.svg index 8e8b42aeed0673..9c15abbdaaf309 100644 --- a/doc/build/cmake/build-postprocess-4.svg +++ b/doc/build/cmake/build-postprocess-4.svg @@ -1,4 +1,4 @@ -

Makefile
(various)

Makefile...
Kernel object hash
Kernel object hash
zephyr_pre1.elf
zephyr_pre1.elf
scripts/gen_kobject_list.py
(Find all kernel objects)
scripts/gen_kobject_list.py...
kobject_hash.gperf
kobject_hash.gperf

otype-to-str.h
otype-to-size.h
kobj-types-enum.h
driver-validation.h

otype-to-str.h...
GNU gperf
GNU gperf
kobject_hash_preprocessed.c
kobject_hash_preprocessed.c
scripts/process_gperf.py
(Optimize hashing)
scripts/process_gperf.py...
kobject_hash.c
kobject_hash.c
GNU cc
(cpp, cc1, as)
GNU cc...
kobject_hash.c.obj
kobject_hash.c.obj
kobject_hash_renamed.o
kobject_hash_renamed.o
GNU objdump
GNU objdump
Viewer does not support full SVG 1.1
\ No newline at end of file +

Makefile
(various)

Makefile...
Kernel object hash
Kernel object hash
zephyr_pre1.elf
zephyr_pre1.elf
scripts/build/gen_kobject_list.py
(Find all kernel objects)
scripts/build/gen_kobject_list.py...
kobject_hash.gperf
kobject_hash.gperf

otype-to-str.h
otype-to-size.h
kobj-types-enum.h
driver-validation.h

otype-to-str.h...
GNU gperf
GNU gperf
kobject_hash_preprocessed.c
kobject_hash_preprocessed.c
scripts/process_gperf.py
(Optimize hashing)
scripts/process_gperf.py...
kobject_hash.c
kobject_hash.c
GNU cc
(cpp, cc1, as)
GNU cc...
kobject_hash.c.obj
kobject_hash.c.obj
kobject_hash_renamed.o
kobject_hash_renamed.o
GNU objdump
GNU objdump
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/doc/build/cmake/index.rst b/doc/build/cmake/index.rst index 2271a959f3fd02..a25ae41bbbb0e5 100644 --- a/doc/build/cmake/index.rst +++ b/doc/build/cmake/index.rst @@ -347,10 +347,10 @@ The following is a detailed description of the scripts used during the build pro .. _gen_kobject_list.py: -:zephyr_file:`scripts/gen_kobject_list.py` +:zephyr_file:`scripts/build/gen_kobject_list.py` ------------------------------------------ -.. include:: ../../../scripts/gen_kobject_list.py +.. include:: ../../../scripts/build/gen_kobject_list.py :start-after: """ :end-before: """ diff --git a/doc/kernel/usermode/kernelobjects.rst b/doc/kernel/usermode/kernelobjects.rst index f14e5954c3c1ba..1ac62ab8a969b8 100644 --- a/doc/kernel/usermode/kernelobjects.rst +++ b/doc/kernel/usermode/kernelobjects.rst @@ -242,7 +242,7 @@ for creating core kernel objects and new driver subsystems. Creating New Core Kernel Objects ================================ -* In ``scripts/gen_kobject_list.py``, add the name of the struct to the +* In ``scripts/build/gen_kobject_list.py``, add the name of the struct to the :py:data:`kobjects` list. Instances of the new struct should now be tracked. @@ -253,7 +253,7 @@ Creating New Driver Subsystem Kernel Objects All driver instances are :c:struct:`device`. They are differentiated by what API struct they are set to. -* In ``scripts/gen_kobject_list.py``, add the name of the API struct for the +* In ``scripts/build/gen_kobject_list.py``, add the name of the API struct for the new subsystem to the :py:data:`subsystems` list. Driver instances of the new subsystem should now be tracked. diff --git a/include/zephyr/sys/kobject.h b/include/zephyr/sys/kobject.h index c64e5452cf2b44..73bf00830a5f32 100644 --- a/include/zephyr/sys/kobject.h +++ b/include/zephyr/sys/kobject.h @@ -21,7 +21,7 @@ struct z_futex_data; * @brief Kernel Object Types * * This enumeration needs to be kept in sync with the lists of kernel objects - * and subsystems in scripts/gen_kobject_list.py, as well as the otype_to_str() + * and subsystems in scripts/build/gen_kobject_list.py, as well as the otype_to_str() * function in kernel/userspace.c */ enum k_objects { diff --git a/kernel/userspace.c b/kernel/userspace.c index 02590a5b95bc6f..10a6d3961a69ff 100644 --- a/kernel/userspace.c +++ b/kernel/userspace.c @@ -94,7 +94,7 @@ struct perm_ctx { }; #ifdef CONFIG_GEN_PRIV_STACKS -/* See write_gperf_table() in scripts/gen_kobject_list.py. The privilege +/* See write_gperf_table() in scripts/build/gen_kobject_list.py. The privilege * mode stacks are allocated as an array. The base of the array is * aligned to Z_PRIVILEGE_STACK_ALIGN, and all members must be as well. */ diff --git a/scripts/gen_kobject_list.py b/scripts/build/gen_kobject_list.py similarity index 100% rename from scripts/gen_kobject_list.py rename to scripts/build/gen_kobject_list.py