master
h 65 lines 1.54 KB
Raw
1 /*
2 * virtio ccw machine definitions
3 *
4 * Copyright 2012, 2016 IBM Corp.
5 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
6 *
7 * This work is licensed under the terms of the GNU GPL, version 2 or (at
8 * your option) any later version. See the COPYING file in the top-level
9 * directory.
10 */
11 #ifndef HW_S390X_S390_VIRTIO_CCW_H
12 #define HW_S390X_S390_VIRTIO_CCW_H
13
14 #include "hw/core/boards.h"
15 #include "qom/object.h"
16 #include "hw/s390x/sclp.h"
17 #include "qapi/qapi-types-machine-s390x.h"
18
19 #define TYPE_S390_CCW_MACHINE "s390-ccw-machine"
20
21 OBJECT_DECLARE_TYPE(S390CcwMachineState, S390CcwMachineClass, S390_CCW_MACHINE)
22
23
24 struct S390CcwMachineState {
25 /*< private >*/
26 MachineState parent_obj;
27
28 /*< public >*/
29 bool aes_key_wrap;
30 bool dea_key_wrap;
31 bool pv;
32 bool secure_boot;
33 uint8_t loadparm[8];
34 uint64_t memory_limit;
35 uint64_t max_pagesize;
36 BootCertificatesList *boot_certs;
37
38 SCLPDevice *sclp;
39 };
40
41 static inline uint64_t s390_get_memory_limit(S390CcwMachineState *s390ms)
42 {
43 /* We expect to be called only after the limit was set. */
44 assert(s390ms->memory_limit);
45 return s390ms->memory_limit;
46 }
47
48 #define S390_PTF_REASON_NONE (0x00 << 8)
49 #define S390_PTF_REASON_DONE (0x01 << 8)
50 #define S390_PTF_REASON_BUSY (0x02 << 8)
51 #define S390_TOPO_FC_MASK 0xffUL
52 void s390_handle_ptf(S390CPU *cpu, uint8_t r1, uintptr_t ra);
53
54 struct S390CcwMachineClass {
55 /*< private >*/
56 MachineClass parent_class;
57
58 /*< public >*/
59 int max_threads;
60 bool use_cpi;
61 bool use_certs;
62 bool use_secure;
63 };
64
65 #endif