Skip to content

Commit

Permalink
[bofm] Allow garbage collection of BOFM code in non-BOFM builds
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcb30 committed Mar 3, 2011
1 parent 85eefad commit d157e24
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/include/ipxe/bofm.h
Expand Up @@ -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
*
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d157e24

Please sign in to comment.