diff options
Diffstat (limited to 'include/hw/ppc/spapr_drc.h')
-rw-r--r-- | include/hw/ppc/spapr_drc.h | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h index 46b0f6216d..fad0a887f9 100644 --- a/include/hw/ppc/spapr_drc.h +++ b/include/hw/ppc/spapr_drc.h @@ -22,65 +22,65 @@ #define TYPE_SPAPR_DR_CONNECTOR "spapr-dr-connector" #define SPAPR_DR_CONNECTOR_GET_CLASS(obj) \ - OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DR_CONNECTOR) + OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DR_CONNECTOR) #define SPAPR_DR_CONNECTOR_CLASS(klass) \ - OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, \ + OBJECT_CLASS_CHECK(SpaprDrcClass, klass, \ TYPE_SPAPR_DR_CONNECTOR) -#define SPAPR_DR_CONNECTOR(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ +#define SPAPR_DR_CONNECTOR(obj) OBJECT_CHECK(SpaprDrc, (obj), \ TYPE_SPAPR_DR_CONNECTOR) #define TYPE_SPAPR_DRC_PHYSICAL "spapr-drc-physical" #define SPAPR_DRC_PHYSICAL_GET_CLASS(obj) \ - OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DRC_PHYSICAL) + OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PHYSICAL) #define SPAPR_DRC_PHYSICAL_CLASS(klass) \ - OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, \ + OBJECT_CLASS_CHECK(SpaprDrcClass, klass, \ TYPE_SPAPR_DRC_PHYSICAL) -#define SPAPR_DRC_PHYSICAL(obj) OBJECT_CHECK(sPAPRDRCPhysical, (obj), \ +#define SPAPR_DRC_PHYSICAL(obj) OBJECT_CHECK(SpaprDrcPhysical, (obj), \ TYPE_SPAPR_DRC_PHYSICAL) #define TYPE_SPAPR_DRC_LOGICAL "spapr-drc-logical" #define SPAPR_DRC_LOGICAL_GET_CLASS(obj) \ - OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DRC_LOGICAL) + OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_LOGICAL) #define SPAPR_DRC_LOGICAL_CLASS(klass) \ - OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, \ + OBJECT_CLASS_CHECK(SpaprDrcClass, klass, \ TYPE_SPAPR_DRC_LOGICAL) -#define SPAPR_DRC_LOGICAL(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ +#define SPAPR_DRC_LOGICAL(obj) OBJECT_CHECK(SpaprDrc, (obj), \ TYPE_SPAPR_DRC_LOGICAL) #define TYPE_SPAPR_DRC_CPU "spapr-drc-cpu" #define SPAPR_DRC_CPU_GET_CLASS(obj) \ - OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DRC_CPU) + OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_CPU) #define SPAPR_DRC_CPU_CLASS(klass) \ - OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, TYPE_SPAPR_DRC_CPU) -#define SPAPR_DRC_CPU(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ + OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_CPU) +#define SPAPR_DRC_CPU(obj) OBJECT_CHECK(SpaprDrc, (obj), \ TYPE_SPAPR_DRC_CPU) #define TYPE_SPAPR_DRC_PCI "spapr-drc-pci" #define SPAPR_DRC_PCI_GET_CLASS(obj) \ - OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DRC_PCI) + OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PCI) #define SPAPR_DRC_PCI_CLASS(klass) \ - OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, TYPE_SPAPR_DRC_PCI) -#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ + OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PCI) +#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(SpaprDrc, (obj), \ TYPE_SPAPR_DRC_PCI) #define TYPE_SPAPR_DRC_LMB "spapr-drc-lmb" #define SPAPR_DRC_LMB_GET_CLASS(obj) \ - OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DRC_LMB) + OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_LMB) #define SPAPR_DRC_LMB_CLASS(klass) \ - OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, TYPE_SPAPR_DRC_LMB) -#define SPAPR_DRC_LMB(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ + OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_LMB) +#define SPAPR_DRC_LMB(obj) OBJECT_CHECK(SpaprDrc, (obj), \ TYPE_SPAPR_DRC_LMB) #define TYPE_SPAPR_DRC_PHB "spapr-drc-phb" #define SPAPR_DRC_PHB_GET_CLASS(obj) \ - OBJECT_GET_CLASS(sPAPRDRConnectorClass, obj, TYPE_SPAPR_DRC_PHB) + OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PHB) #define SPAPR_DRC_PHB_CLASS(klass) \ - OBJECT_CLASS_CHECK(sPAPRDRConnectorClass, klass, TYPE_SPAPR_DRC_PHB) -#define SPAPR_DRC_PHB(obj) OBJECT_CHECK(sPAPRDRConnector, (obj), \ + OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PHB) +#define SPAPR_DRC_PHB(obj) OBJECT_CHECK(SpaprDrc, (obj), \ TYPE_SPAPR_DRC_PHB) /* - * Various hotplug types managed by sPAPRDRConnector + * Various hotplug types managed by SpaprDrc * * these are somewhat arbitrary, but to make things easier * when generating DRC indexes later we've aligned the bit @@ -96,7 +96,7 @@ typedef enum { SPAPR_DR_CONNECTOR_TYPE_SHIFT_VIO = 3, SPAPR_DR_CONNECTOR_TYPE_SHIFT_PCI = 4, SPAPR_DR_CONNECTOR_TYPE_SHIFT_LMB = 8, -} sPAPRDRConnectorTypeShift; +} SpaprDrcTypeShift; typedef enum { SPAPR_DR_CONNECTOR_TYPE_ANY = ~0, @@ -105,7 +105,7 @@ typedef enum { SPAPR_DR_CONNECTOR_TYPE_VIO = 1 << SPAPR_DR_CONNECTOR_TYPE_SHIFT_VIO, SPAPR_DR_CONNECTOR_TYPE_PCI = 1 << SPAPR_DR_CONNECTOR_TYPE_SHIFT_PCI, SPAPR_DR_CONNECTOR_TYPE_LMB = 1 << SPAPR_DR_CONNECTOR_TYPE_SHIFT_LMB, -} sPAPRDRConnectorType; +} SpaprDrcType; /* * set via set-indicator RTAS calls @@ -117,7 +117,7 @@ typedef enum { typedef enum { SPAPR_DR_ISOLATION_STATE_ISOLATED = 0, SPAPR_DR_ISOLATION_STATE_UNISOLATED = 1 -} sPAPRDRIsolationState; +} SpaprDRIsolationState; /* * set via set-indicator RTAS calls @@ -133,7 +133,7 @@ typedef enum { SPAPR_DR_ALLOCATION_STATE_USABLE = 1, SPAPR_DR_ALLOCATION_STATE_EXCHANGE = 2, SPAPR_DR_ALLOCATION_STATE_RECOVER = 3 -} sPAPRDRAllocationState; +} SpaprDRAllocationState; /* * DR-indicator (LED/visual indicator) @@ -152,7 +152,7 @@ typedef enum { SPAPR_DR_INDICATOR_ACTIVE = 1, SPAPR_DR_INDICATOR_IDENTIFY = 2, SPAPR_DR_INDICATOR_ACTION = 3, -} sPAPRDRIndicatorState; +} SpaprDRIndicatorState; /* * returned via get-sensor-state RTAS calls @@ -170,7 +170,7 @@ typedef enum { SPAPR_DR_ENTITY_SENSE_UNUSABLE = 2, SPAPR_DR_ENTITY_SENSE_EXCHANGE = 3, SPAPR_DR_ENTITY_SENSE_RECOVER = 4, -} sPAPRDREntitySense; +} SpaprDREntitySense; typedef enum { SPAPR_DR_CC_RESPONSE_NEXT_SIB = 1, /* currently unused */ @@ -181,7 +181,7 @@ typedef enum { SPAPR_DR_CC_RESPONSE_ERROR = -1, SPAPR_DR_CC_RESPONSE_CONTINUE = -2, SPAPR_DR_CC_RESPONSE_NOT_CONFIGURABLE = -9003, -} sPAPRDRCCResponse; +} SpaprDRCCResponse; typedef enum { /* @@ -199,9 +199,9 @@ typedef enum { SPAPR_DRC_STATE_PHYSICAL_POWERON = 6, SPAPR_DRC_STATE_PHYSICAL_UNISOLATE = 7, SPAPR_DRC_STATE_PHYSICAL_CONFIGURED = 8, -} sPAPRDRCState; +} SpaprDrcState; -typedef struct sPAPRDRConnector { +typedef struct SpaprDrc { /*< private >*/ DeviceState parent; @@ -220,60 +220,60 @@ typedef struct sPAPRDRConnector { bool unplug_requested; void *fdt; int fdt_start_offset; -} sPAPRDRConnector; +} SpaprDrc; -struct sPAPRMachineState; +struct SpaprMachineState; -typedef struct sPAPRDRConnectorClass { +typedef struct SpaprDrcClass { /*< private >*/ DeviceClass parent; - sPAPRDRCState empty_state; - sPAPRDRCState ready_state; + SpaprDrcState empty_state; + SpaprDrcState ready_state; /*< public >*/ - sPAPRDRConnectorTypeShift typeshift; + SpaprDrcTypeShift typeshift; const char *typename; /* used in device tree, PAPR 13.5.2.6 & C.6.1 */ const char *drc_name_prefix; /* used other places in device tree */ - sPAPRDREntitySense (*dr_entity_sense)(sPAPRDRConnector *drc); - uint32_t (*isolate)(sPAPRDRConnector *drc); - uint32_t (*unisolate)(sPAPRDRConnector *drc); + SpaprDREntitySense (*dr_entity_sense)(SpaprDrc *drc); + uint32_t (*isolate)(SpaprDrc *drc); + uint32_t (*unisolate)(SpaprDrc *drc); void (*release)(DeviceState *dev); - int (*dt_populate)(sPAPRDRConnector *drc, struct sPAPRMachineState *spapr, + int (*dt_populate)(SpaprDrc *drc, struct SpaprMachineState *spapr, void *fdt, int *fdt_start_offset, Error **errp); -} sPAPRDRConnectorClass; +} SpaprDrcClass; -typedef struct sPAPRDRCPhysical { +typedef struct SpaprDrcPhysical { /*< private >*/ - sPAPRDRConnector parent; + SpaprDrc parent; /* DR-indicator */ uint32_t dr_indicator; -} sPAPRDRCPhysical; +} SpaprDrcPhysical; static inline bool spapr_drc_hotplugged(DeviceState *dev) { return dev->hotplugged && !runstate_check(RUN_STATE_INMIGRATE); } -void spapr_drc_reset(sPAPRDRConnector *drc); +void spapr_drc_reset(SpaprDrc *drc); -uint32_t spapr_drc_index(sPAPRDRConnector *drc); -sPAPRDRConnectorType spapr_drc_type(sPAPRDRConnector *drc); +uint32_t spapr_drc_index(SpaprDrc *drc); +SpaprDrcType spapr_drc_type(SpaprDrc *drc); -sPAPRDRConnector *spapr_dr_connector_new(Object *owner, const char *type, +SpaprDrc *spapr_dr_connector_new(Object *owner, const char *type, uint32_t id); -sPAPRDRConnector *spapr_drc_by_index(uint32_t index); -sPAPRDRConnector *spapr_drc_by_id(const char *type, uint32_t id); +SpaprDrc *spapr_drc_by_index(uint32_t index); +SpaprDrc *spapr_drc_by_id(const char *type, uint32_t id); int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner, uint32_t drc_type_mask); -void spapr_drc_attach(sPAPRDRConnector *drc, DeviceState *d, Error **errp); -void spapr_drc_detach(sPAPRDRConnector *drc); +void spapr_drc_attach(SpaprDrc *drc, DeviceState *d, Error **errp); +void spapr_drc_detach(SpaprDrc *drc); bool spapr_drc_needed(void *opaque); -static inline bool spapr_drc_unplug_requested(sPAPRDRConnector *drc) +static inline bool spapr_drc_unplug_requested(SpaprDrc *drc) { return drc->unplug_requested; } |