projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] fix MTIME_SEC_MAX on 32-bit
[powerpc.git]
/
arch
/
um
/
drivers
/
stdio_console.c
diff --git
a/arch/um/drivers/stdio_console.c
b/arch/um/drivers/stdio_console.c
index
5e44adb
..
76d1f1c
100644
(file)
--- a/
arch/um/drivers/stdio_console.c
+++ b/
arch/um/drivers/stdio_console.c
@@
-3,7
+3,6
@@
* Licensed under the GPL
*/
* Licensed under the GPL
*/
-#include "linux/config.h"
#include "linux/posix_types.h"
#include "linux/tty.h"
#include "linux/tty_flip.h"
#include "linux/posix_types.h"
#include "linux/tty.h"
#include "linux/tty_flip.h"
@@
-31,8
+30,6
@@
#define MAX_TTYS (16)
#define MAX_TTYS (16)
-/* ----------------------------------------------------------------------------- */
-
/* Referenced only by tty_driver below - presumably it's locked correctly
* by the tty driver.
*/
/* Referenced only by tty_driver below - presumably it's locked correctly
* by the tty driver.
*/
@@
-45,6
+42,7
@@
void stdio_announce(char *dev_name, int dev)
dev_name);
}
dev_name);
}
+/* Almost const, except that xterm_title may be changed in an initcall */
static struct chan_opts opts = {
.announce = stdio_announce,
.xterm_title = "Virtual Console #%d",
static struct chan_opts opts = {
.announce = stdio_announce,
.xterm_title = "Virtual Console #%d",
@@
-53,10
+51,12
@@
static struct chan_opts opts = {
.in_kernel = 1,
};
.in_kernel = 1,
};
-static int con_config(char *str);
+static int con_config(char *str
, char **error_out
);
static int con_get_config(char *dev, char *str, int size, char **error_out);
static int con_get_config(char *dev, char *str, int size, char **error_out);
-static int con_remove(int n);
+static int con_remove(int n, char **con_remove);
+
+/* Const, except for .mc.list */
static struct line_driver driver = {
.name = "UML console",
.device_name = "tty",
static struct line_driver driver = {
.name = "UML console",
.device_name = "tty",
@@
-68,9
+68,8
@@
static struct line_driver driver = {
.read_irq_name = "console",
.write_irq = CONSOLE_WRITE_IRQ,
.write_irq_name = "console-write",
.read_irq_name = "console",
.write_irq = CONSOLE_WRITE_IRQ,
.write_irq_name = "console-write",
- .symlink_from = "ttys",
- .symlink_to = "vc",
.mc = {
.mc = {
+ .list = LIST_HEAD_INIT(driver.mc.list),
.name = "con",
.config = con_config,
.get_config = con_get_config,
.name = "con",
.config = con_config,
.get_config = con_get_config,
@@
-79,18
+78,16
@@
static struct line_driver driver = {
},
};
},
};
-static struct lines console_lines = LINES_INIT(MAX_TTYS);
-
-/* The array is initialized by line_init, which is an initcall. The
- * individual elements are protected by individual semaphores.
+/* The array is initialized by line_init, at initcall time. The
+ * elements are locked individually as needed.
*/
*/
-struct line vts[MAX_TTYS] = { LINE_INIT(CONFIG_CON_ZERO_CHAN, &driver),
- [ 1 ... MAX_TTYS - 1 ] =
- LINE_INIT(CONFIG_CON_CHAN, &driver) };
+st
atic st
ruct line vts[MAX_TTYS] = { LINE_INIT(CONFIG_CON_ZERO_CHAN, &driver),
+
[ 1 ... MAX_TTYS - 1 ] =
+
LINE_INIT(CONFIG_CON_CHAN, &driver) };
-static int con_config(char *str)
+static int con_config(char *str
, char **error_out
)
{
{
- return line_config(vts, ARRAY_SIZE(vts), str, &opts);
+ return line_config(vts, ARRAY_SIZE(vts), str, &opts
, error_out
);
}
static int con_get_config(char *dev, char *str, int size, char **error_out)
}
static int con_get_config(char *dev, char *str, int size, char **error_out)
@@
-98,9
+95,9
@@
static int con_get_config(char *dev, char *str, int size, char **error_out)
return line_get_config(dev, vts, ARRAY_SIZE(vts), str, size, error_out);
}
return line_get_config(dev, vts, ARRAY_SIZE(vts), str, size, error_out);
}
-static int con_remove(int n)
+static int con_remove(int n
, char **error_out
)
{
{
- return line_remove(vts, ARRAY_SIZE(vts), n);
+ return line_remove(vts, ARRAY_SIZE(vts), n
, error_out
);
}
static int con_open(struct tty_struct *tty, struct file *filp)
}
static int con_open(struct tty_struct *tty, struct file *filp)
@@
-108,6
+105,7
@@
static int con_open(struct tty_struct *tty, struct file *filp)
return line_open(vts, tty);
}
return line_open(vts, tty);
}
+/* Set in an initcall, checked in an exitcall */
static int con_init_done = 0;
static const struct tty_operations console_ops = {
static int con_init_done = 0;
static const struct tty_operations console_ops = {
@@
-146,26
+144,25
@@
static int uml_console_setup(struct console *co, char *options)
{
struct line *line = &vts[co->index];
{
struct line *line = &vts[co->index];
- return console_open_chan(line, co
, &opts
);
+ return console_open_chan(line, co);
}
}
+/* No locking for register_console call - relies on single-threaded initcalls */
static struct console stdiocons = {
.name = "tty",
.write = uml_console_write,
.device = uml_console_device,
.setup = uml_console_setup,
static struct console stdiocons = {
.name = "tty",
.write = uml_console_write,
.device = uml_console_device,
.setup = uml_console_setup,
- .flags = CON_PRINTBUFFER,
+ .flags = CON_PRINTBUFFER
|CON_ANYTIME
,
.index = -1,
.index = -1,
- .data = &vts,
};
int stdio_init(void)
{
char *new_title;
};
int stdio_init(void)
{
char *new_title;
- console_driver = line_register_devfs(&console_lines, &driver,
- &console_ops, vts,
- ARRAY_SIZE(vts));
+ console_driver = register_lines(&driver, &console_ops, vts,
+ ARRAY_SIZE(vts));
if (console_driver == NULL)
return -1;
printk(KERN_INFO "Initialized stdio console driver\n");
if (console_driver == NULL)
return -1;
printk(KERN_INFO "Initialized stdio console driver\n");
@@
-192,7
+189,15
@@
__uml_exitcall(console_exit);
static int console_chan_setup(char *str)
{
static int console_chan_setup(char *str)
{
- return line_setup(vts, ARRAY_SIZE(vts), str);
+ char *error;
+ int ret;
+
+ ret = line_setup(vts, ARRAY_SIZE(vts), str, &error);
+ if(ret < 0)
+ printk(KERN_ERR "Failed to set up console with "
+ "configuration string \"%s\" : %s\n", str, error);
+
+ return 1;
}
__setup("con", console_chan_setup);
__channel_help(console_chan_setup, "con");
}
__setup("con", console_chan_setup);
__channel_help(console_chan_setup, "con");