Added some code to dump the node tree. This is currently done always
after hardware recognition (but will be moved into a debugger command later). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10667 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -140,6 +140,14 @@ device_manager_init(struct kernel_args *args)
|
|||||||
|
|
||||||
pnp_root_init_root();
|
pnp_root_init_root();
|
||||||
|
|
||||||
|
{
|
||||||
|
// dump root node
|
||||||
|
pnp_node_info *node = node_list;
|
||||||
|
while (node && node->parent != NULL)
|
||||||
|
node = node->parent;
|
||||||
|
dump_pnp_node_info(node, 0);
|
||||||
|
}
|
||||||
|
|
||||||
// build initial device tree; register all root bus_managers
|
// build initial device tree; register all root bus_managers
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ void pnp_remove_node_ref(pnp_node_info *node);
|
|||||||
void pnp_remove_node_ref_nolock(pnp_node_info *node);
|
void pnp_remove_node_ref_nolock(pnp_node_info *node);
|
||||||
pnp_node_handle pnp_find_device(pnp_node_handle parent, const pnp_node_attr *attrs);
|
pnp_node_handle pnp_find_device(pnp_node_handle parent, const pnp_node_attr *attrs);
|
||||||
pnp_node_handle pnp_get_parent(pnp_node_handle node);
|
pnp_node_handle pnp_get_parent(pnp_node_handle node);
|
||||||
|
void dump_pnp_node_info(pnp_node_info *node, int32 level);
|
||||||
|
|
||||||
|
|
||||||
// notifications.c
|
// notifications.c
|
||||||
|
|||||||
@@ -439,6 +439,62 @@ err:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
put_level(int32 level)
|
||||||
|
{
|
||||||
|
while (level-- > 0)
|
||||||
|
dprintf(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
dump_attribute(pnp_node_attr_info *attr, int32 level)
|
||||||
|
{
|
||||||
|
if (attr == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
put_level(level + 2);
|
||||||
|
dprintf("\"%s\" : ", attr->attr.name);
|
||||||
|
switch (attr->attr.type) {
|
||||||
|
case B_STRING_TYPE:
|
||||||
|
dprintf("string : \"%s\"", attr->attr.value.string);
|
||||||
|
break;
|
||||||
|
case B_UINT8_TYPE:
|
||||||
|
dprintf("uint8 : %u (%#x)", attr->attr.value.ui8, attr->attr.value.ui8);
|
||||||
|
break;
|
||||||
|
case B_UINT16_TYPE:
|
||||||
|
dprintf("uint16 : %u (%#x)", attr->attr.value.ui16, attr->attr.value.ui16);
|
||||||
|
break;
|
||||||
|
case B_UINT32_TYPE:
|
||||||
|
dprintf("uint32 : %lu (%#lx)", attr->attr.value.ui32, attr->attr.value.ui32);
|
||||||
|
break;
|
||||||
|
case B_UINT64_TYPE:
|
||||||
|
dprintf("uint64 : %Lu (%#Lx)", attr->attr.value.ui64, attr->attr.value.ui64);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
dprintf("raw data");
|
||||||
|
}
|
||||||
|
dprintf("\n");
|
||||||
|
|
||||||
|
dump_attribute(attr->next, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
dump_pnp_node_info(pnp_node_info *node, int32 level)
|
||||||
|
{
|
||||||
|
if (node == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
put_level(level);
|
||||||
|
dprintf("(%ld) @%p \"%s\"\n", level, node, node->driver ? node->driver->minfo.name : "---");
|
||||||
|
dump_attribute(node->attributes, level);
|
||||||
|
|
||||||
|
dump_pnp_node_info(node->children, level + 1);
|
||||||
|
dump_pnp_node_info(node->children_next, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
nodes_init(void)
|
nodes_init(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user