Fix MSVC build and remove warning about unused functions

This commit is contained in:
mio
2021-12-30 00:26:25 +01:00
parent 298795a9f8
commit ab4ef2e1de
5 changed files with 36 additions and 30 deletions

View File

@ -116,12 +116,12 @@ QEMU_BUILD_BUG_MSG(sizeof(PMCW) != 28, "size of PMCW is wrong");
#define PMCW_CHARS_MASK_INVALID 0xff1ffff8
/* subchannel information block */
typedef struct SCHIB {
QEMU_PACK(typedef struct SCHIB {
PMCW pmcw;
SCSW scsw;
uint64_t mba;
uint8_t mda[4];
} QEMU_PACKED SCHIB;
}) SCHIB;
/* interruption response block */
typedef struct IRB {
@ -224,11 +224,11 @@ QEMU_BUILD_BUG_MSG(sizeof(CRW) != 4, "size of CRW is wrong");
#define CRW_RSC_CSS 0xb
/* I/O interruption code */
typedef struct IOIntCode {
QEMU_PACK(typedef struct IOIntCode {
uint32_t subsys_id;
uint32_t intparm;
uint32_t interrupt_id;
} QEMU_PACKED IOIntCode;
}) IOIntCode;
/* schid disintegration */
#define IOINST_SCHID_ONE(_schid) ((_schid & 0x00010000) >> 16)

View File

@ -90,27 +90,27 @@
* So we have to double check that all users of sclp data structures use the
* right endianness wrappers.
*/
typedef struct SCCBHeader {
QEMU_PACK(typedef struct SCCBHeader {
uint16_t length;
uint8_t function_code;
uint8_t control_mask[3];
uint16_t response_code;
} QEMU_PACKED SCCBHeader;
}) SCCBHeader;
#define SCCB_DATA_LEN (SCCB_SIZE - sizeof(SCCBHeader))
#define SCCB_CPU_FEATURE_LEN 6
/* CPU information */
typedef struct CPUEntry {
QEMU_PACK(typedef struct CPUEntry {
uint8_t address;
uint8_t reserved0;
uint8_t features[SCCB_CPU_FEATURE_LEN];
uint8_t reserved2[6];
uint8_t type;
uint8_t reserved1;
} QEMU_PACKED CPUEntry;
}) CPUEntry;
typedef struct ReadInfo {
QEMU_PACK(typedef struct ReadInfo {
SCCBHeader h;
uint16_t rnmax;
uint8_t rnsize;
@ -133,9 +133,9 @@ typedef struct ReadInfo {
uint8_t _reserved5[124 - 122]; /* 122-123 */
uint32_t hmfai;
struct CPUEntry entries[];
} QEMU_PACKED ReadInfo;
}) ReadInfo;
typedef struct ReadCpuInfo {
QEMU_PACK(typedef struct ReadCpuInfo {
SCCBHeader h;
uint16_t nr_configured; /* 8-9 */
uint16_t offset_configured; /* 10-11 */
@ -143,42 +143,42 @@ typedef struct ReadCpuInfo {
uint16_t offset_standby; /* 14-15 */
uint8_t reserved0[24-16]; /* 16-23 */
struct CPUEntry entries[];
} QEMU_PACKED ReadCpuInfo;
}) ReadCpuInfo;
typedef struct ReadStorageElementInfo {
QEMU_PACK(typedef struct ReadStorageElementInfo {
SCCBHeader h;
uint16_t max_id;
uint16_t assigned;
uint16_t standby;
uint8_t _reserved0[16 - 14]; /* 14-15 */
uint32_t entries[];
} QEMU_PACKED ReadStorageElementInfo;
}) ReadStorageElementInfo;
typedef struct AttachStorageElement {
QEMU_PACK(typedef struct AttachStorageElement {
SCCBHeader h;
uint8_t _reserved0[10 - 8]; /* 8-9 */
uint16_t assigned;
uint8_t _reserved1[16 - 12]; /* 12-15 */
uint32_t entries[];
} QEMU_PACKED AttachStorageElement;
}) AttachStorageElement;
typedef struct AssignStorage {
QEMU_PACK(typedef struct AssignStorage {
SCCBHeader h;
uint16_t rn;
} QEMU_PACKED AssignStorage;
}) AssignStorage;
typedef struct IoaCfgSccb {
QEMU_PACK(typedef struct IoaCfgSccb {
SCCBHeader header;
uint8_t atype;
uint8_t reserved1;
uint16_t reserved2;
uint32_t aid;
} QEMU_PACKED IoaCfgSccb;
}) IoaCfgSccb;
typedef struct SCCB {
QEMU_PACK(typedef struct SCCB {
SCCBHeader h;
char data[SCCB_DATA_LEN];
} QEMU_PACKED SCCB;
}) SCCB;
#define TYPE_SCLP "sclp"
#define SCLP(obj) OBJECT_CHECK(SCLPDevice, (obj), TYPE_SCLP)

View File

@ -28,9 +28,9 @@
/* #define DEBUG_HELPER */
#ifdef DEBUG_HELPER
#define HELPER_LOG(x...) qemu_log(x)
#define HELPER_LOG(x, ...) qemu_log(x)
#else
#define HELPER_LOG(x...)
#define HELPER_LOG(x, ...)
#endif
static uint32_t cc_calc_ltgt_32(int32_t src, int32_t dst)

View File

@ -13,7 +13,7 @@
#include "cpu.h"
#ifndef CONFIG_USER_ONLY
typedef struct LowCore {
QEMU_PACK(typedef struct LowCore {
/* prefix area: defined by architecture */
uint32_t ccw1[2]; /* 0x000 */
uint32_t ccw2[4]; /* 0x008 */
@ -91,7 +91,7 @@ typedef struct LowCore {
/* align to the top of the prefix area */
uint8_t pad18[0x2000 - 0x1400]; /* 0x1400 */
} QEMU_PACKED LowCore;
}) LowCore;
QEMU_BUILD_BUG_ON(sizeof(LowCore) != 8192);
#endif /* CONFIG_USER_ONLY */

View File

@ -97,6 +97,7 @@ void ioinst_handle_hsch(S390CPU *cpu, uint64_t reg1, uintptr_t ra)
#endif
}
#if 0
static int ioinst_schib_valid(SCHIB *schib)
{
if ((be16_to_cpu(schib->pmcw.flags) & PMCW_FLAGS_MASK_INVALID) ||
@ -109,6 +110,7 @@ static int ioinst_schib_valid(SCHIB *schib)
}
return 1;
}
#endif
void ioinst_handle_msch(S390CPU *cpu, uint64_t reg1, uint32_t ipb, uintptr_t ra)
{
@ -144,6 +146,7 @@ void ioinst_handle_msch(S390CPU *cpu, uint64_t reg1, uint32_t ipb, uintptr_t ra)
#endif
}
#if 0
static void copy_orb_from_guest(ORB *dest, const ORB *src)
{
dest->intparm = be32_to_cpu(src->intparm);
@ -168,6 +171,7 @@ static int ioinst_orb_valid(ORB *orb)
}
return 1;
}
#endif
void ioinst_handle_ssch(S390CPU *cpu, uint64_t reg1, uint32_t ipb, uintptr_t ra)
{
@ -350,20 +354,20 @@ int ioinst_handle_tsch(S390CPU *cpu, uint64_t reg1, uint32_t ipb, uintptr_t ra)
return 0;
}
typedef struct ChscReq {
QEMU_PACK(typedef struct ChscReq {
uint16_t len;
uint16_t command;
uint32_t param0;
uint32_t param1;
uint32_t param2;
} QEMU_PACKED ChscReq;
}) ChscReq;
typedef struct ChscResp {
QEMU_PACK(typedef struct ChscResp {
uint16_t len;
uint16_t code;
uint32_t param;
char data[];
} QEMU_PACKED ChscResp;
}) ChscResp;
#define CHSC_MIN_RESP_LEN 0x0008
@ -546,6 +550,7 @@ out:
#endif
}
#if 0
static int chsc_sei_nt0_get_event(void *res)
{
/* no events yet */
@ -557,6 +562,7 @@ static int chsc_sei_nt0_have_event(void)
/* no events yet */
return 0;
}
#endif
#if 0
static int chsc_sei_nt2_get_event(void *res)