4 * Copyright 2015 IBM Corp.
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
19 uint8_t reserved0[85];
29 typedef struct IplBlockCcw IplBlockCcw;
32 uint8_t reserved1[305 - 1];
41 uint8_t reserved5[12];
43 uint32_t scp_data_len;
44 uint8_t reserved6[260];
47 typedef struct IplBlockFcp IplBlockFcp;
49 union IplParameterBlock {
65 uint8_t reserved1[110];
67 uint8_t reserved2[88];
68 uint8_t reserved_ext[4096 - 200];
71 typedef union IplParameterBlock IplParameterBlock;
73 void s390_ipl_update_diag308(IplParameterBlock *iplb);
74 void s390_ipl_prepare_cpu(S390CPU *cpu);
75 IplParameterBlock *s390_ipl_get_iplb(void);
76 void s390_reipl_request(void);
78 #define TYPE_S390_IPL "s390-ipl"
79 #define S390_IPL(obj) OBJECT_CHECK(S390IPLState, (obj), TYPE_S390_IPL)
83 DeviceState parent_obj;
85 uint64_t bios_start_addr;
87 IplParameterBlock iplb;
99 bool iplbext_migration;
101 typedef struct S390IPLState S390IPLState;
103 #define S390_IPL_TYPE_FCP 0x00
104 #define S390_IPL_TYPE_CCW 0x02
106 #define S390_IPLB_HEADER_LEN 8
107 #define S390_IPLB_MIN_CCW_LEN 200
108 #define S390_IPLB_MIN_FCP_LEN 384
110 static inline bool iplb_valid_len(IplParameterBlock *iplb)
112 return be32_to_cpu(iplb->len) <= sizeof(IplParameterBlock);
115 static inline bool iplb_valid_ccw(IplParameterBlock *iplb)
117 return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_CCW_LEN &&
118 iplb->pbt == S390_IPL_TYPE_CCW;
121 static inline bool iplb_valid_fcp(IplParameterBlock *iplb)
123 return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_FCP_LEN &&
124 iplb->pbt == S390_IPL_TYPE_FCP;