• H
    s390x/event-facility: code restructure · 477a72a1
    Heinz Graalfs 提交于
    Code restructure in order to simplify class hierarchy
      - remove S390SCLPDevice abstract base class
        and move function pointers into new SCLPEventFacilityClass
      - implement SCLPEventFacility as SysBusDevice
      - use define constants for instance creation strings
    
    The following ascii-art shows the class structure wrt the SCLP EventFacility
    before (CURRENT) and after the restructure (NEW):
    
    ----
    CURRENT:
    
       "s390-sclp-events-bus"
       +-------------------------+
       |      SCLPEventsBus      |
       |-------------------------|
       |BusState qbus            |
       +-------------------------+
    
       +-------------------------+
       |   SCLPEventFacility     |  - to be replaced by new SCLPEventFacility,
       |-------------------------|    which will be a SysBusDevice
       |SCLPEventsBus sbus       |
       |DeviceState *qdev        |
       |unsigned int receive_mask|
       +-------------------------+
    
       +-------------------------+
       |   S390SCLPDeviceClass   |  - to be replaced by new SCLPEventFacilityClass
       |-------------------------|
       |DeviceClass qdev         |
       |*(init)()                |
       +-------------------------+
    
       "s390-sclp-event-facility"
                 |
             instance-of
                 |
                 V
       "s390-sclp-device"           - this is an abstract class
       +-------------------------+
       |     S390SCLPDevice   (A)|  - to be replaced by new SCLPEventFacility
       |-------------------------|
       |SysBusDevice busdev      |
       |SCLPEventFacility *ef    |
       |                         |
       |*(sclp_command_handler)()|  - these 2 go to new SCLPEventFacilityClass
       |*(event_pending)()       |
       +-------------------------+
    
    ----
    NEW:
    
       "s390-sclp-events-bus"
       +-------------------------+
       |      SCLPEventsBus      |
       |-------------------------|
       |BusState qbus            |
       +-------------------------+
    
       +-------------------------+
       | SCLPEventFacilityClass  |
       |-------------------------|
       |DeviceClass parent_class |
       |                         |
       |*(init)()                |
       |*(command_handler)()     |
       |*(event_pending)()       |
       +-------------------------+
    
       "s390-sclp-event-facility"
       +-------------------------+
       |   SCLPEventFacility     |
       |-------------------------|
       |SysBusDevice parent_class|
       |SCLPEventsBus sbus       |
       |unsigned int receive_mask|
       +-------------------------+
    Signed-off-by: NHeinz Graalfs <graalfs@linux.vnet.ibm.com>
    Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
    Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
    477a72a1
event-facility.c 11.4 KB