From nobody Sun Nov 24 00:36:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1728350253; cv=none; d=zohomail.com; s=zohoarc; b=G/W6+/8baPYyzjWI3PFz9SxeP31ZNZLV/VnTOYGc36tDyU1Mj8Y9pnjIlCylXDW0MKiYGlELk4dybIKY4V4s4NZTJFoGuvFkuoMfUkuvZjh2nM35MwWk58/7ryjeDGFUPQsMe2wstT/X/i9dDQEn9QoWjYOunBntw/jhgaOR2dE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728350253; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8Ibr4Y+oEzkr6z88q1Ix6um4qVHlqA2MwU1jo4zakzc=; b=K75g7z4wlshojsMVUP2GEZgmW0wCSkErTVnA4I4Fp9KoPzHwnNCQlLGnQyycMYYUPQDYjzQ6lEXJQtaMpqJGjxVxUmdQhMQgjdnrLjHieSQuQUeE5H6g8sr8M+6ySg81iPTqMwOtiBBl/eZDGQlW9j0XLtY3xYBB4+IgwEyDBOk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728350253691717.4886765673847; Mon, 7 Oct 2024 18:17:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxypd-000436-No; Mon, 07 Oct 2024 21:16:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypc-000421-5H; Mon, 07 Oct 2024 21:16:08 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxypY-0008Ds-2M; Mon, 07 Oct 2024 21:16:07 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4980nunk008380; Tue, 8 Oct 2024 01:16:03 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02je-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:02 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4981G2tO026814; Tue, 8 Oct 2024 01:16:02 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 424thq02ja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:02 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 497Mk1I7022848; Tue, 8 Oct 2024 01:16:01 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 423jg0s7nk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 01:16:01 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4981G0MP42664432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 01:16:00 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 64A1758055; Tue, 8 Oct 2024 01:16:00 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1E9558043; Tue, 8 Oct 2024 01:15:59 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.51.58]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 8 Oct 2024 01:15:59 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=8Ibr4Y+oEzkr6 z88q1Ix6um4qVHlqA2MwU1jo4zakzc=; b=Nw+tx9ErAaM8jn30FfaFf43flF0t5 o/1lhmBifHEEYi1+0vreJx5CIXiCr4hbRGqLEp6AiRHOv6IW4Y/5kS69a4UZY1Dd KMBDzoTLXaifOdhq+E4l2AqDb4RNkEhjN5lWXMjXbbdzyCpIyKAke1OZ6Tb/L7Wb gSCkDYTXsvSqce6taMGK4HOAa+AJLeN7tVru9Ltlw9UlA6cEDIJc0ASxYc6R7x86 tUnG/XE6fIWp5aG3bV3g6bOk/YDno/cmTVoFdVVgaDuJyMhysub4zoZpTlG+GENI h5wwJL+XZMDZJ5Q3O5OmREuLf9o9d9AQkuZMpuGxYrBBZjCGZBT1zCEsg== From: jrossi@linux.ibm.com To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com Cc: frankja@linux.ibm.com, jrossi@linux.ibm.com Subject: [PATCH v3 02/19] pc-bios/s390-ccw: Use the libc from SLOF and remove sclp prints Date: Mon, 7 Oct 2024 21:15:35 -0400 Message-ID: <20241008011552.2645520-3-jrossi@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241008011552.2645520-1-jrossi@linux.ibm.com> References: <20241008011552.2645520-1-jrossi@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: j60S4G2e3sattYaDST6-zEptLaY0Bwwn X-Proofpoint-GUID: 9OBI0FEocqmy-HWzSYmwAPvEBjurNDkG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_16,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410080006 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=jrossi@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1728350254366116600 Content-Type: text/plain; charset="utf-8" From: Jared Rossi We are already using the libc from SLOF for the s390-netboot.img, and this libc implementation is way more complete and accurate than the simple implementation that we currently use for the s390-ccw.img binary. Since we are now always assuming that the SLOF submodule is available when building the s390-ccw bios (see commit bf6903f6944f), we can drop the simple implementation and use the SLOF libc for the s390-ccw.img binary, too. Additionally replace sclp_print calls with puts/printf now that it is avali= able. Co-authored by: Thomas Huth Signed-off-by: Jared Rossi --- pc-bios/s390-ccw/netboot.mak | 3 -- pc-bios/s390-ccw/bootmap.h | 4 +- pc-bios/s390-ccw/libc.h | 89 -------------------------------- pc-bios/s390-ccw/s390-ccw.h | 30 ++++------- pc-bios/s390-ccw/bootmap.c | 47 ++++++++--------- pc-bios/s390-ccw/cio.c | 78 +++++++++++++--------------- pc-bios/s390-ccw/dasd-ipl.c | 5 +- pc-bios/s390-ccw/jump2ipl.c | 5 +- pc-bios/s390-ccw/libc.c | 88 ------------------------------- pc-bios/s390-ccw/main.c | 14 ++--- pc-bios/s390-ccw/menu.c | 51 +++++++++--------- pc-bios/s390-ccw/netmain.c | 10 ++-- pc-bios/s390-ccw/sclp.c | 7 +-- pc-bios/s390-ccw/virtio-blkdev.c | 6 +-- pc-bios/s390-ccw/virtio-scsi.c | 17 +++--- pc-bios/s390-ccw/virtio.c | 2 +- pc-bios/s390-ccw/Makefile | 15 ++++-- 17 files changed, 136 insertions(+), 335 deletions(-) delete mode 100644 pc-bios/s390-ccw/libc.h delete mode 100644 pc-bios/s390-ccw/libc.c diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak index 046aa35587..d2b3d8ee74 100644 --- a/pc-bios/s390-ccw/netboot.mak +++ b/pc-bios/s390-ccw/netboot.mak @@ -1,9 +1,6 @@ =20 -SLOF_DIR :=3D $(SRC_PATH)/../../roms/SLOF - NETOBJS :=3D start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain= .o =20 -LIBC_INC :=3D -nostdinc -I$(SLOF_DIR)/lib/libc/include LIBNET_INC :=3D -I$(SLOF_DIR)/lib/libnet =20 NETLDFLAGS :=3D $(LDFLAGS) -Wl,-Ttext=3D0x7800000 diff --git a/pc-bios/s390-ccw/bootmap.h b/pc-bios/s390-ccw/bootmap.h index d4690a88c2..bbe2c132aa 100644 --- a/pc-bios/s390-ccw/bootmap.h +++ b/pc-bios/s390-ccw/bootmap.h @@ -336,9 +336,7 @@ static inline void print_volser(const void *volser) =20 ebcdic_to_ascii((char *)volser, ascii, 6); ascii[6] =3D '\0'; - sclp_print("VOLSER=3D["); - sclp_print(ascii); - sclp_print("]\n"); + printf("VOLSER=3D[%s]", ascii); } =20 static inline bool unused_space(const void *p, size_t size) diff --git a/pc-bios/s390-ccw/libc.h b/pc-bios/s390-ccw/libc.h deleted file mode 100644 index bcdc45732d..0000000000 --- a/pc-bios/s390-ccw/libc.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * libc-style definitions and functions - * - * Copyright (c) 2013 Alexander Graf - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ - -#ifndef S390_CCW_LIBC_H -#define S390_CCW_LIBC_H - -typedef unsigned long size_t; -typedef int bool; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; - -static inline void *memset(void *s, int c, size_t n) -{ - size_t i; - unsigned char *p =3D s; - - for (i =3D 0; i < n; i++) { - p[i] =3D c; - } - - return s; -} - -static inline void *memcpy(void *s1, const void *s2, size_t n) -{ - uint8_t *dest =3D s1; - const uint8_t *src =3D s2; - size_t i; - - for (i =3D 0; i < n; i++) { - dest[i] =3D src[i]; - } - - return s1; -} - -static inline int memcmp(const void *s1, const void *s2, size_t n) -{ - size_t i; - const uint8_t *p1 =3D s1, *p2 =3D s2; - - for (i =3D 0; i < n; i++) { - if (p1[i] !=3D p2[i]) { - return p1[i] > p2[i] ? 1 : -1; - } - } - - return 0; -} - -static inline size_t strlen(const char *str) -{ - size_t i; - for (i =3D 0; *str; i++) { - str++; - } - return i; -} - -static inline char *strcat(char *dest, const char *src) -{ - int i; - char *dest_end =3D dest + strlen(dest); - - for (i =3D 0; i <=3D strlen(src); i++) { - dest_end[i] =3D src[i]; - } - return dest; -} - -static inline int isdigit(int c) -{ - return (c >=3D '0') && (c <=3D '9'); -} - -uint64_t atoui(const char *str); -char *uitoa(uint64_t num, char *str, size_t len); - -#endif diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index c977a52b50..9b622e616a 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -13,6 +13,11 @@ =20 /* #define DEBUG */ =20 +#include +#include +#include +#include + typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; @@ -26,9 +31,6 @@ typedef unsigned long long u64; #define EBUSY 2 #define ENODEV 3 =20 -#ifndef NULL -#define NULL 0 -#endif #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif @@ -87,7 +89,7 @@ bool menu_is_enabled_enum(void); __attribute__ ((__noreturn__)) static inline void panic(const char *string) { - sclp_print(string); + printf("ERROR: %s\n ", string); disabled_wait(); } =20 @@ -109,20 +111,10 @@ static inline void fill_hex_val(char *out, void *ptr,= unsigned size) } } =20 -static inline void print_int(const char *desc, u64 addr) -{ - char out[] =3D ": 0xffffffffffffffff\n"; - - fill_hex_val(&out[4], &addr, sizeof(addr)); - - sclp_print(desc); - sclp_print(out); -} - static inline void debug_print_int(const char *desc, u64 addr) { #ifdef DEBUG - print_int(desc, addr); + printf("%s 0x%X", desc, addr); #endif } =20 @@ -147,18 +139,14 @@ static inline void debug_print_addr(const char *desc,= void *p) static inline void IPL_assert(bool term, const char *message) { if (!term) { - sclp_print("\n! "); - sclp_print(message); - panic(" !\n"); /* no return */ + panic(message); /* no return */ } } =20 static inline void IPL_check(bool term, const char *message) { if (!term) { - sclp_print("\n! WARNING: "); - sclp_print(message); - sclp_print(" !\n"); + printf("WARNING: %s\n", message); } } =20 diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index a2137449dc..3cc79706be 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -8,7 +8,8 @@ * directory. */ =20 -#include "libc.h" +#include +#include #include "s390-ccw.h" #include "s390-arch.h" #include "bootmap.h" @@ -21,7 +22,7 @@ =20 #ifdef DEBUG_FALLBACK #define dputs(txt) \ - do { sclp_print("zipl: " txt); } while (0) + do { printf("zipl: " txt); } while (0) #else #define dputs(fmt, ...) \ do { } while (0) @@ -270,7 +271,7 @@ static int eckd_get_boot_menu_index(block_number_t s1b_= block_nr) prev_block_nr =3D cur_block_nr; } =20 - sclp_print("No zipl boot menu data found. Booting default entry."); + printf("No zipl boot menu data found. Booting default entry."); return 0; } =20 @@ -338,22 +339,22 @@ static void ipl_eckd_cdl(void) block_number_t bmt_block_nr, s1b_block_nr; =20 /* we have just read the block #0 and recognized it as "IPL1" */ - sclp_print("CDL\n"); + puts("CDL"); =20 memset(sec, FREE_SPACE_FILLER, sizeof(sec)); read_block(1, ipl2, "Cannot read IPL2 record at block 1"); =20 mbr =3D &ipl2->mbr; if (!magic_match(mbr, ZIPL_MAGIC)) { - sclp_print("No zIPL section in IPL2 record.\n"); + puts("No zIPL section in IPL2 record."); return; } if (!block_size_ok(mbr->blockptr.xeckd.bptr.size)) { - sclp_print("Bad block size in zIPL section of IPL2 record.\n"); + puts("Bad block size in zIPL section of IPL2 record."); return; } if (mbr->dev_type !=3D DEV_TYPE_ECKD) { - sclp_print("Non-ECKD device type in zIPL section of IPL2 record.\n= "); + puts("Non-ECKD device type in zIPL section of IPL2 record."); return; } =20 @@ -366,11 +367,11 @@ static void ipl_eckd_cdl(void) memset(sec, FREE_SPACE_FILLER, sizeof(sec)); read_block(2, vlbl, "Cannot read Volume Label at block 2"); if (!magic_match(vlbl->key, VOL1_MAGIC)) { - sclp_print("Invalid magic of volume label block.\n"); + puts("Invalid magic of volume label block."); return; } if (!magic_match(vlbl->f.key, VOL1_MAGIC)) { - sclp_print("Invalid magic of volser block.\n"); + puts("Invalid magic of volser block."); return; } print_volser(vlbl->f.volser); @@ -384,8 +385,8 @@ static void print_eckd_ldl_msg(ECKD_IPL_mode_t mode) LDL_VTOC *vlbl =3D (void *)sec; /* already read, 3rd block */ char msg[4] =3D { '?', '.', '\n', '\0' }; =20 - sclp_print((mode =3D=3D ECKD_CMS) ? "CMS" : "LDL"); - sclp_print(" version "); + printf((mode =3D=3D ECKD_CMS) ? "CMS" : "LDL"); + printf(" version "); switch (vlbl->LDL_version) { case LDL1_VERSION: msg[0] =3D '1'; @@ -398,7 +399,7 @@ static void print_eckd_ldl_msg(ECKD_IPL_mode_t mode) msg[1] =3D '?'; break; } - sclp_print(msg); + printf("%s", msg); print_volser(vlbl->volser); } =20 @@ -419,7 +420,7 @@ static void ipl_eckd_ldl(ECKD_IPL_mode_t mode) if (!magic_match(ipl1->bip.magic, ZIPL_MAGIC)) { return; /* not applicable layout */ } - sclp_print("unlabeled LDL.\n"); + puts("unlabeled LDL."); } verify_boot_info(&ipl1->bip); =20 @@ -466,7 +467,7 @@ static void print_eckd_msg(void) *p-- =3D ' '; } } - sclp_print(msg); + printf("%s", msg); } =20 static void ipl_eckd(void) @@ -488,11 +489,11 @@ static void ipl_eckd(void) if (eckd_valid_address((ExtEckdBlockPtr *)&vlbl->f.br, 0)) { ldipl_bmt =3D eckd_find_bmt((ExtEckdBlockPtr *)&vlbl->f.br); if (ldipl_bmt) { - sclp_print("List-Directed\n"); + puts("List-Directed"); /* LD-IPL does not use the S1B bock, just make it NULL */ run_eckd_boot_script(ldipl_bmt, NULL_BLOCK_NR); /* Only return in error, retry as CCW-IPL */ - sclp_print("Retrying IPL "); + printf("Retrying IPL "); print_eckd_msg(); } memset(sec, FREE_SPACE_FILLER, sizeof(sec)); @@ -634,7 +635,7 @@ static void ipl_scsi(void) return; } =20 - sclp_print("Using SCSI scheme.\n"); + puts("Using SCSI scheme."); debug_print_int("MBR Version", mbr->version_id); IPL_check(mbr->version_id =3D=3D 1, "Unknown MBR layout version, assuming version 1"); @@ -743,7 +744,7 @@ static inline uint32_t iso_get_file_size(uint32_t load_= rba) if (cur_record->file_flags & 0x2) { /* Subdirectory */ if (level =3D=3D ISO9660_MAX_DIR_DEPTH - 1) { - sclp_print("ISO-9660 directory depth limit exceeded\n"= ); + puts("ISO-9660 directory depth limit exceeded"); } else { level++; sec_loc[level] =3D iso_733_to_u32(cur_record->ext_loc); @@ -778,9 +779,9 @@ static void load_iso_bc_entry(IsoBcSection *load) if (real_size) { /* Round up blocks to load */ blks_to_load =3D (real_size + ISO_SECTOR_SIZE - 1) / ISO_SECTOR_SI= ZE; - sclp_print("ISO boot image size verified\n"); + puts("ISO boot image size verified"); } else { - sclp_print("ISO boot image size could not be verified\n"); + puts("ISO boot image size could not be verified"); } =20 read_iso_boot_image(bswap32(s.load_rba), @@ -896,7 +897,7 @@ static void zipl_load_vblk(void) } =20 if (blksize !=3D VIRTIO_DASD_DEFAULT_BLOCK_SIZE) { - sclp_print("Using guessed DASD geometry.\n"); + puts("Using guessed DASD geometry."); virtio_assume_eckd(); } ipl_eckd(); @@ -909,7 +910,7 @@ static void zipl_load_vscsi(void) ipl_iso_el_torito(); } =20 - sclp_print("Using guessed DASD geometry.\n"); + puts("Using guessed DASD geometry."); virtio_assume_eckd(); ipl_eckd(); } @@ -944,5 +945,5 @@ void zipl_load(void) panic("\n! Unknown IPL device type !\n"); } =20 - sclp_print("zIPL load failed.\n"); + puts("zIPL load failed."); } diff --git a/pc-bios/s390-ccw/cio.c b/pc-bios/s390-ccw/cio.c index 83ca27ab41..758e74965e 100644 --- a/pc-bios/s390-ccw/cio.c +++ b/pc-bios/s390-ccw/cio.c @@ -11,7 +11,8 @@ * directory. */ =20 -#include "libc.h" +#include +#include #include "s390-ccw.h" #include "s390-arch.h" #include "helper.h" @@ -90,9 +91,9 @@ static void print_eckd_dasd_sense_data(SenseDataEckdDasd = *sd) char msgline[512]; =20 if (sd->config_info & 0x8000) { - sclp_print("Eckd Dasd Sense Data (fmt 24-bytes):\n"); + puts("Eckd Dasd Sense Data (fmt 24-bytes):"); } else { - sclp_print("Eckd Dasd Sense Data (fmt 32-bytes):\n"); + puts("Eckd Dasd Sense Data (fmt 32-bytes):"); } =20 strcat(msgline, " Sense Condition Flags :"); @@ -158,22 +159,21 @@ static void print_eckd_dasd_sense_data(SenseDataEckdD= asd *sd) if (sd->status[1] & SNS_STAT2_IMPRECISE_END) { strcat(msgline, " [Imprecise-End]"); } - strcat(msgline, "\n"); - sclp_print(msgline); - - print_int(" Residual Count =3D", sd->res_count); - print_int(" Phys Drive ID =3D", sd->phys_drive_id); - print_int(" low cyl address =3D", sd->low_cyl_addr); - print_int(" head addr & hi cyl =3D", sd->head_high_cyl_addr); - print_int(" format/message =3D", sd->fmt_msg); - print_int(" fmt-dependent[0-7] =3D", sd->fmt_dependent_info[0]); - print_int(" fmt-dependent[8-15]=3D", sd->fmt_dependent_info[1]); - print_int(" prog action code =3D", sd->program_action_code); - print_int(" Configuration info =3D", sd->config_info); - print_int(" mcode / hi-cyl =3D", sd->mcode_hicyl); - print_int(" cyl & head addr [0]=3D", sd->cyl_head_addr[0]); - print_int(" cyl & head addr [1]=3D", sd->cyl_head_addr[1]); - print_int(" cyl & head addr [2]=3D", sd->cyl_head_addr[2]); + puts(msgline); + + printf(" Residual Count =3D 0x%X", sd->res_count); + printf(" Phys Drive ID =3D 0x%X", sd->phys_drive_id); + printf(" low cyl address =3D 0x%X", sd->low_cyl_addr); + printf(" head addr & hi cyl =3D 0x%X", sd->head_high_cyl_addr); + printf(" format/message =3D 0x%X", sd->fmt_msg); + printf(" fmt-dependent[0-7] =3D 0x%llX", sd->fmt_dependent_info[0]); + printf(" fmt-dependent[8-15]=3D 0x%llX", sd->fmt_dependent_info[1]); + printf(" prog action code =3D 0x%X", sd->program_action_code); + printf(" Configuration info =3D 0x%X", sd->config_info); + printf(" mcode / hi-cyl =3D 0x%X", sd->mcode_hicyl); + printf(" cyl & head addr [0]=3D 0x%X", sd->cyl_head_addr[0]); + printf(" cyl & head addr [1]=3D 0x%X", sd->cyl_head_addr[1]); + printf(" cyl & head addr [2]=3D 0x%X", sd->cyl_head_addr[2]); } =20 static void print_irb_err(Irb *irb) @@ -182,7 +182,7 @@ static void print_irb_err(Irb *irb) uint64_t prev_ccw =3D *(uint64_t *)u32toptr(irb->scsw.cpa - 8); char msgline[256]; =20 - sclp_print("Interrupt Response Block Data:\n"); + puts("Interrupt Response Block Data:"); =20 strcat(msgline, " Function Ctrl :"); if (irb->scsw.ctrl & SCSW_FCTL_START_FUNC) { @@ -194,8 +194,7 @@ static void print_irb_err(Irb *irb) if (irb->scsw.ctrl & SCSW_FCTL_CLEAR_FUNC) { strcat(msgline, " [Clear]"); } - strcat(msgline, "\n"); - sclp_print(msgline); + puts(msgline); =20 msgline[0] =3D '\0'; strcat(msgline, " Activity Ctrl :"); @@ -220,8 +219,7 @@ static void print_irb_err(Irb *irb) if (irb->scsw.ctrl & SCSW_ACTL_SUSPENDED) { strcat(msgline, " [Suspended]"); } - strcat(msgline, "\n"); - sclp_print(msgline); + puts(msgline); =20 msgline[0] =3D '\0'; strcat(msgline, " Status Ctrl :"); @@ -240,9 +238,7 @@ static void print_irb_err(Irb *irb) if (irb->scsw.ctrl & SCSW_SCTL_STATUS_PEND) { strcat(msgline, " [Status-Pending]"); } - - strcat(msgline, "\n"); - sclp_print(msgline); + puts(msgline); =20 msgline[0] =3D '\0'; strcat(msgline, " Device Status :"); @@ -270,8 +266,7 @@ static void print_irb_err(Irb *irb) if (irb->scsw.dstat & SCSW_DSTAT_UEXCP) { strcat(msgline, " [Unit-Exception]"); } - strcat(msgline, "\n"); - sclp_print(msgline); + puts(msgline); =20 msgline[0] =3D '\0'; strcat(msgline, " Channel Status :"); @@ -299,12 +294,11 @@ static void print_irb_err(Irb *irb) if (irb->scsw.cstat & SCSW_CSTAT_CHAINCHK) { strcat(msgline, " [Chaining-Check]"); } - strcat(msgline, "\n"); - sclp_print(msgline); + puts(msgline); =20 - print_int(" cpa=3D", irb->scsw.cpa); - print_int(" prev_ccw=3D", prev_ccw); - print_int(" this_ccw=3D", this_ccw); + printf(" cpa=3D 0x%X", irb->scsw.cpa); + printf(" prev_ccw=3D 0x%llX", prev_ccw); + printf(" this_ccw=3D 0x%llX", this_ccw); } =20 /* @@ -341,7 +335,7 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_ad= dr, int fmt, Irb *irb) return -1; } if (rc) { - print_int("ssch failed with cc=3D", rc); + printf("ssch failed with cc=3D 0x%x", rc); return rc; } =20 @@ -350,7 +344,7 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_ad= dr, int fmt, Irb *irb) /* collect status */ rc =3D tsch(schid, irb); if (rc) { - print_int("tsch failed with cc=3D", rc); + printf("tsch failed with cc=3D 0x%X", rc); } =20 return rc; @@ -406,12 +400,12 @@ int do_cio(SubChannelId schid, uint16_t cutype, uint3= 2_t ccw_addr, int fmt) continue; } =20 - sclp_print("cio device error\n"); - print_int(" ssid ", schid.ssid); - print_int(" cssid ", schid.cssid); - print_int(" sch_no", schid.sch_no); - print_int(" ctrl-unit type", cutype); - sclp_print("\n"); + printf("cio device error\n"); + printf(" ssid 0x%X", schid.ssid); + printf(" cssid 0x%X", schid.cssid); + printf(" sch_no 0x%X", schid.sch_no); + printf(" ctrl-unit type 0x%X", cutype); + printf("\n"); print_irb_err(&irb); if (cutype =3D=3D CU_TYPE_DASD_3990 || cutype =3D=3D CU_TYPE_DASD_= 2107 || cutype =3D=3D CU_TYPE_UNKNOWN) { diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c index 254bb1a15e..99c0b93083 100644 --- a/pc-bios/s390-ccw/dasd-ipl.c +++ b/pc-bios/s390-ccw/dasd-ipl.c @@ -8,7 +8,8 @@ * directory. */ =20 -#include "libc.h" +#include +#include #include "s390-ccw.h" #include "s390-arch.h" #include "dasd-ipl.h" @@ -82,7 +83,7 @@ static int run_dynamic_ccw_program(SubChannelId schid, ui= nt16_t cutype, do { has_next =3D dynamic_cp_fixup(cpa, &next_cpa); =20 - print_int("executing ccw chain at ", cpa); + printf("executing ccw chain at 0x%X", cpa); enable_prefixing(); rc =3D do_cio(schid, cutype, cpa, CCW_FMT0); disable_prefixing(); diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c index 78f5f46533..80b7f6a1f3 100644 --- a/pc-bios/s390-ccw/jump2ipl.c +++ b/pc-bios/s390-ccw/jump2ipl.c @@ -6,7 +6,8 @@ * directory. */ =20 -#include "libc.h" +#include +#include #include "s390-ccw.h" #include "s390-arch.h" =20 @@ -57,7 +58,7 @@ void jump_to_IPL_code(uint64_t address) debug_print_int("set IPL addr to", address ?: *reset_psw & PSW_MASK_SH= ORT_ADDR); =20 /* Ensure the guest output starts fresh */ - sclp_print("\n"); + printf("\n"); =20 /* * HACK ALERT. diff --git a/pc-bios/s390-ccw/libc.c b/pc-bios/s390-ccw/libc.c deleted file mode 100644 index 3187923950..0000000000 --- a/pc-bios/s390-ccw/libc.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * libc-style definitions and functions - * - * Copyright 2018 IBM Corp. - * Author(s): Collin L. Walling - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ - -#include "libc.h" -#include "s390-ccw.h" - -/** - * atoui: - * @str: the string to be converted. - * - * Given a string @str, convert it to an integer. Leading spaces are - * ignored. Any other non-numerical value will terminate the conversion - * and return 0. This function only handles numbers between 0 and - * UINT64_MAX inclusive. - * - * Returns: an integer converted from the string @str, or the number 0 - * if an error occurred. - */ -uint64_t atoui(const char *str) -{ - int val =3D 0; - - if (!str || !str[0]) { - return 0; - } - - while (*str =3D=3D ' ') { - str++; - } - - while (*str) { - if (!isdigit(*(unsigned char *)str)) { - break; - } - val =3D val * 10 + *str - '0'; - str++; - } - - return val; -} - -/** - * uitoa: - * @num: an integer (base 10) to be converted. - * @str: a pointer to a string to store the conversion. - * @len: the length of the passed string. - * - * Given an integer @num, convert it to a string. The string @str must be - * allocated beforehand. The resulting string will be null terminated and - * returned. This function only handles numbers between 0 and UINT64_MAX - * inclusive. - * - * Returns: the string @str of the converted integer @num - */ -char *uitoa(uint64_t num, char *str, size_t len) -{ - long num_idx =3D 1; /* account for NUL */ - uint64_t tmp =3D num; - - IPL_assert(str !=3D NULL, "uitoa: no space allocated to store string"); - - /* Count indices of num */ - while ((tmp /=3D 10) !=3D 0) { - num_idx++; - } - - /* Check if we have enough space for num and NUL */ - IPL_assert(len > num_idx, "uitoa: array too small for conversion"); - - str[num_idx--] =3D '\0'; - - /* Convert int to string */ - while (num_idx >=3D 0) { - str[num_idx--] =3D num % 10 + '0'; - num /=3D 10; - } - - return str; -} diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 5506798098..73093d3f14 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -8,7 +8,9 @@ * directory. */ =20 -#include "libc.h" +#include +#include +#include #include "helper.h" #include "s390-arch.h" #include "s390-ccw.h" @@ -50,7 +52,7 @@ void write_iplb_location(void) =20 unsigned int get_loadparm_index(void) { - return atoui(loadparm_str); + return atoi(loadparm_str); } =20 static int is_dev_possibly_bootable(int dev_no, int sch_no) @@ -176,7 +178,7 @@ static void boot_setup(void) =20 sclp_get_loadparm_ascii(loadparm_str); memcpy(lpmsg + 10, loadparm_str, 8); - sclp_print(lpmsg); + puts(lpmsg); =20 /* * Clear out any potential S390EP magic (see jump_to_low_kernel()), @@ -228,7 +230,7 @@ static int virtio_setup(void) =20 switch (vdev->senseid.cu_model) { case VIRTIO_ID_NET: - sclp_print("Network boot device detected\n"); + puts("Network boot device detected"); vdev->netboot_start_addr =3D qipl.netboot_start_addr; return 0; case VIRTIO_ID_BLOCK: @@ -261,7 +263,7 @@ static void ipl_boot_device(void) } break; default: - print_int("Attempting to boot from unexpected device type", cutype= ); + printf("Attempting to boot from unexpected device type 0x%X", cuty= pe); panic("\nBoot failed.\n"); } } @@ -287,7 +289,7 @@ static void probe_boot_device(void) } } =20 - sclp_print("Could not find a suitable boot device (none specified)\n"); + puts("Could not find a suitable boot device (none specified)"); } =20 void main(void) diff --git a/pc-bios/s390-ccw/menu.c b/pc-bios/s390-ccw/menu.c index d601952d3e..84062e94af 100644 --- a/pc-bios/s390-ccw/menu.c +++ b/pc-bios/s390-ccw/menu.c @@ -9,7 +9,10 @@ * directory. */ =20 -#include "libc.h" +#include +#include +#include +#include #include "s390-ccw.h" #include "sclp.h" #include "s390-time.h" @@ -93,7 +96,7 @@ static int read_prompt(char *buf, size_t len) case KEYCODE_BACKSP: if (idx > 0) { buf[--idx] =3D 0; - sclp_print("\b \b"); + printf("\b \b"); } continue; case KEYCODE_ENTER: @@ -103,7 +106,7 @@ static int read_prompt(char *buf, size_t len) /* Echo input and add to buffer */ if (idx < len) { buf[idx++] =3D inp[0]; - sclp_print(inp); + printf("%s", inp); } } } @@ -140,22 +143,19 @@ static int get_index(void) } } =20 - return atoui(buf); + return atoi(buf); } =20 static void boot_menu_prompt(bool retry) { - char tmp[11]; - if (retry) { - sclp_print("\nError: undefined configuration" + printf("\nError: undefined configuration" "\nPlease choose:\n"); } else if (timeout > 0) { - sclp_print("Please choose (default will boot in "); - sclp_print(uitoa(timeout / 1000, tmp, sizeof(tmp))); - sclp_print(" seconds):\n"); + printf("Please choose (default will boot in %d seconds):\n", + (int)(timeout / 1000)); } else { - sclp_print("Please choose:\n"); + puts("Please choose:"); } } =20 @@ -163,7 +163,6 @@ static int get_boot_index(bool *valid_entries) { int boot_index; bool retry =3D false; - char tmp[5]; =20 do { boot_menu_prompt(retry); @@ -172,8 +171,7 @@ static int get_boot_index(bool *valid_entries) } while (boot_index < 0 || boot_index >=3D MAX_BOOT_ENTRIES || !valid_entries[boot_index]); =20 - sclp_print("\nBooting entry #"); - sclp_print(uitoa(boot_index, tmp, sizeof(tmp))); + printf("\nBooting entry #%d", boot_index); =20 return boot_index; } @@ -187,9 +185,9 @@ static int zipl_print_entry(const char *data, size_t le= n) buf[len] =3D '\n'; buf[len + 1] =3D '\0'; =20 - sclp_print(buf); + printf("%s", buf); =20 - return buf[0] =3D=3D ' ' ? atoui(buf + 1) : atoui(buf); + return buf[0] =3D=3D ' ' ? atoi(buf + 1) : atoi(buf); } =20 int menu_get_zipl_boot_index(const char *menu_data) @@ -209,7 +207,7 @@ int menu_get_zipl_boot_index(const char *menu_data) } =20 /* Print banner */ - sclp_print("s390-ccw zIPL Boot Menu\n\n"); + puts("s390-ccw zIPL Boot Menu\n"); menu_data +=3D strlen(menu_data) + 1; =20 /* Print entries */ @@ -221,37 +219,34 @@ int menu_get_zipl_boot_index(const char *menu_data) valid_entries[entry] =3D true; =20 if (entry =3D=3D 0) { - sclp_print("\n"); + printf("\n"); } } =20 - sclp_print("\n"); + printf("\n"); return get_boot_index(valid_entries); } =20 int menu_get_enum_boot_index(bool *valid_entries) { - char tmp[3]; int i; =20 - sclp_print("s390-ccw Enumerated Boot Menu.\n\n"); + puts("s390-ccw Enumerated Boot Menu.\n"); =20 for (i =3D 0; i < MAX_BOOT_ENTRIES; i++) { if (valid_entries[i]) { if (i < 10) { - sclp_print(" "); + printf(" "); } - sclp_print("["); - sclp_print(uitoa(i, tmp, sizeof(tmp))); - sclp_print("]"); + printf("[%d]", i); if (i =3D=3D 0) { - sclp_print(" default\n"); + printf(" default\n"); } - sclp_print("\n"); + printf("\n"); } } =20 - sclp_print("\n"); + printf("\n"); return get_boot_index(valid_entries); } =20 diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index 5cd619b2d6..509119be15 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -293,7 +293,7 @@ static int load_kernel_with_initrd(filename_ip_t *fn_ip, printf("Loading pxelinux.cfg entry '%s'\n", entry->label); =20 if (!entry->kernel) { - printf("Kernel entry is missing!\n"); + puts("Kernel entry is missing!\n"); return -1; } =20 @@ -515,13 +515,13 @@ void main(void) int rc, fnlen; =20 sclp_setup(); - sclp_print("Network boot starting...\n"); + puts("Network boot starting..."); =20 virtio_setup(); =20 rc =3D net_init(&fn_ip); if (rc) { - panic("Network initialization failed. Halting.\n"); + panic("Network initialization failed. Halting."); } =20 fnlen =3D strlen(fn_ip.filename); @@ -535,9 +535,9 @@ void main(void) net_release(&fn_ip); =20 if (rc > 0) { - sclp_print("Network loading done, starting kernel...\n"); + puts("Network loading done, starting kernel..."); jump_to_low_kernel(); } =20 - panic("Failed to load OS from network\n"); + panic("Failed to load OS from network."); } diff --git a/pc-bios/s390-ccw/sclp.c b/pc-bios/s390-ccw/sclp.c index 7251f9af4d..4a07de018d 100644 --- a/pc-bios/s390-ccw/sclp.c +++ b/pc-bios/s390-ccw/sclp.c @@ -8,7 +8,7 @@ * directory. */ =20 -#include "libc.h" +#include #include "s390-ccw.h" #include "sclp.h" =20 @@ -101,11 +101,6 @@ long write(int fd, const void *str, size_t len) return len; } =20 -void sclp_print(const char *str) -{ - write(1, str, strlen(str)); -} - void sclp_get_loadparm_ascii(char *loadparm) { =20 diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blk= dev.c index a81207b52e..2666326801 100644 --- a/pc-bios/s390-ccw/virtio-blkdev.c +++ b/pc-bios/s390-ccw/virtio-blkdev.c @@ -8,7 +8,7 @@ * directory. */ =20 -#include "libc.h" +#include #include "s390-ccw.h" #include "virtio.h" #include "virtio-scsi.h" @@ -76,7 +76,7 @@ unsigned long virtio_load_direct(unsigned long rec_list1,= unsigned long rec_list return -1; } =20 - sclp_print("."); + printf("."); status =3D virtio_read_many(sec, (void *)addr, sec_num); if (status) { panic("I/O Error"); @@ -230,7 +230,7 @@ int virtio_blk_setup_device(SubChannelId schid) vdev->schid =3D schid; virtio_setup_ccw(vdev); =20 - sclp_print("Using virtio-blk.\n"); + puts("Using virtio-blk."); =20 return 0; } diff --git a/pc-bios/s390-ccw/virtio-scsi.c b/pc-bios/s390-ccw/virtio-scsi.c index d1a84b937c..0e274d0c38 100644 --- a/pc-bios/s390-ccw/virtio-scsi.c +++ b/pc-bios/s390-ccw/virtio-scsi.c @@ -9,7 +9,8 @@ * directory. */ =20 -#include "libc.h" +#include +#include #include "s390-ccw.h" #include "virtio.h" #include "scsi.h" @@ -30,9 +31,9 @@ static inline void vs_assert(bool term, const char **msgs) if (!term) { int i =3D 0; =20 - sclp_print("\n! "); + printf("\n! "); while (msgs[i]) { - sclp_print(msgs[i++]); + printf("%s", msgs[i++]); } panic(" !\n"); } @@ -236,11 +237,11 @@ static int virtio_scsi_locate_device(VDev *vdev) if (resp.response =3D=3D VIRTIO_SCSI_S_BAD_TARGET) { continue; } - print_int("target", target); + printf("target 0x%X", target); virtio_scsi_verify_response(&resp, "SCSI cannot report LUNs"); } if (r->lun_list_len =3D=3D 0) { - print_int("no LUNs for target", target); + printf("no LUNs for target 0x%X", target); continue; } luns =3D r->lun_list_len / 8; @@ -264,7 +265,7 @@ static int virtio_scsi_locate_device(VDev *vdev) } } =20 - sclp_print("Warning: Could not locate a usable virtio-scsi device\n"); + puts("Warning: Could not locate a usable virtio-scsi device"); return -ENODEV; } =20 @@ -379,7 +380,7 @@ static int virtio_scsi_setup(VDev *vdev) } =20 if (virtio_scsi_inquiry_response_is_cdrom(scsi_inquiry_std_response)) { - sclp_print("SCSI CD-ROM detected.\n"); + puts("SCSI CD-ROM detected."); vdev->is_cdrom =3D true; vdev->scsi_block_size =3D VIRTIO_ISO_BLOCK_SIZE; } @@ -443,7 +444,7 @@ int virtio_scsi_setup_device(SubChannelId schid) IPL_assert(vdev->config.scsi.cdb_size =3D=3D VIRTIO_SCSI_CDB_SIZE, "Config: CDB size mismatch"); =20 - sclp_print("Using virtio-scsi.\n"); + puts("Using virtio-scsi."); =20 return virtio_scsi_setup(vdev); } diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index 5edd058d88..8c6b0a8a92 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -8,7 +8,7 @@ * directory. */ =20 -#include "libc.h" +#include #include "s390-ccw.h" #include "cio.h" #include "virtio.h" diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile index 6207911b53..3f4232636e 100644 --- a/pc-bios/s390-ccw/Makefile +++ b/pc-bios/s390-ccw/Makefile @@ -33,13 +33,18 @@ QEMU_DGFLAGS =3D -MMD -MP -MT $@ -MF $(@D)/$(*F).d .PHONY : all clean build-all distclean =20 OBJECTS =3D start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ - virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o + virtio.o virtio-scsi.o virtio-blkdev.o cio.o dasd-ipl.o + +SLOF_DIR :=3D $(SRC_PATH)/../../roms/SLOF + +LIBC_INC :=3D -nostdinc -I$(SLOF_DIR)/lib/libc/include =20 EXTRA_CFLAGS +=3D -Wall EXTRA_CFLAGS +=3D -ffreestanding -fno-delete-null-pointer-checks -fno-comm= on -fPIE EXTRA_CFLAGS +=3D -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-ta= bles EXTRA_CFLAGS +=3D -msoft-float EXTRA_CFLAGS +=3D -std=3Dgnu99 +EXTRA_CFLAGS +=3D $(LIBC_INC) LDFLAGS +=3D -Wl,-pie -nostdlib -z noexecstack =20 cc-test =3D $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>/d= ev/null @@ -55,18 +60,18 @@ config-cc.mak: Makefile $(call cc-option,-march=3Dz900,-march=3Dz10)) 3> config-cc.mak -include config-cc.mak =20 +include $(SRC_PATH)/netboot.mak + build-all: s390-ccw.img s390-netboot.img =20 -s390-ccw.elf: $(OBJECTS) - $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(OBJECTS),Linking) +s390-ccw.elf: $(OBJECTS) libc.a + $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^,Linking) =20 s390-ccw.img: s390-ccw.elf $(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,Stripping $< into) =20 $(OBJECTS): Makefile =20 -include $(SRC_PATH)/netboot.mak - ALL_OBJS =3D $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS)) -include $(ALL_OBJS:%.o=3D%.d) =20 --=20 2.45.1