From 555f3782d4774dc8572bf9e3e9b660eb56bb3c1a Mon Sep 17 00:00:00 2001 From: Sven Schnelle Date: Thu, 20 Apr 2023 13:46:48 +0000 Subject: [PATCH] zipl: rename PROGRAM_TABLE_* to {LEGACY}_BLKPTR_FORMAT_ID In preparation of decoupling the program table position from the block pointer format, rename: PROGRAM_TABLE_0 to LEGACY_BLKPTR_FORMAT_ID PRAGRAM_TABLE_1 to BLKPTR_FORMAT_ID Signed-off-by: Sven Schnelle Acked-by: Stefan Haberland Signed-off-by: Steffen Eiden --- include/boot/boot_defs.h | 3 ++- zipl/include/install.h | 10 +--------- zipl/src/bootmap.c | 8 ++++---- zipl/src/install.c | 6 +++--- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/include/boot/boot_defs.h b/include/boot/boot_defs.h index bb7857e3..2b39b417 100644 --- a/include/boot/boot_defs.h +++ b/include/boot/boot_defs.h @@ -85,7 +85,8 @@ enum blkptr_format_id { * this is the "new" format which serves only List-Directed IPL, * but is also suitable for CCW-type IPL. */ - BLKPTR_FORMAT_ID + BLKPTR_FORMAT_ID, + NR_BLKPTR_FORMATS }; /* diff --git a/zipl/include/install.h b/zipl/include/install.h index d9c5b4ef..84566fb4 100644 --- a/zipl/include/install.h +++ b/zipl/include/install.h @@ -17,15 +17,7 @@ #include "zipl.h" #include "boot/boot_defs.h" -/* - * For compatibility reasons zIPL can build multiple "similar" - * program tables, which differ only in block pointers format - */ -enum program_table_id { - PROGRAM_TABLE_0, - PROGRAM_TABLE_1, - NR_PROGRAM_TABLES -}; +#define NR_PROGRAM_TABLES NR_BLKPTR_FORMATS enum program_component_id { COMPONENT_ID_HEAP_AREA, diff --git a/zipl/src/bootmap.c b/zipl/src/bootmap.c index 2e590dee..2b9ab9c5 100644 --- a/zipl/src/bootmap.c +++ b/zipl/src/bootmap.c @@ -1200,7 +1200,7 @@ static int install_stages_dasd_fba(int fd, char *filename, void *stage2_data; switch (program_table_id) { - case PROGRAM_TABLE_0: + case LEGACY_BLKPTR_FORMAT_ID: /* * This program table is used for CCW-type IPL (see comments * for install_bootloader()). @@ -1221,7 +1221,7 @@ static int install_stages_dasd_fba(int fd, char *filename, return -1; free(stage2_list); break; - case PROGRAM_TABLE_1: + case BLKPTR_FORMAT_ID: /* * This program table is not used when booting from DASD FBA * (see comments for install_bootloader() @@ -1249,7 +1249,7 @@ static int install_stages_eckd_dasd(int fd, char *filename, void *stage2b_data; switch (program_table_id) { - case PROGRAM_TABLE_0: + case LEGACY_BLKPTR_FORMAT_ID: /* * This program table is used for CCW-type IPL. * Add stage2 loader @@ -1270,7 +1270,7 @@ static int install_stages_eckd_dasd(int fd, char *filename, return -1; free(stage2b_list); break; - case PROGRAM_TABLE_1: + case BLKPTR_FORMAT_ID: /* * This program table is used for List-Directed IPL, * which doesn't invoke stage2 loader. diff --git a/zipl/src/install.c b/zipl/src/install.c index f2221c9e..a8543381 100644 --- a/zipl/src/install.c +++ b/zipl/src/install.c @@ -328,7 +328,7 @@ int install_bootloader_ipl(struct program_table *tables, struct disk_info *info, int fd) { - struct program_table *pt = &tables[PROGRAM_TABLE_0]; + struct program_table *pt = &tables[LEGACY_BLKPTR_FORMAT_ID]; int rc = -1; @@ -357,7 +357,7 @@ int install_bootloader_ipl(struct program_table *tables, if (rc) break; /* install one more table for List-Directed IPL */ - pt = &tables[PROGRAM_TABLE_1]; + pt = &tables[BLKPTR_FORMAT_ID]; rc = install_eckd_cdl_ld(fd, pt->stage1b_list, info); break; case disk_type_diag: @@ -378,7 +378,7 @@ static int install_bootloader_dump(struct program_table *tables, int ngdump_enabled, int fd) { - struct program_table *pt = &tables[PROGRAM_TABLE_1]; + struct program_table *pt = &tables[BLKPTR_FORMAT_ID]; int rc = -1; switch (info->type) {