Files
s390-tools/zipl/boot/eckd2dump.h
Mikhail Zaslonko 0dac47cb62 zipl/boot: Introduce write_addr_range() helper function
Move code from write_dump_segment() to write_addr_range() function to use
it later for writing compressed dump segments as well.

Verify that passed address range is a multiple of dasd block size.

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-09-27 18:29:06 +02:00

57 lines
1.3 KiB
C

/*
* zipl - zSeries Initial Program Loader tool
*
* Common ECKD dump I/O functions
*
* Copyright IBM Corp. 2013, 2023
*
* 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 ECKD2DUMP_H
#define ECKD2DUMP_H
#include "dump/s390_dump.h"
#include "cio.h"
#include "stage2dump.h"
struct eckd_device {
uint32_t blk_start;
uint32_t blk_end;
uint16_t blk_size;
uint8_t num_heads;
uint8_t bpt;
struct subchannel_id sid;
uint16_t devno;
};
extern struct eckd_device device;
extern unsigned long eckd_blk_max;
/*
* Convert memory size to number of blocks
*/
static inline unsigned long m2b(unsigned long mem)
{
return mem / device.blk_size;
}
/*
* Convert number of blocks to memory size
*/
static inline unsigned long b2m(unsigned long blk)
{
return blk * device.blk_size;
}
void stage2dump_eckd_init();
void writeblock(unsigned long blk, unsigned long addr, unsigned long blk_count,
unsigned long zero_page);
void readblock(unsigned long blk, unsigned long addr, unsigned long blk_count);
unsigned long write_dump_segment(unsigned long blk,
struct df_s390_dump_segm_hdr *segm);
unsigned long write_addr_range(unsigned long blk, unsigned long addr, unsigned long len);
#endif /* ECKD2DUMP_H */