zdump: Make use of __packed macro

Make use of the pre-defined __packed macro throughout zdump.

Signed-off-by: Philipp Rudo <prudo@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Philipp Rudo
2019-10-08 18:16:41 +02:00
committed by Jan Höppner
parent 0f7ed7d4fc
commit 244bf4e550
7 changed files with 33 additions and 19 deletions

View File

@@ -15,6 +15,8 @@
#include <elf.h>
#include <linux/types.h>
#include "lib/zt_common.h"
#include "dfo.h"
#include "zg.h"
@@ -80,7 +82,7 @@ struct nt_prstatus_64 {
u64 orig_gpr2;
u32 pr_fpvalid;
u8 pad3[4];
} __attribute__ ((packed));
} __packed;
/*
* fpregset ELF Note
@@ -89,7 +91,7 @@ struct nt_fpregset_64 {
u32 fpc;
u32 pad;
u64 fprs[16];
} __attribute__ ((packed));
} __packed;
/*
* prpsinfo ELF Note

View File

@@ -12,6 +12,8 @@
#ifndef DF_LKCD_H
#define DF_LKCD_H
#include "lib/zt_common.h"
#define DF_LKCD_MAGIC 0xa8190173618f23edULL
#define DF_LKCD_MAGIC_ASM 0x733339302d64756dULL
#define DF_LKCD_VERSION 0x8 /* dump version number */
@@ -53,7 +55,7 @@ struct df_lkcd_hdr {
u32 dump_compress;
u32 dump_flags;
u32 dump_device;
} __attribute__((packed));
} __packed;
/*
* s390 LKCD asm header
@@ -65,7 +67,7 @@ struct df_lkcd_hdr_asm {
u16 cpu_cnt;
u16 real_cpu_cnt;
u32 lc_vec[512];
} __attribute__((packed));
} __packed;
/*
* Page header
@@ -74,6 +76,6 @@ struct df_lkcd_pg_hdr {
u64 addr; /* Address of dump page */
u32 size; /* Size of dump page */
u32 flags; /* flags (DF_LKCD_COMPRESSED, DF_LKCD_RAW,...) */
} __attribute__((packed));
} __packed;
#endif /* DF_LKCD_H */

View File

@@ -12,6 +12,8 @@
#ifndef DF_S390_H
#define DF_S390_H
#include "lib/zt_common.h"
#include "dt.h"
#include "zg.h"
@@ -59,7 +61,7 @@ struct df_s390_hdr {
u64 mvdump_zipl_time; /* 0x208 */
u8 end_pad2[0x800-0x210]; /* 0x210 */
u32 lc_vec[DF_S390_CPU_MAX]; /* 0x800 */
} __attribute__((packed));
} __packed;
/*
* End marker: Should be at the end of every valid s390 crash dump.
@@ -67,7 +69,7 @@ struct df_s390_hdr {
struct df_s390_em {
char str[8];
u64 tod;
} __attribute__((packed));
} __packed;
/*
* Segment header for s390 extended dump format
@@ -77,7 +79,7 @@ struct df_s390_dump_segm_hdr {
u64 len;
u64 stop_marker;
u8 reserved[0x1000 - 24];
} __attribute__((packed));
} __packed;
/*
* Convert DFI arch to s390 arch
@@ -118,7 +120,7 @@ struct df_s390_dumper {
u32 size;
u8 force;
u64 mem;
} __attribute__ ((packed));
} __packed;
/*
* s390 dump helpers

View File

@@ -13,7 +13,10 @@
#define DFI_H
#include <linux/utsname.h>
#include "lib/zt_common.h"
#include "lib/util_list.h"
#include "zg.h"
/*
@@ -68,7 +71,7 @@ struct dfi_lowcore_64 {
u32 access_regs_save_area[16]; /* 0x1340 */
u64 cregs_save_area[16]; /* 0x1380 */
u8 pad_0x1400[0x2000-0x1400]; /* 0x1400 */
} __attribute__((packed));
} __packed;
static inline u64 dfi_lc_size(enum dfi_arch arch)
{

View File

@@ -26,14 +26,14 @@ struct vol_parm {
u8 blk_size;
u8 end_sec;
u8 num_heads;
} __attribute__ ((packed));
} __packed;
struct vol_parm_table {
u64 timestamp;
u16 vol_cnt;
struct vol_parm vol_parm[MAX_VOLUMES];
u8 ssid[MAX_VOLUMES];
} __attribute__ ((packed));
} __packed;
/*
* Device signature

View File

@@ -10,6 +10,9 @@
*/
#include <elf.h>
#include "lib/zt_common.h"
#include "zgetdump.h"
#ifdef __s390x__
@@ -38,7 +41,7 @@ struct os_info {
u64 init_fn_size;
u32 init_fn_csum;
u8 reserved[4004];
} __attribute__ ((packed));
} __packed;
/*
* File local static data

View File

@@ -12,7 +12,9 @@
#include <linux/fs.h>
#include <stdio.h>
#include "lib/zt_common.h"
#include "lib/util_part.h"
#include "zgetdump.h"
/*
@@ -28,7 +30,7 @@ struct scsi_dump_sb {
uint64_t csum_off;
uint64_t csum_size;
uint64_t csum;
} __attribute((packed));
} __packed;
/*
* File local static data
@@ -46,7 +48,7 @@ struct scsi_blockptr {
uint16_t size;
uint16_t blockct;
uint8_t reserved[4];
} __attribute__((__packed__));
} __packed;
enum component_entry_type {
component_execute = 0x01,
@@ -61,7 +63,7 @@ struct component_entry {
uint64_t load_address;
uint64_t load_psw;
} address;
} __attribute__((__packed__));
} __packed;
enum component_header_type {
component_header_ipl = 0x00,
@@ -72,7 +74,7 @@ struct component_header {
uint8_t magic[4];
uint8_t type;
uint8_t reserved[27];
} __attribute__((__packed__));
} __packed;
struct boot_info {
char magic[4];
@@ -81,7 +83,7 @@ struct boot_info {
uint8_t dev_type;
uint8_t flags;
uint64_t sb_off;
} __attribute__ ((packed));
} __packed;
struct scsi_mbr {
char magic[4];
@@ -90,7 +92,7 @@ struct scsi_mbr {
struct scsi_blockptr blockptr;
uint8_t reserved2[0x50];
struct boot_info boot_info;
} __attribute__((__packed__));
} __packed;
#define BOOT_INFO_VERSION 1
#define BOOT_INFO_MAGIC "zIPL"