Skip to contentSkip to conversation

Console init revamp.

PATCH David Woodhouse 2 participants 4 messages Nov 6, 2002 – Nov 7, 2002

Subsystems (11)
Arm (32-bit) MIPS s390 SuperH +7 more subsystems
lore
Share & tools
lore
#0 lore raw

This removes all the #ifdef'd calls to initialise individual consoles in con_init(), and replaces them with a mechanism akin to initcalls.

I've fixed all the vmlinux.lds.S files except uCLinux. Greg, how about some appropriate #includes to reduce the duplication there?

===== drivers/char/tty_io.c 1.44 vs edited =====

drivers/char/tty_io.c +17 -79
@@ -112,7 +112,15 @@
 #define TTY_PARANOIA_CHECK 1
 #define CHECK_TTY_COUNT 1
 
-struct termios tty_std_termios;		/* for the benefit of tty drivers  */
+struct termios tty_std_termios = {	/* for the benefit of tty drivers  */
+	.c_iflag = ICRNL | IXON,
+	.c_oflag = OPOST | ONLCR,
+	.c_cflag = B38400 | CS8 | CREAD | HUPCL,
+	.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK |
+		   ECHOCTL | ECHOKE | IEXTEN,
+	.c_cc = INIT_C_CC
+};
+
 LIST_HEAD(tty_drivers);			/* linked list of tty drivers */
 struct tty_ldisc ldiscs[NR_LDISCS];	/* line disc dispatch table	*/
 
@@ -140,24 +148,12 @@
 	      unsigned int cmd, unsigned long arg);
 static int tty_fasync(int fd, struct file * filp, int on);
 extern int vme_scc_init (void);
-extern long vme_scc_console_init(void);
 extern int serial167_init(void);
-extern long serial167_console_init(void);
-extern void console_8xx_init(void);
 extern int rs_8xx_init(void);
-extern void mac_scc_console_init(void);
-extern void hwc_console_init(void);
 extern void hwc_tty_init(void);
-extern void con3215_init(void);
 extern void tty3215_init(void);
-extern void tub3270_con_init(void);
 extern void tub3270_init(void);
-extern void uart_console_init(void);
-extern void sgi_serial_console_init(void);
-extern void sci_console_init(void);
-extern void tx3912_console_init(void);
 extern void tx3912_rs_init(void);
-extern void hvc_console_init(void);
 
 #ifndef MIN
 #define MIN(a,b)	((a) < (b) ? (a) : (b))
@@ -2157,82 +2153,24 @@
  */
 void __init console_init(void)
 {
+	initcall_t *call;
+
 	/* Setup the default TTY line discipline. */
-	memset(ldiscs, 0, sizeof(ldiscs));
 	(void) tty_register_ldisc(N_TTY, &tty_ldisc_N_TTY);
 
 	/*
-	 * Set up the standard termios.  Individual tty drivers may 
-	 * deviate from this; this is used as a template.
-	 */
-	memset(&tty_std_termios, 0, sizeof(struct termios));
-	memcpy(tty_std_termios.c_cc, INIT_C_CC, NCCS);
-	tty_std_termios.c_iflag = ICRNL | IXON;
-	tty_std_termios.c_oflag = OPOST | ONLCR;
-	tty_std_termios.c_cflag = B38400 | CS8 | CREAD | HUPCL;
-	tty_std_termios.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK |
-		ECHOCTL | ECHOKE | IEXTEN;
-
-	/*
 	 * set up the console device so that later boot sequences can 
 	 * inform about problems etc..
 	 */
 #ifdef CONFIG_EARLY_PRINTK
 	disable_early_printk();
 #endif
-#ifdef CONFIG_VT
-	con_init();
-#endif
-#ifdef CONFIG_AU1000_SERIAL_CONSOLE
-	au1000_serial_console_init();
-#endif
-#ifdef CONFIG_SERIAL_CONSOLE
-#if (defined(CONFIG_8xx) || defined(CONFIG_8260))
-	console_8xx_init();
-#elif defined(CONFIG_MAC_SERIAL)
- 	mac_scc_console_init();
-#elif defined(CONFIG_PARISC)
-	pdc_console_init();
-#elif defined(CONFIG_SERIAL)
-	serial_console_init();
-#endif /* CONFIG_8xx */
-#ifdef CONFIG_SGI_SERIAL
-	sgi_serial_console_init();
-#endif
-#if defined(CONFIG_MVME162_SCC) || defined(CONFIG_BVME6000_SCC) || defined(CONFIG_MVME147_SCC)
-	vme_scc_console_init();
-#endif
-#if defined(CONFIG_SERIAL167)
-	serial167_console_init();
-#endif
-#if defined(CONFIG_SH_SCI)
-	sci_console_init();
-#endif
-#endif
-#ifdef CONFIG_TN3270_CONSOLE
-	tub3270_con_init();
-#endif
-#ifdef CONFIG_TN3215
-	con3215_init();
-#endif
-#ifdef CONFIG_HWC
-        hwc_console_init();
-#endif
-#ifdef CONFIG_STDIO_CONSOLE
-	stdio_console_init();
-#endif
-#ifdef CONFIG_SERIAL_CORE_CONSOLE
-	uart_console_init();
-#endif
-#ifdef CONFIG_ARC_CONSOLE
-	arc_console_init();
-#endif
-#ifdef CONFIG_SERIAL_TX3912_CONSOLE
-	tx3912_console_init();
-#endif
-#ifdef CONFIG_HVC_CONSOLE
-	hvc_console_init();
-#endif
+
+	call = &__con_initcall_start;
+	while (call < &__con_initcall_end) {
+		(*call)();
+		call++;
+	};
 }
 
 static struct tty_driver dev_tty_driver, dev_syscons_driver;

===== drivers/serial/core.c 1.17 vs edited =====

drivers/serial/core.c +0 -36
@@ -1827,42 +1827,6 @@
 
 	return 0;
 }
-
-extern void ambauart_console_init(void);
-extern void anakin_console_init(void);
-extern void clps711xuart_console_init(void);
-extern void rs285_console_init(void);
-extern void sa1100_rs_console_init(void);
-extern void serial8250_console_init(void);
-extern void uart00_console_init(void);
-
-/*
- * Central "initialise all serial consoles" container.  Needs to be killed.
- */
-void __init uart_console_init(void)
-{
-#ifdef CONFIG_SERIAL_AMBA_CONSOLE
-	ambauart_console_init();
-#endif
-#ifdef CONFIG_SERIAL_ANAKIN_CONSOLE
-	anakin_console_init();
-#endif
-#ifdef CONFIG_SERIAL_CLPS711X_CONSOLE
-	clps711xuart_console_init();
-#endif
-#ifdef CONFIG_SERIAL_21285_CONSOLE
-	rs285_console_init();
-#endif
-#ifdef CONFIG_SERIAL_SA1100_CONSOLE
-	sa1100_rs_console_init();
-#endif
-#ifdef CONFIG_SERIAL_8250_CONSOLE
-	serial8250_console_init();
-#endif
-#ifdef CONFIG_SERIAL_UART00_CONSOLE
-	uart00_console_init();
-#endif
-}
 #endif /* CONFIG_SERIAL_CORE_CONSOLE */
 
 #ifdef CONFIG_PM

===== drivers/char/amiserial.c 1.10 vs edited =====

drivers/char/amiserial.c +2 -1
@@ -2322,10 +2322,11 @@
 /*
  *	Register console.
  */
-void __init serial_console_init(void)
+static void __init amiserial_console_init(void)
 {
 	register_console(&sercons);
 }
+console_initcall(amiserial_console_init);
 #endif
 
 MODULE_LICENSE("GPL");

===== drivers/char/decserial.c 1.2 vs edited =====

drivers/char/decserial.c +2 -1
@@ -75,7 +75,7 @@
 /* serial_console_init handles the special case of starting
  *   up the console on the serial port
  */
-void __init serial_console_init(void)
+static void __init decserial_console_init(void)
 {
 #if defined(CONFIG_ZS) && defined(CONFIG_DZ)
     if (IOASIC)
@@ -94,5 +94,6 @@
 
 #endif
 }
+console_initcall(decserial_console_init);
 
 #endif

===== drivers/char/hvc_console.c 1.9 vs edited =====

drivers/char/hvc_console.c +2 -1
@@ -348,11 +348,12 @@
 	index:		-1,
 };
 
-int __init hvc_console_init(void)
+static int __init hvc_console_init(void)
 {
 	register_console(&hvc_con_driver);
 	return 0;
 }
+console_initcall(hvc_console_init);
 
 module_init(hvc_init);
 module_exit(hvc_exit);

===== drivers/char/serial167.c 1.12 vs edited =====

drivers/char/serial167.c +2 -1
@@ -2836,7 +2836,7 @@
 };
 
 
-void __init serial167_console_init(void)
+static void __init serial167_console_init(void)
 {
 	if (vme_brdtype == VME_TYPE_MVME166 ||
 			vme_brdtype == VME_TYPE_MVME167 ||
@@ -2845,6 +2845,7 @@
 		register_console(&sercons);
 	}
 }
+console_initcall(serial167_console_init);
 
 #ifdef CONFIG_REMOTE_DEBUG
 void putDebugChar (int c)

===== drivers/char/serial_tx3912.c 1.6 vs edited =====

drivers/char/serial_tx3912.c +2 -1
@@ -1054,9 +1054,10 @@
 	index:    -1
 };
 
-void __init tx3912_console_init(void)
+static void __init tx3912_console_init(void)
 {
 	register_console(&sercons);
 }
+console_initcall(tx3912_console_init);
 
 #endif

===== drivers/char/sh-sci.c 1.11 vs edited =====

drivers/char/sh-sci.c +3 -1
@@ -1275,7 +1275,7 @@
 extern void sh_console_unregister (void);
 #endif
 
-void __init sci_console_init(void)
+static void __init sci_console_init(void)
 {
 	register_console(&sercons);
 #ifdef CONFIG_SH_EARLY_PRINTK
@@ -1285,4 +1285,6 @@
 	sh_console_unregister();
 #endif
 }
+console_initcall(sci_console_init);
+
 #endif /* CONFIG_SERIAL_CONSOLE */

===== drivers/char/vme_scc.c 1.8 vs edited =====

drivers/char/vme_scc.c +2 -2
@@ -1103,7 +1103,7 @@
 };
 
 
-void __init vme_scc_console_init(void)
+static void __init vme_scc_console_init(void)
 {
 	if (vme_brdtype == VME_TYPE_MVME147 ||
 			vme_brdtype == VME_TYPE_MVME162 ||
@@ -1112,4 +1112,4 @@
 			vme_brdtype == VME_TYPE_BVME6000)
 		register_console(&sercons);
 }
-
+console_initcall(vme_scc_console_init);

===== drivers/char/vt.c 1.20 vs edited =====

drivers/char/vt.c +2 -1
@@ -2435,7 +2435,7 @@
 struct tty_driver console_driver;
 static int console_refcount;
 
-void __init con_init(void)
+static void __init con_init(void)
 {
 	const char *display_desc = NULL;
 	unsigned int currcons = 0;
@@ -2484,6 +2484,7 @@
 	register_console(&vt_console_driver);
 #endif
 }
+console_initcall(con_init);
 
 int __init vty_init(void)
 {

===== drivers/macintosh/macserial.c 1.10 vs edited =====

drivers/macintosh/macserial.c +3 -1
@@ -3088,10 +3088,12 @@
 /*
  *	Register console.
  */
-void __init mac_scc_console_init(void)
+static void __init mac_scc_console_init(void)
 {
 	register_console(&sercons);
 }
+console_initcall(mac_scc_console_init);
+
 #endif /* ifdef CONFIG_SERIAL_CONSOLE */
 
 #ifdef CONFIG_KGDB

===== drivers/s390/char/con3215.c 1.9 vs edited =====

drivers/s390/char/con3215.c +2 -1
@@ -1052,7 +1052,7 @@
  * 3215 console initialization code called from console_init().
  * NOTE: This is called before kmalloc is available.
  */
-void __init con3215_init(void)
+static void __init con3215_init(void)
 {
 #ifdef CONFIG_TN3215_CONSOLE
 	raw3215_info *raw;
@@ -1126,6 +1126,7 @@
 	}
 #endif
 }
+console_initcall(con3215_init);
 
 /*
  * 3215 tty registration code called from tty_init().

===== drivers/s390/char/hwc_con.c 1.5 vs edited =====

drivers/s390/char/hwc_con.c +2 -1
@@ -73,7 +73,7 @@
 
 #endif
 
-void __init 
+static void __init 
 hwc_console_init (void)
 {
 	if (!MACHINE_HAS_HWC)
@@ -90,3 +90,4 @@
 
 	return;
 }
+console_initcall(hwc_console_init);

===== drivers/s390/char/tuball.c 1.8 vs edited =====

drivers/s390/char/tuball.c +3 -1
@@ -131,7 +131,7 @@
 #else
 #define tub3270_con_devno console_device
 
-void __init tub3270_con_init(void)
+static void __init tub3270_con_init(void)
 {
 	tub3270_con_bcb.bc_len = 65536;
 	if (!CONSOLE_IS_3270)
@@ -140,6 +140,8 @@
 		tub3270_con_bcb.bc_len);
 	register_console(&tub3270_con);
 }
+console_initcall(tub3270_con_init);
+
 #endif
 
 static kdev_t

===== drivers/serial/21285.c 1.10 vs edited =====

drivers/serial/21285.c +2 -1
@@ -471,11 +471,12 @@
 	.index		= -1,
 };
 
-void __init rs285_console_init(void)
+static void __init rs285_console_init(void)
 {
 	serial21285_setup_ports();
 	register_console(&serial21285_console);
 }
+console_initcall(rs283_console_init);
 
 #define SERIAL_21285_CONSOLE	&serial21285_console
 #else

===== drivers/serial/8250.c 1.22 vs edited =====

drivers/serial/8250.c +2 -1
@@ -1908,11 +1908,12 @@
 	.index		= -1,
 };
 
-void __init serial8250_console_init(void)
+static void __init serial8250_console_init(void)
 {
 	serial8250_isa_init_ports();
 	register_console(&serial8250_console);
 }
+console_initcall(serial8250_console_init);
 
 #define SERIAL8250_CONSOLE	&serial8250_console
 #else

===== drivers/serial/amba.c 1.12 vs edited =====

drivers/serial/amba.c +2 -1
@@ -693,10 +693,11 @@
 	.index		= -1,
 };
 
-void __init ambauart_console_init(void)
+static void __init ambauart_console_init(void)
 {
 	register_console(&amba_console);
 }
+console_initcall(ambauart_console_init);
 
 #define AMBA_CONSOLE	&amba_console
 #else

===== drivers/serial/anakin.c 1.9 vs edited =====

drivers/serial/anakin.c +2 -1
@@ -478,11 +478,12 @@
 	.index		= -1,
 };
 
-void __init
+static void __init
 anakin_console_init(void)
 {
 	register_console(&anakin_console);
 }
+console_initcall(anakin_console_init);
 
 #define ANAKIN_CONSOLE		&anakin_console
 #else

===== drivers/serial/clps711x.c 1.9 vs edited =====

drivers/serial/clps711x.c +2 -1
@@ -553,10 +553,11 @@
 	.index		= -1,
 };
 
-void __init clps711xuart_console_init(void)
+static void __init clps711xuart_console_init(void)
 {
 	register_console(&clps711x_console);
 }
+console_initcall(clps711xuart_console_init);
 
 #define CLPS711X_CONSOLE	&clps711x_console
 #else

===== drivers/serial/sa1100.c 1.12 vs edited =====

drivers/serial/sa1100.c +2 -1
@@ -813,11 +813,12 @@
 	.index		= -1,
 };
 
-void __init sa1100_rs_console_init(void)
+static void __init sa1100_rs_console_init(void)
 {
 	sa1100_init_ports();
 	register_console(&sa1100_console);
 }
+console_initcall(sa1100_rs_console_init);
 
 #define SA1100_CONSOLE	&sa1100_console
 #else

===== drivers/serial/uart00.c 1.7 vs edited =====

drivers/serial/uart00.c +2 -1
@@ -628,10 +628,11 @@
 	.index		= 0,
 };
 
-void __init uart00_console_init(void)
+static void __init uart00_console_init(void)
 {
 	register_console(&uart00_console);
 }
+console_initcall(uart00_console_init);
 
 #define UART00_CONSOLE	&uart00_console
 #else

===== drivers/sgi/char/sgiserial.c 1.6 vs edited =====

drivers/sgi/char/sgiserial.c +3 -1
@@ -2269,8 +2269,10 @@
 /*
  *	Register console.
  */
-void __init sgi_serial_console_init(void)
+static void __init sgi_serial_console_init(void)
 {
 	register_console(&sgi_console_driver);
 }
+console_initcall(sgi_serial_console_init);
+
 __initcall(rs_init);

===== include/linux/init.h 1.16 vs edited =====

include/linux/init.h +4 -0
@@ -49,6 +49,7 @@
 typedef void (*exitcall_t)(void);
 
 extern initcall_t __initcall_start, __initcall_end;
+extern initcall_t __con_initcall_start, __con_initcall_end;
 
 /* initcalls are now grouped by functionality into separate 
  * subsections. Ordering inside the subsections is determined
@@ -72,6 +73,9 @@
 
 #define __exitcall(fn)								\
 	static exitcall_t __exitcall_##fn __exit_call = fn
+
+#define console_initcall(fn) \
+	static initcall_t __initcall_##fn __attribute__ ((unused,__section__ (".con_initcall.init")))=fn
 
 /*
  * Used for kernel command line parameter setup

===== arch/alpha/vmlinux.lds.S 1.12 vs edited =====

arch/alpha/vmlinux.lds.S +6 -0
@@ -73,6 +73,12 @@
 	__initramfs_end = .;
   }
 
+  .con_initcall.init ALIGN(8): {
+	__con_initcall_start = .;
+	*(.con_initcall.init)
+	__con_initcall_end = .;
+  }
+
   .data.percpu ALIGN(64): {
 	__per_cpu_start = .;
 	*(.data.percpu)

===== arch/arm/vmlinux-armo.lds.in 1.10 vs edited =====

arch/arm/vmlinux-armo.lds.in +3 -0
@@ -35,6 +35,9 @@
 			*(.initcall6.init)
 			*(.initcall7.init)
 		__initcall_end = .;
+		__con_initcall_start = .;
+			*(.con_initcall.init)
+		__con_initcall_end = .;
 		. = ALIGN(32768);
 		__init_end = .;
 	}

===== arch/arm/vmlinux-armv.lds.in 1.14 vs edited =====

arch/arm/vmlinux-armv.lds.in +3 -0
@@ -35,6 +35,9 @@
 			*(.initcall6.init)
 			*(.initcall7.init)
 		__initcall_end = .;
+		__con_initcall_start = .;
+			*(.con_initcall.init)
+		__con_initcall_end = .;
 		. = ALIGN(32);
 		__initramfs_start = .;
 			usr/built-in.o(.init.ramfs)

===== arch/cris/vmlinux.lds.S 1.12 vs edited =====

arch/cris/vmlinux.lds.S +6 -1
@@ -73,7 +73,12 @@
 		*(.initcall6.init);
 		*(.initcall7.init);
 		__initcall_end = .;
-
+	}
+	.con_initcall.init : {
+		__con_initcall_start = .;
+		*(.con_initcall.init)
+		__con_initcall_end = .;
+	
 		/* We fill to the next page, so we can discard all init
 		   pages without needing to consider what payload might be
 		   appended to the kernel image.  */

===== arch/i386/vmlinux.lds.S 1.19 vs edited =====

arch/i386/vmlinux.lds.S +3 -0
@@ -77,6 +77,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(4096);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }

===== arch/ia64/vmlinux.lds.S 1.17 vs edited =====

arch/ia64/vmlinux.lds.S +4 -0
@@ -114,6 +114,10 @@
 		*(.initcall7.init)
 	}
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : AT(ADDR(.con_initcall.init) - PAGE_OFFSET)
+	{ *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(PAGE_SIZE);
   __init_end = .;
 

===== arch/m68k/vmlinux-std.lds 1.9 vs edited =====

arch/m68k/vmlinux-std.lds +3 -0
@@ -58,6 +58,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(8192);
   __init_end = .;
 

===== arch/m68k/vmlinux-sun3.lds 1.6 vs edited =====

arch/m68k/vmlinux-sun3.lds +3 -0
@@ -54,6 +54,9 @@
 		*(.initcall7.init)
 	}
 	__initcall_end = .;
+	__con_initcall_start = .;
+	.con_initcall.init : { *(.con_initcall.init) }
+	__con_initcall_end = .;
 	. = ALIGN(8192);
 	__init_end = .;
 	.init.task : { *(init_task) }

===== arch/mips/vmlinux.lds.S 1.4 vs edited =====

arch/mips/vmlinux.lds.S +3 -0
@@ -54,6 +54,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(4096);	/* Align double page for init_task_union */
   __init_end = .;
 

===== arch/mips/arc/arc_con.c 1.1 vs edited =====

arch/mips/arc/arc_con.c +2 -1
@@ -63,7 +63,8 @@
  *    Register console.
  */
 
-void __init arc_console_init(void)
+static void __init arc_console_init(void)
 {
 	register_console(&arc_cons);
 }
+console_initcall(arc_console_init);

===== arch/mips/au1000/common/serial.c 1.4 vs edited =====

arch/mips/au1000/common/serial.c +2 -1
@@ -3054,10 +3054,11 @@
 /*
  *	Register console.
  */
-void __init au1000_serial_console_init(void)
+static void __init au1000_serial_console_init(void)
 {
 	register_console(&sercons);
 }
+console_initcall(au1000_serial_console_init);
 #endif
 
 /*

===== arch/mips64/vmlinux.lds.S 1.4 vs edited =====

arch/mips64/vmlinux.lds.S +3 -0
@@ -50,6 +50,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(4096);	/* Align double page for init_task_union */
   __init_end = .;
 

===== arch/parisc/vmlinux.lds.S 1.6 vs edited =====

arch/parisc/vmlinux.lds.S +3 -0
@@ -79,6 +79,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(32);
   __per_cpu_start = .;
   .data.percpu  : { *(.data.percpu) }

===== arch/ppc/vmlinux.lds.S 1.12 vs edited =====

arch/ppc/vmlinux.lds.S +3 -0
@@ -112,6 +112,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(32);
   __per_cpu_start = .;
   .data.percpu  : { *(.data.percpu) }

===== arch/ppc/8xx_io/uart.c 1.16 vs edited =====

arch/ppc/8xx_io/uart.c +2 -3
@@ -2522,12 +2522,11 @@
 /*
  *	Register console.
  */
-long __init console_8xx_init(long kmem_start, long kmem_end)
+static void __init console_8xx_init(long kmem_start, long kmem_end)
 {
 	register_console(&sercons);
-	return kmem_start;
 }
-
+console_initcall(console_8xx_init);
 #endif
 
 /* Index in baud rate table of the default console baud rate.

===== arch/ppc64/vmlinux.lds.S 1.6 vs edited =====

arch/ppc64/vmlinux.lds.S +3 -0
@@ -110,6 +110,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(32);
   __per_cpu_start = .;
   .data.percpu  : { *(.data.percpu) }

===== arch/s390/vmlinux.lds.S 1.4 vs edited =====

arch/s390/vmlinux.lds.S +3 -0
@@ -64,6 +64,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(256);
   __per_cpu_start = .;
   .data.percpu  : { *(.data.percpu) }

===== arch/s390x/vmlinux.lds.S 1.4 vs edited =====

arch/s390x/vmlinux.lds.S +3 -0
@@ -64,6 +64,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(256);
   __per_cpu_start = .;
   .data.percpu  : { *(.data.percpu) }

===== arch/sh/vmlinux.lds.S 1.6 vs edited =====

arch/sh/vmlinux.lds.S +3 -0
@@ -74,6 +74,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   __machvec_start = .;
   .machvec.init : { *(.machvec.init) }
   __machvec_end = .;

===== arch/sparc/vmlinux.lds.S 1.9 vs edited =====

arch/sparc/vmlinux.lds.S +3 -0
@@ -56,6 +56,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(4096);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }

===== arch/sparc64/vmlinux.lds.S 1.10 vs edited =====

arch/sparc64/vmlinux.lds.S +3 -0
@@ -57,6 +57,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(8192); 
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }

===== arch/um/drivers/stdio_console.c 1.3 vs edited =====

arch/um/drivers/stdio_console.c +2 -1
@@ -185,12 +185,13 @@
 					       console_device, console_setup,
 					       CON_PRINTBUFFER);
 
-void stdio_console_init(void)
+static void __init stdio_console_init(void)
 {
 	INIT_LIST_HEAD(&vts[0].chan_list);
 	list_add(&init_console_chan.list, &vts[0].chan_list);
 	register_console(&stdiocons);
 }
+console_initcall(stdio_console_init);
 
 static int console_chan_setup(char *str)
 {

===== arch/x86_64/vmlinux.lds.S 1.7 vs edited =====

arch/x86_64/vmlinux.lds.S +3 -0
@@ -98,6 +98,9 @@
 	*(.initcall7.init)
   }
   __initcall_end = .;
+  __con_initcall_start = .;
+  .con_initcall.init : { *(.con_initcall.init) }
+  __con_initcall_end = .;
   . = ALIGN(32);
   __per_cpu_start = .;
   .data.percpu  : { *(.data.percpu) }

--
dwmw2

#1 lore raw

Hi David,

Quoted 3 lines · David Woodhouse

This removes all the #ifdef'd calls to initialise individual consoles in con_init(), and replaces them with a mechanism akin to initcalls.

I've fixed all the vmlinux.lds.S files except uCLinux. Greg, how about some appropriate #includes to reduce the duplication there?

That has been on my todo list for a while :-)

I should have them all cleaned up into a single vmlinux.lds.S file by end of today or tomorrow.

Regards
Greg

------------------------------------------------------------------------
Greg Ungerer -- Chief Software Wizard EMAIL: [email protected]
SnapGear Pty Ltd PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: www.SnapGear.com

#2 lore raw
Quoted 3 lines · [email protected] said:

That has been on my todo list for a while :-)
I should have them all cleaned up into a single vmlinux.lds.S file by end of today or tomorrow.

You know, the rest of the vmlinux.lds.S files could also do with a little #include loving, while you're at it... :)

--
dwmw2

#3 lore raw
Quoted 8 lines · David Woodhouse
Quoted 3 lines · [email protected] said:

That has been on my todo list for a while :-)
I should have them all cleaned up into a single vmlinux.lds.S file by end of today or tomorrow.

You know, the rest of the vmlinux.lds.S files could also do with a little #include loving, while you're at it... :)

Hah! I think the 28 or so we have under the m68knommu arch outnumbers all others in the kernel sources put together :-)

Regards
Greg

------------------------------------------------------------------------
Greg Ungerer -- Chief Software Wizard EMAIL: [email protected]
SnapGear Pty Ltd PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: www.SnapGear.com