m68k/atari: ARAnyM - Add support for console access
[geert: Cleanups and updates] Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Petr Stehlik <pstehlik@sophics.cz>
This commit is contained in:

committed by
Geert Uytterhoeven

parent
b2edd2fd9b
commit
37b0b65f63
@@ -35,24 +35,6 @@ asm("\n"
|
||||
EXPORT_SYMBOL_GPL(nf_get_id);
|
||||
EXPORT_SYMBOL_GPL(nf_call);
|
||||
|
||||
static int stderr_id;
|
||||
|
||||
static void nf_write(struct console *co, const char *str, unsigned int count)
|
||||
{
|
||||
char buf[68];
|
||||
|
||||
buf[64] = 0;
|
||||
while (count > 64) {
|
||||
memcpy(buf, str, 64);
|
||||
nf_call(stderr_id, buf);
|
||||
str += 64;
|
||||
count -= 64;
|
||||
}
|
||||
memcpy(buf, str, count);
|
||||
buf[count] = 0;
|
||||
nf_call(stderr_id, buf);
|
||||
}
|
||||
|
||||
void nfprint(const char *fmt, ...)
|
||||
{
|
||||
static char buf[256];
|
||||
@@ -65,26 +47,6 @@ void nfprint(const char *fmt, ...)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
static struct console nf_console_driver = {
|
||||
.name = "debug",
|
||||
.write = nf_write,
|
||||
.flags = CON_PRINTBUFFER,
|
||||
.index = -1,
|
||||
};
|
||||
|
||||
static int __init nf_debug_setup(char *arg)
|
||||
{
|
||||
if (strcmp(arg, "emu"))
|
||||
return 0;
|
||||
|
||||
stderr_id = nf_get_id("NF_STDERR");
|
||||
if (stderr_id)
|
||||
register_console(&nf_console_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
early_param("debug", nf_debug_setup);
|
||||
|
||||
static void nf_poweroff(void)
|
||||
{
|
||||
long id = nf_get_id("NF_SHUTDOWN");
|
||||
|
Reference in New Issue
Block a user