xref: /openbmc/qemu/include/hw/xen/interface/io/console.h (revision a3434a2d56aee3018f4a0f55c7e0f0cda11f3d9e)
1*a3434a2dSAnthony PERARD /******************************************************************************
2*a3434a2dSAnthony PERARD  * console.h
3*a3434a2dSAnthony PERARD  *
4*a3434a2dSAnthony PERARD  * Console I/O interface for Xen guest OSes.
5*a3434a2dSAnthony PERARD  *
6*a3434a2dSAnthony PERARD  * Permission is hereby granted, free of charge, to any person obtaining a copy
7*a3434a2dSAnthony PERARD  * of this software and associated documentation files (the "Software"), to
8*a3434a2dSAnthony PERARD  * deal in the Software without restriction, including without limitation the
9*a3434a2dSAnthony PERARD  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10*a3434a2dSAnthony PERARD  * sell copies of the Software, and to permit persons to whom the Software is
11*a3434a2dSAnthony PERARD  * furnished to do so, subject to the following conditions:
12*a3434a2dSAnthony PERARD  *
13*a3434a2dSAnthony PERARD  * The above copyright notice and this permission notice shall be included in
14*a3434a2dSAnthony PERARD  * all copies or substantial portions of the Software.
15*a3434a2dSAnthony PERARD  *
16*a3434a2dSAnthony PERARD  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17*a3434a2dSAnthony PERARD  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18*a3434a2dSAnthony PERARD  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19*a3434a2dSAnthony PERARD  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20*a3434a2dSAnthony PERARD  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21*a3434a2dSAnthony PERARD  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22*a3434a2dSAnthony PERARD  * DEALINGS IN THE SOFTWARE.
23*a3434a2dSAnthony PERARD  *
24*a3434a2dSAnthony PERARD  * Copyright (c) 2005, Keir Fraser
25*a3434a2dSAnthony PERARD  */
26*a3434a2dSAnthony PERARD 
27*a3434a2dSAnthony PERARD #ifndef __XEN_PUBLIC_IO_CONSOLE_H__
28*a3434a2dSAnthony PERARD #define __XEN_PUBLIC_IO_CONSOLE_H__
29*a3434a2dSAnthony PERARD 
30*a3434a2dSAnthony PERARD typedef uint32_t XENCONS_RING_IDX;
31*a3434a2dSAnthony PERARD 
32*a3434a2dSAnthony PERARD #define MASK_XENCONS_IDX(idx, ring) ((idx) & (sizeof(ring)-1))
33*a3434a2dSAnthony PERARD 
34*a3434a2dSAnthony PERARD struct xencons_interface {
35*a3434a2dSAnthony PERARD     char in[1024];
36*a3434a2dSAnthony PERARD     char out[2048];
37*a3434a2dSAnthony PERARD     XENCONS_RING_IDX in_cons, in_prod;
38*a3434a2dSAnthony PERARD     XENCONS_RING_IDX out_cons, out_prod;
39*a3434a2dSAnthony PERARD };
40*a3434a2dSAnthony PERARD 
41*a3434a2dSAnthony PERARD #ifdef XEN_WANT_FLEX_CONSOLE_RING
42*a3434a2dSAnthony PERARD #include "ring.h"
43*a3434a2dSAnthony PERARD DEFINE_XEN_FLEX_RING(xencons);
44*a3434a2dSAnthony PERARD #endif
45*a3434a2dSAnthony PERARD 
46*a3434a2dSAnthony PERARD #endif /* __XEN_PUBLIC_IO_CONSOLE_H__ */
47