Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23450
b: refs/heads/master
c: 2ea1c53
h: refs/heads/master
v: v3
  • Loading branch information
John Z. Bohach authored and Linus Torvalds committed Mar 24, 2006
1 parent 560eb9a commit d521808
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e9dd124b90af80824754f68c0b246cfd0fb624b
refs/heads/master: 2ea1c5392cc8ce249fb661db4f4cdfbbae373a89
76 changes: 38 additions & 38 deletions trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,44 +122,6 @@ static char *log_buf = __log_buf;
static int log_buf_len = __LOG_BUF_LEN;
static unsigned long logged_chars; /* Number of chars produced since last read+clear operation */

/*
* Setup a list of consoles. Called from init/main.c
*/
static int __init console_setup(char *str)
{
char name[sizeof(console_cmdline[0].name)];
char *s, *options;
int idx;

/*
* Decode str into name, index, options.
*/
if (str[0] >= '0' && str[0] <= '9') {
strcpy(name, "ttyS");
strncpy(name + 4, str, sizeof(name) - 5);
} else
strncpy(name, str, sizeof(name) - 1);
name[sizeof(name) - 1] = 0;
if ((options = strchr(str, ',')) != NULL)
*(options++) = 0;
#ifdef __sparc__
if (!strcmp(str, "ttya"))
strcpy(name, "ttyS0");
if (!strcmp(str, "ttyb"))
strcpy(name, "ttyS1");
#endif
for (s = name; *s; s++)
if ((*s >= '0' && *s <= '9') || *s == ',')
break;
idx = simple_strtoul(s, NULL, 10);
*s = 0;

add_preferred_console(name, idx, options);
return 1;
}

__setup("console=", console_setup);

static int __init log_buf_len_setup(char *str)
{
unsigned long size = memparse(str, &str);
Expand Down Expand Up @@ -659,6 +621,44 @@ static void call_console_drivers(unsigned long start, unsigned long end)

#endif

/*
* Set up a list of consoles. Called from init/main.c
*/
static int __init console_setup(char *str)
{
char name[sizeof(console_cmdline[0].name)];
char *s, *options;
int idx;

/*
* Decode str into name, index, options.
*/
if (str[0] >= '0' && str[0] <= '9') {
strcpy(name, "ttyS");
strncpy(name + 4, str, sizeof(name) - 5);
} else {
strncpy(name, str, sizeof(name) - 1);
}
name[sizeof(name) - 1] = 0;
if ((options = strchr(str, ',')) != NULL)
*(options++) = 0;
#ifdef __sparc__
if (!strcmp(str, "ttya"))
strcpy(name, "ttyS0");
if (!strcmp(str, "ttyb"))
strcpy(name, "ttyS1");
#endif
for (s = name; *s; s++)
if ((*s >= '0' && *s <= '9') || *s == ',')
break;
idx = simple_strtoul(s, NULL, 10);
*s = 0;

add_preferred_console(name, idx, options);
return 1;
}
__setup("console=", console_setup);

/**
* add_preferred_console - add a device to the list of preferred consoles.
* @name: device name
Expand Down

0 comments on commit d521808

Please sign in to comment.