summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2005-04-27 13:38:43 +0200
committerMichael Brown2005-04-27 13:38:43 +0200
commit3e5bf5fb0660704a2e3f0e4cf83fe411c88048e2 (patch)
tree1cf3e2869ef2d437e59d66c28b6791ac3f5df883
parentLinker no longer provides start and end symbols for each table; these (diff)
downloadipxe-3e5bf5fb0660704a2e3f0e4cf83fe411c88048e2.tar.gz
ipxe-3e5bf5fb0660704a2e3f0e4cf83fe411c88048e2.tar.xz
ipxe-3e5bf5fb0660704a2e3f0e4cf83fe411c88048e2.zip
console.c uses the generic table mechanism
-rw-r--r--src/arch/i386/scripts/i386.lds11
-rw-r--r--src/core/console.c4
-rw-r--r--src/include/console.h3
3 files changed, 8 insertions, 10 deletions
diff --git a/src/arch/i386/scripts/i386.lds b/src/arch/i386/scripts/i386.lds
index 51cfbd333..89d2f62ab 100644
--- a/src/arch/i386/scripts/i386.lds
+++ b/src/arch/i386/scripts/i386.lds
@@ -141,7 +141,10 @@ SECTIONS {
*(.data)
*(.data.*)
- /* Various tables */
+ /* Various tables. See include/tables.h for an explanation. */
+ *(SORT(.tbl.*))
+
+
device_drivers = .;
*(.drivers.device)
device_drivers_end = .;
@@ -154,15 +157,9 @@ SECTIONS {
type_drivers = .;
*(.drivers.type)
type_drivers_end = .;
- console_drivers = .;
- *(.drivers.console)
- console_drivers_end = .;
post_reloc_fns = .;
*(SORT(.post_reloc_fns.*))
post_reloc_fns_end = .;
- init_fns = .;
- *(SORT(.init_fns.*))
- init_fns_end = .;
_progbits_end = .;
}
diff --git a/src/core/console.c b/src/core/console.c
index 6e92cb54f..2fbf86380 100644
--- a/src/core/console.c
+++ b/src/core/console.c
@@ -18,8 +18,8 @@
*/
#include "bios.h"
-extern struct console_driver console_drivers[];
-extern struct console_driver console_drivers_end[];
+static struct console_driver console_drivers[0] __table_start ( console );
+static struct console_driver console_drivers_end[0] __table_end ( console );
/*****************************************************************************
* putchar : write a single character to each console
diff --git a/src/include/console.h b/src/include/console.h
index 55ce73095..146fd9c3e 100644
--- a/src/include/console.h
+++ b/src/include/console.h
@@ -3,6 +3,7 @@
#include "stdint.h"
#include "vsprintf.h"
+#include "tables.h"
/*
* Consoles that cannot be used before their INIT_FN() has completed
@@ -18,7 +19,7 @@ struct console_driver {
};
#define __console_driver \
- __attribute__ (( used, __section__ ( ".drivers.console" ) ))
+ __attribute__ (( used, __table_section ( console, 01 ) ))
/* Function prototypes */