1 /*
2  * ioreq.h: Hardware virtual machine assist interface definitions.
3  *
4  * Copyright (c) 2016 Citrix Systems Inc.
5  * Copyright (c) 2019 Arm ltd.
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms and conditions of the GNU General Public License,
9  * version 2, as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program; If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef __ASM_ARM_IOREQ_H__
21 #define __ASM_ARM_IOREQ_H__
22 
23 #ifdef CONFIG_IOREQ_SERVER
24 enum io_state handle_ioserv(struct cpu_user_regs *regs, struct vcpu *v);
25 enum io_state try_fwd_ioserv(struct cpu_user_regs *regs,
26                              struct vcpu *v, mmio_info_t *info);
27 #else
handle_ioserv(struct cpu_user_regs * regs,struct vcpu * v)28 static inline enum io_state handle_ioserv(struct cpu_user_regs *regs,
29                                           struct vcpu *v)
30 {
31     return IO_UNHANDLED;
32 }
33 
try_fwd_ioserv(struct cpu_user_regs * regs,struct vcpu * v,mmio_info_t * info)34 static inline enum io_state try_fwd_ioserv(struct cpu_user_regs *regs,
35                                            struct vcpu *v, mmio_info_t *info)
36 {
37     return IO_UNHANDLED;
38 }
39 #endif
40 
handle_pio(uint16_t port,unsigned int size,int dir)41 static inline bool handle_pio(uint16_t port, unsigned int size, int dir)
42 {
43     /*
44      * TODO: For Arm64, the main user will be PCI. So this should be
45      * implemented when we add support for vPCI.
46      */
47     ASSERT_UNREACHABLE();
48     return true;
49 }
50 
msix_write_completion(struct vcpu * v)51 static inline void msix_write_completion(struct vcpu *v)
52 {
53 }
54 
55 /* This correlation must not be altered */
56 #define IOREQ_STATUS_HANDLED     IO_HANDLED
57 #define IOREQ_STATUS_UNHANDLED   IO_UNHANDLED
58 #define IOREQ_STATUS_RETRY       IO_RETRY
59 
60 #endif /* __ASM_ARM_IOREQ_H__ */
61 
62 /*
63  * Local variables:
64  * mode: C
65  * c-file-style: "BSD"
66  * c-basic-offset: 4
67  * tab-width: 4
68  * indent-tabs-mode: nil
69  * End:
70  */
71