From 6afd5e97d19d35c4610205352de420f99f689e2c Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Mon, 11 Oct 2021 14:14:10 +0200 Subject: [PATCH] zdump/dfi: Extract dfi_vmcoreinfo.h header from dfi.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create a separate C header for DFI VMCOREINFO to separate independent things and make it more readable. Signed-off-by: Alexander Egorenkov Signed-off-by: Jan Höppner --- zdump/dfi.c | 2 ++ zdump/dfi.h | 12 ------------ zdump/dfi_vmcoreinfo.c | 8 ++++++-- zdump/dfi_vmcoreinfo.h | 20 ++++++++++++++++++++ zdump/dfo_elf.c | 5 ++++- 5 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 zdump/dfi_vmcoreinfo.h diff --git a/zdump/dfi.c b/zdump/dfi.c index d4d7b0a3..9ef55ee5 100644 --- a/zdump/dfi.c +++ b/zdump/dfi.c @@ -12,8 +12,10 @@ #include #include "lib/util_log.h" + #include "zgetdump.h" #include "dfi_mem_chunk.h" +#include "dfi_vmcoreinfo.h" #define TIME_FMT_STR "%a, %d %b %Y %H:%M:%S %z" #define PROGRESS_HASH_CNT 50 diff --git a/zdump/dfi.h b/zdump/dfi.h index 909b9eac..b5aa4fd9 100644 --- a/zdump/dfi.h +++ b/zdump/dfi.h @@ -200,18 +200,6 @@ int dfi_feat_copy(void); */ unsigned long dfi_kdump_base(void); -/* - * DFI vmcoreinfo functions - */ -void dfi_vmcoreinfo_init(void); -char *dfi_vmcoreinfo_get(void); -int dfi_vmcoreinfo_tag(char *str, int len, const char *sym); -int dfi_vmcoreinfo_symbol(unsigned long *val, const char *sym); -int dfi_vmcoreinfo_offset(unsigned long *offs, const char *sym); -int dfi_vmcoreinfo_size(unsigned long *size, const char *sym); -int dfi_vmcoreinfo_length(unsigned long *len, const char *sym); -int dfi_vmcoreinfo_val(unsigned long *val, const char *sym); - /* * DFI operations */ diff --git a/zdump/dfi_vmcoreinfo.c b/zdump/dfi_vmcoreinfo.c index 1a5a08af..f76bd731 100644 --- a/zdump/dfi_vmcoreinfo.c +++ b/zdump/dfi_vmcoreinfo.c @@ -9,12 +9,16 @@ * it under the terms of the MIT license. See LICENSE for details. */ +#include +#include #include #include "lib/zt_common.h" #include "lib/util_log.h" -#include "zgetdump.h" +#include "zg.h" +#include "dfi_mem_chunk.h" +#include "dfi_vmcoreinfo.h" #ifdef __s390x__ #define LC_VMCORE_INFO 0xe0c @@ -23,7 +27,7 @@ #endif #define LC_OS_INFO 0xe18 -#define OS_INFO_MAGIC 0x4f53494e464f535aULL /* OSINFOSZ */ +#define OS_INFO_MAGIC 0x4f53494e464f535aULL /* OSINFOSZ */ struct os_info { u64 magic; diff --git a/zdump/dfi_vmcoreinfo.h b/zdump/dfi_vmcoreinfo.h new file mode 100644 index 00000000..6b29f526 --- /dev/null +++ b/zdump/dfi_vmcoreinfo.h @@ -0,0 +1,20 @@ +/* + * Copyright IBM Corp. 2001, 2018 + * + * s390-tools is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef DFI_VMCOREINFO_H +#define DFI_VMCOREINFO_H + +void dfi_vmcoreinfo_init(void); +char *dfi_vmcoreinfo_get(void); +int dfi_vmcoreinfo_tag(char *str, int len, const char *sym); +int dfi_vmcoreinfo_symbol(unsigned long *val, const char *sym); +int dfi_vmcoreinfo_offset(unsigned long *offs, const char *sym); +int dfi_vmcoreinfo_size(unsigned long *size, const char *sym); +int dfi_vmcoreinfo_length(unsigned long *len, const char *sym); +int dfi_vmcoreinfo_val(unsigned long *val, const char *sym); + +#endif /* DFI_VMCOREINFO_H */ diff --git a/zdump/dfo_elf.c b/zdump/dfo_elf.c index 4b29ea82..8263237c 100644 --- a/zdump/dfo_elf.c +++ b/zdump/dfo_elf.c @@ -16,7 +16,10 @@ #include #include -#include "zgetdump.h" +#include "df_elf.h" +#include "dfi.h" +#include "dfi_vmcoreinfo.h" +#include "dfo.h" #define HDR_PER_CPU_SIZE 0x4a0 #define HDR_PER_MEMC_SIZE 0x100