[LinuxBIOS] [PATCH] Add pointer to device tree to LinuxBIOS table

Uwe Hermann uwe at hermann-uwe.de
Thu Sep 13 03:32:53 CEST 2007


On Tue, Sep 11, 2007 at 11:30:20PM +0200, Jens Freimann wrote:
> Add a pointer to the root device to the LinuxBIOS table. Used for
> example to access the device list from Open Firmware.
> 
> Signed-off-by: Jens Freimann <jens at freimann.org>
> 
> Index: src/include/boot/linuxbios_tables.h
> ===================================================================
> --- src/include/boot/linuxbios_tables.h	(Revision 2770)
> +++ src/include/boot/linuxbios_tables.h	(Arbeitskopie)
> @@ -106,6 +106,12 @@
>  	struct lb_memory_range map[0];
>  };
>  
> +struct lb_devtree {
> +    uint32_t tag;
> +    uint32_t size;
> +    uint32_t dev_root_ptr; /* pointer to root device */
> +};

Fix the coding style please (TABs, not spaces, for indentation).


>  #define LB_TAG_HWRPB	0x0002
>  struct lb_hwrpb {
>  	uint32_t tag;
> Index: src/arch/i386/boot/linuxbios_table.c
> ===================================================================
> --- src/arch/i386/boot/linuxbios_table.c	(Revision 2770)
> +++ src/arch/i386/boot/linuxbios_table.c	(Arbeitskopie)
> @@ -348,6 +348,27 @@
>  	return mem;
>  }
>  
> +/**
> + * Add entire device tree to LinuxBIOS table
> + *
> + * @param head Pointer to lbtable header
> + */
> +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 = 0xE;

What is 0xe? Should probably be some #define with a descriptive name
for better readability?


> +     char buf[64];

Why? It's never used in the patch(?)


>  	/* Record our various random string information */
>  	lb_strings(head);
>  
> +    /* Record the LinuxBIOS device tree */
> +    lb_devtree(head);
> +
>  	/* Remember where my valid memory ranges are */
>  	return lb_table_fini(head);
 	
Someone should double-check that this doesn't break any existing tools
(lxbios?) or expectations in the code. Do we consider this as "public API"
of some sort or doesn't it matter at all if it changes?


Uwe.
-- 
http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20070913/22c6ed43/attachment.sig>


More information about the coreboot mailing list