Module Name: src Committed By: pooka Date: Mon Jun 14 13:25:40 UTC 2010
Modified Files: src/sys/rump/librump/rumpkern: emul.c Log Message: Make some stubby tty routines used by printf weak aliases, so that the full ones will be used if we have the upcoming tty component loaded. To generate a diff of this commit: cvs rdiff -u -r1.141 -r1.142 src/sys/rump/librump/rumpkern/emul.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/librump/rumpkern/emul.c diff -u src/sys/rump/librump/rumpkern/emul.c:1.141 src/sys/rump/librump/rumpkern/emul.c:1.142 --- src/sys/rump/librump/rumpkern/emul.c:1.141 Sun Jun 13 15:17:02 2010 +++ src/sys/rump/librump/rumpkern/emul.c Mon Jun 14 13:25:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: emul.c,v 1.141 2010/06/13 15:17:02 pooka Exp $ */ +/* $NetBSD: emul.c,v 1.142 2010/06/14 13:25:40 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.141 2010/06/13 15:17:02 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.142 2010/06/14 13:25:40 pooka Exp $"); #include <sys/param.h> #include <sys/null.h> @@ -204,13 +204,31 @@ } void (*delay_func)(unsigned int) = rump_delay; +/* + * Provide weak aliases for tty routines used by printf. + * They will be used unless the rumpkern_tty component is present. + */ + +int rump_ttycheckoutq(struct tty *, int); int -ttycheckoutq(struct tty *tp, int wait) +rump_ttycheckoutq(struct tty *tp, int wait) { return 1; } +__weak_alias(ttycheckoutq,rump_ttycheckoutq); +int rump_tputchar(int, int, struct tty *); +int +rump_tputchar(int c, int flags, struct tty *tp) +{ + + cnputc(c); + return 0; +} +__weak_alias(tputchar,rump_tputchar); + +//struct cdevsw cons_cdevsw; void cnputc(int c) { @@ -226,14 +244,6 @@ /* done */ } -int -tputchar(int c, int flags, struct tty *tp) -{ - - cnputc(c); - return 0; -} - void cpu_reboot(int howto, char *bootstr) {