mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdump: Extract dfo_mem_chunk interface from DFO
The primary goal is to separate DFO code into multiple smaller modules and make it unit testable. This refactoring only moved the code around w/o changing any functionality. Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
f6a7da141c
commit
4bd16ba8ea
+6
-31
@@ -12,37 +12,12 @@
|
||||
#ifndef DFO_H
|
||||
#define DFO_H
|
||||
|
||||
#include "lib/util_list.h"
|
||||
#include "zg.h"
|
||||
|
||||
struct dfo_chunk;
|
||||
|
||||
typedef void (*dfo_chunk_read_fn)(struct dfo_chunk *chunk, u64 off,
|
||||
void *buf, u64 cnt);
|
||||
|
||||
struct dfo_chunk {
|
||||
struct util_list_node list;
|
||||
u64 start;
|
||||
u64 end;
|
||||
dfo_chunk_read_fn read_fn;
|
||||
void *data;
|
||||
};
|
||||
|
||||
extern void dfo_chunk_zero_fn(struct dfo_chunk *chunk, u64 off, void *buf,
|
||||
u64 cnt);
|
||||
extern void dfo_chunk_buf_fn(struct dfo_chunk *chunk, u64 off, void *buf,
|
||||
u64 cnt);
|
||||
extern void dfo_chunk_mem_fn(struct dfo_chunk *chunk, u64 off, void *buf,
|
||||
u64 cnt);
|
||||
extern void dfo_chunk_add(u64 start, u64 size, void *data,
|
||||
dfo_chunk_read_fn read_fn);
|
||||
|
||||
extern u64 dfo_read(void *buf, u64 cnt);
|
||||
extern void dfo_seek(u64 addr);
|
||||
extern u64 dfo_size(void);
|
||||
extern const char *dfo_name(void);
|
||||
extern void dfo_init(void);
|
||||
extern int dfo_set(const char *dfo_name);
|
||||
u64 dfo_read(void *buf, u64 cnt);
|
||||
void dfo_seek(u64 addr);
|
||||
u64 dfo_size(void);
|
||||
const char *dfo_name(void);
|
||||
void dfo_init(void);
|
||||
int dfo_set(const char *dfo_name);
|
||||
|
||||
/*
|
||||
* DFO operations
|
||||
|
||||
Reference in New Issue
Block a user