tests: Restore check-qdict unit test
[qemu/armbru.git] / include / hw / riscv / riscv_htif.h
blobfb5f88129e99b84058491d5a66b6576e1d8630f6
1 /*
2 * QEMU RISCV Host Target Interface (HTIF) Emulation
4 * Copyright (c) 2016-2017 Sagar Karandikar, sagark@eecs.berkeley.edu
5 * Copyright (c) 2017-2018 SiFive, Inc.
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 or later, as published by the Free Software Foundation.
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.
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/>.
20 #ifndef HW_RISCV_HTIF_H
21 #define HW_RISCV_HTIF_H
23 #include "hw/hw.h"
24 #include "chardev/char.h"
25 #include "chardev/char-fe.h"
26 #include "sysemu/sysemu.h"
27 #include "exec/memory.h"
28 #include "target/riscv/cpu.h"
30 #define TYPE_HTIF_UART "riscv.htif.uart"
32 typedef struct HTIFState {
33 int allow_tohost;
34 int fromhost_inprogress;
36 hwaddr tohost_offset;
37 hwaddr fromhost_offset;
38 uint64_t tohost_size;
39 uint64_t fromhost_size;
40 MemoryRegion mmio;
41 MemoryRegion *address_space;
42 MemoryRegion *main_mem;
43 void *main_mem_ram_ptr;
45 CPURISCVState *env;
46 CharBackend chr;
47 uint64_t pending_read;
48 } HTIFState;
50 extern const VMStateDescription vmstate_htif;
51 extern const MemoryRegionOps htif_io_ops;
53 /* HTIF symbol callback */
54 void htif_symbol_callback(const char *st_name, int st_info, uint64_t st_value,
55 uint64_t st_size);
57 /* legacy pre qom */
58 HTIFState *htif_mm_init(MemoryRegion *address_space, MemoryRegion *main_mem,
59 CPURISCVState *env, Chardev *chr);
61 #endif