Skip to content

Verbatim-port foldbacks: util_macro.h, logging redirect header, single-arg LOG_MODULE_REGISTER #44

@swoisz

Description

@swoisz

A downstream consumer ported upstream Zephyr's SMF (State Machine Framework) source verbatim onto Boreas — validating the near-verbatim-port thesis for pure-software subsystems — but needed three small shims. Each shim is a Boreas gap; folding them back makes such ports shim-free:

  • Single-arg LOG_MODULE_REGISTER(name)highest priority. Upstream defaults the level to CONFIG_LOG_DEFAULT_LEVEL; Boreas requires (name, level). The downstream workaround copies the Boreas registration implementation bodies into a variadic wrapper and must be kept in sync by hand — any Boreas change to the section name / struct layout / constructor pattern silently breaks it. Proper fix: native single-arg support in zsys/log.h (variadic dispatch on argument count).
  • <zephyr/sys/util_macro.h> missing. Boreas util.h supplies IS_ENABLED but not the conditional-code-generation family (COND_CODE_1, IF_ENABLED, the _Z_DEBRACKET helpers). Upstream headers include <zephyr/sys/util_macro.h> directly, so its absence forces edits to otherwise-verbatim upstream sources. Fix: add the header to zkernel and include it from util.h, matching upstream layering.
  • <zephyr/logging/log.h> include path missing. Boreas logging lives at a project-specific path; upstream sources include the zephyr path. Ship a one-line redirect header in Boreas so ported sources compile without per-project plumbing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    zephyr-parityDivergence from upstream Zephyr API/semantics

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions