From 2f1ccc36f478d0cdb55666eb62ae6a338751be9c Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 1 Nov 2007 16:49:26 +1100 Subject: dtc: Move tree checking code to checks.c This patch moves the dtc code for checking the device tree its processing into a new checks.c. The tree accessor functions from livetree.c which the checks use are exported and added to dtc.h. Another small step towards a flexible checking architecture. Signed-off-by: David Gibson --- dtc.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'dtc.h') diff --git a/dtc.h b/dtc.h index 1fc6523..d080153 100644 --- a/dtc.h +++ b/dtc.h @@ -189,11 +189,13 @@ struct node *chain_node(struct node *first, struct node *list); void add_property(struct node *node, struct property *prop); void add_child(struct node *parent, struct node *child); -int check_structure(struct node *dt); -void fixup_references(struct node *dt); -int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys); +char *get_unitname(struct node *node); +struct property *get_property(struct node *node, char *propname); +cell_t propval_cell(struct property *prop); +struct node *get_subnode(struct node *node, char *nodename); +struct node *get_node_by_phandle(struct node *tree, cell_t phandle); -int check_device_tree(struct node *dt, int outversion, int boot_cpuid_phys); +void fixup_references(struct node *dt); /* Boot info (tree plus memreserve information */ @@ -220,6 +222,11 @@ struct boot_info { struct boot_info *build_boot_info(struct reserve_info *reservelist, struct node *tree); +/* Checks */ + +int check_structure(struct node *dt); +int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys); + /* Flattened trees */ void dt_to_blob(FILE *f, struct boot_info *bi, int version, -- cgit v1.1