[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/27] hw/core/resettable: Remove transitional_function machinery
From: |
Peter Maydell |
Subject: |
[PULL 11/27] hw/core/resettable: Remove transitional_function machinery |
Date: |
Fri, 13 Sep 2024 16:13:55 +0100 |
We used to need the transitional_function machinery to handle bus
classes and device classes which still used their legacy reset
handling. We have now converted all bus classes to three phase
reset, and simplified the device class legacy reset so it is just an
adapting wrapper function around registration of a hold phase method.
There are therefore no more users of the transitional_function
machinery and we can remove it.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20240830145812.1967042-12-peter.maydell@linaro.org
---
include/hw/resettable.h | 13 -------------
hw/core/resettable.c | 24 +++---------------------
2 files changed, 3 insertions(+), 34 deletions(-)
diff --git a/include/hw/resettable.h b/include/hw/resettable.h
index 83b561fc830..94f6f22e3cf 100644
--- a/include/hw/resettable.h
+++ b/include/hw/resettable.h
@@ -90,14 +90,6 @@ typedef enum ResetType {
* @get_state: Mandatory method which must return a pointer to a
* ResettableState.
*
- * @get_transitional_function: transitional method to handle Resettable objects
- * not yet fully moved to this interface. It will be removed as soon as it is
- * not needed anymore. This method is optional and may return a pointer to a
- * function to be used instead of the phases. If the method exists and returns
- * a non-NULL function pointer then that function is executed as a replacement
- * of the 'hold' phase method taking the object as argument. The two other
phase
- * methods are not executed.
- *
* @child_foreach: Executes a given callback on every Resettable child. Child
* in this context means a child in the qbus tree, so the children of a qbus
* are the devices on it, and the children of a device are all the buses it
@@ -109,8 +101,6 @@ typedef void (*ResettableEnterPhase)(Object *obj, ResetType
type);
typedef void (*ResettableHoldPhase)(Object *obj, ResetType type);
typedef void (*ResettableExitPhase)(Object *obj, ResetType type);
typedef ResettableState * (*ResettableGetState)(Object *obj);
-typedef void (*ResettableTrFunction)(Object *obj);
-typedef ResettableTrFunction (*ResettableGetTrFunction)(Object *obj);
typedef void (*ResettableChildCallback)(Object *, void *opaque,
ResetType type);
typedef void (*ResettableChildForeach)(Object *obj,
@@ -130,9 +120,6 @@ struct ResettableClass {
/* State access method */
ResettableGetState get_state;
- /* Transitional method for legacy reset compatibility */
- ResettableGetTrFunction get_transitional_function;
-
/* Hierarchy handling method */
ResettableChildForeach child_foreach;
};
diff --git a/hw/core/resettable.c b/hw/core/resettable.c
index 6dd3e3dc487..5cdb4a4f8d3 100644
--- a/hw/core/resettable.c
+++ b/hw/core/resettable.c
@@ -93,20 +93,6 @@ static void resettable_child_foreach(ResettableClass *rc,
Object *obj,
}
}
-/**
- * resettable_get_tr_func:
- * helper to fetch transitional reset callback if any.
- */
-static ResettableTrFunction resettable_get_tr_func(ResettableClass *rc,
- Object *obj)
-{
- ResettableTrFunction tr_func = NULL;
- if (rc->get_transitional_function) {
- tr_func = rc->get_transitional_function(obj);
- }
- return tr_func;
-}
-
static void resettable_phase_enter(Object *obj, void *opaque, ResetType type)
{
ResettableClass *rc = RESETTABLE_GET_CLASS(obj);
@@ -146,7 +132,7 @@ static void resettable_phase_enter(Object *obj, void
*opaque, ResetType type)
if (action_needed) {
trace_resettable_phase_enter_exec(obj, obj_typename, type,
!!rc->phases.enter);
- if (rc->phases.enter && !resettable_get_tr_func(rc, obj)) {
+ if (rc->phases.enter) {
rc->phases.enter(obj, type);
}
s->hold_phase_pending = true;
@@ -171,12 +157,8 @@ static void resettable_phase_hold(Object *obj, void
*opaque, ResetType type)
/* exec hold phase */
if (s->hold_phase_pending) {
s->hold_phase_pending = false;
- ResettableTrFunction tr_func = resettable_get_tr_func(rc, obj);
trace_resettable_phase_hold_exec(obj, obj_typename, !!rc->phases.hold);
- if (tr_func) {
- trace_resettable_transitional_function(obj, obj_typename);
- tr_func(obj);
- } else if (rc->phases.hold) {
+ if (rc->phases.hold) {
rc->phases.hold(obj, type);
}
}
@@ -199,7 +181,7 @@ static void resettable_phase_exit(Object *obj, void
*opaque, ResetType type)
assert(s->count > 0);
if (--s->count == 0) {
trace_resettable_phase_exit_exec(obj, obj_typename, !!rc->phases.exit);
- if (rc->phases.exit && !resettable_get_tr_func(rc, obj)) {
+ if (rc->phases.exit) {
rc->phases.exit(obj, type);
}
}
--
2.34.1
- [PULL 23/27] hw/net/can/xlnx-versal-canfd: Fix FIFO issues, (continued)
- [PULL 23/27] hw/net/can/xlnx-versal-canfd: Fix FIFO issues, Peter Maydell, 2024/09/13
- [PULL 20/27] hw/net/can/xlnx-versal-canfd: Handle flags correctly, Peter Maydell, 2024/09/13
- [PULL 10/27] hw/core/qdev: Simplify legacy_reset handling, Peter Maydell, 2024/09/13
- [PULL 12/27] kvm: Use 'unsigned long' for request argument in functions wrapping ioctl(), Peter Maydell, 2024/09/13
- [PULL 18/27] hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check, Peter Maydell, 2024/09/13
- [PULL 22/27] hw/net/can/xlnx-versal-canfd: Simplify DLC conversions, Peter Maydell, 2024/09/13
- [PULL 27/27] hw/intc/arm_gic: fix spurious level triggered interrupts, Peter Maydell, 2024/09/13
- [PULL 19/27] hw/net/can/xlnx-versal-canfd: Translate CAN ID registers, Peter Maydell, 2024/09/13
- [PULL 15/27] hvf: arm: Implement and use hvf_get_physical_address_range, Peter Maydell, 2024/09/13
- [PULL 07/27] hw: Use device_class_set_legacy_reset() instead of opencoding, Peter Maydell, 2024/09/13
- [PULL 11/27] hw/core/resettable: Remove transitional_function machinery,
Peter Maydell <=
- [PULL 14/27] hvf: Split up hv_vm_create logic per arch, Peter Maydell, 2024/09/13
- [PULL 26/27] MAINTAINERS: Add my-self as CAN maintainer, Peter Maydell, 2024/09/13
- Re: [PULL 00/27] target-arm queue, Peter Maydell, 2024/09/13