On 25/03/29 06:42PM, Philippe Mathieu-Daudé wrote: > Hi Aditya, > > On 29/3/25 15:26, Aditya Gupta wrote: > > <...snip...> > > > > --- a/target/ppc/cpu-models.c > > +++ b/target/ppc/cpu-models.c > > @@ -32,17 +32,22 @@ > > /* PowerPC CPU definitions > > */ > > #define POWERPC_DEF_PREFIX(pvr, svr, type) > > \ > > glue(glue(glue(glue(pvr, _), svr), _), type) > > -#define POWERPC_DEF_SVR(_name, _desc, _pvr, _svr, _type) > > \ > > +#define POWERPC_DEF_SVR_DEPR(_name, _desc, _pvr, _svr, _type, > > _is_deprecated) \ > > static void > > \ > > glue(POWERPC_DEF_PREFIX(_pvr, _svr, _type), _cpu_class_init) > > \ > > (ObjectClass *oc, void *data) > > \ > > { > > \ > > DeviceClass *dc = DEVICE_CLASS(oc); > > \ > > + CPUClass *cc = CPU_CLASS(oc); > > \ > > PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); > > \ > > > > \ > > pcc->pvr = _pvr; > > \ > > pcc->svr = _svr; > > \ > > dc->desc = _desc; > > \ > > + > > \ > > + if (_is_deprecated) { > > \ > > + cc->deprecation_note = "CPU is unmaintained."; > > \ > > The CPUs deprecated in this patch are indeed unmaintained, but maybe > future deprecated ones will have a different reason. > > Maybe use s/_is_deprecated/_deprecation_note/, so passing a NULL > deprecation note is OK? > > cc->deprecation_note = _deprecation_note; \
Makes sense. Thanks, will pass a string then as deprecation message. > > > + } > > \ > > } > > \ > > > > \ > > static const TypeInfo > > \ > > @@ -63,6 +68,12 @@ > > type_init( > > \ > > glue(POWERPC_DEF_PREFIX(_pvr, _svr, _type), _cpu_register_types)) > > +#define POWERPC_DEF_SVR(_name, _desc, _pvr, _svr, _type) > > \ > > + POWERPC_DEF_SVR_DEPR(_name, _desc, _pvr, _svr, _type, false) > > POWERPC_DEF_SVR_DEPR(..., NULL) Got it. > > > +#define POWERPC_DEPRECATED_CPU(_name, _pvr, _type, _desc) > > \ > > + POWERPC_DEF_SVR_DEPR(_name, _desc, _pvr, POWERPC_SVR_NONE, _type, true) > > + > > #define POWERPC_DEF(_name, _pvr, _type, _desc) > > \ > > POWERPC_DEF_SVR(_name, _desc, _pvr, POWERPC_SVR_NONE, _type) > > @@ -722,11 +733,11 @@ > > "POWER7 v2.3") > > POWERPC_DEF("power7p_v2.1", CPU_POWERPC_POWER7P_v21, > > POWER7, > > "POWER7+ v2.1") > > - POWERPC_DEF("power8e_v2.1", CPU_POWERPC_POWER8E_v21, > > POWER8, > > + POWERPC_DEPRECATED_CPU("power8e_v2.1", CPU_POWERPC_POWER8E_v21, > > POWER8, > > "POWER8E v2.1") > > POWERPC_DEF_SVR_DEPR("power8e_v2.1", CPU_POWERPC_POWER8E_v21, > POWER8, "POWER8E v2.1", > "CPU is unmaintained") Got it. > > > POWERPC_DEF("power8_v2.0", CPU_POWERPC_POWER8_v20, > > POWER8, > > "POWER8 v2.0") > > - POWERPC_DEF("power8nvl_v1.0", CPU_POWERPC_POWER8NVL_v10, > > POWER8, > > + POWERPC_DEPRECATED_CPU("power8nvl_v1.0", CPU_POWERPC_POWER8NVL_v10, > > POWER8, > > "POWER8NVL v1.0") > > POWERPC_DEF_SVR_DEPR("power8nvl_v1.0", CPU_POWERPC_POWER8NVL_v10, > POWER8, "POWER8NVL v1.0", > "CPU is unmaintained") Sure. Thanks for the reviews, Philippe. - Aditya G