From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Bin Meng" <bin.meng@windriver.com>,
qemu-riscv@nongnu.org (open list:RISC-V TCG CPUs)
Subject: [PATCH v7 31/40] target/riscv: Restrict has_work() handler to sysemu and TCG
Date: Sat, 25 Sep 2021 16:51:09 +0200 [thread overview]
Message-ID: <20210925145118.1361230-32-f4bug@amsat.org> (raw)
In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org>
Restrict has_work() to TCG sysemu.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/riscv/cpu.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 7c626d89cd7..ca76bc34d9b 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -335,9 +335,9 @@ static void riscv_cpu_synchronize_from_tb(CPUState *cs,
env->pc = tb->pc;
}
+#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
static bool riscv_cpu_has_work(CPUState *cs)
{
-#ifndef CONFIG_USER_ONLY
RISCVCPU *cpu = RISCV_CPU(cs);
CPURISCVState *env = &cpu->env;
/*
@@ -345,10 +345,8 @@ static bool riscv_cpu_has_work(CPUState *cs)
* mode and delegation registers, but respect individual enables
*/
return (env->mip & env->mie) != 0;
-#else
- return true;
-#endif
}
+#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */
void restore_state_to_opc(CPURISCVState *env, TranslationBlock *tb,
target_ulong *data)
@@ -678,6 +676,7 @@ static const struct TCGCPUOps riscv_tcg_ops = {
.tlb_fill = riscv_cpu_tlb_fill,
#ifndef CONFIG_USER_ONLY
+ .has_work = riscv_cpu_has_work,
.cpu_exec_interrupt = riscv_cpu_exec_interrupt,
.do_interrupt = riscv_cpu_do_interrupt,
.do_transaction_failed = riscv_cpu_do_transaction_failed,
@@ -697,7 +696,6 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data)
device_class_set_parent_reset(dc, riscv_cpu_reset, &mcc->parent_reset);
cc->class_by_name = riscv_cpu_class_by_name;
- cc->has_work = riscv_cpu_has_work;
cc->dump_state = riscv_cpu_dump_state;
cc->set_pc = riscv_cpu_set_pc;
cc->gdb_read_register = riscv_cpu_gdb_read_register;
--
2.31.1
parent reply other threads:[~2021-09-25 14:53 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20210925145118.1361230-1-f4bug@amsat.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210925145118.1361230-32-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=alistair.francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).