[gPXE-devel] [PATCH 27/33] [device] Add ordering of root_devices

Piotr Jaroszyński p.jaroszynski at gmail.com
Sun Aug 15 18:59:32 EDT 2010


The linux root_device needs to be probed for first so that it can
arrange for things to work properly for other root_devices. Currently
lpci is doing the arrangement for pci.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski at gmail.com>
---
 src/arch/i386/drivers/net/undionly.c |    2 +-
 src/drivers/bus/eisa.c               |    2 +-
 src/drivers/bus/isa.c                |    2 +-
 src/drivers/bus/isapnp.c             |    2 +-
 src/drivers/bus/mca.c                |    2 +-
 src/drivers/bus/pci.c                |    2 +-
 src/drivers/linux/linux.c            |    2 +-
 src/drivers/net/3c509.c              |    2 +-
 src/drivers/net/efi/snponly.c        |    2 +-
 src/include/gpxe/device.h            |    6 +++++-
 10 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/arch/i386/drivers/net/undionly.c b/src/arch/i386/drivers/net/undionly.c
index 7dfb5d1..283cddb 100644
--- a/src/arch/i386/drivers/net/undionly.c
+++ b/src/arch/i386/drivers/net/undionly.c
@@ -106,7 +106,7 @@ static struct root_driver undi_root_driver = {
 };
 
 /** UNDI bus root device */
-struct root_device undi_root_device __root_device = {
+struct root_device undi_root_device __root_device ( ROOT_NORMAL ) = {
 	.dev = { .name = "UNDI" },
 	.driver = &undi_root_driver,
 };
diff --git a/src/drivers/bus/eisa.c b/src/drivers/bus/eisa.c
index b533364..686e18d 100644
--- a/src/drivers/bus/eisa.c
+++ b/src/drivers/bus/eisa.c
@@ -176,7 +176,7 @@ static struct root_driver eisa_root_driver = {
 };
 
 /** EISA bus root device */
-struct root_device eisa_root_device __root_device = {
+struct root_device eisa_root_device __root_device ( ROOT_NORMAL ) = {
 	.dev = { .name = "EISA" },
 	.driver = &eisa_root_driver,
 };
diff --git a/src/drivers/bus/isa.c b/src/drivers/bus/isa.c
index f458826..1b28d43 100644
--- a/src/drivers/bus/isa.c
+++ b/src/drivers/bus/isa.c
@@ -166,7 +166,7 @@ static struct root_driver isa_root_driver = {
 };
 
 /** ISA bus root device */
-struct root_device isa_root_device __root_device = {
+struct root_device isa_root_device __root_device ( ROOT_NORMAL ) = {
 	.dev = { .name = "ISA" },
 	.driver = &isa_root_driver,
 };
diff --git a/src/drivers/bus/isapnp.c b/src/drivers/bus/isapnp.c
index ccf6209..fa9866b 100644
--- a/src/drivers/bus/isapnp.c
+++ b/src/drivers/bus/isapnp.c
@@ -749,7 +749,7 @@ static struct root_driver isapnp_root_driver = {
 };
 
 /** ISAPnP bus root device */
-struct root_device isapnp_root_device __root_device = {
+struct root_device isapnp_root_device __root_device ( ROOT_NORMAL ) = {
 	.dev = { .name = "ISAPnP" },
 	.driver = &isapnp_root_driver,
 };
diff --git a/src/drivers/bus/mca.c b/src/drivers/bus/mca.c
index 2815603..15e70e7 100644
--- a/src/drivers/bus/mca.c
+++ b/src/drivers/bus/mca.c
@@ -171,7 +171,7 @@ static struct root_driver mca_root_driver = {
 };
 
 /** MCA bus root device */
-struct root_device mca_root_device __root_device = {
+struct root_device mca_root_device __root_device ( ROOT_NORMAL ) = {
 	.dev = { .name = "MCA" },
 	.driver = &mca_root_driver,
 };
diff --git a/src/drivers/bus/pci.c b/src/drivers/bus/pci.c
index 8899e6e..085d15e 100644
--- a/src/drivers/bus/pci.c
+++ b/src/drivers/bus/pci.c
@@ -335,7 +335,7 @@ static struct root_driver pci_root_driver = {
 };
 
 /** PCI bus root device */
-struct root_device pci_root_device __root_device = {
+struct root_device pci_root_device __root_device ( ROOT_NORMAL ) = {
 	.dev = { .name = "PCI" },
 	.driver = &pci_root_driver,
 };
diff --git a/src/drivers/linux/linux.c b/src/drivers/linux/linux.c
index 43d3e6b..486c0f4 100644
--- a/src/drivers/linux/linux.c
+++ b/src/drivers/linux/linux.c
@@ -109,7 +109,7 @@ static struct root_driver linux_root_driver = {
 };
 
 /** Linux root device */
-struct root_device linux_root_device __root_device = {
+struct root_device linux_root_device __root_device ( ROOT_EARLY ) = {
 	.dev = { .name = "linux" },
 	.driver = &linux_root_driver,
 };
diff --git a/src/drivers/net/3c509.c b/src/drivers/net/3c509.c
index 1c58f77..5a51013 100644
--- a/src/drivers/net/3c509.c
+++ b/src/drivers/net/3c509.c
@@ -424,7 +424,7 @@ static struct root_driver t509_root_driver = {
 };
 
 /** 3c509 bus root device */
-struct root_device t509_root_device __root_device = {
+struct root_device t509_root_device __root_device ( ROOT_NORMAL ) = {
 	.dev = { .name = "3c509" },
 	.driver = &t509_root_driver,
 };
diff --git a/src/drivers/net/efi/snponly.c b/src/drivers/net/efi/snponly.c
index 9cc593d..0948f38 100644
--- a/src/drivers/net/efi/snponly.c
+++ b/src/drivers/net/efi/snponly.c
@@ -106,7 +106,7 @@ static struct root_driver snp_root_driver = {
 };
 
 /** SNP bus root device */
-struct root_device snp_root_device __root_device = {
+struct root_device snp_root_device __root_device ( ROOT_NORMAL ) = {
 	.dev = { .name = "EFI SNP" },
 	.driver = &snp_root_driver,
 };
diff --git a/src/include/gpxe/device.h b/src/include/gpxe/device.h
index 1db3ff9..1531843 100644
--- a/src/include/gpxe/device.h
+++ b/src/include/gpxe/device.h
@@ -107,7 +107,11 @@ struct root_driver {
 /** Root device table */
 #define ROOT_DEVICES __table ( struct root_device, "root_devices" )
 
+#define ROOT_EARLY	01	/**< Early probe */
+#define ROOT_NORMAL	02	/**< Normal probe */
+#define ROOT_LATE	03	/**< Late probe */
+
 /** Declare a root device */
-#define __root_device __table_entry ( ROOT_DEVICES, 01 )
+#define __root_device( root_order ) __table_entry ( ROOT_DEVICES, root_order )
 
 #endif /* _GPXE_DEVICE_H */
-- 
1.7.1



More information about the gPXE-devel mailing list