1 /*
2  * Copyright (c) 2019 LK Trusty Authors. All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining
5  * a copy of this software and associated documentation files
6  * (the "Software"), to deal in the Software without restriction,
7  * including without limitation the rights to use, copy, modify, merge,
8  * publish, distribute, sublicense, and/or sell copies of the Software,
9  * and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  */
23 
24 #pragma once
25 #include <virtio.h>
26 
27 /**
28  * virtio_probe_console() - Probe Virtio console device
29  *
30  * Return: Base address of the Virtio device specific configuration structure
31  */
32 struct virtio_config* virtio_probe_console(void);
33 
34 /**
35  * virtio_or_status() - Set status bit of Virtio device
36  * @vio:    The Virtio device to set feature bit on
37  * @flags:  The feature bit to be set
38  */
39 void virtio_or_status(struct virtio_config* vio, uint32_t flags);
40 
41 /**
42  * virtio_get_status() - Get status of Virtio device
43  * @vio:    The Virtio device to get status from
44  *
45  * Return: Status of the Virtio device
46  */
47 uint32_t virtio_get_status(struct virtio_config* vio);
48 
49 /**
50  * virtio_reset_device() - Reset Virtio device
51  * @vio:    The Virtio device to be reset
52  */
53 void virtio_reset_device(struct virtio_config* vio);
54 
55 /**
56  * virtio_set_guest_page_size() - Set guest page size of Virtio device
57  * @vio:    The Virtio device to set guest page size on
58  * @size:   Size of guest page
59  */
60 void virtio_set_guest_page_size(struct virtio_config* vio, uint32_t size);
61