From 55c86cb8038d8a2db792712fd27b4f486ee09c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 11 Feb 2023 00:17:51 +0100 Subject: hw/rtc/mc146818rtc: Pass MC146818RtcState instead of ISADevice argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rtc_get_memory() and rtc_set_memory() methods can not take any TYPE_ISA_DEVICE object. They expect a TYPE_MC146818_RTC one. Simplify the API by passing a MC146818RtcState. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230210233116.80311-3-philmd@linaro.org> --- hw/i386/x86.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hw/i386/x86.c') diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 5f28dc8390..38d2ec0581 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -150,8 +150,10 @@ void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version) } } -void x86_rtc_set_cpus_count(ISADevice *rtc, uint16_t cpus_count) +void x86_rtc_set_cpus_count(ISADevice *s, uint16_t cpus_count) { + MC146818RtcState *rtc = MC146818_RTC(s); + if (cpus_count > 0xff) { /* * If the number of CPUs can't be represented in 8 bits, the -- cgit v1.2.3