Bladeren bron

[bofm] Allow garbage collection of BOFM code in non-BOFM builds

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>
tags/v1.20.1
Michael Brown 13 jaren geleden
bovenliggende
commit
d157e249f3
1 gewijzigde bestanden met toevoegingen van 10 en 1 verwijderingen
  1. 10
    1
      src/include/ipxe/bofm.h

+ 10
- 1
src/include/ipxe/bofm.h Bestand weergeven

@@ -13,6 +13,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
13 13
 #include <stdint.h>
14 14
 #include <ipxe/list.h>
15 15
 #include <ipxe/pci.h>
16
+#include <config/sideband.h>
16 17
 
17 18
 /** 'IBM ' signature
18 19
  *
@@ -316,8 +317,16 @@ struct bofm_operations {
316 317
 /** BOFM driver table */
317 318
 #define BOFM_DRIVERS __table ( struct pci_driver, "bofm_drivers" )
318 319
 
319
-/** Declare a BOFM driver */
320
+/** Declare a BOFM driver
321
+ *
322
+ * In the common case of non-BOFM-enabled builds, allow any BOFM code
323
+ * to be garbage-collected at link time to save space.
324
+ */
325
+#ifdef CONFIG_BOFM
320 326
 #define __bofm_driver __table_entry ( BOFM_DRIVERS, 01 )
327
+#else
328
+#define __bofm_driver
329
+#endif
321 330
 
322 331
 /**
323 332
  * Initialise BOFM device

Laden…
Annuleren
Opslaan