summary refs log tree commit diff stats
path: root/target/mips/cpu.h
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-10-12 11:57:54 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-10-17 13:59:40 +0200
commita0713e85bfaec4d787b978640096322716938a56 (patch)
treeda50692f413846d267b24a0d523fd37104810feb /target/mips/cpu.h
parentd0bec217ee0f6c948ba4579ca0f43a1a3f346cb4 (diff)
downloadfocaccia-qemu-a0713e85bfaec4d787b978640096322716938a56.tar.gz
focaccia-qemu-a0713e85bfaec4d787b978640096322716938a56.zip
target/mips/cpu: Allow the CPU to use dynamic frequencies
Use the Clock API and let the CPU object have an input clock.

If no clock is connected, keep using the default frequency of
200 MHz used since the introduction of the 'r4k' machine in
commit 6af0bf9c7c3.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20201012095804.3335117-12-f4bug@amsat.org>
Diffstat (limited to 'target/mips/cpu.h')
-rw-r--r--target/mips/cpu.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/mips/cpu.h b/target/mips/cpu.h
index baeceb892e..062a4ba622 100644
--- a/target/mips/cpu.h
+++ b/target/mips/cpu.h
@@ -4,6 +4,7 @@
 #include "cpu-qom.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat-types.h"
+#include "hw/clock.h"
 #include "mips-defs.h"
 
 #define TCG_GUEST_DEFAULT_MO (0)
@@ -1151,6 +1152,8 @@ struct CPUMIPSState {
 /**
  * MIPSCPU:
  * @env: #CPUMIPSState
+ * @clock: this CPU input clock (may be connected
+ *         to an output clock from another device).
  * @cp0_count_rate: rate at which the coprocessor 0 counter increments
  *
  * A MIPS CPU.
@@ -1160,6 +1163,7 @@ struct MIPSCPU {
     CPUState parent_obj;
     /*< public >*/
 
+    Clock *clock;
     CPUNegativeOffsetState neg;
     CPUMIPSState env;
     /*