summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMichael Brown2007-01-10 05:22:09 +0100
committerMichael Brown2007-01-10 05:22:09 +0100
commitdad52745227fd06090e73ea535e0b0fe0f667c60 (patch)
tree6be296bedc785a5aab0d055ae148c6ffb1fe285f /src/core
parentRemove uIP; we haven't used it for quite some time now. (diff)
downloadipxe-dad52745227fd06090e73ea535e0b0fe0f667c60.tar.gz
ipxe-dad52745227fd06090e73ea535e0b0fe0f667c60.tar.xz
ipxe-dad52745227fd06090e73ea535e0b0fe0f667c60.zip
Add "name" field to struct device to allow human-readable hardware device
names. Add "dev" pointer in struct net_device to tie network interfaces back to a hardware device. Force natural alignment of data types in __table() macros. This seems to prevent gcc from taking the unilateral decision to occasionally increase their alignment (which screws up the table packing).
Diffstat (limited to 'src/core')
-rw-r--r--src/core/background.c6
-rw-r--r--src/core/console.c6
-rw-r--r--src/core/dev.c12
-rw-r--r--src/core/device.c12
-rw-r--r--src/core/exec.c6
-rw-r--r--src/core/init.c6
-rw-r--r--src/core/resolv.c6
-rw-r--r--src/core/settings.c16
8 files changed, 43 insertions, 27 deletions
diff --git a/src/core/background.c b/src/core/background.c
index 1cec05a51..e0dceaef3 100644
--- a/src/core/background.c
+++ b/src/core/background.c
@@ -1,7 +1,9 @@
#include "background.h"
-static struct background backgrounds[0] __table_start ( background );
-static struct background backgrounds_end[0] __table_end ( background );
+static struct background backgrounds[0]
+ __table_start ( struct background, background );
+static struct background backgrounds_end[0]
+ __table_end ( struct background, background );
/** @file */
diff --git a/src/core/console.c b/src/core/console.c
index 830f45390..6f55d5583 100644
--- a/src/core/console.c
+++ b/src/core/console.c
@@ -6,8 +6,10 @@
#include "bios.h"
-static struct console_driver console_drivers[0] __table_start ( console );
-static struct console_driver console_drivers_end[0] __table_end ( console );
+static struct console_driver console_drivers[0]
+ __table_start ( struct console_driver, console );
+static struct console_driver console_drivers_end[0]
+ __table_end ( struct console_driver, console );
/**
* Write a single character to each console device.
diff --git a/src/core/dev.c b/src/core/dev.c
index 3d1fdd91c..541a9eb1b 100644
--- a/src/core/dev.c
+++ b/src/core/dev.c
@@ -10,10 +10,14 @@
*/
/* Linker symbols for the various tables */
-static struct bus_driver bus_drivers[0] __table_start ( bus_driver );
-static struct bus_driver bus_drivers_end[0] __table_end ( bus_driver );
-static struct device_driver device_drivers[0] __table_start ( device_driver );
-static struct device_driver device_drivers_end[0] __table_end (device_driver );
+static struct bus_driver bus_drivers[0]
+ __table_start ( struct bus_driver, bus_driver );
+static struct bus_driver bus_drivers_end[0]
+ __table_end ( struct bus_driver, bus_driver );
+static struct device_driver device_drivers[0]
+ __table_start ( struct device_driver, device_driver );
+static struct device_driver device_drivers_end[0]
+ __table_end ( struct device_driver, device_driver );
/* Current attempted boot device */
struct dev dev = {
diff --git a/src/core/device.c b/src/core/device.c
index 567d90153..b1b148e85 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -28,8 +28,10 @@
*
*/
-static struct root_device root_devices[0] __table_start ( root_devices );
-static struct root_device root_devices_end[0] __table_end ( root_devices );
+static struct root_device root_devices[0]
+ __table_start ( struct root_device, root_devices );
+static struct root_device root_devices_end[0]
+ __table_end ( struct root_device, root_devices );
/** Registered root devices */
static LIST_HEAD ( devices );
@@ -43,10 +45,10 @@ static LIST_HEAD ( devices );
static int rootdev_probe ( struct root_device *rootdev ) {
int rc;
- DBG ( "Adding %s root bus\n", rootdev->name );
+ DBG ( "Adding %s root bus\n", rootdev->dev.name );
if ( ( rc = rootdev->driver->probe ( rootdev ) ) != 0 ) {
DBG ( "Failed to add %s root bus: %s\n",
- rootdev->name, strerror ( rc ) );
+ rootdev->dev.name, strerror ( rc ) );
return rc;
}
@@ -60,7 +62,7 @@ static int rootdev_probe ( struct root_device *rootdev ) {
*/
static void rootdev_remove ( struct root_device *rootdev ) {
rootdev->driver->remove ( rootdev );
- DBG ( "Removed %s root bus\n", rootdev->name );
+ DBG ( "Removed %s root bus\n", rootdev->dev.name );
}
/**
diff --git a/src/core/exec.c b/src/core/exec.c
index 3340d18a6..61e7339aa 100644
--- a/src/core/exec.c
+++ b/src/core/exec.c
@@ -33,8 +33,10 @@
*
*/
-static struct command commands[0] __table_start ( commands );
-static struct command commands_end[0] __table_end ( commands );
+static struct command commands[0]
+ __table_start ( struct command, commands );
+static struct command commands_end[0]
+ __table_end ( struct command, commands );
/* Avoid dragging in getopt.o unless a command really uses it */
int optind;
diff --git a/src/core/init.c b/src/core/init.c
index 3f41ddd1e..66b428fee 100644
--- a/src/core/init.c
+++ b/src/core/init.c
@@ -9,8 +9,10 @@
#include <gpxe/init.h>
-static struct init_fn init_fns[0] __table_start(init_fn);
-static struct init_fn init_fns_end[0] __table_end(init_fn);
+static struct init_fn init_fns[0]
+ __table_start ( struct init_fn, init_fn );
+static struct init_fn init_fns_end[0]
+ __table_end ( struct init_fn, init_fn );
void call_init_fns ( void ) {
struct init_fn *init_fn;
diff --git a/src/core/resolv.c b/src/core/resolv.c
index 0737294ac..eb01a3090 100644
--- a/src/core/resolv.c
+++ b/src/core/resolv.c
@@ -1,7 +1,9 @@
#include "resolv.h"
-static struct resolver resolvers[0] __table_start(resolver);
-static struct resolver resolvers_end[0] __table_end(resolver);
+static struct resolver resolvers[0]
+ __table_start ( struct resolver, resolver );
+static struct resolver resolvers_end[0]
+ __table_end ( struct resolver, resolver );
/*
* Resolve a name (which may be just a dotted quad IP address) to an
diff --git a/src/core/settings.c b/src/core/settings.c
index 8009d3769..5d36c30e4 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -34,16 +34,16 @@
*/
/** Registered configuration setting types */
-static struct config_setting_type
-config_setting_types[0] __table_start ( config_setting_types );
-static struct config_setting_type
-config_setting_types_end[0] __table_end ( config_setting_types );
+static struct config_setting_type config_setting_types[0]
+ __table_start ( struct config_setting_type, config_setting_types );
+static struct config_setting_type config_setting_types_end[0]
+ __table_end ( struct config_setting_type, config_setting_types );
/** Registered configuration settings */
-static struct config_setting
-config_settings[0] __table_start ( config_settings );
-static struct config_setting
-config_settings_end[0] __table_end ( config_settings );
+static struct config_setting config_settings[0]
+ __table_start ( struct config_setting, config_settings );
+static struct config_setting config_settings_end[0]
+ __table_end ( struct config_setting, config_settings );
/**
* Find configuration setting type