Sfoglia il codice sorgente

[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 14 anni fa
parent
commit
d157e249f3
1 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 10
    1
      src/include/ipxe/bofm.h

+ 10
- 1
src/include/ipxe/bofm.h Vedi File

13
 #include <stdint.h>
13
 #include <stdint.h>
14
 #include <ipxe/list.h>
14
 #include <ipxe/list.h>
15
 #include <ipxe/pci.h>
15
 #include <ipxe/pci.h>
16
+#include <config/sideband.h>
16
 
17
 
17
 /** 'IBM ' signature
18
 /** 'IBM ' signature
18
  *
19
  *
316
 /** BOFM driver table */
317
 /** BOFM driver table */
317
 #define BOFM_DRIVERS __table ( struct pci_driver, "bofm_drivers" )
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
 #define __bofm_driver __table_entry ( BOFM_DRIVERS, 01 )
326
 #define __bofm_driver __table_entry ( BOFM_DRIVERS, 01 )
327
+#else
328
+#define __bofm_driver
329
+#endif
321
 
330
 
322
 /**
331
 /**
323
  * Initialise BOFM device
332
  * Initialise BOFM device

Loading…
Annulla
Salva