/* This function generates a proxy driver for each serial port driver. These proxy drivers then register with the STDIO core, making the serial drivers available as STDIO devices.  */
void serial_stdio_init(void)
/* This function generates a proxy driver for each serial port driver. These proxy drivers then register with the STDIO core, making the serial drivers available as STDIO devices.  */
void serial_stdio_init(void)
{
	struct stdio_dev dev;
	struct serial_device *s = serial_devices;
	while (s) {
		memset(&dev, 0, sizeof(dev));
		strcpy(dev.name, s->name);
		dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT;
		dev.start = serial_stub_start;
		dev.stop = serial_stub_stop;
		dev.putc = serial_stub_putc;
		dev.puts = serial_stub_puts;
		dev.getc = serial_stub_getc;
		dev.tstc = serial_stub_tstc;
		dev.priv = s;
		stdio_register(&dev);
		s = s->next;
	}
}