spinconsole.c revision 119482
1119482Sobrien/*-
266133Sarchie * nullconsole.c
366133Sarchie *
4119482Sobrien * Author: Doug Ambrisko <ambrisko@whistle.com>
566133Sarchie * Copyright (c) 2000 Whistle Communications, Inc.
666133Sarchie * All rights reserved.
766133Sarchie *
866133Sarchie * Subject to the following obligations and disclaimer of warranty, use and
966133Sarchie * redistribution of this software, in source or object code forms, with or
1066133Sarchie * without modifications are expressly permitted by Whistle Communications;
1166133Sarchie * provided, however, that:
1266133Sarchie * 1. Any and all reproductions of the source or object code must include the
1366133Sarchie *    copyright notice above and the following disclaimer of warranties; and
1466133Sarchie * 2. No rights are granted, in any manner or form, to use Whistle
1566133Sarchie *    Communications, Inc. trademarks, including the mark "WHISTLE
1666133Sarchie *    COMMUNICATIONS" on advertising, endorsements, or otherwise except as
1766133Sarchie *    such appears in the above copyright notice or in the software.
1866133Sarchie *
1966133Sarchie * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
2066133Sarchie * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
2166133Sarchie * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
2266133Sarchie * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
2366133Sarchie * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
2466133Sarchie * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
2566133Sarchie * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
2666133Sarchie * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
2766133Sarchie * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
2866133Sarchie * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
2966133Sarchie * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
3066133Sarchie * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
3166133Sarchie * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
3266133Sarchie * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3366133Sarchie * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3466133Sarchie * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
3566133Sarchie * OF SUCH DAMAGE.
3666133Sarchie */
3766133Sarchie
38119482Sobrien#include <sys/cdefs.h>
39119482Sobrien__FBSDID("$FreeBSD: head/sys/boot/i386/libi386/nullconsole.c 119482 2003-08-25 23:28:32Z obrien $");
40119482Sobrien
4166133Sarchie#include <stand.h>
4266133Sarchie#include <bootstrap.h>
4366133Sarchie
4466133Sarchiestatic void	nullc_probe(struct console *cp);
4566133Sarchiestatic int	nullc_init(int arg);
4666133Sarchiestatic void	nullc_putchar(int c);
4766133Sarchiestatic int	nullc_getchar(void);
4866133Sarchiestatic int	nullc_ischar(void);
4966133Sarchie
5066133Sarchiestruct console nullconsole = {
5166133Sarchie	"nullconsole",
5266133Sarchie	"null port",
5366133Sarchie	0,
5466133Sarchie	nullc_probe,
5566133Sarchie	nullc_init,
5666133Sarchie	nullc_putchar,
5766133Sarchie	nullc_getchar,
5866133Sarchie	nullc_ischar
5966133Sarchie};
6066133Sarchie
6166133Sarchiestatic void
6266133Sarchienullc_probe(struct console *cp)
6366133Sarchie{
6466133Sarchie	cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT);
6566133Sarchie}
6666133Sarchie
6766133Sarchiestatic int
6866133Sarchienullc_init(int arg)
6966133Sarchie{
7066133Sarchie	return(0);
7166133Sarchie}
7266133Sarchie
7366133Sarchiestatic void
7466133Sarchienullc_putchar(int c)
7566133Sarchie{
7666133Sarchie}
7766133Sarchie
7866133Sarchiestatic int
7966133Sarchienullc_getchar(void)
8066133Sarchie{
8166133Sarchie	return(-1);
8266133Sarchie}
8366133Sarchie
8466133Sarchiestatic int
8566133Sarchienullc_ischar(void)
8666133Sarchie{
8766133Sarchie	return(0);
8866133Sarchie}
89