]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[bofm] Allow garbage collection of BOFM code in non-BOFM builds
authorMichael Brown <mcb30@ipxe.org>
Wed, 23 Feb 2011 17:52:13 +0000 (17:52 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 3 Mar 2011 02:40:11 +0000 (02:40 +0000)
Most builds will not have BOFM enabled.  In these builds, allow all
BOFM code (including BOFM-only code within the individual drivers) to
be garbage-collected at link time in order to save space in the final
binary.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/bofm.h

index cc57e1e6da4d8e8f5ecac49714ff56246ff700c9..1da47f65188cc7193c26d639aa238c4b3b30ca7a 100644 (file)
@@ -13,6 +13,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #include <stdint.h>
 #include <ipxe/list.h>
 #include <ipxe/pci.h>
+#include <config/sideband.h>
 
 /** 'IBM ' signature
  *
@@ -316,8 +317,16 @@ struct bofm_operations {
 /** BOFM driver table */
 #define BOFM_DRIVERS __table ( struct pci_driver, "bofm_drivers" )
 
-/** Declare a BOFM driver */
+/** Declare a BOFM driver
+ *
+ * In the common case of non-BOFM-enabled builds, allow any BOFM code
+ * to be garbage-collected at link time to save space.
+ */
+#ifdef CONFIG_BOFM
 #define __bofm_driver __table_entry ( BOFM_DRIVERS, 01 )
+#else
+#define __bofm_driver
+#endif
 
 /**
  * Initialise BOFM device