]>
Commit | Line | Data |
---|---|---|
50336067 MC |
1 | /* |
2 | * QEMU RISCV Host Target Interface (HTIF) Emulation | |
3 | * | |
4 | * Copyright (c) 2016-2017 Sagar Karandikar, sagark@eecs.berkeley.edu | |
5 | * Copyright (c) 2017-2018 SiFive, Inc. | |
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 or later, 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 HW_RISCV_HTIF_H | |
21 | #define HW_RISCV_HTIF_H | |
22 | ||
50336067 MC |
23 | #include "chardev/char.h" |
24 | #include "chardev/char-fe.h" | |
50336067 | 25 | #include "exec/memory.h" |
50336067 MC |
26 | |
27 | #define TYPE_HTIF_UART "riscv.htif.uart" | |
28 | ||
29 | typedef struct HTIFState { | |
30 | int allow_tohost; | |
31 | int fromhost_inprogress; | |
32 | ||
1237c2d6 BM |
33 | uint64_t tohost; |
34 | uint64_t fromhost; | |
50336067 MC |
35 | hwaddr tohost_offset; |
36 | hwaddr fromhost_offset; | |
50336067 | 37 | MemoryRegion mmio; |
50336067 | 38 | |
50336067 MC |
39 | CharBackend chr; |
40 | uint64_t pending_read; | |
41 | } HTIFState; | |
42 | ||
66247edc WL |
43 | extern const char *sig_file; |
44 | extern uint8_t line_size; | |
45 | ||
50336067 MC |
46 | /* HTIF symbol callback */ |
47 | void htif_symbol_callback(const char *st_name, int st_info, uint64_t st_value, | |
48 | uint64_t st_size); | |
49 | ||
50 | /* legacy pre qom */ | |
1237c2d6 | 51 | HTIFState *htif_mm_init(MemoryRegion *address_space, Chardev *chr, |
71d68c48 | 52 | uint64_t nonelf_base, bool custom_base); |
50336067 MC |
53 | |
54 | #endif |