zdump/dfi: Extract dfi_vmcoreinfo.h header from dfi.h

Create a separate C header for DFI VMCOREINFO to separate
independent things and make it more readable.

Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Alexander Egorenkov
2021-10-11 14:14:10 +02:00
committed by Jan Höppner
parent b1da8bbbe9
commit 6afd5e97d1
5 changed files with 32 additions and 15 deletions

View File

@@ -12,8 +12,10 @@
#include <time.h>
#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

View File

@@ -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
*/

View File

@@ -9,12 +9,16 @@
* it under the terms of the MIT license. See LICENSE for details.
*/
#include <stdio.h>
#include <string.h>
#include <elf.h>
#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;

20
zdump/dfi_vmcoreinfo.h Normal file
View File

@@ -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 */

View File

@@ -16,7 +16,10 @@
#include <string.h>
#include <unistd.h>
#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