mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
hw/char: riscv_htif: Move registers from CPUArchState to HTIFState
At present for some unknown reason the HTIF registers (fromhost & tohost) are defined in the RISC-V CPUArchState. It should really be put in the HTIFState struct as it is only meaningful to HTIF. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20221229091828.1945072-6-bmeng@tinylab.org> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
dadee9e3ce
commit
1237c2d694
5 changed files with 24 additions and 32 deletions
|
@ -23,7 +23,6 @@
|
|||
#include "chardev/char.h"
|
||||
#include "chardev/char-fe.h"
|
||||
#include "exec/memory.h"
|
||||
#include "target/riscv/cpu.h"
|
||||
|
||||
#define TYPE_HTIF_UART "riscv.htif.uart"
|
||||
|
||||
|
@ -31,11 +30,12 @@ typedef struct HTIFState {
|
|||
int allow_tohost;
|
||||
int fromhost_inprogress;
|
||||
|
||||
uint64_t tohost;
|
||||
uint64_t fromhost;
|
||||
hwaddr tohost_offset;
|
||||
hwaddr fromhost_offset;
|
||||
MemoryRegion mmio;
|
||||
|
||||
CPURISCVState *env;
|
||||
CharBackend chr;
|
||||
uint64_t pending_read;
|
||||
} HTIFState;
|
||||
|
@ -51,7 +51,7 @@ void htif_symbol_callback(const char *st_name, int st_info, uint64_t st_value,
|
|||
bool htif_uses_elf_symbols(void);
|
||||
|
||||
/* legacy pre qom */
|
||||
HTIFState *htif_mm_init(MemoryRegion *address_space, CPURISCVState *env,
|
||||
Chardev *chr, uint64_t nonelf_base);
|
||||
HTIFState *htif_mm_init(MemoryRegion *address_space, Chardev *chr,
|
||||
uint64_t nonelf_base);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue