@@ -903,27 +903,17 @@ add_custom_command(
903
903
DEPENDS ${PARSE_SYSCALLS_TARGET}
904
904
)
905
905
906
- # This is passed into all calls to the gen_kobject_list.py script.
907
- set (gen_kobject_list_include_args --include -subsystem-list ${struct_tags_json} )
906
+ include (${ZEPHYR_BASE} /cmake/kobj.cmake)
908
907
909
908
set (DRV_VALIDATION ${PROJECT_BINARY_DIR} /include /generated /zephyr/driver-validation.h)
910
- add_custom_command (
911
- OUTPUT ${DRV_VALIDATION}
912
- COMMAND
913
- ${PYTHON_EXECUTABLE}
914
- ${ZEPHYR_BASE} /scripts/build /gen_kobject_list.py
915
- --validation-output ${DRV_VALIDATION}
916
- ${gen_kobject_list_include_args}
917
- $<$<BOOL :${CMAKE_VERBOSE_MAKEFILE} >:--verbose>
918
- DEPENDS
919
- ${ZEPHYR_BASE} /scripts/build /gen_kobject_list.py
920
- ${PARSE_SYSCALLS_TARGET}
921
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
909
+ gen_kobject_list(
910
+ TARGET ${DRIVER_VALIDATION_H_TARGET}
911
+ OUTPUTS ${DRV_VALIDATION}
912
+ SCRIPT_ARGS --validation-output ${DRV_VALIDATION}
913
+ INCLUDES ${struct_tags_json}
922
914
)
923
- add_custom_target (${DRIVER_VALIDATION_H_TARGET} DEPENDS ${DRV_VALIDATION} )
924
915
925
- include (${ZEPHYR_BASE} /cmake/kobj.cmake)
926
- gen_kobj(KOBJ_INCLUDE_PATH)
916
+ gen_kobject_list_headers(INCLUDES ${struct_tags_json} )
927
917
928
918
# Generate sections for kernel device subsystems
929
919
set (
@@ -1122,7 +1112,6 @@ if(CONFIG_USERSPACE)
1122
1112
NO_COVERAGE_FLAGS "${compiler_flags_priv} "
1123
1113
)
1124
1114
1125
- set (GEN_KOBJ_LIST ${ZEPHYR_BASE} /scripts/build /gen_kobject_list.py)
1126
1115
set (PROCESS_GPERF ${ZEPHYR_BASE} /scripts/build /process_gperf.py)
1127
1116
endif ()
1128
1117
@@ -1276,23 +1265,12 @@ if(CONFIG_USERSPACE)
1276
1265
set (KOBJECT_PREBUILT_HASH_OUTPUT_SRC_PRE kobject_prebuilt_hash_preprocessed.c)
1277
1266
set (KOBJECT_PREBUILT_HASH_OUTPUT_SRC kobject_prebuilt_hash.c)
1278
1267
1279
- add_custom_command (
1268
+ gen_kobject_list_gperf(
1269
+ TARGET kobj_prebuilt_hash_list
1280
1270
OUTPUT ${KOBJECT_PREBUILT_HASH_LIST}
1281
- COMMAND
1282
- ${PYTHON_EXECUTABLE}
1283
- ${GEN_KOBJ_LIST}
1284
- --kernel $<TARGET_FILE:${ZEPHYR_LINK_STAGE_EXECUTABLE} >
1285
- --gperf-output ${KOBJECT_PREBUILT_HASH_LIST}
1286
- ${gen_kobject_list_include_args}
1287
- $<$<BOOL :${CMAKE_VERBOSE_MAKEFILE} >:--verbose>
1288
- DEPENDS
1289
- ${ZEPHYR_LINK_STAGE_EXECUTABLE}
1290
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
1271
+ KERNEL_TARGET ${ZEPHYR_LINK_STAGE_EXECUTABLE}
1272
+ INCLUDES ${struct_tags_json}
1291
1273
)
1292
- add_custom_target (
1293
- kobj_prebuilt_hash_list
1294
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR} /${KOBJECT_PREBUILT_HASH_LIST}
1295
- )
1296
1274
1297
1275
add_custom_command (
1298
1276
OUTPUT ${KOBJECT_PREBUILT_HASH_OUTPUT_SRC_PRE}
@@ -1483,23 +1461,12 @@ if(CONFIG_USERSPACE)
1483
1461
# Use the script GEN_KOBJ_LIST to scan the kernel binary's
1484
1462
# (${ZEPHYR_LINK_STAGE_EXECUTABLE}) DWARF information to produce a table of kernel
1485
1463
# objects (KOBJECT_HASH_LIST) which we will then pass to gperf
1486
- add_custom_command (
1464
+ gen_kobject_list_gperf(
1465
+ TARGET kobj_hash_list
1487
1466
OUTPUT ${KOBJECT_HASH_LIST}
1488
- COMMAND
1489
- ${PYTHON_EXECUTABLE}
1490
- ${GEN_KOBJ_LIST}
1491
- --kernel $<TARGET_FILE:${ZEPHYR_LINK_STAGE_EXECUTABLE} >
1492
- --gperf-output ${KOBJECT_HASH_LIST}
1493
- ${gen_kobject_list_include_args}
1494
- $<$<BOOL :${CMAKE_VERBOSE_MAKEFILE} >:--verbose>
1495
- DEPENDS
1496
- ${ZEPHYR_LINK_STAGE_EXECUTABLE}
1497
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
1467
+ KERNEL_TARGET ${ZEPHYR_LINK_STAGE_EXECUTABLE}
1468
+ INCLUDES ${struct_tags_json}
1498
1469
)
1499
- add_custom_target (
1500
- kobj_hash_list
1501
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR} /${KOBJECT_HASH_LIST}
1502
- )
1503
1470
1504
1471
# Use gperf to generate C code (KOBJECT_HASH_OUTPUT_SRC_PRE) which implements a
1505
1472
# perfect hashtable based on KOBJECT_HASH_LIST
0 commit comments