mirror of
https://github.com/Dasharo/zephyr.git
synced 2026-03-06 14:57:20 -08:00
dts: gen_defines: generate _ORD_STR_SORTABLE
Generate a zero padded variant of `_ORD` that is suitable for use in linker scripts with the `SORT` property, so that `6` is correctly placed before `24`, and so on. Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
committed by
Fabio Baltieri
parent
76ba68cd18
commit
b6e03417c7
@@ -24,6 +24,13 @@
|
||||
*/
|
||||
#define DT_DEP_ORD(node_id) DT_CAT(node_id, _ORD)
|
||||
|
||||
/**
|
||||
* @brief Get a node's dependency ordinal in string sortable form
|
||||
* @param node_id Node identifier
|
||||
* @return the node's dependency ordinal as a zero-padded integer literal
|
||||
*/
|
||||
#define DT_DEP_ORD_STR_SORTABLE(node_id) DT_CAT(node_id, _ORD_STR_SORTABLE)
|
||||
|
||||
/**
|
||||
* @brief Get a list of dependency ordinals of a node's direct dependencies
|
||||
*
|
||||
|
||||
@@ -747,6 +747,7 @@ def write_dep_info(node):
|
||||
|
||||
out_comment("Node's dependency ordinal:")
|
||||
out_dt_define(f"{node.z_path_id}_ORD", node.dep_ordinal)
|
||||
out_dt_define(f"{node.z_path_id}_ORD_STR_SORTABLE", f"{node.dep_ordinal:0>5}")
|
||||
|
||||
out_comment("Ordinals for what this node depends on directly:")
|
||||
out_dt_define(f"{node.z_path_id}_REQUIRES_ORDS",
|
||||
|
||||
Reference in New Issue
Block a user