-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
Describe the bug
Originally introduced in #35460. I have no idea how I missed all of this in review, but it showed up while I was working on release notes.
Marking high because it affects a stable API (devicetree.h) and these concerns ought to be fixed before we include the new API in the v2.7 LTS release with known mistakes from an API perspective.
- we should not be adding any include/devicetree/foo.h headers for manual inclusion; they should be included at the bottom of devicetree.h. So either devicetree/memory.h is in the wrong place or it needs to be included from devicetree.h.
- At least some of the contents are in the wrong place. Specifically
#define DT_RESERVED_MEM_GET_PTR(node_id) _DT_RESERVED_START(node_id)refers to_DT_RESERVED_START, which is defined in include/linker/devicetree_reserved.h. This is a layering violation as devicetree.h macros should not depend on contents of higher layer headers. - No documentation was added to doc/reference/devicetree/api.rst for the macros in devicetree/memory.h
- No explicit test coverage under tests/lib/devicetree exists; we require all macros to have API tests and docs.
Given the above, my suspicion is that these macros should probably all go to linker/devicetree_reserved.h. This is not an officially documented API (in the sense of https://docs.zephyrproject.org/latest/reference/api/overview.html) and can therefore basically do whatever it wants without getting into as much trouble from an API stability perspective.
Environment (please complete the following information):
- Commit SHA or Version used: v2.7.0-rc3