From 3e5bf5fb0660704a2e3f0e4cf83fe411c88048e2 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 27 Apr 2005 11:38:43 +0000 Subject: [PATCH] console.c uses the generic table mechanism --- src/arch/i386/scripts/i386.lds | 11 ++++------- src/core/console.c | 4 ++-- src/include/console.h | 3 ++- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/arch/i386/scripts/i386.lds b/src/arch/i386/scripts/i386.lds index 51cfbd33..89d2f62a 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 6e92cb54..2fbf8638 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 55ce7309..146fd9c3 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 */