docs/devel/reset: Update to new API for hold and exit phase methods
Update the reset documentation's example code to match the new API for the hold and exit phase method APIs where they take a ResetType argument. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Luc Michel <luc.michel@amd.com> Message-id: 20240412160809.1260625-6-peter.maydell@linaro.org
This commit is contained in:
parent
ad80e36744
commit
41d49ec190
@ -150,25 +150,25 @@ in reset.
|
|||||||
mydev->var = 0;
|
mydev->var = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mydev_reset_hold(Object *obj)
|
static void mydev_reset_hold(Object *obj, ResetType type)
|
||||||
{
|
{
|
||||||
MyDevClass *myclass = MYDEV_GET_CLASS(obj);
|
MyDevClass *myclass = MYDEV_GET_CLASS(obj);
|
||||||
MyDevState *mydev = MYDEV(obj);
|
MyDevState *mydev = MYDEV(obj);
|
||||||
/* call parent class hold phase */
|
/* call parent class hold phase */
|
||||||
if (myclass->parent_phases.hold) {
|
if (myclass->parent_phases.hold) {
|
||||||
myclass->parent_phases.hold(obj);
|
myclass->parent_phases.hold(obj, type);
|
||||||
}
|
}
|
||||||
/* set an IO */
|
/* set an IO */
|
||||||
qemu_set_irq(mydev->irq, 1);
|
qemu_set_irq(mydev->irq, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mydev_reset_exit(Object *obj)
|
static void mydev_reset_exit(Object *obj, ResetType type)
|
||||||
{
|
{
|
||||||
MyDevClass *myclass = MYDEV_GET_CLASS(obj);
|
MyDevClass *myclass = MYDEV_GET_CLASS(obj);
|
||||||
MyDevState *mydev = MYDEV(obj);
|
MyDevState *mydev = MYDEV(obj);
|
||||||
/* call parent class exit phase */
|
/* call parent class exit phase */
|
||||||
if (myclass->parent_phases.exit) {
|
if (myclass->parent_phases.exit) {
|
||||||
myclass->parent_phases.exit(obj);
|
myclass->parent_phases.exit(obj, type);
|
||||||
}
|
}
|
||||||
/* clear an IO */
|
/* clear an IO */
|
||||||
qemu_set_irq(mydev->irq, 0);
|
qemu_set_irq(mydev->irq, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user