[legacy] Allocate legacy driver .bss-like segments at probe time
Some legacy drivers use large static allocations for transmit and receive buffers. To avoid bloating the .bss segment, we currently implement these as a single common symbol named "_shared_bss" (which is permissible since only one legacy driver may be active at any one time). Switch to dynamic allocation of these .bss-like segments, to avoid the requirement for using common symbols. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -65,12 +65,13 @@ static unsigned int cur_phy;
|
||||
|
||||
static unsigned int cur_rx;
|
||||
|
||||
struct {
|
||||
struct sis900_bss {
|
||||
BufferDesc txd;
|
||||
BufferDesc rxd[NUM_RX_DESC];
|
||||
unsigned char txb[TX_BUF_SIZE];
|
||||
unsigned char rxb[NUM_RX_DESC * RX_BUF_SIZE];
|
||||
} sis900_bufs __shared;
|
||||
};
|
||||
#define sis900_bufs NIC_FAKE_BSS ( struct sis900_bss )
|
||||
#define txd sis900_bufs.txd
|
||||
#define rxd sis900_bufs.rxd
|
||||
#define txb sis900_bufs.txb
|
||||
@@ -1291,7 +1292,7 @@ PCI_ROM(0x1039, 0x7016, "sis7016", "SIS7016", 0),
|
||||
PCI_DRIVER ( sis900_driver, sis900_nics, PCI_NO_CLASS );
|
||||
|
||||
DRIVER ( "SIS900", nic_driver, pci_driver, sis900_driver,
|
||||
sis900_probe, sis900_disable );
|
||||
sis900_probe, sis900_disable, sis900_bufs );
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
|
||||
Reference in New Issue
Block a user