2 * Copyright (c) 2010 Broadcom Corporation
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #define CBUF_LEN (128)
19 #define LOG_BUF_LEN 1024
22 u32 buf; /* Can't be pointer on (64-bit) hosts */
25 char *_buf_compat; /* Redundant pointer for backward compat. */
30 * When there is no UART (e.g. Quickturn),
31 * the host should write a complete
32 * input line directly into cbuf and then write
33 * the length into vcons_in.
34 * This may also be used when there is a real UART
35 * (at risk of conflicting with
36 * the real UART). vcons_out is currently unused.
38 volatile uint vcons_in;
39 volatile uint vcons_out;
41 /* Output (logging) buffer
42 * Console output is written to a ring buffer log_buf at index log_idx.
43 * The host may read the output when it sees log_idx advance.
44 * Output will be lost if the output wraps around faster than the host
49 /* Console input line buffer
50 * Characters are read one at a time into cbuf
51 * until <CR> is received, then
52 * the buffer is processed as a command line.
53 * Also used for virtual UART.