mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
hw/misc: Convert TYPE_MOS6522 subclasses to 3-phase reset
Convert the various subclasses of TYPE_MOS6522 to 3-phase reset. This removes some uses of device_class_set_parent_reset(), which we would eventually like to be able to get rid of. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20221110143459.3833425-3-peter.maydell@linaro.org
This commit is contained in:
parent
8bdaed0f30
commit
ed053e8997
4 changed files with 33 additions and 23 deletions
|
@ -589,12 +589,14 @@ static void mos6522_cuda_portB_write(MOS6522State *s)
|
|||
cuda_update(cs);
|
||||
}
|
||||
|
||||
static void mos6522_cuda_reset(DeviceState *dev)
|
||||
static void mos6522_cuda_reset_hold(Object *obj)
|
||||
{
|
||||
MOS6522State *ms = MOS6522(dev);
|
||||
MOS6522State *ms = MOS6522(obj);
|
||||
MOS6522DeviceClass *mdc = MOS6522_GET_CLASS(ms);
|
||||
|
||||
mdc->parent_reset(dev);
|
||||
if (mdc->parent_phases.hold) {
|
||||
mdc->parent_phases.hold(obj);
|
||||
}
|
||||
|
||||
ms->timers[0].frequency = CUDA_TIMER_FREQ;
|
||||
ms->timers[1].frequency = (SCALE_US * 6000) / 4700;
|
||||
|
@ -602,11 +604,11 @@ static void mos6522_cuda_reset(DeviceState *dev)
|
|||
|
||||
static void mos6522_cuda_class_init(ObjectClass *oc, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
ResettableClass *rc = RESETTABLE_CLASS(oc);
|
||||
MOS6522DeviceClass *mdc = MOS6522_CLASS(oc);
|
||||
|
||||
device_class_set_parent_reset(dc, mos6522_cuda_reset,
|
||||
&mdc->parent_reset);
|
||||
resettable_class_set_parent_phases(rc, NULL, mos6522_cuda_reset_hold,
|
||||
NULL, &mdc->parent_phases);
|
||||
mdc->portB_write = mos6522_cuda_portB_write;
|
||||
mdc->get_timer1_counter_value = cuda_get_counter_value;
|
||||
mdc->get_timer2_counter_value = cuda_get_counter_value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue