mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
hw/rtc: Rename rtc_[get|set]_memory -> mc146818rtc_[get|set]_cmos_data
rtc_get_memory() and rtc_set_memory() helpers only work with
TYPE_MC146818_RTC devices. 'memory' in their name refer to
the CMOS region. Rename them as mc146818rtc_get_cmos_data()
and mc146818rtc_set_cmos_data() to be explicit about what
they are doing.
Mechanical change doing:
$ sed -i -e 's/rtc_set_memory/mc146818rtc_set_cmos_data/g' \
$(git grep -wl rtc_set_memory)
$ sed -i -e 's/rtc_get_memory/mc146818rtc_get_cmos_data/g' \
$(git grep -wl rtc_get_memory)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230210233116.80311-4-philmd@linaro.org>
This commit is contained in:
@@ -739,13 +739,13 @@ static uint64_t cmos_ioport_read(void *opaque, hwaddr addr,
|
||||
}
|
||||
}
|
||||
|
||||
void rtc_set_memory(MC146818RtcState *s, int addr, int val)
|
||||
void mc146818rtc_set_cmos_data(MC146818RtcState *s, int addr, int val)
|
||||
{
|
||||
if (addr >= 0 && addr <= 127)
|
||||
s->cmos_data[addr] = val;
|
||||
}
|
||||
|
||||
int rtc_get_memory(MC146818RtcState *s, int addr)
|
||||
int mc146818rtc_get_cmos_data(MC146818RtcState *s, int addr)
|
||||
{
|
||||
assert(addr >= 0 && addr <= 127);
|
||||
return s->cmos_data[addr];
|
||||
@@ -857,7 +857,7 @@ static void rtc_notify_suspend(Notifier *notifier, void *data)
|
||||
{
|
||||
MC146818RtcState *s = container_of(notifier, MC146818RtcState,
|
||||
suspend_notifier);
|
||||
rtc_set_memory(s, 0xF, 0xFE);
|
||||
mc146818rtc_set_cmos_data(s, 0xF, 0xFE);
|
||||
}
|
||||
|
||||
static const MemoryRegionOps cmos_ops = {
|
||||
|
||||
Reference in New Issue
Block a user