[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/16] pc-bios/s390-ccw: Move ipl-related code from main() into a
From: |
Thomas Huth |
Subject: |
[PULL 02/16] pc-bios/s390-ccw: Move ipl-related code from main() into a separate function |
Date: |
Tue, 6 Oct 2020 20:31:08 +0200 |
Let's move this part of the code into a separate function to be able
to use it from multiple spots later.
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Message-Id: <20200806105349.632-3-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
pc-bios/s390-ccw/main.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index 146a50760b..9b64eb0c24 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -223,14 +223,8 @@ static void virtio_setup(void)
}
}
-int main(void)
+static void ipl_boot_device(void)
{
- sclp_setup();
- css_setup();
- boot_setup();
- find_boot_device();
- enable_subchannel(blk_schid);
-
switch (cutype) {
case CU_TYPE_DASD_3990:
case CU_TYPE_DASD_2107:
@@ -242,8 +236,18 @@ int main(void)
break;
default:
print_int("Attempting to boot from unexpected device type", cutype);
- panic("");
+ panic("\nBoot failed.\n");
}
+}
+
+int main(void)
+{
+ sclp_setup();
+ css_setup();
+ boot_setup();
+ find_boot_device();
+ enable_subchannel(blk_schid);
+ ipl_boot_device();
panic("Failed to load OS from hard disk\n");
return 0; /* make compiler happy */
--
2.18.2
- [PULL 00/16] s390-ccw bios update, Thomas Huth, 2020/10/06
- [PULL 01/16] pc-bios/s390-ccw/Makefile: Compile with -std=gnu99, -fwrapv and -fno-common, Thomas Huth, 2020/10/06
- [PULL 03/16] pc-bios/s390-ccw: Introduce ENODEV define and remove guards of others, Thomas Huth, 2020/10/06
- [PULL 02/16] pc-bios/s390-ccw: Move ipl-related code from main() into a separate function,
Thomas Huth <=
- [PULL 04/16] pc-bios/s390-ccw: Move the inner logic of find_subch() to a separate function, Thomas Huth, 2020/10/06
- [PULL 08/16] pc-bios/s390-ccw/main: Remove superfluous call to enable_subchannel(), Thomas Huth, 2020/10/06
- [PULL 06/16] pc-bios/s390-ccw: Scan through all devices if no boot device specified, Thomas Huth, 2020/10/06
- [PULL 09/16] pc-bios/s390-ccw: fix off-by-one error, Thomas Huth, 2020/10/06
- [PULL 12/16] pc-bios: s390x: Save PSW rework, Thomas Huth, 2020/10/06
- [PULL 07/16] pc-bios/s390-ccw: Allow booting in case the first virtio-blk disk is bad, Thomas Huth, 2020/10/06
- [PULL 05/16] pc-bios/s390-ccw: Do not bail out early if not finding a SCSI disk, Thomas Huth, 2020/10/06
- [PULL 13/16] pc-bios: s390x: Use reset PSW if avaliable, Thomas Huth, 2020/10/06
- [PULL 10/16] pc-bios/s390-ccw: break loop if a null block number is reached, Thomas Huth, 2020/10/06
- [PULL 14/16] pc-bios: s390x: Go into disabled wait when encountering a PGM exception, Thomas Huth, 2020/10/06