@@ -16,6 +16,10 @@
* struct SysemuCPUOps: System operations specific to a CPU class
*/
typedef struct SysemuCPUOps {
+ /**
+ * @has_work: Callback for checking if there is work to do.
+ */
+ bool (*has_work)(CPUState *cpu);
/**
* @get_memory_mapping: Callback for obtaining the memory mappings.
*/
@@ -141,7 +141,7 @@ struct TCGCPUOps {
*
* This method must be provided. If the target does not need to
* do anything special for halt, the same function used for its
- * CPUClass::has_work method can be used here, as they have the
+ * SysemuCPUOps::has_work method can be used here, as they have the
* same function signature.
*/
bool (*cpu_exec_halt)(CPUState *cpu);
@@ -25,6 +25,10 @@
bool cpu_has_work(CPUState *cpu)
{
+ if (cpu->cc->sysemu_ops->has_work) {
+ return cpu->cc->sysemu_ops->has_work(cpu);
+ }
+
g_assert(cpu->cc->has_work);
return cpu->cc->has_work(cpu);
}