diff options
| author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-10-12 11:57:53 +0200 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2020-10-17 11:13:15 +0200 |
| commit | d0bec217ee0f6c948ba4579ca0f43a1a3f346cb4 (patch) | |
| tree | 2b7642eba94be8849c9089d67fe97200cbd42812 /target/mips/cpu.h | |
| parent | 68b981aa76079216f5765a6aecaf8728f27d3696 (diff) | |
| download | focaccia-qemu-d0bec217ee0f6c948ba4579ca0f43a1a3f346cb4.tar.gz focaccia-qemu-d0bec217ee0f6c948ba4579ca0f43a1a3f346cb4.zip | |
target/mips/cpu: Make cp0_count_rate a property
Since not all CPU implementations use a cores use a CP0 timer at half the frequency of the CPU, make this variable a property. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201012095804.3335117-11-f4bug@amsat.org>
Diffstat (limited to 'target/mips/cpu.h')
| -rw-r--r-- | target/mips/cpu.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 085a88e955..baeceb892e 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1151,6 +1151,7 @@ struct CPUMIPSState { /** * MIPSCPU: * @env: #CPUMIPSState + * @cp0_count_rate: rate at which the coprocessor 0 counter increments * * A MIPS CPU. */ @@ -1161,6 +1162,14 @@ struct MIPSCPU { CPUNegativeOffsetState neg; CPUMIPSState env; + /* + * The Count register acts as a timer, incrementing at a constant rate, + * whether or not an instruction is executed, retired, or any forward + * progress is made through the pipeline. The rate at which the counter + * increments is implementation dependent, and is a function of the + * pipeline clock of the processor, not the issue width of the processor. + */ + unsigned cp0_count_rate; }; |