From nobody Fri Apr 19 11:52:20 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1558130239; cv=none; d=zoho.com; s=zohoarc; b=O9FxS1ERrw1+juqNaF6f3demkQ9fEm7CzCq0BFegNMrxeWCggaYfuS5DZaaxJHw+8eI5Scvzl0FlKjBGrnX7HGNi3XalykCzPZ5WU6UV0H7+ld9mG3CpiDjE0sQ5vQjKuPgR40tfh/PN7z08oGhVoamJLrskOSsLsFG2qfFdYSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558130239; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=WkvjLbrT5uJGzhgRYe0WFxXOXOkxmyojCdxeb2W+CEY=; b=eNh7MjCecuZzE7AkqjzhwqGLfvCgckvi1beJgb/TDnWp/O9I58RM5Tsps08XfqzVzO6wA9krfW3gVtTrcUpq5QmArpFQY2710NXK9CtKMVF7rFZ/BCyMK4o+a4VutgO+BceAx4SUEhFBOe1VKpvXWl5HXJbdGv8oiaCfBH24THQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1558130239449145.61273503918073; Fri, 17 May 2019 14:57:19 -0700 (PDT) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id 7B2B012E2E6E; Fri, 17 May 2019 21:57:14 +0000 (UTC) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by coreboot.org (Postfix) with ESMTP id C44A512E2E67 for ; Fri, 17 May 2019 21:57:06 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4HKnwwH002931; Fri, 17 May 2019 20:57:47 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2sdq1r3yxn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:47 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4HKvQaE087551; Fri, 17 May 2019 20:57:46 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2sggeugp5p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:46 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4HKvjnj023166; Fri, 17 May 2019 20:57:46 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 May 2019 20:57:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=uxLae4GcYP+DjXUsr2yBd+29Jw97iHgDlo9easTqGXc=; b=HYCSl0r9Jq1I89IDO3RjrC5xzjOTXVTNskRAjx+EG0yVyGtjgkje3W4eFYyeF1Z83VKP W3kwr149kxI7DLrqDWzBdm4aowyXP7zWqS78dRNIprwkNKcZF5Cbc0rQOjJmTnwQHZmw DsPgMgrDIjtQGAVdV1Jv3nr+RgpDc+iHEBEgE+W/CZp59ZKYMRLA0m3lfALQm0B66fcr Uy2gkMGzeYQfIczP1ZkW85mirMjevNQciLHUctjQmcNSfmKyd00/lYAmgq0Vn43jrys2 j3GrpZ8jZHPV+e6+HH1vQ7yPhW5gGdBK9e4XeNdlUVWMDTca9vkpE1+FzG/U78amY91O 3A== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Fri, 17 May 2019 23:57:22 +0300 Message-Id: <20190517205726.34703-3-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190517205726.34703-1-shmuel.eiderman@oracle.com> References: <20190517205726.34703-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905170124 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905170124 Message-ID-Hash: RNLQ6RUZN6HM3U5BMQSKZEAZUWLV4IER X-Message-ID-Hash: RNLQ6RUZN6HM3U5BMQSKZEAZUWLV4IER X-MailFrom: shmuel.eiderman@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: arbel.moshe@oracle.com, konrad.wilk@oracle.com X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [PATCH 2/6] bios_date: Make bios date appear once in the ROM List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ++++ X-Spam-Level: **** Authentication-Results: coreboot.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Liran Alon We find all the places which cause BIOS_DATE to appear in the data section and remove them - leaving the only place to contain the contents of BIOS_DATE to be BiosDate at FSEG(0xfff5). We do this by removing the usages of BIOS_DATE and by changing strlen(BIOS_DATE) to sizeof(BIOS_DATE) which works at the preprocessing step - removing the need to add BIOS_DATE as a string in the data section. We will use the fact that BiosDate is now the only place in FSEG containing the date in the next commit. Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- src/fw/biostables.c | 14 +++++++++++--- src/util.h | 4 ++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/fw/biostables.c b/src/fw/biostables.c index b055c9b2..546e83c6 100644 --- a/src/fw/biostables.c +++ b/src/fw/biostables.c @@ -439,7 +439,7 @@ smbios_romfile_setup(void) if (need_t0) { /* common case: add our own type 0, with 3 strings and 4 '\0's */ u16 t0_len =3D sizeof(struct smbios_type_0) + strlen(BIOS_NAME) + - strlen(VERSION) + strlen(BIOS_DATE) + 4; + strlen(VERSION) + sizeof(BIOS_DATE) + 3; ep.structure_table_length +=3D t0_len; if (t0_len > ep.max_structure_size) ep.max_structure_size =3D t0_len; @@ -459,8 +459,16 @@ smbios_romfile_setup(void) ep.structure_table_address =3D (u32)tables; =20 /* populate final blob */ - if (need_t0) - tables =3D smbios_new_type_0(tables, BIOS_NAME, VERSION, BIOS_DATE= ); + if (need_t0) { + char bios_date[sizeof(BIOS_DATE)]; + memcpy(bios_date, BiosDate, sizeof("mm/dd/") - 1); + memcpy(bios_date + sizeof("mm/dd/") - 1, BIOS_DATE_YEAR_PREFIX, + sizeof("yy") - 1); + memcpy(bios_date + sizeof("mm/dd/yy") - 1, + BiosDate + sizeof("mm/dd/") - 1, + sizeof("yy")); + tables =3D smbios_new_type_0(tables, BIOS_NAME, VERSION, bios_date= ); + } memcpy(tables, qtables, qtables_len); free(qtables); =20 diff --git a/src/util.h b/src/util.h index 6dd080f6..68ba848d 100644 --- a/src/util.h +++ b/src/util.h @@ -2,6 +2,7 @@ #ifndef __UTIL_H #define __UTIL_H =20 +#include "config.h" // BIOS_DATE_SHORT #include "types.h" // u32 =20 // apm.c @@ -243,6 +244,9 @@ void lpt_setup(void); // version.c extern const char VERSION[], BUILDINFO[]; =20 +// misc.c +extern char BiosDate[sizeof(BIOS_DATE_SHORT)] __aligned(1); + // vgahooks.c void handle_155f(struct bregs *regs); void handle_157f(struct bregs *regs); --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org