Date: Thu, 8 Sep 2011 17:55:02 -0400 From: Andrew Duane <aduane@juniper.net> To: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>, "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org> Subject: Soliciting opinions on an extension of the bootinfo structure Message-ID: <AC6674AB7BC78549BB231821ABF7A9AEB748F9A329@EMBX01-WF.jnpr.net>
next in thread | raw e-mail | index | archive | help
I'm proposing an extension framework for the bootinfo structure used to pas= s information from the bootstrap/loader to the kernel. Although I'm only pr= oposing this for the MIPS bootinfo, it's completely applicable to any of th= em. What I propose is adding an optional platform extension structure: bootinfo= _pext, surrounded by #ifdef BOOTINFO_PEXT struct bootinfo { .... u_int32_t bi_kernend; /* end of kernel space */ u_int32_t bi_envp; /* environment */ u_int32_t bi_modulep; /* preloaded modules */ +#ifdef BOOTINFO_PEXT + struct bootinfo_pext bi_pext; /* platform extensions if d= efined */ +#endif }; Then, any vendor, platform, architecture, family, or developer could define= a new header file (or expand an existing one) with a definition of struct = bootinfo_pext, and a #define BOOTINFO_PEXT. Include the new (or existing) h= eader file in your source, and you have whatever extensions you want, witho= ut affecting other platforms, architectures, families, or developers. The f= ile we're looking to add is sys/mips/cavium/bootinfo_octeon.h: +/* + * Platform bootinfo extensions for OCTEON bootinfo structure + * + * Specific vendors can add their own bootinfo_pext structures + * surrounded by #ifdef OCTEON_VENDOR_XXX + */ + +#include "opt_cvmx.h" /* For OCTEON_VENDOR_XXX definitions */ + +#ifdef OCTEON_VENDOR_JUNIPER +#define BOOTINFO_PEXT /* include bootinfo_pext in main structure = */ +#define BOOTINFO_PEXT_MAGIC 0xCADECADE +#define BOOTINFO_PEXT_VERSION 1 + +struct bootinfo_pext { + int pext_i2cid; + u_int32_t pext_flags; + u_int32_t pext_magic; /* Magic number for octeon= pext */ + u_int32_t pext_version; /* Version of pext */ + u_int16_t pext_uboot_major_rev; + u_int16_t pext_uboot_minor_rev; + u_int16_t pext_loader_major_rev; + u_int16_t pext_loader_minor_rev; +}; +#endif /* OCTEON_VENDOR_JUNIPER */ Reasonable? Unreasonable? Insane? -- Andrew Duane Juniper Networks 978-589-0551 10 Technology Park Dr aduane@juniper.net Westford, MA 01886-3418
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AC6674AB7BC78549BB231821ABF7A9AEB748F9A329>