mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
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:
committed by
Jan Höppner
parent
0f7ed7d4fc
commit
244bf4e550
+4
-2
@@ -15,6 +15,8 @@
|
|||||||
#include <elf.h>
|
#include <elf.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
|
#include "lib/zt_common.h"
|
||||||
|
|
||||||
#include "dfo.h"
|
#include "dfo.h"
|
||||||
#include "zg.h"
|
#include "zg.h"
|
||||||
|
|
||||||
@@ -80,7 +82,7 @@ struct nt_prstatus_64 {
|
|||||||
u64 orig_gpr2;
|
u64 orig_gpr2;
|
||||||
u32 pr_fpvalid;
|
u32 pr_fpvalid;
|
||||||
u8 pad3[4];
|
u8 pad3[4];
|
||||||
} __attribute__ ((packed));
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fpregset ELF Note
|
* fpregset ELF Note
|
||||||
@@ -89,7 +91,7 @@ struct nt_fpregset_64 {
|
|||||||
u32 fpc;
|
u32 fpc;
|
||||||
u32 pad;
|
u32 pad;
|
||||||
u64 fprs[16];
|
u64 fprs[16];
|
||||||
} __attribute__ ((packed));
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* prpsinfo ELF Note
|
* prpsinfo ELF Note
|
||||||
|
|||||||
+5
-3
@@ -12,6 +12,8 @@
|
|||||||
#ifndef DF_LKCD_H
|
#ifndef DF_LKCD_H
|
||||||
#define DF_LKCD_H
|
#define DF_LKCD_H
|
||||||
|
|
||||||
|
#include "lib/zt_common.h"
|
||||||
|
|
||||||
#define DF_LKCD_MAGIC 0xa8190173618f23edULL
|
#define DF_LKCD_MAGIC 0xa8190173618f23edULL
|
||||||
#define DF_LKCD_MAGIC_ASM 0x733339302d64756dULL
|
#define DF_LKCD_MAGIC_ASM 0x733339302d64756dULL
|
||||||
#define DF_LKCD_VERSION 0x8 /* dump version number */
|
#define DF_LKCD_VERSION 0x8 /* dump version number */
|
||||||
@@ -53,7 +55,7 @@ struct df_lkcd_hdr {
|
|||||||
u32 dump_compress;
|
u32 dump_compress;
|
||||||
u32 dump_flags;
|
u32 dump_flags;
|
||||||
u32 dump_device;
|
u32 dump_device;
|
||||||
} __attribute__((packed));
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* s390 LKCD asm header
|
* s390 LKCD asm header
|
||||||
@@ -65,7 +67,7 @@ struct df_lkcd_hdr_asm {
|
|||||||
u16 cpu_cnt;
|
u16 cpu_cnt;
|
||||||
u16 real_cpu_cnt;
|
u16 real_cpu_cnt;
|
||||||
u32 lc_vec[512];
|
u32 lc_vec[512];
|
||||||
} __attribute__((packed));
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Page header
|
* Page header
|
||||||
@@ -74,6 +76,6 @@ struct df_lkcd_pg_hdr {
|
|||||||
u64 addr; /* Address of dump page */
|
u64 addr; /* Address of dump page */
|
||||||
u32 size; /* Size of dump page */
|
u32 size; /* Size of dump page */
|
||||||
u32 flags; /* flags (DF_LKCD_COMPRESSED, DF_LKCD_RAW,...) */
|
u32 flags; /* flags (DF_LKCD_COMPRESSED, DF_LKCD_RAW,...) */
|
||||||
} __attribute__((packed));
|
} __packed;
|
||||||
|
|
||||||
#endif /* DF_LKCD_H */
|
#endif /* DF_LKCD_H */
|
||||||
|
|||||||
+6
-4
@@ -12,6 +12,8 @@
|
|||||||
#ifndef DF_S390_H
|
#ifndef DF_S390_H
|
||||||
#define DF_S390_H
|
#define DF_S390_H
|
||||||
|
|
||||||
|
#include "lib/zt_common.h"
|
||||||
|
|
||||||
#include "dt.h"
|
#include "dt.h"
|
||||||
#include "zg.h"
|
#include "zg.h"
|
||||||
|
|
||||||
@@ -59,7 +61,7 @@ struct df_s390_hdr {
|
|||||||
u64 mvdump_zipl_time; /* 0x208 */
|
u64 mvdump_zipl_time; /* 0x208 */
|
||||||
u8 end_pad2[0x800-0x210]; /* 0x210 */
|
u8 end_pad2[0x800-0x210]; /* 0x210 */
|
||||||
u32 lc_vec[DF_S390_CPU_MAX]; /* 0x800 */
|
u32 lc_vec[DF_S390_CPU_MAX]; /* 0x800 */
|
||||||
} __attribute__((packed));
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* End marker: Should be at the end of every valid s390 crash dump.
|
* 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 {
|
struct df_s390_em {
|
||||||
char str[8];
|
char str[8];
|
||||||
u64 tod;
|
u64 tod;
|
||||||
} __attribute__((packed));
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Segment header for s390 extended dump format
|
* Segment header for s390 extended dump format
|
||||||
@@ -77,7 +79,7 @@ struct df_s390_dump_segm_hdr {
|
|||||||
u64 len;
|
u64 len;
|
||||||
u64 stop_marker;
|
u64 stop_marker;
|
||||||
u8 reserved[0x1000 - 24];
|
u8 reserved[0x1000 - 24];
|
||||||
} __attribute__((packed));
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert DFI arch to s390 arch
|
* Convert DFI arch to s390 arch
|
||||||
@@ -118,7 +120,7 @@ struct df_s390_dumper {
|
|||||||
u32 size;
|
u32 size;
|
||||||
u8 force;
|
u8 force;
|
||||||
u64 mem;
|
u64 mem;
|
||||||
} __attribute__ ((packed));
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* s390 dump helpers
|
* s390 dump helpers
|
||||||
|
|||||||
+4
-1
@@ -13,7 +13,10 @@
|
|||||||
#define DFI_H
|
#define DFI_H
|
||||||
|
|
||||||
#include <linux/utsname.h>
|
#include <linux/utsname.h>
|
||||||
|
|
||||||
|
#include "lib/zt_common.h"
|
||||||
#include "lib/util_list.h"
|
#include "lib/util_list.h"
|
||||||
|
|
||||||
#include "zg.h"
|
#include "zg.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -68,7 +71,7 @@ struct dfi_lowcore_64 {
|
|||||||
u32 access_regs_save_area[16]; /* 0x1340 */
|
u32 access_regs_save_area[16]; /* 0x1340 */
|
||||||
u64 cregs_save_area[16]; /* 0x1380 */
|
u64 cregs_save_area[16]; /* 0x1380 */
|
||||||
u8 pad_0x1400[0x2000-0x1400]; /* 0x1400 */
|
u8 pad_0x1400[0x2000-0x1400]; /* 0x1400 */
|
||||||
} __attribute__((packed));
|
} __packed;
|
||||||
|
|
||||||
static inline u64 dfi_lc_size(enum dfi_arch arch)
|
static inline u64 dfi_lc_size(enum dfi_arch arch)
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -26,14 +26,14 @@ struct vol_parm {
|
|||||||
u8 blk_size;
|
u8 blk_size;
|
||||||
u8 end_sec;
|
u8 end_sec;
|
||||||
u8 num_heads;
|
u8 num_heads;
|
||||||
} __attribute__ ((packed));
|
} __packed;
|
||||||
|
|
||||||
struct vol_parm_table {
|
struct vol_parm_table {
|
||||||
u64 timestamp;
|
u64 timestamp;
|
||||||
u16 vol_cnt;
|
u16 vol_cnt;
|
||||||
struct vol_parm vol_parm[MAX_VOLUMES];
|
struct vol_parm vol_parm[MAX_VOLUMES];
|
||||||
u8 ssid[MAX_VOLUMES];
|
u8 ssid[MAX_VOLUMES];
|
||||||
} __attribute__ ((packed));
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Device signature
|
* Device signature
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <elf.h>
|
#include <elf.h>
|
||||||
|
|
||||||
|
#include "lib/zt_common.h"
|
||||||
|
|
||||||
#include "zgetdump.h"
|
#include "zgetdump.h"
|
||||||
|
|
||||||
#ifdef __s390x__
|
#ifdef __s390x__
|
||||||
@@ -38,7 +41,7 @@ struct os_info {
|
|||||||
u64 init_fn_size;
|
u64 init_fn_size;
|
||||||
u32 init_fn_csum;
|
u32 init_fn_csum;
|
||||||
u8 reserved[4004];
|
u8 reserved[4004];
|
||||||
} __attribute__ ((packed));
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* File local static data
|
* File local static data
|
||||||
|
|||||||
+8
-6
@@ -12,7 +12,9 @@
|
|||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "lib/zt_common.h"
|
||||||
#include "lib/util_part.h"
|
#include "lib/util_part.h"
|
||||||
|
|
||||||
#include "zgetdump.h"
|
#include "zgetdump.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -28,7 +30,7 @@ struct scsi_dump_sb {
|
|||||||
uint64_t csum_off;
|
uint64_t csum_off;
|
||||||
uint64_t csum_size;
|
uint64_t csum_size;
|
||||||
uint64_t csum;
|
uint64_t csum;
|
||||||
} __attribute((packed));
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* File local static data
|
* File local static data
|
||||||
@@ -46,7 +48,7 @@ struct scsi_blockptr {
|
|||||||
uint16_t size;
|
uint16_t size;
|
||||||
uint16_t blockct;
|
uint16_t blockct;
|
||||||
uint8_t reserved[4];
|
uint8_t reserved[4];
|
||||||
} __attribute__((__packed__));
|
} __packed;
|
||||||
|
|
||||||
enum component_entry_type {
|
enum component_entry_type {
|
||||||
component_execute = 0x01,
|
component_execute = 0x01,
|
||||||
@@ -61,7 +63,7 @@ struct component_entry {
|
|||||||
uint64_t load_address;
|
uint64_t load_address;
|
||||||
uint64_t load_psw;
|
uint64_t load_psw;
|
||||||
} address;
|
} address;
|
||||||
} __attribute__((__packed__));
|
} __packed;
|
||||||
|
|
||||||
enum component_header_type {
|
enum component_header_type {
|
||||||
component_header_ipl = 0x00,
|
component_header_ipl = 0x00,
|
||||||
@@ -72,7 +74,7 @@ struct component_header {
|
|||||||
uint8_t magic[4];
|
uint8_t magic[4];
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
uint8_t reserved[27];
|
uint8_t reserved[27];
|
||||||
} __attribute__((__packed__));
|
} __packed;
|
||||||
|
|
||||||
struct boot_info {
|
struct boot_info {
|
||||||
char magic[4];
|
char magic[4];
|
||||||
@@ -81,7 +83,7 @@ struct boot_info {
|
|||||||
uint8_t dev_type;
|
uint8_t dev_type;
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
uint64_t sb_off;
|
uint64_t sb_off;
|
||||||
} __attribute__ ((packed));
|
} __packed;
|
||||||
|
|
||||||
struct scsi_mbr {
|
struct scsi_mbr {
|
||||||
char magic[4];
|
char magic[4];
|
||||||
@@ -90,7 +92,7 @@ struct scsi_mbr {
|
|||||||
struct scsi_blockptr blockptr;
|
struct scsi_blockptr blockptr;
|
||||||
uint8_t reserved2[0x50];
|
uint8_t reserved2[0x50];
|
||||||
struct boot_info boot_info;
|
struct boot_info boot_info;
|
||||||
} __attribute__((__packed__));
|
} __packed;
|
||||||
|
|
||||||
#define BOOT_INFO_VERSION 1
|
#define BOOT_INFO_VERSION 1
|
||||||
#define BOOT_INFO_MAGIC "zIPL"
|
#define BOOT_INFO_MAGIC "zIPL"
|
||||||
|
|||||||
Reference in New Issue
Block a user