summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMichael Brown2005-04-14 12:10:54 +0200
committerMichael Brown2005-04-14 12:10:54 +0200
commit75d864432cc41c45d46df9ea7d3afd7cccbc0148 (patch)
tree8b98bce9c01b2f99f16d5da9f93a4e147dfe1865 /src/core/main.c
parentStripped references to variables in C code. (diff)
downloadipxe-75d864432cc41c45d46df9ea7d3afd7cccbc0148.tar.gz
ipxe-75d864432cc41c45d46df9ea7d3afd7cccbc0148.tar.xz
ipxe-75d864432cc41c45d46df9ea7d3afd7cccbc0148.zip
Use the magic of common symbols to allow struct dev to effectively grow at
link time to accommodate whatever bus objects are included.
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/core/main.c b/src/core/main.c
index da1c58a6..3cc777a8 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -144,7 +144,10 @@ static int initialized;
/* Global instance of the current boot device */
-struct dev dev;
+DEV_BUS(struct {}, dev_bus);
+struct dev dev = {
+ .bus = &dev_bus,
+};
/**************************************************************************
* initialise() - perform any C-level initialisation
@@ -213,24 +216,6 @@ void exit(int status)
}
-/*
- * Set PCI device to use.
- *
- * This routine can be called by e.g. the ROM prefix to specify that
- * the first device to be tried should be the device on which the ROM
- * was physically located.
- *
- * Note that this is deliberately in main.c rather than pci.c, because
- * this function should generalise to other bus types (e.g. ISAPnP),
- * and we don't want to end up dragging in pci.o unnecessarily.
- */
-void set_pci_device ( uint16_t busdevfn ) {
- dev.devid.bus_type = PCI_BUS_TYPE;
- dev.pci.busdevfn = busdevfn;
- dev.pci.already_tried = 0;
-}
-
-
#if 0
static int main_loop(int state)