diff options
author | Thomas Huth <thuth@redhat.com> | 2020-07-28 10:35:53 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2020-10-06 19:36:50 +0200 |
commit | d1f060a8b515a0b1d14c38f2c8f86ab54e79c3dc (patch) | |
tree | d864c51541ef444c3a3d8100065aed22fcdccfce /pc-bios/s390-ccw | |
parent | 4f6a1eb886961f1f9da2d553c4b0e5ef69cd3801 (diff) |
pc-bios/s390-ccw: Move ipl-related code from main() into a separate function
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>
Diffstat (limited to 'pc-bios/s390-ccw')
-rw-r--r-- | pc-bios/s390-ccw/main.c | 20 |
1 files 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 */ |