diff --git a/arch/x86/linuxbios_table.c b/arch/x86/linuxbios_table.c index 9ed2d7f42b..502c109e39 100644 --- a/arch/x86/linuxbios_table.c +++ b/arch/x86/linuxbios_table.c @@ -385,6 +385,25 @@ static struct lb_memory *build_lb_mem(struct lb_header *head) return mem; } +/** + * Add pointer to device tree to LinuxBIOS table. + * + * @param head Pointer to lbtable header. + * @return TODO + */ +struct lb_devtree *lb_devtree(struct lb_header *head) +{ + struct lb_devtree *lbdev = NULL; + struct device *dev = NULL; + + lbdev = (struct lb_devtree *)lb_new_record(head); + lbdev->tag = LB_TAG_DEVTREE_PTR; + lbdev->size = sizeof(*lbdev); + lbdev->dev_root_ptr = &dev_root; + + return lbdev; +} + unsigned long write_linuxbios_table( unsigned long low_table_start, unsigned long low_table_end, unsigned long rom_table_start, unsigned long rom_table_end) @@ -431,12 +450,15 @@ unsigned long write_linuxbios_table( * size of the linuxbios table. */ - /* Record our motheboard */ + /* Record our motherboard */ lb_mainboard(head); /* Record our various random string information */ lb_strings(head); + /* Record a pointer to the LinuxBIOS device tree */ + lb_devtree(head); + /* Remember where my valid memory ranges are */ return lb_table_fini(head); diff --git a/include/tables.h b/include/tables.h index c4c012b6e8..fefbd61eb9 100644 --- a/include/tables.h +++ b/include/tables.h @@ -167,6 +167,14 @@ struct lb_string { u8 string[0]; }; +#define LB_TAG_DEVTREE_PTR 0x000e + +struct lb_devtree { + u32 tag; + u32 size; + u32 dev_root_ptr; /* Pointer to the root device */ +}; + /* The following structures are for the cmos definitions table */ #define LB_TAG_CMOS_OPTION_TABLE 200 /* cmos header record */