[PATCH v2 07/33] dtoc: Support scanning of structs in header files

Simon Glass sjg at chromium.org
Sun Feb 7 01:17:23 CET 2021


Drivers can have private / platform data contained in structs and these
struct definitions are generally kept in header files. In order to
generate build-time devices, dtoc needs to generate code that declares
the data contained in those structs. This generated code must include the
relevant header file, to avoid a build error.

We need a way for dtoc to scan header files for struct definitions. Then,
when it wants to generate code that uses a struct, it can make sure it
includes the correct header file, first.

Add a parser for struct information, similar to drivers. Keep a dict of
the structs that were found.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 tools/dtoc/src_scan.py      | 86 +++++++++++++++++++++++++++++++++++--
 tools/dtoc/test_src_scan.py | 45 +++++++++++++++++++
 2 files changed, 128 insertions(+), 3 deletions(-)

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list