mark initgraph nodes red and dimmed if not run

This commit is contained in:
2026-10-12 16:03:36 +02:00
parent 350e65837b
commit bc5f01dab6
3 changed files with 47 additions and 14 deletions
+15 -11
View File
@@ -41,6 +41,8 @@ struct init_node {
bool wanted;
bool done;
bool disabled;
bool executed;
bool failed;
struct init_edge* in_edges;
struct init_edge* out_edges;
struct init_node* queue_next;
@@ -49,17 +51,17 @@ struct init_node {
#define INIT_EXTERN(node) extern struct init_node node[1]
#define INIT_TASK(node, display, ...) \
struct init_node node[1] = {{ \
.name = (display), \
__VA_OPT__( \
.action = _Generic( \
(__VA_ARGS__), \
void (*)(struct boot_info*): INIT_CALLBACK, \
bool (*)(struct boot_info*): INIT_GATE \
), \
.func = (void*)(__VA_ARGS__), \
) \
}}; \
struct init_node node[1] = { \
{.name = (display), \
__VA_OPT__( \
.action = _Generic( \
(__VA_ARGS__), \
void (*)(struct boot_info*): INIT_CALLBACK, \
bool (*)(struct boot_info*): INIT_GATE \
), \
.func = (void*)(__VA_ARGS__), \
)} \
}; \
[[__used, __section(".initgraph.nodes")]] \
static struct init_node* const CONCAT(node, _initgraph_node) = node
@@ -80,3 +82,5 @@ struct init_node {
#define INIT_ENTAILS(node, ...) _INIT_EDGES(UNIQUE_IDENT(init_edges), node, false, __VA_ARGS__)
void initgraph_run(struct init_node* goal, struct boot_info* info);
void initgraph_panic();