3 * Event Facility definitions
5 * Copyright IBM, Corp. 2012
8 * Heinz Graalfs <graalfs@de.ibm.com>
10 * This work is licensed under the terms of the GNU GPL, version 2 or (at your
11 * option) any later version. See the COPYING file in the top-level directory.
15 #ifndef HW_S390_SCLP_EVENT_FACILITY_H
16 #define HW_S390_SCLP_EVENT_FACILITY_H
19 #include "qemu-thread.h"
21 /* SCLP event types */
22 #define SCLP_EVENT_ASCII_CONSOLE_DATA 0x1a
23 #define SCLP_EVENT_SIGNAL_QUIESCE 0x1d
25 /* SCLP event masks */
26 #define SCLP_EVENT_MASK_SIGNAL_QUIESCE 0x00000008
27 #define SCLP_EVENT_MASK_MSG_ASCII 0x00000040
29 #define SCLP_UNCONDITIONAL_READ 0x00
30 #define SCLP_SELECTIVE_READ 0x01
32 #define TYPE_SCLP_EVENT "s390-sclp-event-type"
33 #define SCLP_EVENT(obj) \
34 OBJECT_CHECK(SCLPEvent, (obj), TYPE_SCLP_EVENT)
35 #define SCLP_EVENT_CLASS(klass) \
36 OBJECT_CLASS_CHECK(SCLPEventClass, (klass), TYPE_SCLP_EVENT)
37 #define SCLP_EVENT_GET_CLASS(obj) \
38 OBJECT_GET_CLASS(SCLPEventClass, (obj), TYPE_SCLP_EVENT)
40 typedef struct WriteEventMask
{
44 uint32_t cp_receive_mask
;
45 uint32_t cp_send_mask
;
47 uint32_t receive_mask
;
48 } QEMU_PACKED WriteEventMask
;
50 typedef struct EventBufferHeader
{
55 } QEMU_PACKED EventBufferHeader
;
57 typedef struct WriteEventData
{
59 EventBufferHeader ebh
;
60 } QEMU_PACKED WriteEventData
;
62 typedef struct ReadEventData
{
64 EventBufferHeader ebh
;
66 } QEMU_PACKED ReadEventData
;
68 typedef struct SCLPEvent
{
75 typedef struct SCLPEventClass
{
76 DeviceClass parent_class
;
77 int (*init
)(SCLPEvent
*event
);
78 int (*exit
)(SCLPEvent
*event
);
80 /* get SCLP's send mask */
81 unsigned int (*get_send_mask
)(void);
83 /* get SCLP's receive mask */
84 unsigned int (*get_receive_mask
)(void);
86 int (*read_event_data
)(SCLPEvent
*event
, EventBufferHeader
*evt_buf_hdr
,
89 int (*write_event_data
)(SCLPEvent
*event
, EventBufferHeader
*evt_buf_hdr
);
91 /* returns the supported event type */
92 int (*event_type
)(void);