199767f8919635c4928607450d9e0abb932109ceToomas Soome/*-
199767f8919635c4928607450d9e0abb932109ceToomas Soome * nullconsole.c
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Author: Doug Ambrisko <ambrisko@whistle.com>
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright (c) 2000 Whistle Communications, Inc.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Subject to the following obligations and disclaimer of warranty, use and
199767f8919635c4928607450d9e0abb932109ceToomas Soome * redistribution of this software, in source or object code forms, with or
199767f8919635c4928607450d9e0abb932109ceToomas Soome * without modifications are expressly permitted by Whistle Communications;
199767f8919635c4928607450d9e0abb932109ceToomas Soome * provided, however, that:
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 1. Any and all reproductions of the source or object code must include the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * copyright notice above and the following disclaimer of warranties; and
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 2. No rights are granted, in any manner or form, to use Whistle
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Communications, Inc. trademarks, including the mark "WHISTLE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * COMMUNICATIONS" on advertising, endorsements, or otherwise except as
199767f8919635c4928607450d9e0abb932109ceToomas Soome * such appears in the above copyright notice or in the software.
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
199767f8919635c4928607450d9e0abb932109ceToomas Soome * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
199767f8919635c4928607450d9e0abb932109ceToomas Soome * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
199767f8919635c4928607450d9e0abb932109ceToomas Soome * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
199767f8919635c4928607450d9e0abb932109ceToomas Soome * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
199767f8919635c4928607450d9e0abb932109ceToomas Soome * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
199767f8919635c4928607450d9e0abb932109ceToomas Soome * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
199767f8919635c4928607450d9e0abb932109ceToomas Soome * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
199767f8919635c4928607450d9e0abb932109ceToomas Soome * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
199767f8919635c4928607450d9e0abb932109ceToomas Soome * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
199767f8919635c4928607450d9e0abb932109ceToomas Soome * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
199767f8919635c4928607450d9e0abb932109ceToomas Soome * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OF SUCH DAMAGE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome */
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <sys/cdefs.h>
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <stand.h>
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <bootstrap.h>
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic void nullc_probe(struct console *cp);
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int nullc_init(struct console *, int arg);
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic void nullc_putchar(struct console *, int c);
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int nullc_getchar(struct console *);
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int nullc_ischar(struct console *);
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomestruct console nullconsole = {
199767f8919635c4928607450d9e0abb932109ceToomas Soome "null",
199767f8919635c4928607450d9e0abb932109ceToomas Soome "null port",
199767f8919635c4928607450d9e0abb932109ceToomas Soome 0,
199767f8919635c4928607450d9e0abb932109ceToomas Soome nullc_probe,
199767f8919635c4928607450d9e0abb932109ceToomas Soome nullc_init,
199767f8919635c4928607450d9e0abb932109ceToomas Soome nullc_putchar,
199767f8919635c4928607450d9e0abb932109ceToomas Soome nullc_getchar,
199767f8919635c4928607450d9e0abb932109ceToomas Soome nullc_ischar,
199767f8919635c4928607450d9e0abb932109ceToomas Soome NULL
199767f8919635c4928607450d9e0abb932109ceToomas Soome};
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic void
199767f8919635c4928607450d9e0abb932109ceToomas Soomenullc_probe(struct console *cp)
199767f8919635c4928607450d9e0abb932109ceToomas Soome{
199767f8919635c4928607450d9e0abb932109ceToomas Soome cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT);
199767f8919635c4928607450d9e0abb932109ceToomas Soome}
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int
199767f8919635c4928607450d9e0abb932109ceToomas Soomenullc_init(struct console *cp __attribute((unused)),
199767f8919635c4928607450d9e0abb932109ceToomas Soome int arg __attribute((unused)))
199767f8919635c4928607450d9e0abb932109ceToomas Soome{
199767f8919635c4928607450d9e0abb932109ceToomas Soome return(0);
199767f8919635c4928607450d9e0abb932109ceToomas Soome}
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic void
199767f8919635c4928607450d9e0abb932109ceToomas Soomenullc_putchar(struct console *cp __attribute((unused)),
199767f8919635c4928607450d9e0abb932109ceToomas Soome int c __attribute((unused)))
199767f8919635c4928607450d9e0abb932109ceToomas Soome{
199767f8919635c4928607450d9e0abb932109ceToomas Soome}
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int
199767f8919635c4928607450d9e0abb932109ceToomas Soomenullc_getchar(struct console *cp __attribute((unused)))
199767f8919635c4928607450d9e0abb932109ceToomas Soome{
199767f8919635c4928607450d9e0abb932109ceToomas Soome return(-1);
199767f8919635c4928607450d9e0abb932109ceToomas Soome}
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int
199767f8919635c4928607450d9e0abb932109ceToomas Soomenullc_ischar(struct console *cp __attribute((unused)))
199767f8919635c4928607450d9e0abb932109ceToomas Soome{
199767f8919635c4928607450d9e0abb932109ceToomas Soome return(0);
199767f8919635c4928607450d9e0abb932109ceToomas Soome}